From 5dbd6b9ab812d109b08c3ef9f2a60c13a56779e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 24 Sep 2024 11:09:51 +0800 Subject: [PATCH] Chore: remove temps_windows --- CMakeLists.txt | 2 +- src/detection/cpu/cpu_windows.c | 5 +++-- .../{temps/temps_windows.cpp => cpu/cpu_windows.cpp} | 6 +----- src/detection/temps/temps_windows.h | 3 --- 4 files changed, 5 insertions(+), 11 deletions(-) rename src/detection/{temps/temps_windows.cpp => cpu/cpu_windows.cpp} (90%) delete mode 100644 src/detection/temps/temps_windows.h diff --git a/CMakeLists.txt b/CMakeLists.txt index fec2f9729..ea2c93f3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -723,6 +723,7 @@ elseif(WIN32) src/detection/btrfs/btrfs_nosupport.c src/detection/chassis/chassis_windows.c src/detection/cpu/cpu_windows.c + src/detection/cpu/cpu_windows.cpp src/detection/cpucache/cpucache_windows.c src/detection/cpuusage/cpuusage_windows.c src/detection/cursor/cursor_windows.c @@ -757,7 +758,6 @@ elseif(WIN32) src/detection/terminalfont/terminalfont_windows.c src/detection/terminalshell/terminalshell_windows.c src/detection/terminalsize/terminalsize_windows.c - src/detection/temps/temps_windows.cpp src/detection/theme/theme_nosupport.c src/detection/uptime/uptime_windows.c src/detection/users/users_windows.c diff --git a/src/detection/cpu/cpu_windows.c b/src/detection/cpu/cpu_windows.c index 411ffe6f7..7479ff6d1 100644 --- a/src/detection/cpu/cpu_windows.c +++ b/src/detection/cpu/cpu_windows.c @@ -1,5 +1,4 @@ #include "cpu.h" -#include "detection/temps/temps_windows.h" #include "util/windows/registry.h" #include "util/windows/nt.h" #include "util/mallocHelper.h" @@ -160,6 +159,8 @@ static const char* detectCoreTypes(FFCPUResult* cpu) return NULL; } +const char* detectThermalTemp(double* current, double* critical); + const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu) { detectNCores(cpu); @@ -175,7 +176,7 @@ const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu) detectMaxSpeedBySmbios(cpu); if(options->temp) - ffDetectSmbiosTemp(&cpu->temperature, NULL); + detectThermalTemp(&cpu->temperature, NULL); return NULL; } diff --git a/src/detection/temps/temps_windows.cpp b/src/detection/cpu/cpu_windows.cpp similarity index 90% rename from src/detection/temps/temps_windows.cpp rename to src/detection/cpu/cpu_windows.cpp index ac9fccab6..4a961d4c5 100644 --- a/src/detection/temps/temps_windows.cpp +++ b/src/detection/cpu/cpu_windows.cpp @@ -1,11 +1,7 @@ -extern "C" -{ -#include "temps_windows.h" -} #include "util/windows/wmi.hpp" extern "C" -const char* ffDetectSmbiosTemp(double* current, double* critical) +const char* detectThermalTemp(double* current, double* critical) { // Requires Administrator privileges // https://wutils.com/wmi/root/wmi/msacpi_thermalzonetemperature/#properties diff --git a/src/detection/temps/temps_windows.h b/src/detection/temps/temps_windows.h deleted file mode 100644 index 501cc0aa7..000000000 --- a/src/detection/temps/temps_windows.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -const char* ffDetectSmbiosTemp(double* current, double* critical);