diff options
author | Ondrej Čerman | 2019-10-12 21:46:51 +0200 |
---|---|---|
committer | Ondrej Čerman | 2019-10-12 21:46:51 +0200 |
commit | 2a912ed3055593613e1c36add99e156bb105f863 (patch) | |
tree | 04405235160dcfabe94e6d160ce1e498e0f1d86a /src | |
parent | 43fb7cb8da5331037d81eeb905860ecec958a456 (diff) |
Updated makefile + fixed warnings
Diffstat (limited to 'src')
-rw-r--r-- | src/ss/msr.c | 8 | ||||
-rw-r--r-- | src/ss/os.c | 10 | ||||
-rw-r--r-- | src/sysfs.c | 4 |
3 files changed, 13 insertions, 9 deletions
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; } } |