Skip to content

Commit f0c653f

Browse files
committed
simplify enum to integer
1 parent dfe5c04 commit f0c653f

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/video/windows/SDL_windowsrawinput.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,15 +253,15 @@ bool WIN_SetRawKeyboardEnabled(SDL_VideoDevice *_this, bool enabled)
253253
return true;
254254
}
255255

256-
bool WIN_SetRawKeyboardFlag(SDL_VideoDevice *_this, WIN_RawKeyboardFlag flag, bool enabled)
256+
bool WIN_SetRawKeyboardFlag(SDL_VideoDevice *_this, Uint32 flag, bool enabled)
257257
{
258258
SDL_VideoData *data = _this->internal;
259259
if (data->gameinput_context) {
260260
return false;
261261
}
262262

263263
switch(flag) {
264-
case NOHOTKEYS:
264+
case WIN_RAWKEYBOARD_FLAG_ENUM_NOHOTKEYS:
265265
data->raw_keyboard_flag_nohotkeys = enabled;
266266
break;
267267
default:

src/video/windows/SDL_windowsrawinput.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626
extern bool WIN_SetRawMouseEnabled(SDL_VideoDevice *_this, bool enabled);
2727
extern bool WIN_SetRawKeyboardEnabled(SDL_VideoDevice *_this, bool enabled);
2828

29-
typedef enum WIN_RawKeyboardFlag {
30-
NOHOTKEYS
31-
} WIN_RawKeyboardFlag;
32-
extern bool WIN_SetRawKeyboardFlag(SDL_VideoDevice *_this, WIN_RawKeyboardFlag flag, bool enabled);
29+
#define WIN_RAWKEYBOARD_FLAG_ENUM_NOHOTKEYS 0
30+
extern bool WIN_SetRawKeyboardFlag(SDL_VideoDevice *_this, Uint32 flag, bool enabled);
3331

3432
#endif // SDL_windowsrawinput_h_

0 commit comments

Comments
 (0)