summaryrefslogtreecommitdiff
path: root/sensors-applet
diff options
context:
space:
mode:
authorzhuyaliang <[email protected]>2023-04-22 12:56:21 +0800
committerraveit65 <[email protected]>2023-04-28 00:38:32 +0200
commit6148063f860bf23d970199fd74a9efdf547be834 (patch)
treeb5756324ac8fae1b79ba402d4d887989e6314c8b /sensors-applet
parent68740373619824398f0c16c39ca12ed8ac1e275c (diff)
downloadmate-sensors-applet-6148063f860bf23d970199fd74a9efdf547be834.tar.bz2
mate-sensors-applet-6148063f860bf23d970199fd74a9efdf547be834.tar.xz
Fix Compilation Warning
Diffstat (limited to 'sensors-applet')
-rw-r--r--sensors-applet/active-sensor.c5
-rw-r--r--sensors-applet/prefs-dialog.c1
-rw-r--r--sensors-applet/sensor-config-dialog.c3
-rw-r--r--sensors-applet/sensors-applet-plugin.h2
-rw-r--r--sensors-applet/sensors-applet.c2
5 files changed, 6 insertions, 7 deletions
diff --git a/sensors-applet/active-sensor.c b/sensors-applet/active-sensor.c
index d273b1b..fdd10c3 100644
--- a/sensors-applet/active-sensor.c
+++ b/sensors-applet/active-sensor.c
@@ -261,7 +261,7 @@ static void active_sensor_update_graph(ActiveSensor *as, cairo_t *cr) {
GtkAllocation allocation;
gdouble line_height;
gdouble width, height;
- gdouble x, y;
+ gdouble x = 0.0, y = 0.0;
cairo_pattern_t *pattern;
gint i;
@@ -344,6 +344,7 @@ void active_sensor_destroy(ActiveSensor *active_sensor) {
g_free(active_sensor);
}
+static
gboolean graph_draw_cb(GtkWidget *graph,
cairo_t *cr,
gpointer data) {
@@ -502,7 +503,6 @@ void active_sensor_update(ActiveSensor *active_sensor,
GdkPixbuf *icon_pixbuf;
gchar *graph_color;
gint label_min_width;
- gint label_width;
GtkRequisition req;
/* to build the list of labels as we go */
@@ -727,7 +727,6 @@ void active_sensor_update(ActiveSensor *active_sensor,
gtk_label_set_markup(GTK_LABEL(active_sensor->value), value_text);
gtk_widget_get_preferred_size (GTK_WIDGET (active_sensor->value), &req, NULL);
- label_width = MAX(req.width, label_min_width);
gtk_widget_set_size_request (GTK_WIDGET (active_sensor->value), label_min_width, req.height);
if (tooltip) {
diff --git a/sensors-applet/prefs-dialog.c b/sensors-applet/prefs-dialog.c
index 58b839d..20db2ec 100644
--- a/sensors-applet/prefs-dialog.c
+++ b/sensors-applet/prefs-dialog.c
@@ -50,6 +50,7 @@ void prefs_dialog_close(SensorsApplet *sensors_applet) {
}
+static
void prefs_dialog_response(GtkDialog *prefs_dialog,
gint response,
gpointer data) {
diff --git a/sensors-applet/sensor-config-dialog.c b/sensors-applet/sensor-config-dialog.c
index ecf27b5..7a85d1b 100644
--- a/sensors-applet/sensor-config-dialog.c
+++ b/sensors-applet/sensor-config-dialog.c
@@ -73,11 +73,8 @@ static void sensor_config_dialog_response(GtkDialog *dialog,
gint response,
gpointer data) {
- SensorConfigDialog *config_dialog;
GError *error = NULL;
- config_dialog = (SensorConfigDialog *)data;
-
switch (response) {
case GTK_RESPONSE_HELP:
g_debug("loading help in config dialog");
diff --git a/sensors-applet/sensors-applet-plugin.h b/sensors-applet/sensors-applet-plugin.h
index 5f48b48..cde21ba 100644
--- a/sensors-applet/sensors-applet-plugin.h
+++ b/sensors-applet/sensors-applet-plugin.h
@@ -37,6 +37,8 @@ gdouble sensors_applet_plugin_get_sensor_value(const gchar *path,
SensorType type,
GError **error);
+const gchar *sensors_applet_plugin_name(void);
+
typedef void SensorsAppletPluginTestSensorFunc(GList **sensors,
const gchar *path);
void sensors_applet_plugin_find_sensors(GList **sensors,
diff --git a/sensors-applet/sensors-applet.c b/sensors-applet/sensors-applet.c
index b680836..93c8617 100644
--- a/sensors-applet/sensors-applet.c
+++ b/sensors-applet/sensors-applet.c
@@ -450,7 +450,7 @@ static void sensors_applet_pack_display(SensorsApplet *sensors_applet) {
/* note the if () around each widget is to ensure we only
* operate on those that actually exist */
GtkLabel *no_sensors_enabled_label = NULL;
- gint num_active_sensors = 0, num_sensors_per_group, rows, cols, i, j;
+ gint num_active_sensors = 0, num_sensors_per_group = 0, rows, cols, i, j;
GList *old_grid_children = NULL;
GList *current_sensor;