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 421 - Missing const specification forces use of const_cast in application code
Summary: Missing const specification forces use of const_cast in application code
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 1.2
Hardware: Other Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-26 02:06 UTC by esigra
Modified: 2009-04-13 02:04 UTC (History)
0 users

See Also:


Attachments
Patch against SDL-1.2.11 that fixes 2 occurences of the bug for me. (1.41 KB, patch)
2007-03-26 02:08 UTC, esigra
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description esigra 2007-03-26 02:06:05 UTC
Some const specifications are missing in the SDL code. This forces us who develop applications based on SDL to use const_cast. This is really ugly and needs to be fixed. For example the first parameter of SDL_MapRGB and SDL_MapRGBA.
Comment 1 esigra 2007-03-26 02:08:07 UTC
Created attachment 203 [details]
Patch against SDL-1.2.11 that fixes 2 occurences of the bug for me.
Comment 2 Ryan C. Gordon 2007-04-04 02:43:58 UTC
Fixed in svn revision #3008 for the 1.2 branch and #3009 for the 1.3 branch.

Thanks!

--ryan.

Comment 3 esigra 2008-04-09 11:46:46 UTC
This bug also needs to be fixed for SDL_GetRGB and SDL_GetRGBA (those should not change the format of the surface either). Until this is fixed, I still need to const_cast the format parameter in calls to those functions.
Comment 4 Sam Lantinga 2009-04-13 02:04:28 UTC
This was fixed for SDL 1.2 in revision 4487.  This was already fixed for SDL 1.3.

Thanks!