From e14fad11626e881b104d4cc520abfdecdb82532f Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Fri, 8 May 2015 13:19:03 +0200 Subject: [PATCH] wmaker: fix warnings from compiler when animations are disabled The code for animating stuff needs some parameters in a few functions, which are not used when animations are disabled at compile time, so the compiler issues some warnings about them. This patch adds the appropriate statements to disable declaration that are not needed in this case, and tell the compiler it is ok to not use the parameters not needed, thus fixing the warnings. Signed-off-by: Christophe CURIS --- src/actions.c | 20 ++++++++++++++++++-- src/misc.c | 4 ++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/actions.c b/src/actions.c index d69f900c..23499782 100644 --- a/src/actions.c +++ b/src/actions.c @@ -57,6 +57,7 @@ static void find_Maximus_geometry(WWindow *wwin, WArea usableArea, int *new_x, i static void save_old_geometry(WWindow *wwin, int directions); /******* Local Variables *******/ +#ifdef USE_ANIMATIONS static struct { int steps; int delay; @@ -68,10 +69,12 @@ static struct { { SHADE_STEPS_US, SHADE_DELAY_US } }; -#define UNSHADE 0 -#define SHADE 1 #define SHADE_STEPS shadePars[(int)wPreferences.shade_speed].steps #define SHADE_DELAY shadePars[(int)wPreferences.shade_speed].delay +#endif + +#define UNSHADE 0 +#define SHADE 1 static int compareTimes(Time t1, Time t2) { @@ -1061,6 +1064,7 @@ static WWindow *recursiveTransientFor(WWindow *wwin) return wwin; } +#ifdef USE_ANIMATIONS static int getAnimationGeometry(WWindow *wwin, int *ix, int *iy, int *iw, int *ih) { if (wwin->screen_ptr->flags.startup || wPreferences.no_animations @@ -1087,6 +1091,7 @@ static int getAnimationGeometry(WWindow *wwin, int *ix, int *iy, int *iw, int *i } return 1; } +#endif /* USE_ANIMATIONS */ void wIconifyWindow(WWindow *wwin) { @@ -1397,6 +1402,11 @@ static void hideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int a wwin->frame->core->width, wwin->frame->core->height, icon_x, icon_y, icon->core->width, icon->core->height); } +#else + /* Tell the compiler it is normal that those parameters are not used in this case */ + (void) icon_x; + (void) icon_y; + (void) animate; #endif wwin->flags.skip_next_animation = 0; @@ -1575,6 +1585,12 @@ static void unhideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int wwin->frame_x, wwin->frame_y, wwin->frame->core->width, wwin->frame->core->height); } +#else + /* Tell the compiler it is normal that those parameters are not used in this case */ + (void) icon; + (void) icon_x; + (void) icon_y; + (void) animate; #endif wwin->flags.skip_next_animation = 0; if (wwin->screen_ptr->current_workspace == wwin->frame->workspace) { diff --git a/src/misc.c b/src/misc.c index bc324dfb..4144c7de 100644 --- a/src/misc.c +++ b/src/misc.c @@ -148,6 +148,10 @@ void move_window(Window win, int from_x, int from_y, int to_x, int to_y) SlideWindow(win, from_x, from_y, to_x, to_y); #else XMoveWindow(dpy, win, to_x, to_y); + + /* Tell the compiler it is normal that those parameters are not used in this case */ + (void) from_x; + (void) from_y; #endif } -- 2.11.4.GIT