Additional cleanup exposed by building with a C++ compiler
This commit is contained in:
parent
f08ac438ed
commit
00c409cff8
26 changed files with 84 additions and 120 deletions
|
@ -214,14 +214,14 @@ const char *SDL_GetKeyboardNameForID(SDL_KeyboardID instance_id)
|
|||
void SDL_ResetKeyboard(void)
|
||||
{
|
||||
SDL_Keyboard *keyboard = &SDL_keyboard;
|
||||
SDL_Scancode scancode;
|
||||
int scancode;
|
||||
|
||||
#ifdef DEBUG_KEYBOARD
|
||||
printf("Resetting keyboard\n");
|
||||
#endif
|
||||
for (scancode = (SDL_Scancode)0; scancode < SDL_NUM_SCANCODES; ++scancode) {
|
||||
for (scancode = SDL_SCANCODE_UNKNOWN; scancode < SDL_NUM_SCANCODES; ++scancode) {
|
||||
if (keyboard->keystate[scancode] == SDL_PRESSED) {
|
||||
SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, 0, scancode, SDL_RELEASED);
|
||||
SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, 0, (SDL_Scancode)scancode, SDL_RELEASED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -696,12 +696,12 @@ bool SDL_SendKeyboardKeyAutoRelease(Uint64 timestamp, SDL_Scancode scancode)
|
|||
void SDL_ReleaseAutoReleaseKeys(void)
|
||||
{
|
||||
SDL_Keyboard *keyboard = &SDL_keyboard;
|
||||
SDL_Scancode scancode;
|
||||
int scancode;
|
||||
|
||||
if (keyboard->autorelease_pending) {
|
||||
for (scancode = SDL_SCANCODE_UNKNOWN; scancode < SDL_NUM_SCANCODES; ++scancode) {
|
||||
if (keyboard->keysource[scancode] == KEYBOARD_AUTORELEASE) {
|
||||
SDL_SendKeyboardKeyInternal(0, KEYBOARD_AUTORELEASE, SDL_GLOBAL_KEYBOARD_ID, 0, scancode, SDL_RELEASED);
|
||||
SDL_SendKeyboardKeyInternal(0, KEYBOARD_AUTORELEASE, SDL_GLOBAL_KEYBOARD_ID, 0, (SDL_Scancode)scancode, SDL_RELEASED);
|
||||
}
|
||||
}
|
||||
keyboard->autorelease_pending = false;
|
||||
|
@ -718,7 +718,7 @@ void SDL_ReleaseAutoReleaseKeys(void)
|
|||
bool SDL_HardwareKeyboardKeyPressed(void)
|
||||
{
|
||||
SDL_Keyboard *keyboard = &SDL_keyboard;
|
||||
SDL_Scancode scancode;
|
||||
int scancode;
|
||||
|
||||
for (scancode = SDL_SCANCODE_UNKNOWN; scancode < SDL_NUM_SCANCODES; ++scancode) {
|
||||
if (keyboard->keysource[scancode] & KEYBOARD_HARDWARE) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue