From abd7fe5ce0ae207551c5d140cdea2d5254e4dea4 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 19 Mar 2013 22:02:34 -0700 Subject: [PATCH] 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 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/SDL_stdinc.h b/include/SDL_stdinc.h index f37678957..bc400524b 100644 --- a/include/SDL_stdinc.h +++ b/include/SDL_stdinc.h @@ -342,13 +342,12 @@ SDL_FORCE_INLINE void SDL_memset4(void *dst, int val, size_t len) ); /* !!! 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;