From adac422179cf6e761a6ef1ff9c5fcff16dc44c74 Mon Sep 17 00:00:00 2001 From: Drath Date: Thu, 1 Jan 2026 16:34:24 +0100 Subject: [PATCH] get rid of macros --- include/gpu.hpp | 4 ---- src/gpu.cpp | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/gpu.hpp b/include/gpu.hpp index 428407a..58e7e6e 100644 --- a/include/gpu.hpp +++ b/include/gpu.hpp @@ -4,10 +4,6 @@ #include #include - -#define REL_METRICS_PATH "/../../gpu_metrics" // gpu_metrics path relative to hwmon path -#define MAX_METRICS_LENGTH 512 // length of the metrics buffer - /* clean abstraction for gpu_metrics or metrics in filesystem in sane units */ namespace gpu { diff --git a/src/gpu.cpp b/src/gpu.cpp index 8fab334..abff8e2 100644 --- a/src/gpu.cpp +++ b/src/gpu.cpp @@ -9,6 +9,9 @@ namespace gpu { +const std::string rel_metrics_path = "/../../gpu_metrics"; // gpu_metrics path relative to hwmon path +constexpr uint16_t max_metrics_length = 512; // length of the metrics buffer + /* takes pointer to a target gpu::sensors struct and updates its hwmon path and detects gpu_metrics */ void detectHwmon(gpuSensors* target, const std::string& pci) { target->hwmon = utils::getFirstDir("/sys/bus/pci/devices/" + pci + "/hwmon");