Remove set but unread variables
- Adding a sensor in the mbmon support stored the added sensor in a pointer but never used it afterwards - Drop pixbuf width in draw_left_frame_overlap, the code unlike other drawing helpers does not use the pixbuf width - Remove unused scroll selection from net_stats_page This fixes several set but unread warnings when compiling with a recent gcc (encountered with gcc 4.8.2).
This commit is contained in:
parent
720ac43b8c
commit
b279d76837
|
@ -540,12 +540,10 @@ cb_cpu_extra(GtkWidget *widget, GdkEventButton *ev)
|
||||||
{
|
{
|
||||||
GList *list;
|
GList *list;
|
||||||
CpuMon *cpu;
|
CpuMon *cpu;
|
||||||
GkrellmChart *cp;
|
|
||||||
|
|
||||||
for (list = cpu_mon_list; list; list = list->next)
|
for (list = cpu_mon_list; list; list = list->next)
|
||||||
{
|
{
|
||||||
cpu = (CpuMon *) list->data;
|
cpu = (CpuMon *) list->data;
|
||||||
cp = cpu->chart;
|
|
||||||
if (widget != cpu->chart->drawing_area)
|
if (widget != cpu->chart->drawing_area)
|
||||||
continue;
|
continue;
|
||||||
if (ev->button == 1 && ev->type == GDK_BUTTON_PRESS)
|
if (ev->button == 1 && ev->type == GDK_BUTTON_PRESS)
|
||||||
|
@ -968,12 +966,10 @@ static void
|
||||||
create_alert(void)
|
create_alert(void)
|
||||||
{
|
{
|
||||||
GList *list;
|
GList *list;
|
||||||
CpuMon *cpu;
|
|
||||||
|
|
||||||
list = g_list_nth(cpu_mon_list, 0);
|
list = g_list_nth(cpu_mon_list, 0);
|
||||||
if (!list)
|
if (!list)
|
||||||
return;
|
return;
|
||||||
cpu = (CpuMon *) list->data;
|
|
||||||
cpu_alert = gkrellm_alert_create(NULL, _("CPU"),
|
cpu_alert = gkrellm_alert_create(NULL, _("CPU"),
|
||||||
_("Percent Usage"),
|
_("Percent Usage"),
|
||||||
TRUE, FALSE, TRUE,
|
TRUE, FALSE, TRUE,
|
||||||
|
|
7
src/fs.c
7
src/fs.c
|
@ -1034,7 +1034,6 @@ cb_panel_motion(GtkWidget *widget, GdkEventButton *ev)
|
||||||
GList *list;
|
GList *list;
|
||||||
FSmon *fs;
|
FSmon *fs;
|
||||||
GkrellmDecal *d;
|
GkrellmDecal *d;
|
||||||
PangoFontDescription *font_desc;
|
|
||||||
gchar buf[128];
|
gchar buf[128];
|
||||||
gint w, x_delta = 0;
|
gint w, x_delta = 0;
|
||||||
|
|
||||||
|
@ -1047,7 +1046,6 @@ cb_panel_motion(GtkWidget *widget, GdkEventButton *ev)
|
||||||
fs_in_motion = NULL;
|
fs_in_motion = NULL;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
font_desc = gkrellm_meter_alt_textstyle(style_id)->font;
|
|
||||||
|
|
||||||
d = fs_in_motion->data_decal;
|
d = fs_in_motion->data_decal;
|
||||||
format_fs_data(fs_in_motion, data_format_locale, buf, sizeof(buf));
|
format_fs_data(fs_in_motion, data_format_locale, buf, sizeof(buf));
|
||||||
|
@ -2201,15 +2199,10 @@ row_drop_possible(GtkTreeDragDest *drag_dest, GtkTreePath *path,
|
||||||
GtkSelectionData *selection_data)
|
GtkSelectionData *selection_data)
|
||||||
{
|
{
|
||||||
GtkTreePath *src_path;
|
GtkTreePath *src_path;
|
||||||
gint *indices;
|
|
||||||
|
|
||||||
if (!row_reference)
|
if (!row_reference)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
src_path = gtk_tree_row_reference_get_path(row_reference);
|
src_path = gtk_tree_row_reference_get_path(row_reference);
|
||||||
indices = gtk_tree_path_get_indices(path);
|
|
||||||
// g_debug("drop path: indices=[%d,%d]:%d, path=%s\n",
|
|
||||||
// indices[0], indices[1], gtk_tree_path_get_depth(path),
|
|
||||||
// gtk_tree_path_to_string(path));
|
|
||||||
|
|
||||||
if ( gtk_tree_path_get_depth(src_path) == 1
|
if ( gtk_tree_path_get_depth(src_path) == 1
|
||||||
|| gtk_tree_path_get_depth(path) != 2
|
|| gtk_tree_path_get_depth(path) != 2
|
||||||
|
|
|
@ -520,7 +520,6 @@ static void
|
||||||
update_inet(void)
|
update_inet(void)
|
||||||
{
|
{
|
||||||
InetMon *in;
|
InetMon *in;
|
||||||
GkrellmChart *cp;
|
|
||||||
ActiveTCP *tcp;
|
ActiveTCP *tcp;
|
||||||
GList *list;
|
GList *list;
|
||||||
gchar buf[32], *ap;
|
gchar buf[32], *ap;
|
||||||
|
@ -575,7 +574,6 @@ update_inet(void)
|
||||||
for (list = inet_mon_list; list; list = list->next)
|
for (list = inet_mon_list; list; list = list->next)
|
||||||
{
|
{
|
||||||
in = (InetMon *) list->data;
|
in = (InetMon *) list->data;
|
||||||
cp = in->chart;
|
|
||||||
if (GK.hour_tick)
|
if (GK.hour_tick)
|
||||||
{
|
{
|
||||||
if (!*in->label0)
|
if (!*in->label0)
|
||||||
|
|
|
@ -979,11 +979,10 @@ draw_left_frame_overlap(GdkPixbuf *pixbuf, GkrellmBorder *border,
|
||||||
GkrellmPiximage piximage;
|
GkrellmPiximage piximage;
|
||||||
GdkPixmap *pixmap = NULL;
|
GdkPixmap *pixmap = NULL;
|
||||||
GdkBitmap *mask = NULL;
|
GdkBitmap *mask = NULL;
|
||||||
gint w_pixbuf, h_pixbuf;
|
gint h_pixbuf;
|
||||||
|
|
||||||
if (overlap <= 0)
|
if (overlap <= 0)
|
||||||
return;
|
return;
|
||||||
w_pixbuf = gdk_pixbuf_get_width(pixbuf);
|
|
||||||
h_pixbuf = gdk_pixbuf_get_height(pixbuf);
|
h_pixbuf = gdk_pixbuf_get_height(pixbuf);
|
||||||
piximage.pixbuf = gdk_pixbuf_new_subpixbuf(pixbuf, 0, 0,
|
piximage.pixbuf = gdk_pixbuf_new_subpixbuf(pixbuf, 0, 0,
|
||||||
overlap, h_pixbuf);
|
overlap, h_pixbuf);
|
||||||
|
|
|
@ -670,7 +670,6 @@ net_stats_page(GtkWidget *vbox, NetMon *net,
|
||||||
{
|
{
|
||||||
GtkTreeView *treeview;
|
GtkTreeView *treeview;
|
||||||
GtkTreeModel *model;
|
GtkTreeModel *model;
|
||||||
GtkTreeSelection *selection;
|
|
||||||
GtkCellRenderer *renderer;
|
GtkCellRenderer *renderer;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
|
@ -704,7 +703,7 @@ net_stats_page(GtkWidget *vbox, NetMon *net,
|
||||||
renderer, "text", TIME_COLUMN, NULL);
|
renderer, "text", TIME_COLUMN, NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
selection = gkrellm_gtk_scrolled_selection(treeview, vbox,
|
gkrellm_gtk_scrolled_selection(treeview, vbox,
|
||||||
GTK_SELECTION_NONE,
|
GTK_SELECTION_NONE,
|
||||||
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC,
|
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
|
|
|
@ -1512,7 +1512,6 @@ cb_place_button(GtkWidget *widget, gpointer data)
|
||||||
GSList *group;
|
GSList *group;
|
||||||
GList *list;
|
GList *list;
|
||||||
GkrellmMonitor *mon;
|
GkrellmMonitor *mon;
|
||||||
GkrellmMonprivate *mp;
|
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
if (gkrellm_demo_mode())
|
if (gkrellm_demo_mode())
|
||||||
|
@ -1540,7 +1539,6 @@ cb_place_button(GtkWidget *widget, gpointer data)
|
||||||
for (i = 0, list = gkrellm_monitor_list; list; list = list->next)
|
for (i = 0, list = gkrellm_monitor_list; list; list = list->next)
|
||||||
{
|
{
|
||||||
mon = (GkrellmMonitor *) list->data;
|
mon = (GkrellmMonitor *) list->data;
|
||||||
mp = mon->privat;
|
|
||||||
mon->privat->button_id = -1;
|
mon->privat->button_id = -1;
|
||||||
if (MONITOR_ID(mon) != MON_PLUGIN)
|
if (MONITOR_ID(mon) != MON_PLUGIN)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2333,7 +2333,6 @@ static void
|
||||||
create_location_menu(gint group)
|
create_location_menu(gint group)
|
||||||
{
|
{
|
||||||
gint n, n_cpus;
|
gint n, n_cpus;
|
||||||
static gint sig_id;
|
|
||||||
|
|
||||||
if (group == sensor_last_group)
|
if (group == sensor_last_group)
|
||||||
return;
|
return;
|
||||||
|
@ -2357,7 +2356,7 @@ create_location_menu(gint group)
|
||||||
{
|
{
|
||||||
gtk_combo_box_append_text(GTK_COMBO_BOX(optionmenu), _("Disk"));
|
gtk_combo_box_append_text(GTK_COMBO_BOX(optionmenu), _("Disk"));
|
||||||
}
|
}
|
||||||
sig_id = g_signal_connect(G_OBJECT(optionmenu), "changed",
|
g_signal_connect(G_OBJECT(optionmenu), "changed",
|
||||||
G_CALLBACK(cb_location_menu), NULL);
|
G_CALLBACK(cb_location_menu), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2437,7 +2436,7 @@ cb_tree_selection_changed(GtkTreeSelection *selection, gpointer data)
|
||||||
GtkTreeModel *model;
|
GtkTreeModel *model;
|
||||||
GtkTreePath *path;
|
GtkTreePath *path;
|
||||||
Sensor *s;
|
Sensor *s;
|
||||||
gint *indices, depth;
|
gint depth;
|
||||||
|
|
||||||
if (!gtk_tree_selection_get_selected(selection, &model, &iter))
|
if (!gtk_tree_selection_get_selected(selection, &model, &iter))
|
||||||
{
|
{
|
||||||
|
@ -2446,11 +2445,7 @@ cb_tree_selection_changed(GtkTreeSelection *selection, gpointer data)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
path = gtk_tree_model_get_path(model, &iter);
|
path = gtk_tree_model_get_path(model, &iter);
|
||||||
indices = gtk_tree_path_get_indices(path);
|
|
||||||
depth = gtk_tree_path_get_depth(path);
|
depth = gtk_tree_path_get_depth(path);
|
||||||
//g_debug("selection: indices=[%d,%d]:%d, path=%s\n",
|
|
||||||
// indices[0], indices[1], gtk_tree_path_get_depth(path),
|
|
||||||
// gtk_tree_path_to_string(path));
|
|
||||||
change_row_reference(model, path);
|
change_row_reference(model, path);
|
||||||
gtk_tree_path_free(path);
|
gtk_tree_path_free(path);
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,6 @@ static gboolean
|
||||||
mbmon_daemon_read(void)
|
mbmon_daemon_read(void)
|
||||||
{
|
{
|
||||||
gchar *server = "127.0.0.1";
|
gchar *server = "127.0.0.1";
|
||||||
gpointer sr;
|
|
||||||
MbmonSensor *mb;
|
MbmonSensor *mb;
|
||||||
gchar *default_label, *id_name;
|
gchar *default_label, *id_name;
|
||||||
gchar name[32], buf[256];
|
gchar name[32], buf[256];
|
||||||
|
@ -193,7 +192,7 @@ mbmon_daemon_read(void)
|
||||||
mb->name = g_strdup(name);
|
mb->name = g_strdup(name);
|
||||||
default_label = name;
|
default_label = name;
|
||||||
id_name = g_strdup_printf("mbmon/%s", name);
|
id_name = g_strdup_printf("mbmon/%s", name);
|
||||||
sr = gkrellm_sensors_add_sensor(type,
|
gkrellm_sensors_add_sensor(type,
|
||||||
name, id_name,
|
name, id_name,
|
||||||
0, 0, MBMON_INTERFACE,
|
0, 0, MBMON_INTERFACE,
|
||||||
1.0, 0.0, NULL, default_label);
|
1.0, 0.0, NULL, default_label);
|
||||||
|
|
Loading…
Reference in New Issue