[build] use define WINPR_FALLTHROUGH

with c17 compatible compilers annotate with [[fallthrough]]
This commit is contained in:
Armin Novak 2023-07-31 16:49:24 +02:00 committed by David Fort
parent 0983288224
commit ef5c0e78ab
7 changed files with 18 additions and 0 deletions

View File

@ -288,7 +288,9 @@ static void LIBUSB_CALL func_iso_callback(struct libusb_transfer* transfer)
/* fallthrough */ /* fallthrough */
case LIBUSB_TRANSFER_CANCELLED: case LIBUSB_TRANSFER_CANCELLED:
WINPR_FALLTHROUGH
case LIBUSB_TRANSFER_TIMED_OUT: case LIBUSB_TRANSFER_TIMED_OUT:
WINPR_FALLTHROUGH
case LIBUSB_TRANSFER_ERROR: case LIBUSB_TRANSFER_ERROR:
{ {
const UINT32 InterfaceId = const UINT32 InterfaceId =

View File

@ -855,12 +855,16 @@ static int xf_input_handle_event_remote(xfContext* xfc, const XEvent* event)
{ {
case XI_TouchBegin: case XI_TouchBegin:
xf_input_pens_unhover(xfc); xf_input_pens_unhover(xfc);
WINPR_FALLTHROUGH
case XI_TouchUpdate: case XI_TouchUpdate:
WINPR_FALLTHROUGH
case XI_TouchEnd: case XI_TouchEnd:
xf_input_touch_remote(xfc, cookie.cc->data, cookie.cc->evtype); xf_input_touch_remote(xfc, cookie.cc->data, cookie.cc->evtype);
break; break;
case XI_ButtonPress: case XI_ButtonPress:
WINPR_FALLTHROUGH
case XI_Motion: case XI_Motion:
WINPR_FALLTHROUGH
case XI_ButtonRelease: case XI_ButtonRelease:
{ {
WLog_DBG(TAG, "checking for pen"); WLog_DBG(TAG, "checking for pen");
@ -873,6 +877,7 @@ static int xf_input_handle_event_remote(xfContext* xfc, const XEvent* event)
break; break;
} }
} }
WINPR_FALLTHROUGH
default: default:
xf_input_pens_unhover(xfc); xf_input_pens_unhover(xfc);
xf_input_event(xfc, event, cookie.cc->data, cookie.cc->evtype); xf_input_event(xfc, event, cookie.cc->data, cookie.cc->evtype);

View File

@ -707,6 +707,7 @@ void credssp_auth_free(rdpCredsspAuth* auth)
WINPR_ASSERT(auth->table->DeleteSecurityContext); WINPR_ASSERT(auth->table->DeleteSecurityContext);
auth->table->DeleteSecurityContext(&auth->context); auth->table->DeleteSecurityContext(&auth->context);
/* FALLTHROUGH */ /* FALLTHROUGH */
WINPR_FALLTHROUGH
case AUTH_STATE_CREDS: case AUTH_STATE_CREDS:
WINPR_ASSERT(auth->table->FreeCredentialsHandle); WINPR_ASSERT(auth->table->FreeCredentialsHandle);
auth->table->FreeCredentialsHandle(&auth->credentials); auth->table->FreeCredentialsHandle(&auth->credentials);

View File

@ -287,6 +287,7 @@ static int rpc_client_recv_pdu(rdpRpc* rpc, RPC_PDU* pdu)
return -1; return -1;
} }
/* FALLTHROUGH */ /* FALLTHROUGH */
WINPR_FALLTHROUGH
case RPC_BIND_STATE_COMPLETE: case RPC_BIND_STATE_COMPLETE:
rpc_client_transition_to_state(rpc, RPC_CLIENT_STATE_CONTEXT_NEGOTIATED); rpc_client_transition_to_state(rpc, RPC_CLIENT_STATE_CONTEXT_NEGOTIATED);

View File

@ -20,6 +20,12 @@
#ifndef WINPR_WTYPES_H #ifndef WINPR_WTYPES_H
#define WINPR_WTYPES_H #define WINPR_WTYPES_H
#if defined(__STDC__) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201710L)
#define WINPR_FALLTHROUGH [[fallthrough]]
#else
#define WINPR_FALLTHROUGH
#endif
/* Set by CMake during configuration */ /* Set by CMake during configuration */
#cmakedefine WINPR_HAVE_STDINT_H #cmakedefine WINPR_HAVE_STDINT_H
#cmakedefine WINPR_HAVE_STDBOOL_H #cmakedefine WINPR_HAVE_STDBOOL_H

View File

@ -207,6 +207,8 @@ static CK_RV object_load_attributes(NCryptP11ProviderHandle* provider, CK_SESSIO
if (!attributes_have_unallocated_buffers(attributes, count)) if (!attributes_have_unallocated_buffers(attributes, count))
return rv; return rv;
/* fallthrough */ /* fallthrough */
WINPR_FALLTHROUGH
case CKR_ATTRIBUTE_SENSITIVE: case CKR_ATTRIBUTE_SENSITIVE:
case CKR_ATTRIBUTE_TYPE_INVALID: case CKR_ATTRIBUTE_TYPE_INVALID:
case CKR_BUFFER_TOO_SMALL: case CKR_BUFFER_TOO_SMALL:

View File

@ -818,6 +818,7 @@ static SECURITY_STATUS SEC_ENTRY kerberos_InitializeSecurityContextA(
goto bad_token; goto bad_token;
/* Continue to AP-REQ */ /* Continue to AP-REQ */
WINPR_FALLTHROUGH
case KERBEROS_STATE_AP_REQ: case KERBEROS_STATE_AP_REQ: