[SDL2] pointer boolean (#8523)

This commit is contained in:
Sylvain Becker
2023-11-10 15:30:56 +01:00
committed by GitHub
parent 4a3a9f3ad8
commit a14b948b6c
394 changed files with 2564 additions and 2559 deletions

View File

@@ -69,7 +69,7 @@ int main(int argc, char **argv)
SDL_Log("%d Haptic devices detected.\n", SDL_NumHaptics());
if (SDL_NumHaptics() > 0) {
/* We'll just use index or the first force feedback device found */
if (name == NULL) {
if (!name) {
i = (index != -1) ? index : 0;
}
/* Try to find matching device */
@@ -88,7 +88,7 @@ int main(int argc, char **argv)
}
haptic = SDL_HapticOpen(i);
if (haptic == NULL) {
if (!haptic) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to create the haptic device: %s\n",
SDL_GetError());
return 1;
@@ -279,7 +279,7 @@ int main(int argc, char **argv)
}
/* Quit */
if (haptic != NULL) {
if (haptic) {
SDL_HapticClose(haptic);
}
SDL_Quit();