We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1764 - Integer Precision Loss During Compilation
Summary: Integer Precision Loss During Compilation
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.0
Hardware: x86_64 Other
: P2 minor
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-19 17:47 UTC by Phil Sampson
Modified: 2013-03-20 01:03 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Phil Sampson 2013-03-19 17:47:32 UTC
Macbook Pro Retina
OSX 10.8

/Library/Frameworks/SDL2.framework/Headers/SDL_stdinc.h:345:28: Implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'unsigned int'

#if defined(__GNUC__) && defined(i386)
    int u0, u1, u2;
    __asm__ __volatile__ (
        "cld \n\t"
        "rep ; stosl \n\t"
        : "=&D" (u0), "=&a" (u1), "=&c" (u2)
        : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, len))
        : "memory"
    );
/* !!! FIXME: amd64? */
#else
    unsigned int _count = (len);     <<<<<<<=============
    unsigned int _n = (_count + 3) / 4;
    Uint32 *_p = SDL_static_cast(Uint32 *, dst);
    Uint32 _val = (val);
    if (len == 0)
        return;
    switch (_count % 4)
    {
        case 0: do {    *_p++ = _val;
        case 3:         *_p++ = _val;
        case 2:         *_p++ = _val;
        case 1:         *_p++ = _val;
        } while ( --_n );
    }
#endif
Comment 1 Sam Lantinga 2013-03-20 01:03:37 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL/rev/e3cba60c0f0a