Author: post
Date: 2010-02-06 23:11:57 +0100 (Sat, 06 Feb 2010)
New Revision: 194
Modified:
RawSpeed/BitPumpPlain.cpp
Log:
Missed a few masks.
Modified: RawSpeed/BitPumpPlain.cpp
===================================================================
--- RawSpeed/BitPumpPlain.cpp 2010-02-06 22:09:37 UTC (rev 193)
+++ RawSpeed/BitPumpPlain.cpp 2010-02-06 22:11:57 UTC (rev 194)
@@ -51,7 +51,7 @@
}
guint BitPumpPlain::getBits(guint nbits) {
- guint v = *(guint*) & buffer[off>>3] >> (off & 7) & masks[nbits];
+ guint v = *(guint*) & buffer[off>>3] >> (off & 7) & ((1 << nbits) - 1);
off += nbits;
return v;
}
@@ -61,7 +61,7 @@
}
guint BitPumpPlain::peekBits(guint nbits) {
- return *(guint*)&buffer[off>>3] >> (off&7) & masks[nbits];
+ return *(guint*)&buffer[off>>3] >> (off&7) & ((1 << nbits) - 1);
}
guint BitPumpPlain::peekByte() {
@@ -79,7 +79,7 @@
if (off > size)
throw IOException("Out of buffer read");
- return *(guint*)&buffer[off>>3] >> (off&7) & masks[nbits];
+ return *(guint*)&buffer[off>>3] >> (off&7) & ((1 << nbits) - 1);
}
void BitPumpPlain::skipBits(unsigned int nbits) {
_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit