Commit 19ecb64e0dfea5616798f77d8262715f0d722038

Sam Lantinga 2022-10-02T10:18:57

Fixed build

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/test/testjoystick.c b/test/testjoystick.c
index 3fb004f..96f4be1 100644
--- a/test/testjoystick.c
+++ b/test/testjoystick.c
@@ -245,9 +245,9 @@ loop(void *arg)
         SDL_SetRenderDrawColor(screen, 0x00, 0x00, 0xFF, SDL_ALPHA_OPAQUE);
         for (i = 0; i < SDL_JoystickNumHats(joystick); ++i) {
             /* Derive the new position */
+            const Uint8 hat_pos = SDL_JoystickGetHat(joystick, i);
             x = SCREEN_WIDTH/2;
             y = SCREEN_HEIGHT/2;
-            const Uint8 hat_pos = SDL_JoystickGetHat(joystick, i);
 
             if (hat_pos & SDL_HAT_UP) {
                 y = 0;