pipewire: module-rtp: fix compilation with UBSan

The type of `0xffff` is `int`, and UBSan does not like
when that value is shifted left by 16 bits, which causes
e.g.

  case APPLE_MIDI_CMD_IN:

to not compile with the following error:

  error: case label does not reduce to an integer constant

One could use `0xffffu` to force the type to be `unsigned int`,
or simply use `0xffff0000` which has no shifts. This patch
does the latter.
This commit is contained in:
Barnabás Pőcze 2023-03-09 23:09:28 +01:00
parent 57cd5611d1
commit 82e30d46a9

View file

@ -32,11 +32,11 @@ struct rtp_apple_midi_ck {
uint32_t ts3_l; uint32_t ts3_l;
} __attribute__ ((packed)); } __attribute__ ((packed));
#define APPLE_MIDI_CMD_IN ((0xffff << 16) | 'I'<<8 | 'N') #define APPLE_MIDI_CMD_IN (0xffff0000 | 'I'<<8 | 'N')
#define APPLE_MIDI_CMD_NO ((0xffff << 16) | 'N'<<8 | 'O') #define APPLE_MIDI_CMD_NO (0xffff0000 | 'N'<<8 | 'O')
#define APPLE_MIDI_CMD_OK ((0xffff << 16) | 'O'<<8 | 'K') #define APPLE_MIDI_CMD_OK (0xffff0000 | 'O'<<8 | 'K')
#define APPLE_MIDI_CMD_CK ((0xffff << 16) | 'C'<<8 | 'K') #define APPLE_MIDI_CMD_CK (0xffff0000 | 'C'<<8 | 'K')
#define APPLE_MIDI_CMD_BY ((0xffff << 16) | 'B'<<8 | 'Y') #define APPLE_MIDI_CMD_BY (0xffff0000 | 'B'<<8 | 'Y')
#ifdef __cplusplus #ifdef __cplusplus
} }