[Commits] SDL: Trivial integer truncation warning fixes.

libsdl.org revision control commits-owner at libsdl.org
Thu Jul 30 10:05:29 PDT 2015


details:   https://hg.libsdl.org/SDL/rev/c1d91866a968
changeset: 9821:c1d91866a968
user:      Sam Lantinga <slouken at libsdl.org>
date:      Thu Jul 30 10:01:04 2015 -0700
description:
Trivial integer truncation warning fixes.

diffstat:

 src/video/SDL_egl.c                     |  2 +-
 src/video/windows/SDL_windowsevents.c   |  2 +-
 src/video/windows/SDL_windowskeyboard.c |  6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diffs (54 lines):

diff -r c0bcc39a3491 -r c1d91866a968 src/video/SDL_egl.c
--- a/src/video/SDL_egl.c	Wed Jul 29 17:19:15 2015 -0700
+++ b/src/video/SDL_egl.c	Thu Jul 30 10:01:04 2015 -0700
@@ -81,7 +81,7 @@
 {
     int i;
     int len = 0;
-    int ext_len;
+    size_t ext_len;
     const char *exts;
     const char *ext_word;
 
diff -r c0bcc39a3491 -r c1d91866a968 src/video/windows/SDL_windowsevents.c
--- a/src/video/windows/SDL_windowsevents.c	Wed Jul 29 17:19:15 2015 -0700
+++ b/src/video/windows/SDL_windowsevents.c	Thu Jul 30 10:01:04 2015 -0700
@@ -598,7 +598,7 @@
 	case WM_CHAR:
 		{
 			char text[5];
-			if ( WIN_ConvertUTF32toUTF8( wParam, text ) ) {
+			if ( WIN_ConvertUTF32toUTF8( (UINT32)wParam, text ) ) {
 				SDL_SendKeyboardText( text );
 			}
 		}
diff -r c0bcc39a3491 -r c1d91866a968 src/video/windows/SDL_windowskeyboard.c
--- a/src/video/windows/SDL_windowskeyboard.c	Wed Jul 29 17:19:15 2015 -0700
+++ b/src/video/windows/SDL_windowskeyboard.c	Thu Jul 30 10:01:04 2015 -0700
@@ -738,7 +738,7 @@
         SDL_wcslcpy(buffer, videodata->ime_composition, size);
     }
     s = WIN_StringToUTF8(buffer);
-    SDL_SendEditingText(s, videodata->ime_cursor + SDL_wcslen(videodata->ime_readingstring), 0);
+    SDL_SendEditingText(s, videodata->ime_cursor + (int)SDL_wcslen(videodata->ime_readingstring), 0);
     SDL_free(s);
 }
 
@@ -1403,7 +1403,7 @@
         if (!*s)
             break;
 
-        GetTextExtentPoint32W(hdc, s, SDL_wcslen(s), &candsizes[i]);
+        GetTextExtentPoint32W(hdc, s, (int)SDL_wcslen(s), &candsizes[i]);
         maxcandsize.cx = SDL_max(maxcandsize.cx, candsizes[i].cx);
         maxcandsize.cy = SDL_max(maxcandsize.cy, candsizes[i].cy);
 
@@ -1495,7 +1495,7 @@
         }
 
         DrawRect(hdc, left, top, right, bottom, candborder);
-        ExtTextOutW(hdc, left + candborder + candpadding, top + candborder + candpadding, 0, NULL, s, SDL_wcslen(s), NULL);
+        ExtTextOutW(hdc, left + candborder + candpadding, top + candborder + candpadding, 0, NULL, s, (int)SDL_wcslen(s), NULL);
     }
     StopDrawToBitmap(hdc, &hbm);
 


More information about the commits mailing list