From 6148063f860bf23d970199fd74a9efdf547be834 Mon Sep 17 00:00:00 2001 From: zhuyaliang <15132211195@163.com> Date: Sat, 22 Apr 2023 12:56:21 +0800 Subject: Fix Compilation Warning --- plugins/i2c-sys/i2c-sys-plugin.c | 2 -- plugins/i8k/i8k-plugin.c | 1 + plugins/ibm-acpi/ibm-acpi-plugin.c | 4 +++- plugins/libsensors/libsensors-plugin.c | 3 +-- plugins/pmu-sys/pmu-sys-plugin.c | 2 ++ plugins/smu-sys/smu-sys-plugin.c | 3 ++- plugins/sonypi/sonypi-plugin.c | 2 ++ 7 files changed, 11 insertions(+), 6 deletions(-) (limited to 'plugins') diff --git a/plugins/i2c-sys/i2c-sys-plugin.c b/plugins/i2c-sys/i2c-sys-plugin.c index b39ede4..72e2aee 100644 --- a/plugins/i2c-sys/i2c-sys-plugin.c +++ b/plugins/i2c-sys/i2c-sys-plugin.c @@ -92,8 +92,6 @@ static void i2c_sys_plugin_add_sensor(GList **sensors, const gchar *path) { /* SHOULDN'T BE ABLE * TO GET HERE!! */ g_warning("filename:\"%s\" begins with a charater that is not covered by this switch statement... not adding sensor", filename); g_free(filename); - g_free(id); - g_free(label); return; } diff --git a/plugins/i8k/i8k-plugin.c b/plugins/i8k/i8k-plugin.c index 826c7bd..b675b1d 100644 --- a/plugins/i8k/i8k-plugin.c +++ b/plugins/i8k/i8k-plugin.c @@ -81,6 +81,7 @@ static GList *i8k_plugin_init(void) { return sensors; } +static gdouble i8k_plugin_get_sensor_value(const gchar *path, const gchar *id, SensorType type, diff --git a/plugins/ibm-acpi/ibm-acpi-plugin.c b/plugins/ibm-acpi/ibm-acpi-plugin.c index 9bf3615..285ff86 100644 --- a/plugins/ibm-acpi/ibm-acpi-plugin.c +++ b/plugins/ibm-acpi/ibm-acpi-plugin.c @@ -129,6 +129,7 @@ static void ibm_acpi_plugin_setup_manually(GList **sensors) { } /* to be called externally to setup for ibm_acpi sensors */ +static GList *ibm_acpi_plugin_init(void) { GList *sensors = NULL; @@ -137,6 +138,7 @@ GList *ibm_acpi_plugin_init(void) { return sensors; } +static gdouble ibm_acpi_plugin_get_sensor_value(const gchar *path, const gchar *id, SensorType type, @@ -144,7 +146,7 @@ gdouble ibm_acpi_plugin_get_sensor_value(const gchar *path, /* to open and access the value of each sensor */ FILE *fp; - gint sensor_value; + gint sensor_value = 0; gint cpu_temp, minipci_temp, hdd_temp, gpu_temp, bat0_temp, bat1_temp, unknown0, unknown1; gint fan_speed; diff --git a/plugins/libsensors/libsensors-plugin.c b/plugins/libsensors/libsensors-plugin.c index b95b888..ebe8b02 100644 --- a/plugins/libsensors/libsensors-plugin.c +++ b/plugins/libsensors/libsensors-plugin.c @@ -230,11 +230,11 @@ static void check_sensor_with_data(GList **sensors, static GList *libsensors_plugin_get_sensors(void) { const sensors_chip_name *chip_name; - int i; GList *sensors = NULL; #if SENSORS_API_VERSION < 0x400 FILE *file; + int i; g_debug("%s: using libsensors version < 4", __FUNCTION__); /* try to open config file, otherwise try alternate config @@ -281,7 +281,6 @@ static GList *libsensors_plugin_get_sensors(void) { return sensors; } - i = 0; while ((chip_name = sensors_get_detected_chips(NULL, &nr))) { char *chip_name_string, *label; diff --git a/plugins/pmu-sys/pmu-sys-plugin.c b/plugins/pmu-sys/pmu-sys-plugin.c index 5a47aea..46f8f2b 100644 --- a/plugins/pmu-sys/pmu-sys-plugin.c +++ b/plugins/pmu-sys/pmu-sys-plugin.c @@ -116,6 +116,7 @@ static void pmu_sys_plugin_test_sensor(GList **sensors, const gchar *path) { } /* to be called to setup for sys sensors */ +static GList *pmu_sys_plugin_init(void) { GList *sensors = NULL; /* call function to recursively look for sensors @@ -127,6 +128,7 @@ GList *pmu_sys_plugin_init(void) { /* returns the value of the sensor_list at the given iter, or if an error occurs, instatiates error with an error message */ +static gdouble pmu_sys_plugin_get_sensor_value(const gchar *path, const gchar *id, SensorType type, diff --git a/plugins/smu-sys/smu-sys-plugin.c b/plugins/smu-sys/smu-sys-plugin.c index f5940fd..d9e530d 100644 --- a/plugins/smu-sys/smu-sys-plugin.c +++ b/plugins/smu-sys/smu-sys-plugin.c @@ -108,7 +108,7 @@ static void smu_sys_plugin_test_sensor(GList **sensors, const gchar *path) { } /* to be called to setup for sys sensors */ -GList *smu_sys_plugin_init(void) { +static GList *smu_sys_plugin_init(void) { GList *sensors = NULL; /* call function to recursively look for sensors @@ -120,6 +120,7 @@ GList *smu_sys_plugin_init(void) { /* returns the value of the sensor_list at the given iter, or if an error occurs, instatiates error with an error message */ +static gdouble smu_sys_plugin_get_sensor_value(const gchar *path, const gchar *id, SensorType type, diff --git a/plugins/sonypi/sonypi-plugin.c b/plugins/sonypi/sonypi-plugin.c index 8a69cf4..64a0c8c 100644 --- a/plugins/sonypi/sonypi-plugin.c +++ b/plugins/sonypi/sonypi-plugin.c @@ -52,6 +52,7 @@ enum { SONYPI_DEVICE_FILE_READ_ERROR }; +static GList *sonypi_plugin_init(void) { int fd; GList *sensors = NULL; @@ -71,6 +72,7 @@ GList *sonypi_plugin_init(void) { return sensors; } +static gdouble sonypi_plugin_get_sensor_value(const gchar *path, const gchar *id, SensorType type, -- cgit v1.2.1