Hi, I've been meaning to get around to this for a while. At work I noticed with a recent GCC upgrade that GCC 4.6 onwards defaults to -Wunused-but-set, which is annoying but flagged up a tonne of bit-rotting code in FVWM.
As the attached commit message notes, there was only one false-positive. I've not tested this though, just made the changes look OK enough to shut up GCC. I was tempted to explicitly disable this warning, but it proved useful. Git branch is here: https://github.com/ThomasAdam/fvwm/tree/ta/fix-compiler-warnings Patch also attached. The diffstat is the useful thing to note here. :) I'll get to looking at this properly at the weekend. -- Thomas Adam -- "Deep in my heart I wish I was wrong. But deep in my heart I know I am not." -- Morrissey ("Girl Least Likely To" -- off of Viva Hate.)
commit a7c0f81a3dda83b7d3874cbe411a09c49e1f0831 Author: Thomas Adam <[email protected]> Date: Mon Jul 25 00:20:04 2011 +0100 Fix compiler warning with gcc-4.6 The default warning checks in GCC-4.6 now flag up unused-but-set -- there seems to be a lot of bit-rot in FVWM for things like that, and note that there's only one false-positive to come of it in FvwmProxy which I've declined to fix as part of this commit. --- fvwm/borders.c | 5 ---- fvwm/builtins.c | 4 --- fvwm/events.c | 3 -- fvwm/ewmh.c | 2 +- fvwm/ewmh_events.c | 2 - fvwm/frame.c | 6 ----- fvwm/fvwm.c | 2 - fvwm/menus.c | 24 +-------------------- fvwm/menustyle.c | 13 ++--------- fvwm/module_interface.c | 2 - fvwm/move_resize.c | 5 ---- fvwm/placement.c | 3 +- fvwm/session.c | 7 ++--- fvwm/style.c | 3 +- fvwm/virtual.c | 4 --- libs/FGettext.c | 10 ++++---- libs/Ficonv.c | 5 +-- libs/Graphics.c | 2 - libs/PictureBase.c | 4 --- libs/PictureImageLoader.c | 3 -- libs/PictureUtils.c | 15 -------------- libs/fsm.c | 2 - modules/FvwmAnimate/FvwmAnimate.c | 32 ++++------------------------- modules/FvwmButtons/FvwmButtons.c | 3 -- modules/FvwmButtons/draw.c | 2 - modules/FvwmCpp/FvwmCpp.c | 3 -- modules/FvwmForm/FvwmForm.c | 3 -- modules/FvwmForm/ParseCommand.c | 4 +- modules/FvwmForm/ReadXServer.c | 11 +-------- modules/FvwmIconBox/FvwmIconBox.c | 3 -- modules/FvwmIconMan/readconfig.c | 2 - modules/FvwmM4/FvwmM4.c | 3 -- modules/FvwmPager/FvwmPager.c | 2 - modules/FvwmPager/x_pager.c | 4 +-- modules/FvwmProxy/FvwmProxy.c | 5 +--- modules/FvwmRearrange/FvwmRearrange.c | 2 - modules/FvwmScript/FvwmScript.c | 3 -- modules/FvwmScript/Instructions.c | 14 +++--------- modules/FvwmScript/Widgets/HScrollBar.c | 6 ----- modules/FvwmScript/Widgets/Menu.c | 3 +- modules/FvwmScript/Widgets/PopupMenu.c | 4 +-- modules/FvwmScript/Widgets/PushButton.c | 4 +-- modules/FvwmScript/Widgets/RadioButton.c | 4 +-- modules/FvwmTaskBar/FvwmTaskBar.c | 12 ----------- modules/FvwmWharf/FvwmWharf.c | 15 ++----------- modules/FvwmWinList/ButtonArray.c | 4 +-- modules/FvwmWinList/FvwmWinList.c | 3 +- 47 files changed, 42 insertions(+), 235 deletions(-) diff --git a/fvwm/borders.c b/fvwm/borders.c index e88352f..d348e8e 100644 --- a/fvwm/borders.c +++ b/fvwm/borders.c @@ -2621,10 +2621,8 @@ static void border_mp_draw_mp_titlebar( unsigned short solid_flags; unsigned short stretch_flags; rectangle tmp_g, left_of_text_g,left_end_g,right_of_text_g,right_end_g; - dynamic_common_decorations *dcd; ButtonState bs; - dcd = &(td->cd->dynamic_cd); bs = td->tbstate.tstate; pm = df->u.mp.pixmaps; acs = df->u.mp.acs; @@ -3630,8 +3628,6 @@ static void border_get_titlebar_draw_descr( FvwmWindow *fw, titlebar_descr *td, title_draw_descr *tdd, Pixmap dest_pix) { - rectangle *title_g; - memset(tdd, 0, sizeof(*tdd)); /* prepare the gcs and variables */ if (td->tbstate.is_title_pressed) @@ -3645,7 +3641,6 @@ static void border_get_titlebar_draw_descr( tdd->sgc = td->cd->shadow_gc; } NewFontAndColor(fw->title_font, td->cd->fore_color, td->cd->back_color); - title_g = &td->layout.title_g; tdd->tstyle = &TB_STATE( GetDecor(fw, titlebar))[td->tbstate.tstate].style; tdd->df = &TB_STATE(GetDecor(fw, titlebar))[td->tbstate.tstate]; diff --git a/fvwm/builtins.c b/fvwm/builtins.c index e23fbec..c343512 100644 --- a/fvwm/builtins.c +++ b/fvwm/builtins.c @@ -1185,14 +1185,12 @@ static void update_decors_colorset(int cset) { int i; - int has_changed; FvwmDecor *decor = &Scr.DefaultDecor; #ifdef USEDECOR for(decor = &Scr.DefaultDecor; decor != NULL; decor = decor->next) #endif { - has_changed = 0; for(i = 0; i < NUMBER_OF_TITLE_BUTTONS; i++) { decor->flags.has_changed |= update_titlebutton_colorset( @@ -3150,7 +3148,6 @@ void CMD_WindowFont(F_CMD_ARGS) void CMD_ChangeDecor(F_CMD_ARGS) { char *item; - int old_height; FvwmDecor *decor = &Scr.DefaultDecor; FvwmDecor *found = NULL; FvwmWindow * const fw = exc->w.fw; @@ -3175,7 +3172,6 @@ void CMD_ChangeDecor(F_CMD_ARGS) return; } SET_DECOR_CHANGED(fw, 1); - old_height = (fw->decor) ? fw->decor->title_height : 0; fw->decor = found; apply_decor_change(fw); diff --git a/fvwm/events.c b/fvwm/events.c index c1218ad..3328c2e 100644 --- a/fvwm/events.c +++ b/fvwm/events.c @@ -2911,9 +2911,6 @@ void HandleMapRequestKeepRaised( ew = ea->exc->w.w; if (ReuseWin == NULL) { - Window pw; - - pw = ea->exc->x.etrigger->xmaprequest.parent; if (XFindContext(dpy, ew, FvwmContext, (caddr_t *)&fw) == XCNOENT) { diff --git a/fvwm/ewmh.c b/fvwm/ewmh.c index 9937a87..e4fba0a 100644 --- a/fvwm/ewmh.c +++ b/fvwm/ewmh.c @@ -1910,7 +1910,7 @@ void EWMH_fullscreen(FvwmWindow *fw) { fscreen_scr_arg fscr; rectangle scr_g; - size_borders b, old_sb; + size_borders b; int page_x; int page_y; char cmd[128] = "\0"; diff --git a/fvwm/ewmh_events.c b/fvwm/ewmh_events.c index 9110a79..55c7996 100644 --- a/fvwm/ewmh_events.c +++ b/fvwm/ewmh_events.c @@ -188,7 +188,6 @@ int ewmh_MoveResizeWindow(EWMH_CMD_ARGS) int do_reconfigure; int win_gravity; int value_mask; - int source; if (ev == NULL) { @@ -196,7 +195,6 @@ int ewmh_MoveResizeWindow(EWMH_CMD_ARGS) } win_gravity = ev->xclient.data.l[0] & 0xff; value_mask = (ev->xclient.data.l[0] >> 8) & 0xf; - source = (ev->xclient.data.l[0] >> 12) & 0xf; if (fw == NULL) { /* unmanaged window */ diff --git a/fvwm/frame.c b/fvwm/frame.c index a42efa9..5a434d6 100644 --- a/fvwm/frame.c +++ b/fvwm/frame.c @@ -1337,8 +1337,6 @@ void frame_get_titlebar_dimensions( int tb_thick; int tb_x; int tb_y; - int tb_w; - int tb_h; int b_length; int b_w; int b_h; @@ -1418,8 +1416,6 @@ void frame_get_titlebar_dimensions( t_w = tb_thick; t_h = t_length; b_l = &b_h; - tb_w = tb_thick; - tb_h = tb_length; } else { @@ -1444,8 +1440,6 @@ void frame_get_titlebar_dimensions( t_w = t_length; t_h = tb_thick; b_l = &b_w; - tb_w = tb_length; - tb_h = tb_thick; } if (fw->title_text_rotation == ROTATION_270 || fw->title_text_rotation == ROTATION_180) diff --git a/fvwm/fvwm.c b/fvwm/fvwm.c index 75c52c8..036add7 100644 --- a/fvwm/fvwm.c +++ b/fvwm/fvwm.c @@ -1073,7 +1073,6 @@ static void CreateGCs(void) { XGCValues gcv; unsigned long gcm; - XColor c; /* create scratch GC's */ gcm = GCFunction|GCLineWidth; @@ -1087,7 +1086,6 @@ static void CreateGCs(void) Scr.TitleGC = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv); Scr.BordersGC = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv); Scr.TransMaskGC = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv); - c.pixel = GetColor(DEFAULT_FORE_COLOR); Scr.ScratchMonoPixmap = XCreatePixmap(dpy, Scr.Root, 1, 1, 1); Scr.MonoGC = fvwmlib_XCreateGC(dpy, Scr.ScratchMonoPixmap, gcm, &gcv); Scr.ScratchAlphaPixmap = XCreatePixmap( diff --git a/fvwm/menus.c b/fvwm/menus.c index 918f366..4b18974 100644 --- a/fvwm/menus.c +++ b/fvwm/menus.c @@ -2520,16 +2520,7 @@ static Bool paint_menu_gradient_background( register int i = 0, numLines; int cindex = -1; XRectangle r; - FvwmPicture *sidePic = NULL; - if (MR_SIDEPIC(mr)) - { - sidePic = MR_SIDEPIC(mr); - } - else if (MST_SIDEPIC(mr)) - { - sidePic = MST_SIDEPIC(mr); - } if (pevent) { r.x = pevent->xexpose.x; @@ -2702,10 +2693,8 @@ static void paint_menu( MenuItem *mi; MenuStyle *ms = MR_STYLE(mr); int bw = MST_BORDER_WIDTH(mr); - XGCValues gcv; int relief_thickness = ST_RELIEF_THICKNESS(MR_STYLE(mr)); - gcv.line_width = 3; if (fw && !check_if_fvwm_window_exists(fw)) { fw = NULL; @@ -3859,7 +3848,6 @@ static void pop_menu_down_and_repaint_parent( MenuRoot **pmr, Bool *fSubmenuOverlaps, MenuParameters *pmp) { MenuRoot *parent = MR_PARENT_MENU(*pmr); - Window win; XEvent event; int mr_x; int mr_y; @@ -3874,8 +3862,6 @@ static void pop_menu_down_and_repaint_parent( { /* popping down the menu may destroy the menu via the dynamic * popdown action! Thus we must not access *pmr afterwards. */ - win = MR_WINDOW(*pmr); - /* Create a fake event to pass into paint_menu */ event.type = Expose; if (!menu_get_geometry( @@ -4388,13 +4374,12 @@ static mloop_ret_code_t __mloop_handle_event( * previous menu or possibly ignore the mouse position */ if (pmret->flags.is_menu_posted) { - MenuItem *l_mi; MenuRoot *l_mrMi; int l_x_offset; XEvent e; pmret->flags.is_menu_posted = 0; - l_mi = find_entry( + (void)find_entry( pmp, &l_x_offset, &l_mrMi, None, -1, -1); if (l_mrMi != NULL) { @@ -5271,7 +5256,6 @@ static mloop_ret_code_t __mloop_handle_action_without_mi( static void __mloop_exit_warp_back(MenuParameters *pmp) { - MenuItem *tmi; MenuRoot *tmrMi; if (pmp->parent_menu && MR_SELECTED_ITEM(pmp->parent_menu)) @@ -5279,7 +5263,7 @@ static void __mloop_exit_warp_back(MenuParameters *pmp) warp_pointer_to_item( pmp->parent_menu, MR_SELECTED_ITEM(pmp->parent_menu), False); - tmi = find_entry(pmp, NULL, &tmrMi, None, -1, -1); + (void)find_entry(pmp, NULL, &tmrMi, None, -1, -1); if (pmp->parent_menu != tmrMi && MR_XANIMATION(pmp->menu) == 0) { /* Warping didn't take us to the correct menu, i.e. the @@ -5904,7 +5888,6 @@ void do_menu(MenuParameters *pmp, MenuReturn *pmret) static int indirect_depth = 0; static int x_start; static int y_start; - static Bool has_mouse_moved = False; int scr_x, scr_y; int scr_w, scr_h; @@ -5990,7 +5973,6 @@ void do_menu(MenuParameters *pmp, MenuReturn *pmret) fscreen_scr_arg fscr; /* we're a top level menu */ - has_mouse_moved = False; if (!GrabEm(CRS_MENU, GRAB_MENU)) { /* GrabEm specifies the cursor to use */ @@ -7036,7 +7018,6 @@ char *get_menu_options( int x; int y; int button; - int gflags; int width; int height; int dummy_int; @@ -7074,7 +7055,6 @@ char *get_menu_options( while (action != NULL && *action != 0 && once_more) { /* ^ just to be able to jump to end of loop without 'goto' */ - gflags = NoValue; pops->pos_hints.is_relative = False; pops->pos_hints.menu_width = 0; pops->pos_hints.is_menu_relative = False; diff --git a/fvwm/menustyle.c b/fvwm/menustyle.c index e33df5a..954699b 100644 --- a/fvwm/menustyle.c +++ b/fvwm/menustyle.c @@ -832,7 +832,6 @@ MenuStyle *menustyle_parse_style(F_CMD_ARGS) char *option = NULL; char *poption = NULL; char *optstring = NULL; - char *nextarg; char *args = NULL; char *arg1; int on; @@ -840,7 +839,6 @@ MenuStyle *menustyle_parse_style(F_CMD_ARGS) MenuStyle *tmpms; Bool is_initialised = True; Bool has_gc_changed = False; - Bool is_default_style = False; int val[2]; int n; FlocaleFont *new_font = NULL; @@ -867,10 +865,6 @@ MenuStyle *menustyle_parse_style(F_CMD_ARGS) { /* copy the structure over our temporary menu face. */ memcpy(tmpms, ms, sizeof(MenuStyle)); - if (ms == default_menu_style) - { - is_default_style = True; - } free(name); } else @@ -926,7 +920,7 @@ MenuStyle *menustyle_parse_style(F_CMD_ARGS) free(optstring); break; } - nextarg = GetNextToken(args, &arg1); + (void)GetNextToken(args, &arg1); } poption = option; while (poption[0] == '!') @@ -1950,7 +1944,6 @@ void CMD_MenuStyle(F_CMD_ARGS) { char *option; char *poption; - MenuStyle *dummy; GetNextSimpleOption(SkipNTokens(action, 1), &option); poption = option; @@ -1960,11 +1953,11 @@ void CMD_MenuStyle(F_CMD_ARGS) } if (option == NULL || menustyle_get_styleopt_index(poption) != -1) { - dummy = menustyle_parse_style(F_PASS_ARGS); + (void)menustyle_parse_style(F_PASS_ARGS); } else { - dummy = menustyle_parse_old_style(F_PASS_ARGS); + (void)menustyle_parse_old_style(F_PASS_ARGS); } if (option) { diff --git a/fvwm/module_interface.c b/fvwm/module_interface.c index 636cc81..a393f50 100644 --- a/fvwm/module_interface.c +++ b/fvwm/module_interface.c @@ -657,7 +657,6 @@ void module_input_execute(struct fmodule_input *input) XEvent e; const exec_context_t *exc; exec_context_changes_t ecc; - int flags; memset(&e, 0, sizeof(e)); if (XFindContext(dpy, input->window, FvwmContext, @@ -703,7 +702,6 @@ void module_input_execute(struct fmodule_input *input) fev_fake_event(&e); ecc.type = EXCT_MODULE; ecc.w.w = input->window; - flags = (input->window == None) ? 0 : FUNC_DONT_DEFER; ecc.w.wcontext = GetContext(NULL, ecc.w.fw, &e, &(input->window)); ecc.x.etrigger = &e; ecc.m.module = input->module; diff --git a/fvwm/move_resize.c b/fvwm/move_resize.c index 91056a7..b10e4dd 100644 --- a/fvwm/move_resize.c +++ b/fvwm/move_resize.c @@ -1038,7 +1038,6 @@ static Bool resize_move_window(F_CMD_ARGS) int x,y; Bool fWarp = False; Bool fPointer = False; - Bool has_focus; int dx; int dy; size_borders b; @@ -1116,7 +1115,6 @@ static Bool resize_move_window(F_CMD_ARGS) fw->g.normal.x += dx; fw->g.normal.y += dy; } - has_focus = (fw == get_focus_window())? True : False; update_absolute_geometry(fw); maximize_adjust_offset(fw); XFlush(dpy); @@ -3818,9 +3816,6 @@ static Bool __resize_window(F_CMD_ARGS) if (ev.type == MotionNotify || ev.type == EnterNotify || ev.type == LeaveNotify) { - Bool is_motion; - - is_motion = (ev.type == MotionNotify) ? True : False; /* discard any extra motion events before a release */ /* dv (2004-07-01): With XFree 4.1.0.1, some Mouse * events are not reported to fvwm when the pointer diff --git a/fvwm/placement.c b/fvwm/placement.c index 11e4d1c..63a88b5 100644 --- a/fvwm/placement.c +++ b/fvwm/placement.c @@ -998,7 +998,6 @@ static pl_penalty_t __pl_minoverlap_get_pos_penalty( other_fw = other_fw->next) { rectangle other_g; - Bool rc; get_window_borders(other_fw, &b); if ( @@ -1014,7 +1013,7 @@ static pl_penalty_t __pl_minoverlap_get_pos_penalty( { continue; } - rc = get_visible_window_or_icon_geometry(other_fw, &other_g); + (void)get_visible_window_or_icon_geometry(other_fw, &other_g); if (IS_STICKY_ACROSS_PAGES(other_fw)) { other_g.x -= arg->pdelta_p.x; diff --git a/fvwm/session.c b/fvwm/session.c index cddd27b..5bc6550 100644 --- a/fvwm/session.c +++ b/fvwm/session.c @@ -1124,7 +1124,7 @@ LoadGlobalState(char *filename) FILE *f; char s[4096], s1[4096]; /* char s2[256]; */ - int i1, i2, i3, i4, i5; + int i1, i2, i3, i4; if (!does_file_version_match) { @@ -1145,7 +1145,6 @@ LoadGlobalState(char *filename) i2 = 0; i3 = 0; i4 = 0; - i5 = 0; sscanf(s, "%4000s", s1); /* If we are restarting, [REAL_STATE_FILENAME] points * to the file containing the true session state. */ @@ -1185,8 +1184,8 @@ LoadGlobalState(char *filename) * changed rc files. */ if (!strcmp(s1, "[SCROLL]")) { - sscanf(s, "%*s %i %i %i %i %i", &i1, - &i2, &i3, &i4, &i5); + sscanf(s, "%*s %i %i %i %i ", &i1, + &i2, &i3, &i4); Scr.EdgeScrollX = i1; Scr.EdgeScrollY = i2; Scr.ScrollDelay = i3; diff --git a/fvwm/style.c b/fvwm/style.c index eebf4f8..b2988e5 100644 --- a/fvwm/style.c +++ b/fvwm/style.c @@ -4427,7 +4427,6 @@ static Bool style_parse_one_style_option( static void parse_and_set_window_style(char *action, char *prefix, window_style *ps) { - char *line; char *option; char *token; char *rest; @@ -4439,7 +4438,7 @@ void parse_and_set_window_style(char *action, char *prefix, window_style *ps) { action++; } - line = action; + while (action && *action && *action != '\n') { action = GetNextFullOption(action, &option); diff --git a/fvwm/virtual.c b/fvwm/virtual.c index d3c0b80..7f7cadf 100644 --- a/fvwm/virtual.c +++ b/fvwm/virtual.c @@ -1519,15 +1519,11 @@ Bool get_page_arguments(char *action, int *page_x, int *page_y) int wrapy; int limitdeskx; int limitdesky; - int startx; - int starty; wrapx = 0; wrapy = 0; limitdeskx = 1; limitdesky = 1; - startx = *page_x; - starty = *page_y; for (; ; action = taction) { int do_reverse; diff --git a/libs/FGettext.c b/libs/FGettext.c index bd21534..0d8fd2e 100644 --- a/libs/FGettext.c +++ b/libs/FGettext.c @@ -157,7 +157,7 @@ void FGettextInit(const char *domain, const char *dir, const char *module) const char *FGettext(char *str) { flist *l = FGPathList; - const char *s, *dummy; + const char *s; if (!HaveNLSSupport || !FGettextInitOk || FGPathList == NULL || str == NULL) @@ -167,8 +167,8 @@ const char *FGettext(char *str) if (FGLastPath != l->object) { - dummy = bindtextdomain (FGP_DOMAIN(l), FGP_DIR(l)); - dummy = textdomain (FGP_DOMAIN(l)); + (void)bindtextdomain (FGP_DOMAIN(l), FGP_DIR(l)); + (void)textdomain (FGP_DOMAIN(l)); FGLastPath = l->object; } s = gettext(str); @@ -179,8 +179,8 @@ const char *FGettext(char *str) l = l->next; while(l != NULL) { - dummy = bindtextdomain (FGP_DOMAIN(l), FGP_DIR(l)); - dummy = textdomain (FGP_DOMAIN(l)); + (void)bindtextdomain (FGP_DOMAIN(l), FGP_DIR(l)); + (void)textdomain (FGP_DOMAIN(l)); FGLastPath = l->object; s = gettext(str); if (s != str) diff --git a/libs/Ficonv.c b/libs/Ficonv.c index 46199fd..b2718f9 100644 --- a/libs/Ficonv.c +++ b/libs/Ficonv.c @@ -69,7 +69,6 @@ Bool is_iconv_supported(char *c1, char *c2) { Ficonv_t cd1,cd2; Bool r = False; - int dummy; if (!FiconvSupport || !c1 || !c2) return False; @@ -79,9 +78,9 @@ Bool is_iconv_supported(char *c1, char *c2) if (cd1 != (Ficonv_t) -1 && cd2 != (Ficonv_t) -1) r = True; if (cd1 != (Ficonv_t) -1) - dummy = Ficonv_close(cd1); + (void)Ficonv_close(cd1); if (cd2 != (Ficonv_t) -1) - dummy = Ficonv_close(cd2); + (void)Ficonv_close(cd2); return r; } diff --git a/libs/Graphics.c b/libs/Graphics.c index fa45ef9..9c4b3d8 100644 --- a/libs/Graphics.c +++ b/libs/Graphics.c @@ -930,7 +930,6 @@ Drawable CreateGradientPixmap( int t_y; int t_width; int t_height; - int ps; if (d_pixels != NULL && *d_pixels != NULL) { @@ -985,7 +984,6 @@ Drawable CreateGradientPixmap( dpy, Pcmap, t_width, t_height, False, False, dither, False); } - ps = t_width * t_height; /* now do the fancy drawing */ switch (type) { diff --git a/libs/PictureBase.c b/libs/PictureBase.c index 14034ec..c0ecab9 100644 --- a/libs/PictureBase.c +++ b/libs/PictureBase.c @@ -211,10 +211,6 @@ GC PictureDefaultGC(Display *dpy, Window win) } if (gc == None) { - XGCValues xgcv; - - xgcv.foreground = PictureBlackPixel(); - xgcv.background = PictureWhitePixel(); gc = fvwmlib_XCreateGC(dpy, win, 0, NULL); } diff --git a/libs/PictureImageLoader.c b/libs/PictureImageLoader.c index cb7b8d2..b22ca6b 100644 --- a/libs/PictureImageLoader.c +++ b/libs/PictureImageLoader.c @@ -650,7 +650,6 @@ Pixmap PImageCreatePixmapFromFImage(Display *dpy, Window win, FImage *fimage) int w; int h; int depth; - int must_free_gc; w = fimage->im->width; h = fimage->im->height; @@ -659,12 +658,10 @@ Pixmap PImageCreatePixmapFromFImage(Display *dpy, Window win, FImage *fimage) if (depth == Pdepth) { gc = PictureDefaultGC(dpy, win); - must_free_gc = 0; } else { gc = fvwmlib_XCreateGC(dpy, pixmap, 0, NULL); - must_free_gc = 1; } FPutFImage(dpy, pixmap, gc, fimage, 0, 0, 0, 0, w, h); if (depth != Pdepth) diff --git a/libs/PictureUtils.c b/libs/PictureUtils.c index 8da68fc..1d78dca 100644 --- a/libs/PictureUtils.c +++ b/libs/PictureUtils.c @@ -1286,9 +1286,6 @@ int PictureAllocColorTable( int do_allocate = 0; int use_default = 1; int private_cmap = !(Pdefault); - int dyn_cl_set = False; - int strict_cl_set = False; - int alloc_table_set = False; int color_limit; int pa_type = (Pvisual->class != GrayScale) ? PA_COLOR_CUBE : PA_GRAY_SCALE; @@ -1455,12 +1452,10 @@ int PictureAllocColorTable( { if (rest[0] == '1') { - strict_cl_set = True; PStrictColorLimit = 1; } else { - strict_cl_set = True; PStrictColorLimit = 0; } if (strlen(rest) > 1 && rest[1] == '1') @@ -1473,22 +1468,18 @@ int PictureAllocColorTable( } if (strlen(rest) > 2 && rest[2] == '1') { - dyn_cl_set = True; PUseDynamicColors = 1; } else { - dyn_cl_set = True; PUseDynamicColors = 0; } if (strlen(rest) > 3 && rest[3] == '1') { - alloc_table_set = True; PAllocTable = 1; } else { - alloc_table_set = True; PAllocTable = 0; } } @@ -1506,12 +1497,10 @@ int PictureAllocColorTable( } if (opt->strict > 0) { - strict_cl_set = True; PStrictColorLimit = 1; } else if (opt->strict == 0) { - strict_cl_set = True; PStrictColorLimit = 0; } if (opt->use_named_table > 0) @@ -1524,22 +1513,18 @@ int PictureAllocColorTable( } if (opt->not_dynamic > 0) { - dyn_cl_set = True; PUseDynamicColors = 0; } else if (opt->not_dynamic == 0) { - dyn_cl_set = True; PUseDynamicColors = 0; } if (opt->allocate > 0) { - alloc_table_set = True; PAllocTable = 1; } else if (opt->allocate == 0) { - alloc_table_set = True; PAllocTable = 0; } } diff --git a/libs/fsm.c b/libs/fsm.c index 901455b..62dacd1 100644 --- a/libs/fsm.c +++ b/libs/fsm.c @@ -697,7 +697,6 @@ void CompletNewConnectionMsg(void) { flist *l = pending_ice_conn_list; FIceConn ice_conn; - Bool pending = False; FIceAcceptStatus cstatus; if (!SessionSupport) @@ -711,7 +710,6 @@ void CompletNewConnectionMsg(void) cstatus = FIceConnectionStatus(ice_conn); if (cstatus == (int)FIceConnectPending) { - pending = True; l = l->next; } else if (cstatus == (int)FIceConnectAccepted) diff --git a/modules/FvwmAnimate/FvwmAnimate.c b/modules/FvwmAnimate/FvwmAnimate.c index 3fe9b25..95374ed 100644 --- a/modules/FvwmAnimate/FvwmAnimate.c +++ b/modules/FvwmAnimate/FvwmAnimate.c @@ -838,10 +838,6 @@ int main(int argc, char **argv) { */ static void Loop(void) { FvwmPacket* packet; - clock_t time_start; /* for time() */ - clock_t time_end; /* for time() */ - clock_t time_accum; - struct tms time_buffer; /* for time() */ char cmd[200]; myfprintf((stderr,"Starting event loop\n")); @@ -867,9 +863,6 @@ static void Loop(void) { || packet->body[5] == 0) { /* or a "noicon" icon */ break; /* don't animate it */ } - if (Animate.time != 0) { - time_start = times(&time_buffer); - } Animate.resize((int)packet->body[3], /* t->icon_x_loc */ (int)packet->body[4], /* t->icon_y_loc */ (int)packet->body[5], /* t->icon_p_width */ @@ -878,12 +871,8 @@ static void Loop(void) { (int)packet->body[8], /* t->frame_y */ (int)packet->body[9], /* t->frame_width */ (int)packet->body[10]); /* t->frame_height */ - if (Animate.time != 0) { - time_end = times(&time_buffer); - time_accum = time_end - time_start; - } myaprintf((stderr, - "DE_Iconify, args %d+%d+%dx%d %d+%d+%dx%d. took %dx%d\n", + "DE_Iconify, args %d+%d+%dx%d %d+%d+%dx%d.\n", (int)packet->body[3], /* t->icon_x_loc */ (int)packet->body[4], /* t->icon_y_loc */ (int)packet->body[5], /* t->icon_p_width */ @@ -891,12 +880,8 @@ static void Loop(void) { (int)packet->body[7], /* t->frame_x */ (int)packet->body[8], /* t->frame_y */ (int)packet->body[9], /* t->frame_width */ - (int)packet->body[10], /* t->frame_height */ - (int)time_accum,1)); -#if 0 - /* So far, clk_tck seems to be non-portable...dje */ -/* (int)time_accum,(int)CLK_TCK)); */ -#endif + (int)packet->body[10] /* t->frame_height */ + )); break; case M_ICONIFY: if (play_state == False) @@ -912,9 +897,6 @@ static void Loop(void) { || (int)packet->body[5] == 0) { /* or a "noicon" icon */ break; /* don't animate it */ } - if (Animate.time != 0) { - time_start = times(&time_buffer); - } Animate.resize((int)packet->body[7], /* t->frame_x */ (int)packet->body[8], /* t->frame_y */ (int)packet->body[9], /* t->frame_width */ @@ -923,10 +905,6 @@ static void Loop(void) { (int)packet->body[4], /* t->icon_y_loc */ (int)packet->body[5], /* t->icon_p_width */ (int)packet->body[6]); /* t->icon_p_height */ - if (Animate.time != 0) { - time_end = times(&time_buffer); - time_accum = time_end - time_start; - } myaprintf((stderr, "Iconify, args %d+%d+%dx%d %d+%d+%dx%d. Took %d\n", (int)packet->body[7], /* t->frame_x */ @@ -936,8 +914,8 @@ static void Loop(void) { (int)packet->body[3], /* t->icon_x_loc */ (int)packet->body[4], /* t->icon_y_loc */ (int)packet->body[5], /* t->icon_p_width */ - (int)packet->body[6], - (int)time_accum)); + (int)packet->body[6] + )); break; case M_STRING: { diff --git a/modules/FvwmButtons/FvwmButtons.c b/modules/FvwmButtons/FvwmButtons.c index 0f5444d..6493b00 100644 --- a/modules/FvwmButtons/FvwmButtons.c +++ b/modules/FvwmButtons/FvwmButtons.c @@ -1574,7 +1574,6 @@ void RedrawWindow(void) XEvent dummy; button_info *ub, *b; static Bool initial_redraw = True; - Bool clear_buttons; if (ready < 1) { @@ -1590,12 +1589,10 @@ void RedrawWindow(void) if (initial_redraw == False) { XClearWindow(Dpy, MyWindow); - clear_buttons = False; } else { initial_redraw = False; - clear_buttons = True; } button = -1; diff --git a/modules/FvwmButtons/draw.c b/modules/FvwmButtons/draw.c index 20119a8..35f8f10 100644 --- a/modules/FvwmButtons/draw.c +++ b/modules/FvwmButtons/draw.c @@ -248,7 +248,6 @@ void RedrawButton(button_info *b, int draw, XEvent *pev) XRectangle clip; Bool clean = False; Bool cleaned = False; - Bool clear_bg = False; char *title; if (b->parent == NULL) @@ -314,7 +313,6 @@ void RedrawButton(button_info *b, int draw, XEvent *pev) { /* bg of the button is the true bg */ clean = True; - clear_bg = True; } } diff --git a/modules/FvwmCpp/FvwmCpp.c b/modules/FvwmCpp/FvwmCpp.c index 2b8e0d4..8e426ff 100644 --- a/modules/FvwmCpp/FvwmCpp.c +++ b/modules/FvwmCpp/FvwmCpp.c @@ -242,7 +242,6 @@ static char *cpp_defs(Display *display, const char *host, char *cpp_options, cha FILE *tmpf; struct passwd *pwent; int fd; - int ScreenWidth, ScreenHeight; int Mscreen; /* Generate a temporary filename. Honor the TMPDIR environment variable, @@ -345,8 +344,6 @@ static char *cpp_defs(Display *display, const char *host, char *cpp_options, cha Mscreen= DefaultScreen(display); fputs(MkNum("SCREEN", Mscreen), tmpf); - ScreenWidth = DisplayWidth(display,Mscreen); - ScreenHeight = DisplayHeight(display,Mscreen); fputs(MkNum("WIDTH", DisplayWidth(display,Mscreen)), tmpf); fputs(MkNum("HEIGHT", DisplayHeight(display,Mscreen)), tmpf); diff --git a/modules/FvwmForm/FvwmForm.c b/modules/FvwmForm/FvwmForm.c index 2b4d0ec..48b7ed6 100644 --- a/modules/FvwmForm/FvwmForm.c +++ b/modules/FvwmForm/FvwmForm.c @@ -2094,7 +2094,6 @@ static void OpenWindows(void) static XSizeHints sh = { PPosition | PSize | USPosition | USSize | PWinGravity}; XClassHint myclasshints; - fscreen_scr_t scr; if (!CF.pointer[input_pointer]) { CF.pointer[input_pointer] = XCreateFontCursor(dpy, XC_xterm); @@ -2168,11 +2167,9 @@ static void OpenWindows(void) { gravity = SouthEastGravity; } - scr = FSCREEN_XYPOS; } else { FScreenCenterOnScreen( NULL, FSCREEN_CURRENT, &x, &y, CF.max_width, CF.total_height); - scr = FSCREEN_CURRENT; } /* hack to prevent mapping on wrong screen with StartsOnScreen */ FScreenMangleScreenIntoUSPosHints(FSCREEN_CURRENT, &sh); diff --git a/modules/FvwmForm/ParseCommand.c b/modules/FvwmForm/ParseCommand.c index cd1a109..c13d73d 100644 --- a/modules/FvwmForm/ParseCommand.c +++ b/modules/FvwmForm/ParseCommand.c @@ -50,7 +50,7 @@ static int N = 8; char * ParseCommand (int dn, char *sp, char end, int *dn1, char **sp1) { static char var[256]; - char c, x, *wp, *cp, *vp; + char c, x, *cp, *vp; int j, dn2; int added_sel; Item *item; @@ -71,7 +71,7 @@ char * ParseCommand (int dn, char *sp, char end, int *dn1, char **sp1) if (c == '$') { /* variable */ if (*sp != '(') goto normal_char; - wp = ++sp; + ++sp; vp = var; while (1) { x = *(sp++); diff --git a/modules/FvwmForm/ReadXServer.c b/modules/FvwmForm/ReadXServer.c index aa0daed..1680057 100644 --- a/modules/FvwmForm/ReadXServer.c +++ b/modules/FvwmForm/ReadXServer.c @@ -68,7 +68,7 @@ static void ResizeFrame (void); void ReadXServer (void) { static XEvent event; - int old_cursor = 0, keypress; + int keypress; Item *item, *old_item; KeySym ks; char *sp, *dp; @@ -250,14 +250,12 @@ void ReadXServer (void) } /* end one input field */ switch (buf[0]) { case '\001': /* ^A */ - old_cursor = CF.abs_cursor; CF.rel_cursor = 0; CF.abs_cursor = 0; CF.cur_input->input.left = 0; goto redraw_newcursor; break; case '\005': /* ^E */ - old_cursor = CF.abs_cursor; CF.rel_cursor = CF.cur_input->input.n; if ((CF.cur_input->input.left = CF.rel_cursor - CF.cur_input->input.size) < 0) @@ -266,7 +264,6 @@ void ReadXServer (void) goto redraw_newcursor; break; case '\002': /* ^B */ - old_cursor = CF.abs_cursor; if (CF.rel_cursor > 0) { CF.rel_cursor--; CF.abs_cursor--; @@ -278,7 +275,6 @@ void ReadXServer (void) goto redraw_newcursor; break; case '\006': /* ^F */ - old_cursor = CF.abs_cursor; if (CF.rel_cursor < CF.cur_input->input.n) { CF.rel_cursor++; CF.abs_cursor++; @@ -291,7 +287,6 @@ void ReadXServer (void) goto redraw_newcursor; break; case '\010': /* ^H */ - old_cursor = CF.abs_cursor; if (CF.rel_cursor > 0) { sp = CF.cur_input->input.value + CF.rel_cursor; dp = sp - 1; @@ -345,7 +340,6 @@ void ReadXServer (void) } break; default: - old_cursor = CF.abs_cursor; if((buf[0] >= ' ' && buf[0] < '\177') || (buf[0] >= 160)) { /* regular or intl char */ @@ -669,11 +663,10 @@ static void process_paste_request (XEvent *event, Item *item) { Atom actual_type; int actual_format; unsigned long nitems, bytes_after, nread; - unsigned char *data, *h, buf[256]; + unsigned char *data; unsigned char *c; nread = 0; /* init read offset */ - h = buf; /* starting point */ do { if (XGetWindowProperty (dpy, DefaultRootWindow (dpy), diff --git a/modules/FvwmIconBox/FvwmIconBox.c b/modules/FvwmIconBox/FvwmIconBox.c index b1451b5..ef8c237 100644 --- a/modules/FvwmIconBox/FvwmIconBox.c +++ b/modules/FvwmIconBox/FvwmIconBox.c @@ -3371,7 +3371,6 @@ static int CheckActionType( void ExecuteAction(int x, int y, struct icon_info *item) { int type = NO_CLICK; - XEvent *ev; XEvent d; struct mousefunc *tmp; @@ -3380,7 +3379,6 @@ void ExecuteAction(int x, int y, struct icon_info *item) type = CheckActionType(x, y, &d, False, True); if (type == CLICK) { - ev = &d; /* If it was a click, wait to see if its a double click */ if (have_double_click) { @@ -3389,7 +3387,6 @@ void ExecuteAction(int x, int y, struct icon_info *item) { case CLICK: type = DOUBLE_CLICK; - ev = &d; break; case TIMEOUT: type = CLICK; diff --git a/modules/FvwmIconMan/readconfig.c b/modules/FvwmIconMan/readconfig.c index 57b9527..e6ddd79 100644 --- a/modules/FvwmIconMan/readconfig.c +++ b/modules/FvwmIconMan/readconfig.c @@ -1147,11 +1147,9 @@ static void handle_button_config(int manager, int context, char *option) static void add_weighted_sort(WinManager *man, WeightedSort *weighted_sort) { WeightedSort *p; - int i; if (man->weighted_sorts_len == man->weighted_sorts_size) { - i = man->weighted_sorts_size; man->weighted_sorts_size += 16; man->weighted_sorts = (WeightedSort *)saferealloc( (char *)man->weighted_sorts, diff --git a/modules/FvwmM4/FvwmM4.c b/modules/FvwmM4/FvwmM4.c index 5ca7cb1..df798c0 100644 --- a/modules/FvwmM4/FvwmM4.c +++ b/modules/FvwmM4/FvwmM4.c @@ -284,7 +284,6 @@ static char *m4_defs( FILE *tmpf; struct passwd *pwent; int fd; - int ScreenWidth, ScreenHeight; int Mscreen; /* Generate a temporary filename. Honor the TMPDIR environment variable, @@ -410,8 +409,6 @@ static char *m4_defs( Mscreen= DefaultScreen(display); fputs(MkNum("SCREEN", Mscreen), tmpf); - ScreenWidth = DisplayWidth(display,Mscreen); - ScreenHeight = DisplayHeight(display,Mscreen); fputs(MkNum("WIDTH", DisplayWidth(display,Mscreen)), tmpf); fputs(MkNum("HEIGHT", DisplayHeight(display,Mscreen)), tmpf); diff --git a/modules/FvwmPager/FvwmPager.c b/modules/FvwmPager/FvwmPager.c index b254aba..f03ab0d 100644 --- a/modules/FvwmPager/FvwmPager.c +++ b/modules/FvwmPager/FvwmPager.c @@ -1245,10 +1245,8 @@ void list_icon_name(unsigned long *body) void list_mini_icon(unsigned long *body) { PagerWindow *t; - Window target_w; MiniIconPacket *mip = (MiniIconPacket *) body; - target_w = body[0]; t = Start; while (t && (t->w != mip->w)) t = t->next; diff --git a/modules/FvwmPager/x_pager.c b/modules/FvwmPager/x_pager.c index 71a5286..68a6943 100644 --- a/modules/FvwmPager/x_pager.c +++ b/modules/FvwmPager/x_pager.c @@ -2890,7 +2890,7 @@ void PictureIconWindow (PagerWindow *t) void IconMoveWindow(XEvent *Event, PagerWindow *t) { - int x1, y1, finished = 0, wx, wy, n, x = 0, y = 0, xi = 0, yi = 0; + int x1, y1, finished = 0, n, x = 0, y = 0, xi = 0, yi = 0; Window dumwin; int m, n1, m1; int moved = 0; @@ -2908,8 +2908,6 @@ void IconMoveWindow(XEvent *Event, PagerWindow *t) m = Scr.VyMax / Scr.MyDisplayHeight; n1 = (Scr.Vx + t->x) / Scr.MyDisplayWidth; m1 = (Scr.Vy + t->y) / Scr.MyDisplayHeight; - wx = (Scr.Vx + t->x) * (icon_w - n) / Scr.VWidth + n1; - wy = (Scr.Vy + t->y) * (icon_h - m) / Scr.VHeight + m1; XRaiseWindow(dpy, t->IconView); diff --git a/modules/FvwmProxy/FvwmProxy.c b/modules/FvwmProxy/FvwmProxy.c index d01ef30..acd47e5 100644 --- a/modules/FvwmProxy/FvwmProxy.c +++ b/modules/FvwmProxy/FvwmProxy.c @@ -994,7 +994,6 @@ static void send_command_to_fvwm(char *command, Window w) static int GetProperty(Window w,char* propertyname) { Atom atom,actual_type; - char *atom_name; int actual_format; unsigned long nitems; unsigned long bytes_after; @@ -1005,7 +1004,6 @@ static int GetProperty(Window w,char* propertyname) int bytes; atom = XInternAtom(dpy, propertyname, True); - atom_name = XGetAtomName (dpy,atom); status = XGetWindowProperty(dpy, w, atom, 0L, 1024, False, AnyPropertyType, @@ -1057,7 +1055,6 @@ static int GetLeader(Window w) static int GetParentProcessId(int pid) { int ppid=0; - int bytes; FILE* statusfile; sprintf(commandBuffer,"/proc/%d/stat",pid); @@ -1066,7 +1063,7 @@ static int GetParentProcessId(int pid) { return 0; } - bytes=fread(resultBuffer,32,1,statusfile); + (void)fread(resultBuffer,32,1,statusfile); sscanf(resultBuffer,"%*d %*[^)]) %*s %d",&ppid); fclose(statusfile); return ppid; diff --git a/modules/FvwmRearrange/FvwmRearrange.c b/modules/FvwmRearrange/FvwmRearrange.c index af7c897..188ccf5 100644 --- a/modules/FvwmRearrange/FvwmRearrange.c +++ b/modules/FvwmRearrange/FvwmRearrange.c @@ -514,7 +514,6 @@ int main(int argc, char *argv[]) { char match[128]; char *config_line; - int scr; console = fopen("/dev/console","w"); if (!console) console = stderr; @@ -538,7 +537,6 @@ int main(int argc, char *argv[]) signal (SIGPIPE, DeadPipe); FScreenInit(dpy); - scr = DefaultScreen(dpy); fd_width = GetFdWidth(); strcpy(match, "*"); diff --git a/modules/FvwmScript/FvwmScript.c b/modules/FvwmScript/FvwmScript.c index 23fac70..f21468f 100644 --- a/modules/FvwmScript/FvwmScript.c +++ b/modules/FvwmScript/FvwmScript.c @@ -1310,7 +1310,6 @@ void ReadFvwmScriptArg(int argc, char **argv,int IsFather) { int i; Atom myatom; - int FisrtArg; BuffSend.NbMsg=0; /* Aucun message dans le buffer */ @@ -1321,7 +1320,6 @@ void ReadFvwmScriptArg(int argc, char **argv,int IsFather) { myatom = XInternAtom(dpy,x11base->TabScriptId[1],True); XSetSelectionOwner(dpy, myatom, x11base->win, CurrentTime); - FisrtArg = 9; } else { /* Cas du fils */ @@ -1331,7 +1329,6 @@ void ReadFvwmScriptArg(int argc, char **argv,int IsFather) x11base->TabScriptId[1] = argv[7]; myatom=XInternAtom(dpy, x11base->TabScriptId[1], True); XSetSelectionOwner(dpy, myatom, x11base->win, CurrentTime); - FisrtArg = 8; } } diff --git a/modules/FvwmScript/Instructions.c b/modules/FvwmScript/Instructions.c index 20e48d2..b814ab0 100644 --- a/modules/FvwmScript/Instructions.c +++ b/modules/FvwmScript/Instructions.c @@ -110,9 +110,8 @@ static int InfEq(char *arg1,char *arg2) static int Equal(char *arg1,char *arg2) { - int an1,an2; - an1=atoi(arg1); - an2=atoi(arg2); + (void)atoi(arg1); + (void)atoi(arg2); return (strcmp(arg1,arg2)==0); } @@ -134,9 +133,8 @@ static int Sup(char *arg1,char *arg2) static int Diff(char *arg1,char *arg2) { - int an1,an2; - an1=atoi(arg1); - an2=atoi(arg2); + (void)atoi(arg1); + (void)atoi(arg2); return (strcmp(arg1,arg2)!=0); } @@ -326,7 +324,6 @@ static char *FuncGetOutput(int *NbArg, long *TabArg) int line,index,i=2,j=0,k,NewWord; FILE *f; int maxsize=32000; - int size; (*NbArg)++; cmndbuf=CalcArg(TabArg,NbArg); @@ -353,7 +350,6 @@ static char *FuncGetOutput(int *NbArg, long *TabArg) if (strcmp(Command,"None")) free(BufCom); BufCom = (char*)safecalloc(sizeof(char),maxsize); - size = fread(BufCom,1,maxsize,f); pclose(f); strncpy(Command,cmndbuf,255); TimeCom=time(NULL); @@ -1581,14 +1577,12 @@ static void IfThen (int NbArg,long *TabArg) /* Instruction boucle **/ static void Loop (int NbArg,long *TabArg) { - int IdVar; char *arg[2]; int limit[2]; int i; int CurrArg=0; /* le premier argument est une variable */ - IdVar = TabArg[0]; /*On ajuste la taille de la var pour contenir un nombre */ TabVVar[TabArg[0]] = (char*)saferealloc(TabVVar[TabArg[0]],sizeof(char)*10); /* Calcul des 2 autres arguments */ diff --git a/modules/FvwmScript/Widgets/HScrollBar.c b/modules/FvwmScript/Widgets/HScrollBar.c index 46da741..264f0e5 100644 --- a/modules/FvwmScript/Widgets/HScrollBar.c +++ b/modules/FvwmScript/Widgets/HScrollBar.c @@ -168,7 +168,6 @@ void DrawHScrollBar(struct XObj *xobj, XEvent *evp) void EvtMouseHScrollBar(struct XObj *xobj, XButtonEvent *EvtButton) { static XEvent event; - int x,y,w,h; int oldx = 0; int oldvalue = -1; int newvalue; @@ -177,11 +176,6 @@ void EvtMouseHScrollBar(struct XObj *xobj, XButtonEvent *EvtButton) unsigned int modif; fd_set in_fdset; - x = 2 + ((xobj->width - 36) * xobj->value) / (xobj->value3 - xobj->value2); - y = xobj->height/2 - 11; - w = 34; - h = 22; - do { /* On suit les mouvements de la souris */ diff --git a/modules/FvwmScript/Widgets/Menu.c b/modules/FvwmScript/Widgets/Menu.c index 8366e9a..c1b3446 100644 --- a/modules/FvwmScript/Widgets/Menu.c +++ b/modules/FvwmScript/Widgets/Menu.c @@ -149,7 +149,7 @@ void EvtMouseMenu(struct XObj *xobj, XButtonEvent *EvtButton) { static XEvent event; unsigned int modif; - int x1,x2,y1,y2,i,oldy; + int x1,x2,y1,y2,i; Window Win1,Win2,WinPop; char *str; int x,y,hOpt,yMenu,hMenu,wMenu; @@ -227,7 +227,6 @@ void EvtMouseMenu(struct XObj *xobj, XButtonEvent *EvtButton) /* Determiner l'option courante */ y2 = y2 - y; x2 = x2 - x; - oldy = y2; /* calcule de xobj->value */ if ((x2 > 0) && (x2 < wMenu) && (y2 > 0) && (y2 < hMenu)) newvalue = y2 / hOpt+1; diff --git a/modules/FvwmScript/Widgets/PopupMenu.c b/modules/FvwmScript/Widgets/PopupMenu.c index 68cf3f0..fe944ac 100644 --- a/modules/FvwmScript/Widgets/PopupMenu.c +++ b/modules/FvwmScript/Widgets/PopupMenu.c @@ -155,7 +155,7 @@ void EvtMousePopupMenu(struct XObj *xobj, XButtonEvent *EvtButton) { static XEvent event; int x,y,hOpt,yMenu,hMenu; - int x1,y1,x2,y2,oldy; + int x1,y1,x2,y2; int oldvalue = 0; int newvalue = 0; Window Win1,Win2,WinPop; @@ -220,7 +220,6 @@ void EvtMousePopupMenu(struct XObj *xobj, XButtonEvent *EvtButton) /* Determiner l'option courante / Current option */ y2 = y2 - y; x2 = x2 - x; - oldy = y2; /* calcule de xobj->value / compute xobj->value */ if ((x2 > 0) && (x2 < xobj->width) && (y2 > 0) && (y2 < hMenu)) newvalue = y2 / hOpt+1; @@ -274,7 +273,6 @@ void EvtMousePopupMenu(struct XObj *xobj, XButtonEvent *EvtButton) y2 = y2 - y; x2 = x2 - x; { - oldy = y2; /* calcule de xobj->value / compute xobj->value */ if ((x2 > 0) && (x2 < xobj->width) && (y2 > 0) && (y2 < hMenu)) newvalue = y2 / hOpt+1; diff --git a/modules/FvwmScript/Widgets/PushButton.c b/modules/FvwmScript/Widgets/PushButton.c index 4e50b96..56224df 100644 --- a/modules/FvwmScript/Widgets/PushButton.c +++ b/modules/FvwmScript/Widgets/PushButton.c @@ -135,7 +135,7 @@ void EvtMousePushButton(struct XObj *xobj, XButtonEvent *EvtButton) static XEvent event; int End = 1; unsigned int modif; - int x1,x2,y1,y2,i,j,oldy; + int x1,x2,y1,y2,i; Window Win1,Win2,WinPop; Window WinBut = 0; int In = 0; @@ -147,7 +147,6 @@ void EvtMousePushButton(struct XObj *xobj, XButtonEvent *EvtButton) if (EvtButton->button == Button1) { - j = xobj->height / 2+3; i = (xobj->width - FlocaleTextWidth( xobj->Ffont, xobj->title, strlen(xobj->title)))/2; @@ -323,7 +322,6 @@ void EvtMousePushButton(struct XObj *xobj, XButtonEvent *EvtButton) y2 = y2 - y; x2 = x2 - x; { - oldy = y2; /* calcule de xobj->value / Compute * xobj->value */ if ((x2 > 0) && (x2 < wMenu) && diff --git a/modules/FvwmScript/Widgets/RadioButton.c b/modules/FvwmScript/Widgets/RadioButton.c index b68bc0d..78e46cc 100644 --- a/modules/FvwmScript/Widgets/RadioButton.c +++ b/modules/FvwmScript/Widgets/RadioButton.c @@ -116,14 +116,12 @@ void EvtMouseRadioButton(struct XObj *xobj,XButtonEvent *EvtButton) static XEvent event; int End=1; unsigned int modif; - int x1,x2,y1,y2,i,j; + int x1,x2,y1,y2,j; Window Win1,Win2; Window WinBut=0; int In = 0; j=xobj->height/2+3; - i=(xobj->width-FlocaleTextWidth( - xobj->Ffont,xobj->title,strlen(xobj->title)))/2; while (End) { diff --git a/modules/FvwmTaskBar/FvwmTaskBar.c b/modules/FvwmTaskBar/FvwmTaskBar.c index 0366bbb..4034d6c 100644 --- a/modules/FvwmTaskBar/FvwmTaskBar.c +++ b/modules/FvwmTaskBar/FvwmTaskBar.c @@ -1541,7 +1541,6 @@ void HandleEvents( { int num = 0; XEvent *evp_save; - int x, y; int ex=10000, ey=10000, ex2=0, ey2=0; *redraw = -1; @@ -1562,17 +1561,6 @@ void HandleEvents( { StartButtonUpdate(NULL, whichButton, BUTTON_DOWN); ButtonPressed = whichButton; - x = win_x; - if (win_y < Midline) - { - /* bar in top half of the screen */ - y = win_y + RowHeight; - } - else - { - /* bar in bottom of the screen */ - y = win_y - screen_g.height; - } } else { diff --git a/modules/FvwmWharf/FvwmWharf.c b/modules/FvwmWharf/FvwmWharf.c index ac27639..d6210a5 100644 --- a/modules/FvwmWharf/FvwmWharf.c +++ b/modules/FvwmWharf/FvwmWharf.c @@ -485,9 +485,8 @@ void Loop(void) Window *CurrentWin=None; int x,y,CurrentRow,CurrentColumn,CurrentBase=0; XEvent Event; - int NewButton,i=0,j=0,i2, bl=-1; + int NewButton,i=0,j=0,i2; int LastMapped=-1; - time_t t, tl = (time_t) 0; int CancelPush=0; while(1) @@ -829,9 +828,6 @@ void Loop(void) if(NewButton == CurrentButton) { - t = time( 0); - bl = -1; - tl = -1; if(strncasecmp(Buttons[CurrentButton].action,"Folder",6)!=0) { if (LastMapped != -1 && CurrentWin != &main_win) @@ -1420,7 +1416,7 @@ void CreateVizWindow(void) */ void CreateWindow(void) { - int first_avail_button,i; + int i; XSetWindowAttributes attr; int wx = 0; int wy = 0; @@ -1429,8 +1425,6 @@ void CreateWindow(void) _XA_WM_PROTOCOLS = XInternAtom (dpy, "WM_PROTOCOLS", False); /* Allow for multi-width/height buttons */ - first_avail_button = num_buttons; - if(num_buttons > MAX_BUTTONS) { fprintf(stderr,"%s: Out of Buttons!\n",MyName); @@ -1581,12 +1575,11 @@ int TOTHEFOLDER = -1; */ void ParseOptions(char *filename) { - char *tline,*orig_tline,*tmp; + char *tline,*tmp; int Clength, len; InitGetConfigLine(fd,CatString3("*", MyName, 0)); /* speedup */ GetConfigLine(fd, &tline); - orig_tline = tline; Clength = strlen(MyName); while(tline != NULL && tline[0] != '\0') { @@ -1597,7 +1590,6 @@ void ParseOptions(char *filename) if(strlen(&tline[0]) <= 0) { GetConfigLine(fd, &tline); - orig_tline = tline; continue; } @@ -1815,7 +1807,6 @@ void ParseOptions(char *filename) tline + sizeof(XINERAMA_CONFIG_STRING) - 1); } GetConfigLine(fd, &tline); - orig_tline = tline; } /* while */ #ifdef ENABLE_DND /* ignore last button if there's nothing bound to it */ diff --git a/modules/FvwmWinList/ButtonArray.c b/modules/FvwmWinList/ButtonArray.c index 13452fb..2a9a008 100644 --- a/modules/FvwmWinList/ButtonArray.c +++ b/modules/FvwmWinList/ButtonArray.c @@ -378,7 +378,7 @@ Button *temp,*temp2; void DoButton( Button *button, int x, int y, int w, int h, Bool clear_bg, XEvent *evp) { - int up,Fontheight,newx,set,len; + int up,newx,set,len; GC topgc; GC bottomgc; char *string; @@ -424,8 +424,6 @@ void DoButton( XChangeGC(dpy, graph[set], gcm, &gcv); } - Fontheight=FButtonFont->height; - if ((FftSupport && Ffont->fftf.fftfont != NULL) || (button->p.picture != 0 && button->p.alpha != 0) || (colorset[set] >= 0 && diff --git a/modules/FvwmWinList/FvwmWinList.c b/modules/FvwmWinList/FvwmWinList.c index 8e57b5a..2132bbd 100644 --- a/modules/FvwmWinList/FvwmWinList.c +++ b/modules/FvwmWinList/FvwmWinList.c @@ -1529,12 +1529,11 @@ void StartMeUp_I(void) void StartMeUp_II(void) { XSizeHints g_hints; - int g_hints_rc; if (geometry == NULL) UpdateString(&geometry, ""); /* evaluate further down */ - g_hints_rc = FScreenParseGeometryWithScreen( + (void)FScreenParseGeometryWithScreen( geometry, &g_hints.x, &g_hints.y, (unsigned int *)&g_hints.width, (unsigned int *)&g_hints.height, &fscreen); FScreenGetScrRect(
