[haiku-development] Re: src_build_libbe_interface_Bitmap.cpp.diff

Hi,

Am 29.05.2008 um 19:54 schrieb kaoutsis:

tried to fix this warning:
rc/build/libbe/interface/Bitmap.cpp: In member function ‘uint8 BPrivate::PaletteConverter::IndexForRGB16(uint16) const’: src/build/libbe/interface/Bitmap.cpp:470: warning: suggest parentheses around arithmetic
in operand of |

Index: src/build/libbe/interface/Bitmap.cpp
===================================================================
--- src/build/libbe/interface/Bitmap.cpp        (revision 25705)
+++ src/build/libbe/interface/Bitmap.cpp        (working copy)
@@ -467,7 +467,7 @@
uint8
PaletteConverter::IndexForRGB16(uint16 rgb) const
{
-       return fColorMap->index_map[(rgb >> 1) & 0x7fe0 | rgb & 0x1f];
+       return fColorMap->index_map[(rgb >> 1 & 0x7fe0) | (rgb & 0x1f)];
}

// IndexForRGB16

I'd suggest to keep the original bracket around the shift operation.
But don't let me discourage you from fixing the warnings. :)

Andreas

Other related posts: