testhaptic.c, testjoystick.c: fixed -Wshadow warnings.

main
Ozkan Sezer 2021-11-23 15:10:50 +03:00
parent e6a4230de9
commit d2871a348b
2 changed files with 18 additions and 18 deletions

View File

@ -25,7 +25,7 @@ static SDL_Haptic *haptic;
* prototypes
*/
static void abort_execution(void);
static void HapticPrintSupported(SDL_Haptic * haptic);
static void HapticPrintSupported(SDL_Haptic *);
/**
@ -310,13 +310,13 @@ abort_execution(void)
* Displays information about the haptic device.
*/
static void
HapticPrintSupported(SDL_Haptic * haptic)
HapticPrintSupported(SDL_Haptic * ptr)
{
unsigned int supported;
supported = SDL_HapticQuery(haptic);
supported = SDL_HapticQuery(ptr);
SDL_Log(" Supported effects [%d effects, %d playing]:\n",
SDL_HapticNumEffects(haptic), SDL_HapticNumEffectsPlaying(haptic));
SDL_HapticNumEffects(ptr), SDL_HapticNumEffectsPlaying(ptr));
if (supported & SDL_HAPTIC_CONSTANT)
SDL_Log(" constant\n");
if (supported & SDL_HAPTIC_SINE)

View File

@ -38,14 +38,14 @@ static SDL_Joystick *joystick = NULL;
static SDL_bool done = SDL_FALSE;
static void
PrintJoystick(SDL_Joystick *joystick)
PrintJoystick(SDL_Joystick *joy)
{
const char *type;
char guid[64];
SDL_assert(SDL_JoystickFromInstanceID(SDL_JoystickInstanceID(joystick)) == joystick);
SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(joystick), guid, sizeof (guid));
switch (SDL_JoystickGetType(joystick)) {
SDL_assert(SDL_JoystickFromInstanceID(SDL_JoystickInstanceID(joy)) == joy);
SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(joy), guid, sizeof (guid));
switch (SDL_JoystickGetType(joy)) {
case SDL_JOYSTICK_TYPE_GAMECONTROLLER:
type = "Game Controller";
break;
@ -78,18 +78,18 @@ PrintJoystick(SDL_Joystick *joystick)
break;
}
SDL_Log("Joystick\n");
SDL_Log(" name: %s\n", SDL_JoystickName(joystick));
SDL_Log(" name: %s\n", SDL_JoystickName(joy));
SDL_Log(" type: %s\n", type);
SDL_Log(" LED: %s\n", SDL_JoystickHasLED(joystick) ? "yes" : "no");
SDL_Log(" rumble: %s\n", SDL_JoystickHasRumble(joystick) ? "yes" : "no");
SDL_Log("trigger rumble: %s\n", SDL_JoystickHasRumbleTriggers(joystick) ? "yes" : "no");
SDL_Log(" axes: %d\n", SDL_JoystickNumAxes(joystick));
SDL_Log(" balls: %d\n", SDL_JoystickNumBalls(joystick));
SDL_Log(" hats: %d\n", SDL_JoystickNumHats(joystick));
SDL_Log(" buttons: %d\n", SDL_JoystickNumButtons(joystick));
SDL_Log(" instance id: %d\n", SDL_JoystickInstanceID(joystick));
SDL_Log(" LED: %s\n", SDL_JoystickHasLED(joy) ? "yes" : "no");
SDL_Log(" rumble: %s\n", SDL_JoystickHasRumble(joy) ? "yes" : "no");
SDL_Log("trigger rumble: %s\n", SDL_JoystickHasRumbleTriggers(joy) ? "yes" : "no");
SDL_Log(" axes: %d\n", SDL_JoystickNumAxes(joy));
SDL_Log(" balls: %d\n", SDL_JoystickNumBalls(joy));
SDL_Log(" hats: %d\n", SDL_JoystickNumHats(joy));
SDL_Log(" buttons: %d\n", SDL_JoystickNumButtons(joy));
SDL_Log(" instance id: %d\n", SDL_JoystickInstanceID(joy));
SDL_Log(" guid: %s\n", guid);
SDL_Log(" VID/PID: 0x%.4x/0x%.4x\n", SDL_JoystickGetVendor(joystick), SDL_JoystickGetProduct(joystick));
SDL_Log(" VID/PID: 0x%.4x/0x%.4x\n", SDL_JoystickGetVendor(joy), SDL_JoystickGetProduct(joy));
}
static void