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 451 - #define SDL_memset4 memset is wrong
Summary: #define SDL_memset4 memset is wrong
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 1.2
Hardware: PowerPC Mac OS X (All)
: P2 major
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL: http://libsdl.org/cgi/viewvc.cgi/bran...
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-08 06:31 UTC by Christian Walther
Modified: 2007-07-08 07:25 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 Christian Walther 2007-07-08 06:31:46 UTC
SDL_stdinc.h rev. 3038 (http://libsdl.org/cgi/viewvc.cgi/branches/SDL-1.2/include/SDL_stdinc.h?r1=3038&r2=3037&pathrev=3038) changed the definition of SDL_memset4 to:

#if defined(__MACH__) && defined(__APPLE__)
#define SDL_memset4(dst, val, len) memset(dst, val, (len)*4)
#elif ...

This is wrong, and causes e.g. SDL_FillRect to malfunction (e.g. in testcursor.c). memset fills every byte of memory with the given byte value, while SDL_memset4 is apparently supposed to fill every 32-bit word of memory with the given 32-bit value.

I can fix this by reverting the first hunk of rev. 3038. The other two changes, to SDL_memcpy and SDL_memcpy4, look OK to me.
Comment 1 Sam Lantinga 2007-07-08 07:25:36 UTC
Good catch.  This is fixed in subversion revisions 3175 and 3176.  Thanks!