Fixed bug 1764 - Integer Precision Loss During Compilation
authorSam Lantinga <slouken@libsdl.org>
Tue, 19 Mar 2013 22:02:34 -0700
changeset 7015 e3cba60c0f0a
parent 7014 3e0d048e1c14
child 7016 24edf0189bc5
Fixed bug 1764 - Integer Precision Loss During Compilation Phil Sampson /Library/Frameworks/SDL2.framework/Headers/SDL_stdinc.h:345:28: Implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'unsigned int'
include/SDL_stdinc.h
--- a/include/SDL_stdinc.h	Tue Mar 19 21:53:33 2013 -0700
+++ b/include/SDL_stdinc.h	Tue Mar 19 22:02:34 2013 -0700
@@ -342,13 +342,12 @@
     );
 /* !!! FIXME: amd64? */
 #else
-    unsigned int _count = (len);
-    unsigned int _n = (_count + 3) / 4;
+    size_t _n = (len + 3) / 4;
     Uint32 *_p = SDL_static_cast(Uint32 *, dst);
     Uint32 _val = (val);
     if (len == 0)
         return;
-    switch (_count % 4)
+    switch (len % 4)
     {
         case 0: do {    *_p++ = _val;
         case 3:         *_p++ = _val;