mate-desktop / mate-sensors-applet

Display readings from hardware sensors in your MATE panel
http://www.mate-desktop.org
GNU General Public License v2.0
16 stars 13 forks source link

Remove cppcheck warnings about the variable scope can be reduced #120

Closed rbuj closed 3 years ago

rbuj commented 3 years ago
lib/sensors-applet-plugin.c:35:11: style: The scope of the variable 'dir' can be reduced. [variableScope]
    GDir *dir;
          ^
lib/sensors-applet-plugin.c:36:18: style: The scope of the variable 'new_file' can be reduced. [variableScope]
    const gchar* new_file;
                 ^
lib/sensors-applet-plugin.c:37:12: style: The scope of the variable 'new_path' can be reduced. [variableScope]
    gchar *new_path;
           ^
lib/sensors-applet-plugin.c:66:12: style: The scope of the variable 'string' can be reduced. [variableScope]
    gchar *string;
           ^
--
plugins/hddtemp/hddtemp-plugin.c:63:9: style: The scope of the variable 'sockfd' can be reduced. [variableScope]
    int sockfd;
        ^
plugins/hddtemp/hddtemp-plugin.c:64:13: style: The scope of the variable 'n' can be reduced. [variableScope]
    ssize_t n = 1;
            ^
plugins/hddtemp/hddtemp-plugin.c:67:12: style: The scope of the variable 'pc' can be reduced. [variableScope]
    gchar *pc;
           ^
--
plugins/ibm-acpi/ibm-acpi-plugin.c:53:12: style: The scope of the variable 'label' can be reduced. [variableScope]
    gchar *label;
           ^
plugins/mbmon/mbmon-plugin.c:57:9: style: The scope of the variable 'sockfd' can be reduced. [variableScope]
    int sockfd;
        ^
plugins/mbmon/mbmon-plugin.c:58:13: style: The scope of the variable 'n' can be reduced. [variableScope]
    ssize_t n = 1;
            ^
plugins/mbmon/mbmon-plugin.c:138:43: style: The scope of the variable 'pv2' can be reduced. [variableScope]
    gchar **output_vector = NULL, **pv, **pv2;
                                          ^
--
sensors-applet/active-sensor.c:214:16: style: The scope of the variable 'overlay_icon' can be reduced. [variableScope]
    GdkPixbuf *overlay_icon, *new_icon;
               ^
sensors-applet/active-sensor.c:363:14: style: The scope of the variable 'old_values' can be reduced. [variableScope]
    gdouble *old_values;
             ^
sensors-applet/active-sensor.c:507:12: style: The scope of the variable 'old_value_text' can be reduced. [variableScope]
    gchar *old_value_text;
           ^
--
sensors-applet/main.c:31:20: style: The scope of the variable 'sensors_applet' can be reduced. [variableScope]
    SensorsApplet *sensors_applet;
                   ^
sensors-applet/prefs-dialog.c:296:18: style: The scope of the variable 'path' can be reduced. [variableScope]
    GtkTreePath *path;
                 ^
sensors-applet/prefs-dialog.c:352:18: style: The scope of the variable 'path' can be reduced. [variableScope]
    GtkTreePath *path;
                 ^
--
sensors-applet/sensor-config-dialog.c:286:18: style: The scope of the variable 'path' can be reduced. [variableScope]
    GtkTreePath *path;
                 ^
sensors-applet/sensor-config-dialog.c:354:16: style: The scope of the variable 'pixbuf' can be reduced. [variableScope]
    GdkPixbuf *pixbuf;
               ^
sensors-applet/sensors-applet-plugins.c:42:41: style: The scope of the variable 'name_fn' can be reduced. [variableScope]
                SensorsAppletPluginName name_fn;
                                        ^
sensors-applet/sensors-applet-plugins.c:44:51: style: The scope of the variable 'get_value_fn' can be reduced. [variableScope]
                SensorsAppletPluginGetSensorValue get_value_fn;
                                                  ^
--
sensors-applet/sensors-applet.c:168:18: style: The scope of the variable 'path' can be reduced. [variableScope]
    GtkTreePath *path;
                 ^
sensors-applet/sensors-applet.c:171:16: style: The scope of the variable 'new_icon' can be reduced. [variableScope]
    GdkPixbuf *new_icon;
               ^
sensors-applet/sensors-applet.c:862:18: style: The scope of the variable 'tree_path' can be reduced. [variableScope]
    GtkTreePath *tree_path;
                 ^
sensors-applet/sensors-applet.c:1044:18: style: The scope of the variable 'sensor_tree_path' can be reduced. [variableScope]
    GtkTreePath *sensor_tree_path;
                 ^