OK->find . -name '*.h' -o -name '*.c' | xargs grep -n 257
./fvwm/ewmh_icons.c:343:                fg[0] = colors[0].blue/257;
./fvwm/ewmh_icons.c:344:                fg[1] = colors[0].green/257;
./fvwm/ewmh_icons.c:345:                fg[2] = colors[0].red/257;
./fvwm/ewmh_icons.c:346:                bg[0] = colors[1].blue/257;
./fvwm/ewmh_icons.c:347:                bg[1] = colors[1].green/257;
./fvwm/ewmh_icons.c:348:                bg[2] = colors[1].red/257;
./fvwm/ewmh_icons.c:425: c_new_icon[l++] = colors[k].blue/257; ./fvwm/ewmh_icons.c:426: c_new_icon[l++] = colors[k].green/257; ./fvwm/ewmh_icons.c:427: c_new_icon[l++] = colors[k].red/257; ./fvwm/ewmh_icons.c:454: c_new_icon[k] = (unsigned short)c.blue/257; ./fvwm/ewmh_icons.c:455: c_new_icon[k+1] = (unsigned short)c.green/257; ./fvwm/ewmh_icons.c:456: c_new_icon[k+2] = (unsigned short)c.red/257; ./libs/PictureGraphics.c:352: c.red/257, ./libs/PictureGraphics.c:353: c.green/257, ./libs/PictureGraphics.c:354: c.blue/257); ./libs/PictureImageLoader.c:535: c.blue = b * 257; ./libs/PictureImageLoader.c:536: c.green = g * 257; ./libs/PictureImageLoader.c:537: c.red = r * 257; ./libs/PictureUtils.c:324: c->pixel = PictureRGBtoPixel(c->red/257, c->green/257, c->blue/257);
./libs/PictureUtils.c:415:              c.red = r*257;
./libs/PictureUtils.c:416:              c.green = g*257;
./libs/PictureUtils.c:417:              c.blue = b*257;
./libs/PictureUtils.c:444: c->red/257, c->green/257, c->blue/257);

I can't help feeling that 257 is the wrong number for all this stuff and 256 is the correct number. It might be better to just leave most of these things as unsigned shorts or pass XColor's around and convert to byte size pieces as late as possible.

/257 will take ages on any processor, /256 will take one cycle on most.

Cheers,
Tim.


--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]

Reply via email to