1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-21 21:38:00 +01:00

wmaker: Marked args as unused for compiler in XClickEvent callback code

The toolkit dispatches X events for MouseButton using callback functions,
which means having a fixed argument list for that function.

It is then correct to not use all the arguments, so this patch adds the
appropriate stuff to avoid a false report from compiler.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2013-10-13 22:44:06 +02:00
committed by Carlos R. Mafra
parent c34a55ed5a
commit 3857def779
2 changed files with 31 additions and 0 deletions

View File

@@ -2094,6 +2094,9 @@ static void menuTitleDoubleClick(WCoreWindow * sender, void *data, XEvent * even
WMenu *menu = data; WMenu *menu = data;
int lower; int lower;
/* Parameter not used, but tell the compiler that it is ok */
(void) sender;
if (event->xbutton.state & MOD_MASK) { if (event->xbutton.state & MOD_MASK) {
if (menu->flags.lowered) { if (menu->flags.lowered) {
lower = 0; lower = 0;
@@ -2114,6 +2117,9 @@ static void menuTitleMouseDown(WCoreWindow * sender, void *data, XEvent * event)
int i, lower; int i, lower;
Bool started; Bool started;
/* Parameter not used, but tell the compiler that it is ok */
(void) sender;
/* can't touch the menu copy */ /* can't touch the menu copy */
if (menu->flags.brother) if (menu->flags.brother)
return; return;
@@ -2221,6 +2227,10 @@ static void menuCloseClick(WCoreWindow * sender, void *data, XEvent * event)
WMenu *parent = menu->parent; WMenu *parent = menu->parent;
int i; int i;
/* Parameter not used, but tell the compiler that it is ok */
(void) sender;
(void) event;
if (parent) { if (parent) {
for (i = 0; i < parent->cascade_no; i++) { for (i = 0; i < parent->cascade_no; i++) {
/* find the entry that points to the copy */ /* find the entry that points to the copy */

View File

@@ -2669,6 +2669,9 @@ static void resizebarMouseDown(WCoreWindow *sender, void *data, XEvent *event)
{ {
WWindow *wwin = data; WWindow *wwin = data;
/* Parameter not used, but tell the compiler that it is ok */
(void) sender;
#ifndef NUMLOCK_HACK #ifndef NUMLOCK_HACK
if ((event->xbutton.state & ValidModMask) if ((event->xbutton.state & ValidModMask)
!= (event->xbutton.state & ~LockMask)) { != (event->xbutton.state & ~LockMask)) {
@@ -2711,6 +2714,9 @@ static void titlebarDblClick(WCoreWindow *sender, void *data, XEvent *event)
{ {
WWindow *wwin = data; WWindow *wwin = data;
/* Parameter not used, but tell the compiler that it is ok */
(void) sender;
event->xbutton.state &= w_global.shortcut.modifiers_mask; event->xbutton.state &= w_global.shortcut.modifiers_mask;
if (event->xbutton.button == Button1) { if (event->xbutton.button == Button1) {
@@ -2826,6 +2832,9 @@ static void titlebarMouseDown(WCoreWindow *sender, void *data, XEvent *event)
{ {
WWindow *wwin = (WWindow *) data; WWindow *wwin = (WWindow *) data;
/* Parameter not used, but tell the compiler that it is ok */
(void) sender;
#ifndef NUMLOCK_HACK #ifndef NUMLOCK_HACK
if ((event->xbutton.state & ValidModMask) != (event->xbutton.state & ~LockMask)) if ((event->xbutton.state & ValidModMask) != (event->xbutton.state & ~LockMask))
wwarning(_("The NumLock, ScrollLock or similar key seems to be turned on. " wwarning(_("The NumLock, ScrollLock or similar key seems to be turned on. "
@@ -2889,6 +2898,9 @@ static void windowCloseClick(WCoreWindow *sender, void *data, XEvent *event)
{ {
WWindow *wwin = data; WWindow *wwin = data;
/* Parameter not used, but tell the compiler that it is ok */
(void) sender;
event->xbutton.state &= w_global.shortcut.modifiers_mask; event->xbutton.state &= w_global.shortcut.modifiers_mask;
CloseWindowMenu(wwin->screen_ptr); CloseWindowMenu(wwin->screen_ptr);
@@ -2912,6 +2924,9 @@ static void windowCloseDblClick(WCoreWindow *sender, void *data, XEvent *event)
{ {
WWindow *wwin = data; WWindow *wwin = data;
/* Parameter not used, but tell the compiler that it is ok */
(void) sender;
CloseWindowMenu(wwin->screen_ptr); CloseWindowMenu(wwin->screen_ptr);
if (event->xbutton.button < Button1 || event->xbutton.button > Button3) if (event->xbutton.button < Button1 || event->xbutton.button > Button3)
@@ -2933,6 +2948,9 @@ static void windowLanguageClick(WCoreWindow *sender, void *data, XEvent *event)
WScreen *scr = fwin->screen_ptr; WScreen *scr = fwin->screen_ptr;
int tl; int tl;
/* Parameter not used, but tell the compiler that it is ok */
(void) sender;
if (event->xbutton.button != Button1 && event->xbutton.button != Button3) if (event->xbutton.button != Button1 && event->xbutton.button != Button3)
return; return;
tl = wwin->frame->languagemode; tl = wwin->frame->languagemode;
@@ -2952,6 +2970,9 @@ static void windowIconifyClick(WCoreWindow *sender, void *data, XEvent *event)
{ {
WWindow *wwin = data; WWindow *wwin = data;
/* Parameter not used, but tell the compiler that it is ok */
(void) sender;
event->xbutton.state &= w_global.shortcut.modifiers_mask; event->xbutton.state &= w_global.shortcut.modifiers_mask;
CloseWindowMenu(wwin->screen_ptr); CloseWindowMenu(wwin->screen_ptr);