testhaptic.c, testjoystick.c: fixed -Wshadow warnings.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
diff --git a/test/testhaptic.c b/test/testhaptic.c
index 74be9e0..9b73ce2 100644
--- a/test/testhaptic.c
+++ b/test/testhaptic.c
@@ -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)
diff --git a/test/testjoystick.c b/test/testjoystick.c
index fc8389f..ea70572 100644
--- a/test/testjoystick.c
+++ b/test/testjoystick.c
@@ -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