|
21 | 21 |
|
22 | 22 | /* Include socket headers before SDL to avoid macro conflicts */ |
23 | 23 | #ifdef _WIN32 |
24 | | -#define WIN32_LEAN_AND_MEAN |
25 | 24 | #include <winsock2.h> |
26 | 25 | #include <ws2tcpip.h> |
27 | 26 | #ifdef _MSC_VER |
@@ -108,14 +107,14 @@ static bool DSU_JoystickInit(void) |
108 | 107 |
|
109 | 108 | server_port = SDL_GetHint(SDL_HINT_DSU_SERVER_PORT); |
110 | 109 | if (server_port && *server_port) { |
111 | | - ctx->server_port = SDL_atoi(server_port); |
| 110 | + ctx->server_port = (Uint16)SDL_atoi(server_port); |
112 | 111 | } else { |
113 | 112 | ctx->server_port = DSU_SERVER_PORT_DEFAULT; |
114 | 113 | } |
115 | 114 |
|
116 | 115 | client_port = SDL_GetHint(SDL_HINT_DSU_CLIENT_PORT); |
117 | 116 | if (client_port && *client_port) { |
118 | | - ctx->client_port = SDL_atoi(client_port); |
| 117 | + ctx->client_port = (Uint16)SDL_atoi(client_port); |
119 | 118 | } else { |
120 | 119 | ctx->client_port = DSU_CLIENT_PORT_DEFAULT; |
121 | 120 | } |
@@ -207,12 +206,12 @@ static void DSU_JoystickDetect(void) |
207 | 206 | /* Periodically request controller info and re-subscribe to data */ |
208 | 207 | now = SDL_GetTicks(); |
209 | 208 | if (now - ctx->last_request_time >= 500) { /* Request more frequently */ |
210 | | - DSU_RequestControllerInfo(ctx, 0xFF); |
| 209 | + DSU_RequestControllerInfo(ctx, (Uint8)0xFF); |
211 | 210 |
|
212 | 211 | /* Re-subscribe to data for detected controllers */ |
213 | 212 | for (i = 0; i < DSU_MAX_SLOTS; i++) { |
214 | 213 | if (ctx->slots[i].detected || ctx->slots[i].connected) { |
215 | | - DSU_RequestControllerData(ctx, i); |
| 214 | + DSU_RequestControllerData(ctx, (Uint8)i); |
216 | 215 | } |
217 | 216 | } |
218 | 217 |
|
@@ -389,7 +388,7 @@ static SDL_JoystickID DSU_JoystickGetDeviceInstanceID(int device_index) |
389 | 388 |
|
390 | 389 | ctx = s_dsu_ctx; |
391 | 390 | if (!ctx) { |
392 | | - return -1; |
| 391 | + return 0; |
393 | 392 | } |
394 | 393 |
|
395 | 394 | mutex = ctx->slots_mutex; |
@@ -607,15 +606,15 @@ static void DSU_JoystickUpdate(SDL_Joystick *joystick) |
607 | 606 | if (pressed) { |
608 | 607 | SDL_Log(" Button %d (%s): PRESSED", i, button_names[i]); |
609 | 608 | } |
610 | | - SDL_SendJoystickButton(timestamp, joystick, i, pressed); |
| 609 | + SDL_SendJoystickButton(timestamp, joystick, (Uint8)i, pressed); |
611 | 610 | } |
612 | 611 |
|
613 | 612 | /* Update axes with detailed logging */ |
614 | 613 | SDL_Log("DSU UPDATE: Axes - LX=%d LY=%d RX=%d RY=%d L2=%d R2=%d", |
615 | 614 | slot->axes[0], slot->axes[1], slot->axes[2], |
616 | 615 | slot->axes[3], slot->axes[4], slot->axes[5]); |
617 | 616 | for (i = 0; i < 6; i++) { |
618 | | - SDL_SendJoystickAxis(timestamp, joystick, i, slot->axes[i]); |
| 617 | + SDL_SendJoystickAxis(timestamp, joystick, (Uint8)i, slot->axes[i]); |
619 | 618 | } |
620 | 619 |
|
621 | 620 | /* Update hat (D-Pad) */ |
|
0 commit comments