forked from Green-Sky/tomato
Merge commit '852f2a6343518919e5ca8d3c1bbcab9f493e3cd8'
This commit is contained in:
12
external/sdl/SDL/test/testrumble.c
vendored
12
external/sdl/SDL/test/testrumble.c
vendored
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
@ -29,7 +29,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
static SDL_Haptic *haptic;
|
||||
|
||||
/**
|
||||
* \brief The entry point of this force feedback demo.
|
||||
* The entry point of this force feedback demo.
|
||||
* \param[in] argc Number of arguments.
|
||||
* \param[in] argv Array of argc arguments.
|
||||
*/
|
||||
@ -42,7 +42,7 @@ int main(int argc, char **argv)
|
||||
|
||||
/* Initialize test framework */
|
||||
state = SDLTest_CommonCreateState(argv, 0);
|
||||
if (state == NULL) {
|
||||
if (!state) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -88,7 +88,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 */
|
||||
@ -107,7 +107,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;
|
||||
@ -146,7 +146,7 @@ int main(int argc, char **argv)
|
||||
SDL_Delay(2000);
|
||||
|
||||
/* Quit */
|
||||
if (haptic != NULL) {
|
||||
if (haptic) {
|
||||
SDL_HapticClose(haptic);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user