[SDL] Get pixel value ...more in details
root at rainerdeyke.com
Sun Aug 26 08:56:01 PDT 2001
<sragno at libero.it> wrote in message
news:mailman.998808066.21512.sdl at libsdl.org...
> - shifting one bite by 16 or even 8 bits doesn't always gives
> a zero value ?
Integral promotion rules. In 'x << 8', the right-hand side is of type
'int', so the left hand side is promoted also promoted to 'int'. There is
also a rule that in any expression, all types narrower than 'int' are
promoted to 'int'.
> - we are returning p<< a | p << b | p that is not*
> a Uint32 (also *p or *(Uint16 *)p are not) , so how and where
> happens this conversion ??
Since the function is defined as returning 'Uint32', all returned values are
converted to type 'Uint32' by the rules of implicit conversion. In other
words, the following two functions are semantically equivalent:
/* Let A and B be any types. */
A f(B arg)
return arg; /* implicit conversion here */
A f(B arg)
A result = arg; /* implicit conversion here */
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games - http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor
More information about the SDL