Subject: Re: coding issues
To: None <port-macppc@netbsd.org>
From: Brian Hechinger <wonko@4amlunch.net>
List: port-macppc
Date: 01/24/2005 11:28:38
On Mon, Jan 24, 2005 at 07:51:09AM -0500, Michael wrote:
> >g = ( ((p >> 24) & 0xff)  + ((p >> 16) & 0xff) + ((p >> 8) & 0xff)) / 
> >3;
> This seems to calculate the brightness of a pixel (average of the 
> colour components)...
> 
> >p = (g << 24) | (g << 16) | (g << 8) | (p & 0xff);
> ... and this makes a grey one from the brightness value calculated 
> above.
> 
> How are p and g declared? Should be uint32_t to be portable.

g is uint32 and p is a pointer of type uint32, changing that to uint32_t
didn't help.

-brian
-- 
"Now you know why I got the everliving hell OUT of Windows administration.
Knowing it doesn't make it any easier.  It's just broken-as-designed."