[Pkg-wmaker-commits] [wmhdplop] 07/26: wmhdplop: Fix compiler warnings.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Fri Nov 25 01:49:08 UTC 2016
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository wmhdplop.
commit aee4731c9d1049aacff17b3bc947c3d411380d55
Author: Doug Torrance <dtorrance at piedmont.edu>
Date: Thu Nov 24 10:26:51 2016 -0500
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/
---
dockapp_imlib2.c | 1 +
gkrellm_hdplop.c | 1 +
procstat.c | 5 ++---
wmhdplop.c | 10 ++++++++--
4 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/dockapp_imlib2.c b/dockapp_imlib2.c
index c632b99..4d21115 100644
--- a/dockapp_imlib2.c
+++ b/dockapp_imlib2.c
@@ -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);
diff --git a/gkrellm_hdplop.c b/gkrellm_hdplop.c
index 42e0e5d..ed14534 100644
--- a/gkrellm_hdplop.c
+++ b/gkrellm_hdplop.c
@@ -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)));
diff --git a/procstat.c b/procstat.c
index c899435..18c74cf 100644
--- a/procstat.c
+++ b/procstat.c
@@ -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) {
diff --git a/wmhdplop.c b/wmhdplop.c
index f55224f..91b6d52 100644
--- a/wmhdplop.c
+++ b/wmhdplop.c
@@ -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 */
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmhdplop.git
More information about the Pkg-wmaker-commits
mailing list