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 1420

Summary: SDLNet_Read fails when passing a const pointer
Product: SDL_net Reporter: Felix Geyer <debfx>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2    
Version: 1.2.8   
Hardware: x86_64   
OS: Linux   

Description Felix Geyer 2012-02-17 05:32:44 UTC
SDLNet_Read16 and SDLNet_Read32 fail when passing a const pointer:
> error: reinterpret_cast from type 'const char*' to type 'Uint32* {aka unsigned int*}' casts away qualifiers

The actual SDLNet_Read* functions are only defined for "void *" but the macros previously allowed passing const pointers as they used c-style casts.

This can probably be fixed by casting to "const Uint16 *" / "const Uint32 *".
Comment 1 Sam Lantinga 2013-06-07 02:40:49 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL_net/rev/fbd60945674e