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

Andreas Färber wrote:
Am 29.05.2008 um 19:54 schrieb kaoutsis:
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. :)

I think there is no need to: the shift operator '>>' has clearly
greatest priority in relation to bitwise and '&' operator.
The other parentheses around |, i put them in favor of the compiler.

good bye,
   Vasilis



Other related posts: