Skip to content

Commit 83dd0ec

Browse files
committed
simplify enum to integer
1 parent dfe5c04 commit 83dd0ec

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
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_

src/video/windows/SDL_windowsvideo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static void SDLCALL UpdateWindowsRawKeyboardNoHotkeys(void *userdata, const char
6666
{
6767
SDL_VideoDevice *_this = (SDL_VideoDevice *)userdata;
6868
bool enabled = SDL_GetStringBoolean(newValue, false);
69-
WIN_SetRawKeyboardFlag(_this, NOHOTKEYS, enabled);
69+
WIN_SetRawKeyboardFlag(_this, WIN_RAWKEYBOARD_FLAG_ENUM_NOHOTKEYS, enabled);
7070
}
7171

7272
static void SDLCALL UpdateWindowsEnableMessageLoop(void *userdata, const char *name, const char *oldValue, const char *newValue)

0 commit comments

Comments
 (0)