[SDL] argument types for SDL_MapRGB (newbie)

Peter Jay Salzman p at dirac.org
Wed Jan 8 12:15:00 PST 2003


hola,

sdl newbie alert.  i'm getting the following warnings:

warning: passing arg 2 of `SDL_MapRGB' with different width due to prototype
warning: passing arg 3 of `SDL_MapRGB' with different width due to prototype
warning: passing arg 4 of `SDL_MapRGB' with different width due to prototype

from this line of code:

   Uint32 white = SDL_MapRGB(screen->format, 255, 255, 255);

according to sdldoc.csn.ul.ie/sdlmaprgb.php, the last 3 args should be
Uint8's.  i've tried this:

   Uint32 white = SDL_MapRGB(screen->format, (Uint8)255, (Uint8)255,
        (Uint8)255);

and this:

   Uint8 a = 255;
   Uint32 white = SDL_MapRGB(screen->format, a, a, a);

but i still get the same warning.   i give up.  how can i do this
correctly (ie- without turning off compiler warnings).

thanks,
pete

-- 
First they ignore you, then they laugh at you, then they fight you,
then you win. -- Gandhi, being prophetic about Linux.

Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D




More information about the SDL mailing list