mirror of
https://github.com/X11Libre/xf86-input-mouse.git
synced 2026-03-24 01:24:06 +00:00
Make switch fallthrough markers compatible with clang and C23
Uses _X_FALLTHROUGH from xproto 7.0.34 if available,
local fallback if xproto is older than that.
Clears warnings from clang 19.1.7 of the form:
mouse.c:1219:17: warning: unannotated fall-through between switch labels
[-Wimplicit-fallthrough]
1219 | default:
| ^
mouse.c:1219:17: note: insert '[[fallthrough]];' to silence this warning
1219 | default:
| ^
| [[fallthrough]];
mouse.c:1219:17: note: insert 'break;' to avoid fall-through
1219 | default:
| ^
| break;
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-mouse/-/merge_requests/23>
This commit is contained in:
@@ -48,7 +48,7 @@ XORG_WITH_LINT
|
||||
AC_CHECK_FUNCS([asprintf timingsafe_memcmp])
|
||||
|
||||
# Obtain compiler/linker options from server and required extensions
|
||||
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10] xproto inputproto)
|
||||
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10 xproto >= 7.0.27 inputproto])
|
||||
|
||||
# Define a configure option for an alternate input module directory
|
||||
AC_ARG_WITH(xorg-module-dir,
|
||||
|
||||
@@ -1214,7 +1214,7 @@ MouseReadInput(InputInfoPtr pInfo)
|
||||
case PROT_GLIDE:
|
||||
case PROT_THINKING:
|
||||
buttons |= ((int)(u & 0x10) >> 1);
|
||||
/* fall through */
|
||||
_X_FALLTHROUGH; /* fall through */
|
||||
|
||||
default:
|
||||
buttons |= ((int)(u & 0x20) >> 4) |
|
||||
@@ -3641,7 +3641,7 @@ autoGood(MouseDevPtr pMse)
|
||||
case AUTOPROBE_H_VALIDATE2:
|
||||
if (mPriv->goodCount < PROBE_UNCERTAINTY/2)
|
||||
return TRUE;
|
||||
/* FALLTHROUGH */
|
||||
_X_FALLTHROUGH; /* FALLTHROUGH */
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
10
src/mouse.h
10
src/mouse.h
@@ -30,6 +30,16 @@
|
||||
#ifndef _XF86OSMOUSE_H_
|
||||
#define _XF86OSMOUSE_H_
|
||||
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
#ifndef _X_FALLTHROUGH /* xproto < 7.0.34 */
|
||||
# if __has_attribute(fallthrough)
|
||||
# define _X_FALLTHROUGH __attribute__((fallthrough))
|
||||
# else
|
||||
# define _X_FALLTHROUGH (void)0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include "xf86Xinput.h"
|
||||
|
||||
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 18
|
||||
|
||||
@@ -752,7 +752,7 @@ vuidMouseProc(DeviceIntPtr pPointer, int what)
|
||||
if (m != NULL)
|
||||
m->next = pVuidMse->next;
|
||||
}
|
||||
/* fallthrough */
|
||||
_X_FALLTHROUGH; /* fallthrough */
|
||||
case DEVICE_OFF:
|
||||
if (pInfo->fd != -1) {
|
||||
if (pVuidMse->strmod) {
|
||||
|
||||
Reference in New Issue
Block a user