wmhdplop: Fix compiler warnings.

In particular, the following:

 wmhdplop.c:451:96: warning: operation on ‘dl->touched_w’ may be undefined
 [-Wsequence-point]

 wmhdplop.c:980:44: warning: ignoring return value of ‘seteuid’, declared with
 attribute warn_unused_result [-Wunused-result]

 procstat.c:73:19: warning: variable ‘in_our_disk’ set but not used
 [-Wunused-but-set-variable]

 dockapp_imlib2.c:311:85: warning: unused parameter ‘prefs’ [-Wunused-parameter]

 gkrellm_hdplop.c:187:40: warning: unused parameter ‘widget’
 [-Wunused-parameter]

https://sources.debian.net/src/wmhdplop/0.9.9-5/debian/patches/
  fix_compiler_warnings.patch/
This commit is contained in:
Doug Torrance 2016-11-24 10:26:51 -05:00 committed by Carlos R. Mafra
parent 7ab8a56465
commit 85d2e894e8
4 changed files with 12 additions and 5 deletions

View file

@ -319,6 +319,7 @@ DockImlib2* dockimlib2_gkrellm_setup(int x0, int y0, int w, int h, DockImlib2Pre
#ifndef GKRELLM
dockimlib2_xinit(dock, prefs);
#else
(void) prefs;
dockimlib2_gkrellm_xinit(dock, gkdrawable);
#endif
dockimlib2_setup_imlib(dock);

View file

@ -185,6 +185,7 @@ static void cb_spinbutton_modified(GtkWidget *widget UNUSED, GtkSpinButton *spin
}
static void cb_reload_fonts(GtkWidget *widget) {
(void) widget;
if (strcmp(gtk_entry_get_text(GTK_ENTRY(entry_smallfont)), app->current_smallfont_name) ||
strcmp(gtk_entry_get_text(GTK_ENTRY(entry_bigfont)), app->current_bigfont_name)) {
ASSIGN_STRING(Prefs.smallfontname, gtk_entry_get_text(GTK_ENTRY(entry_smallfont)));

View file

@ -70,7 +70,7 @@ void update_stats() {
FILE *f;
char line[1024];
char hdname[200];
int readok = 0, in_our_disk = 0;
int readok = 0;
const char *proc_fname;
if (!use_proc_diskstats) proc_fname = "/proc/partitions";
else proc_fname = "/proc/diskstats";
@ -93,7 +93,6 @@ void update_stats() {
dl->touched_r = (dl->nr - nr) ? 10 : dl->touched_r;
dl->touched_w = (dl->nw - nw) ? 10 : dl->touched_w;
dl->nr = nr; dl->nw = nw;
if (!is_partition(major,minor)) in_our_disk = 1;
if (is_displayed(dl->hd_id,dl->part_id) &&
((dl->part_id && (!find_id(dl->hd_id, 0) || !is_displayed(dl->hd_id, 0))) || /* partition without host disk */
(dl->part_id == 0))) /* disk */
@ -112,7 +111,7 @@ void update_stats() {
}
readok = 2;
}
} else if (!is_partition(major,minor)) in_our_disk = 0;
}
/* if (in_our_disk || find_dev(major,minor))*/ {
strlist *sl;
for (sl = swap_list(); sl; sl=sl->next) {

View file

@ -448,7 +448,8 @@ static void draw_hdlist(App *app) {
imlib_image_fill_rectangle(lx+1,y-5,3,3);
}
if (dl->touched_w) {
imlib_context_set_color(255,100-10*dl->touched_w,100-10*dl->touched_w, 25*dl->touched_w--);
imlib_context_set_color(255,100-10*dl->touched_w,100-10*dl->touched_w, 25*dl->touched_w - 1);
dl->touched_w--;
imlib_image_fill_rectangle(lx+1,y-9,3,3);
}
x += 5;
@ -977,7 +978,12 @@ int main(int argc, char**argv)
int hdplop_main(int width, int height, GdkDrawable *gkdrawable)
#endif
{
euid = geteuid(); uid = getuid(); seteuid(uid);
int s;
euid = geteuid(); uid = getuid();
s = seteuid(uid);
if (s == -1)
fprintf(stderr, "seteuid(uid) failed : %s\n", strerror(errno));
ALLOC_OBJ(app);
srand(time(NULL));
/* Initialize options */