Fixed some warnings building for 64-bit Windows
authorSam Lantinga <slouken@libsdl.org>
Mon, 21 Oct 2013 01:16:16 -0700
changeset 7870 3aed2f137788
parent 7869 6871ab38d224
child 7871 ff9f1a1ed2dd
Fixed some warnings building for 64-bit Windows
src/joystick/SDL_gamecontroller.c
src/joystick/SDL_joystick.c
src/video/windows/SDL_windowskeyboard.c
src/video/windows/SDL_windowsmessagebox.c
--- a/src/joystick/SDL_gamecontroller.c	Mon Oct 21 00:30:05 2013 -0700
+++ b/src/joystick/SDL_gamecontroller.c	Mon Oct 21 01:16:16 2013 -0700
@@ -758,7 +758,7 @@
 {
     const char *hint = SDL_GetHint(SDL_HINT_GAMECONTROLLERCONFIG);
     if ( hint && hint[0] ) {
-        int nchHints = SDL_strlen( hint );
+        size_t nchHints = SDL_strlen( hint );
         char *pUserMappings = SDL_malloc( nchHints + 1 );
         char *pTempMappings = pUserMappings;
         SDL_memcpy( pUserMappings, hint, nchHints );
--- a/src/joystick/SDL_joystick.c	Mon Oct 21 00:30:05 2013 -0700
+++ b/src/joystick/SDL_joystick.c	Mon Oct 21 01:16:16 2013 -0700
@@ -830,7 +830,7 @@
 {
     SDL_JoystickGUID guid;
     int maxoutputbytes= sizeof(guid);
-    int len = SDL_strlen( pchGUID );
+    size_t len = SDL_strlen( pchGUID );
     Uint8 *p;
     int i;
 
--- a/src/video/windows/SDL_windowskeyboard.c	Mon Oct 21 00:30:05 2013 -0700
+++ b/src/video/windows/SDL_windowskeyboard.c	Mon Oct 21 01:16:16 2013 -0700
@@ -758,10 +758,10 @@
                 if (LANG() == LANG_CHS && IME_GetId(videodata, 0)) {
                     const UINT maxcandchar = 18;
                     UINT i = 0;
-                    UINT cchars = 0;
+                    size_t cchars = 0;
 
                     for (; i < videodata->ime_candcount; ++i) {
-                        UINT len = SDL_wcslen((LPWSTR)((DWORD_PTR)cand_list + cand_list->dwOffset[i])) + 1;
+                        size_t len = SDL_wcslen((LPWSTR)((DWORD_PTR)cand_list + cand_list->dwOffset[i])) + 1;
                         if (len + cchars > maxcandchar) {
                             if (i > cand_list->dwSelection)
                                 break;
--- a/src/video/windows/SDL_windowsmessagebox.c	Mon Oct 21 00:30:05 2013 -0700
+++ b/src/video/windows/SDL_windowsmessagebox.c	Mon Oct 21 01:16:16 2013 -0700
@@ -342,7 +342,8 @@
 WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
 {
     WIN_DialogData *dialog;
-    int i, x, y, which;
+    int i, x, y;
+    UINT_PTR which;
     const SDL_MessageBoxButtonData *buttons = messageboxdata->buttons;
     HFONT DialogFont;
     SIZE Size;