mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
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 <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
0bab67f9be
commit
e14fad1162
@@ -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);
|
static void save_old_geometry(WWindow *wwin, int directions);
|
||||||
|
|
||||||
/******* Local Variables *******/
|
/******* Local Variables *******/
|
||||||
|
#ifdef USE_ANIMATIONS
|
||||||
static struct {
|
static struct {
|
||||||
int steps;
|
int steps;
|
||||||
int delay;
|
int delay;
|
||||||
@@ -68,10 +69,12 @@ static struct {
|
|||||||
{ SHADE_STEPS_US, SHADE_DELAY_US }
|
{ SHADE_STEPS_US, SHADE_DELAY_US }
|
||||||
};
|
};
|
||||||
|
|
||||||
#define UNSHADE 0
|
|
||||||
#define SHADE 1
|
|
||||||
#define SHADE_STEPS shadePars[(int)wPreferences.shade_speed].steps
|
#define SHADE_STEPS shadePars[(int)wPreferences.shade_speed].steps
|
||||||
#define SHADE_DELAY shadePars[(int)wPreferences.shade_speed].delay
|
#define SHADE_DELAY shadePars[(int)wPreferences.shade_speed].delay
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define UNSHADE 0
|
||||||
|
#define SHADE 1
|
||||||
|
|
||||||
static int compareTimes(Time t1, Time t2)
|
static int compareTimes(Time t1, Time t2)
|
||||||
{
|
{
|
||||||
@@ -1061,6 +1064,7 @@ static WWindow *recursiveTransientFor(WWindow *wwin)
|
|||||||
return wwin;
|
return wwin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_ANIMATIONS
|
||||||
static int getAnimationGeometry(WWindow *wwin, int *ix, int *iy, int *iw, int *ih)
|
static int getAnimationGeometry(WWindow *wwin, int *ix, int *iy, int *iw, int *ih)
|
||||||
{
|
{
|
||||||
if (wwin->screen_ptr->flags.startup || wPreferences.no_animations
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
#endif /* USE_ANIMATIONS */
|
||||||
|
|
||||||
void wIconifyWindow(WWindow *wwin)
|
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,
|
wwin->frame->core->width, wwin->frame->core->height,
|
||||||
icon_x, icon_y, icon->core->width, icon->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
|
#endif
|
||||||
wwin->flags.skip_next_animation = 0;
|
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_x, wwin->frame_y,
|
||||||
wwin->frame->core->width, wwin->frame->core->height);
|
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
|
#endif
|
||||||
wwin->flags.skip_next_animation = 0;
|
wwin->flags.skip_next_animation = 0;
|
||||||
if (wwin->screen_ptr->current_workspace == wwin->frame->workspace) {
|
if (wwin->screen_ptr->current_workspace == wwin->frame->workspace) {
|
||||||
|
|||||||
@@ -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);
|
SlideWindow(win, from_x, from_y, to_x, to_y);
|
||||||
#else
|
#else
|
||||||
XMoveWindow(dpy, win, to_x, to_y);
|
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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user