mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 06:34:35 +00:00
Cleanup add brace (#6545)
* Add braces after if conditions
* More add braces after if conditions
* Add braces after while() conditions
* Fix compilation because of macro being modified
* Add braces to for loop
* Add braces after if/goto
* Move comments up
* Remove extra () in the 'return ...;' statements
* More remove extra () in the 'return ...;' statements
* More remove extra () in the 'return ...;' statements after merge
* Fix inconsistent patterns are xxx == NULL vs !xxx
* More "{}" for "if() break;" and "if() continue;"
* More "{}" after if() short statement
* More "{}" after "if () return;" statement
* More fix inconsistent patterns are xxx == NULL vs !xxx
* Revert some modificaion on SDL_RLEaccel.c
* SDL_RLEaccel: no short statement
* Cleanup 'if' where the bracket is in a new line
* Cleanup 'while' where the bracket is in a new line
* Cleanup 'for' where the bracket is in a new line
* Cleanup 'else' where the bracket is in a new line
This commit is contained in:
parent
4958dafdc3
commit
6a2200823c
387 changed files with 6094 additions and 4633 deletions
|
|
@ -78,8 +78,9 @@ main(int argc, char **argv)
|
|||
/* Try to find matching device */
|
||||
else {
|
||||
for (i = 0; i < SDL_NumHaptics(); i++) {
|
||||
if (SDL_strstr(SDL_HapticName(i), name) != NULL)
|
||||
if (SDL_strstr(SDL_HapticName(i), name) != NULL) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i >= SDL_NumHaptics()) {
|
||||
|
|
@ -283,8 +284,9 @@ main(int argc, char **argv)
|
|||
}
|
||||
|
||||
/* Quit */
|
||||
if (haptic != NULL)
|
||||
if (haptic != NULL) {
|
||||
SDL_HapticClose(haptic);
|
||||
}
|
||||
SDL_Quit();
|
||||
|
||||
return 0;
|
||||
|
|
@ -317,40 +319,55 @@ HapticPrintSupported(SDL_Haptic * ptr)
|
|||
supported = SDL_HapticQuery(ptr);
|
||||
SDL_Log(" Supported effects [%d effects, %d playing]:\n",
|
||||
SDL_HapticNumEffects(ptr), SDL_HapticNumEffectsPlaying(ptr));
|
||||
if (supported & SDL_HAPTIC_CONSTANT)
|
||||
if (supported & SDL_HAPTIC_CONSTANT) {
|
||||
SDL_Log(" constant\n");
|
||||
if (supported & SDL_HAPTIC_SINE)
|
||||
}
|
||||
if (supported & SDL_HAPTIC_SINE) {
|
||||
SDL_Log(" sine\n");
|
||||
}
|
||||
/* !!! FIXME: put this back when we have more bits in 2.1 */
|
||||
/* if (supported & SDL_HAPTIC_SQUARE)
|
||||
SDL_Log(" square\n"); */
|
||||
if (supported & SDL_HAPTIC_TRIANGLE)
|
||||
if (supported & SDL_HAPTIC_TRIANGLE) {
|
||||
SDL_Log(" triangle\n");
|
||||
if (supported & SDL_HAPTIC_SAWTOOTHUP)
|
||||
}
|
||||
if (supported & SDL_HAPTIC_SAWTOOTHUP) {
|
||||
SDL_Log(" sawtoothup\n");
|
||||
if (supported & SDL_HAPTIC_SAWTOOTHDOWN)
|
||||
}
|
||||
if (supported & SDL_HAPTIC_SAWTOOTHDOWN) {
|
||||
SDL_Log(" sawtoothdown\n");
|
||||
if (supported & SDL_HAPTIC_RAMP)
|
||||
}
|
||||
if (supported & SDL_HAPTIC_RAMP) {
|
||||
SDL_Log(" ramp\n");
|
||||
if (supported & SDL_HAPTIC_FRICTION)
|
||||
}
|
||||
if (supported & SDL_HAPTIC_FRICTION) {
|
||||
SDL_Log(" friction\n");
|
||||
if (supported & SDL_HAPTIC_SPRING)
|
||||
}
|
||||
if (supported & SDL_HAPTIC_SPRING) {
|
||||
SDL_Log(" spring\n");
|
||||
if (supported & SDL_HAPTIC_DAMPER)
|
||||
}
|
||||
if (supported & SDL_HAPTIC_DAMPER) {
|
||||
SDL_Log(" damper\n");
|
||||
if (supported & SDL_HAPTIC_INERTIA)
|
||||
}
|
||||
if (supported & SDL_HAPTIC_INERTIA) {
|
||||
SDL_Log(" inertia\n");
|
||||
if (supported & SDL_HAPTIC_CUSTOM)
|
||||
}
|
||||
if (supported & SDL_HAPTIC_CUSTOM) {
|
||||
SDL_Log(" custom\n");
|
||||
if (supported & SDL_HAPTIC_LEFTRIGHT)
|
||||
}
|
||||
if (supported & SDL_HAPTIC_LEFTRIGHT) {
|
||||
SDL_Log(" left/right\n");
|
||||
}
|
||||
SDL_Log(" Supported capabilities:\n");
|
||||
if (supported & SDL_HAPTIC_GAIN)
|
||||
if (supported & SDL_HAPTIC_GAIN) {
|
||||
SDL_Log(" gain\n");
|
||||
if (supported & SDL_HAPTIC_AUTOCENTER)
|
||||
}
|
||||
if (supported & SDL_HAPTIC_AUTOCENTER) {
|
||||
SDL_Log(" autocenter\n");
|
||||
if (supported & SDL_HAPTIC_STATUS)
|
||||
}
|
||||
if (supported & SDL_HAPTIC_STATUS) {
|
||||
SDL_Log(" status\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue