diff options
-rwxr-xr-x | makefile | 5 | ||||
-rw-r--r-- | src/ss/msr.c | 8 | ||||
-rw-r--r-- | src/ss/os.c | 10 | ||||
-rw-r--r-- | src/sysfs.c | 4 |
4 files changed, 17 insertions, 10 deletions
@@ -1,2 +1,5 @@ build: - cc -Isrc/include `pkg-config --cflags gtk+-3.0` src/*.c src/ss/*.c -o zenmonitor `pkg-config --libs gtk+-3.0` -lm -no-pie + cc -Isrc/include `pkg-config --cflags gtk+-3.0` src/*.c src/ss/*.c -o zenmonitor `pkg-config --libs gtk+-3.0` -lm -no-pie -Wall + +clean: + rm -f zenmonitor diff --git a/src/ss/msr.c b/src/ss/msr.c index 0c77a6a..c3a0224 100644 --- a/src/ss/msr.c +++ b/src/ss/msr.c @@ -76,7 +76,7 @@ gulong get_core_energy(gint core) { gboolean msr_init() { gshort *cpu_dev_ids = NULL; - int i; + guint i; if (!check_zen()) return FALSE; @@ -112,7 +112,7 @@ gboolean msr_init() { } void msr_update() { - gint i; + guint i; package_eng_b = get_package_energy(); for (i = 0; i < cores; i++) { @@ -142,7 +142,7 @@ void msr_update() { } void msr_clear_minmax() { - gint i; + guint i; package_power_min = package_power; package_power_max = package_power; @@ -155,7 +155,7 @@ void msr_clear_minmax() { GSList* msr_get_sensors() { GSList *list = NULL; SensorInit *data; - gint i; + guint i; data = sensor_init_new(); data->label = g_strdup("Package Power"); diff --git a/src/ss/os.c b/src/ss/os.c index d232a1f..9b25a04 100644 --- a/src/ss/os.c +++ b/src/ss/os.c @@ -1,4 +1,6 @@ #include <glib.h> +#include <stdlib.h> +#include <string.h> #include "zenmonitor.h" #include "sysfs.h" #include "os.h" @@ -22,7 +24,7 @@ static gdouble get_frequency(guint coreid) { gboolean os_init() { gshort *cpu_dev_ids = NULL; - gint i; + guint i; if (!check_zen()) return FALSE; @@ -52,7 +54,7 @@ gboolean os_init() { } void os_update() { - gint i; + guint i; for (i = 0; i < cores; i++) { core_freq[i] = get_frequency(i); @@ -64,7 +66,7 @@ void os_update() { } void os_clear_minmax() { - gint i; + guint i; for (i = 0; i < cores; i++) { core_freq_min[i] = core_freq[i]; @@ -75,7 +77,7 @@ void os_clear_minmax() { GSList* os_get_sensors() { GSList *list = NULL; SensorInit *data; - gint i; + guint i; for (i = 0; i < cores; i++) { data = sensor_init_new(); diff --git a/src/sysfs.c b/src/sysfs.c index ea59c1b..1536dfb 100644 --- a/src/sysfs.c +++ b/src/sysfs.c @@ -1,5 +1,7 @@ #include <glib.h> #include <stdio.h> +#include <stdlib.h> +#include <string.h> #include "sysfs.h" #include "zenmonitor.h" @@ -26,7 +28,7 @@ gshort* get_cpu_dev_ids(){ if (g_file_get_contents(filename, &buffer, NULL, NULL)) { coreid = (gshort) atoi(buffer); - if (coreid < cores && cpu_dev_ids[coreid] == -1) { + if ((guint) coreid < cores && cpu_dev_ids[coreid] == -1) { cpu_dev_ids[coreid] = cpuid; } } |