mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-27 15:09:11 +00:00
Pointer as bool (libsdl-org#7214)
This commit is contained in:
parent
23db971681
commit
d8600f717e
371 changed files with 2448 additions and 2442 deletions
|
@ -173,7 +173,7 @@ static int fatal_signals[] = {
|
|||
static void kbd_cleanup(void)
|
||||
{
|
||||
SDL_EVDEV_keyboard_state *kbd = kbd_cleanup_state;
|
||||
if (kbd == NULL) {
|
||||
if (!kbd) {
|
||||
return;
|
||||
}
|
||||
kbd_cleanup_state = NULL;
|
||||
|
@ -258,7 +258,7 @@ static void kbd_register_emerg_cleanup(SDL_EVDEV_keyboard_state *kbd)
|
|||
{
|
||||
int tabidx;
|
||||
|
||||
if (kbd_cleanup_state != NULL) {
|
||||
if (kbd_cleanup_state) {
|
||||
return;
|
||||
}
|
||||
kbd_cleanup_state = kbd;
|
||||
|
@ -428,7 +428,7 @@ SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void)
|
|||
char shift_state[sizeof(long)] = { TIOCL_GETSHIFTSTATE, 0 };
|
||||
|
||||
kbd = (SDL_EVDEV_keyboard_state *)SDL_calloc(1, sizeof(*kbd));
|
||||
if (kbd == NULL) {
|
||||
if (!kbd) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -464,7 +464,7 @@ SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void)
|
|||
|
||||
void SDL_EVDEV_kbd_set_muted(SDL_EVDEV_keyboard_state *state, SDL_bool muted)
|
||||
{
|
||||
if (state == NULL) {
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -892,7 +892,7 @@ void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *state, unsigned int keycode
|
|||
unsigned short *key_map;
|
||||
unsigned short keysym;
|
||||
|
||||
if (state == NULL) {
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -900,7 +900,7 @@ void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *state, unsigned int keycode
|
|||
|
||||
shift_final = (state->shift_state | state->slockstate) ^ state->lockstate;
|
||||
key_map = state->key_maps[shift_final];
|
||||
if (key_map == NULL) {
|
||||
if (!key_map) {
|
||||
/* Unsupported shift state (e.g. ctrl = 4, alt = 8), just reset to the default state */
|
||||
state->shift_state = 0;
|
||||
state->slockstate = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue