"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "core/src/main/java/com/google/zxing/common/BitArray.java" between
zxing-zxing-3.4.0.tar.gz and zxing-zxing-3.4.1.tar.gz

About: ZXing ("zebra crossing") is a multi-format 1D/2D barcode image processing library implemented in Java, with ports to other languages.

BitArray.java  (zxing-zxing-3.4.0):BitArray.java  (zxing-zxing-3.4.1)
skipping to change at line 110 skipping to change at line 110
int currentBits = bits[bitsOffset]; int currentBits = bits[bitsOffset];
// mask off lesser bits first // mask off lesser bits first
currentBits &= -(1 << (from & 0x1F)); currentBits &= -(1 << (from & 0x1F));
while (currentBits == 0) { while (currentBits == 0) {
if (++bitsOffset == bits.length) { if (++bitsOffset == bits.length) {
return size; return size;
} }
currentBits = bits[bitsOffset]; currentBits = bits[bitsOffset];
} }
int result = (bitsOffset * 32) + Integer.numberOfTrailingZeros(currentBits); int result = (bitsOffset * 32) + Integer.numberOfTrailingZeros(currentBits);
return result > size ? size : result; return Math.min(result, size);
} }
/** /**
* @param from index to start looking for unset bit * @param from index to start looking for unset bit
* @return index of next unset bit, or {@code size} if none are unset until th e end * @return index of next unset bit, or {@code size} if none are unset until th e end
* @see #getNextSet(int) * @see #getNextSet(int)
*/ */
public int getNextUnset(int from) { public int getNextUnset(int from) {
if (from >= size) { if (from >= size) {
return size; return size;
skipping to change at line 133 skipping to change at line 133
int currentBits = ~bits[bitsOffset]; int currentBits = ~bits[bitsOffset];
// mask off lesser bits first // mask off lesser bits first
currentBits &= -(1 << (from & 0x1F)); currentBits &= -(1 << (from & 0x1F));
while (currentBits == 0) { while (currentBits == 0) {
if (++bitsOffset == bits.length) { if (++bitsOffset == bits.length) {
return size; return size;
} }
currentBits = ~bits[bitsOffset]; currentBits = ~bits[bitsOffset];
} }
int result = (bitsOffset * 32) + Integer.numberOfTrailingZeros(currentBits); int result = (bitsOffset * 32) + Integer.numberOfTrailingZeros(currentBits);
return result > size ? size : result; return Math.min(result, size);
} }
/** /**
* Sets a block of 32 bits, starting at bit i. * Sets a block of 32 bits, starting at bit i.
* *
* @param i first bit to set * @param i first bit to set
* @param newBits the new value of the next 32 bits. Note again that the least -significant bit * @param newBits the new value of the next 32 bits. Note again that the least -significant bit
* corresponds to bit i, the next-least-significant to i+1, and so on. * corresponds to bit i, the next-least-significant to i+1, and so on.
*/ */
public void setBulk(int i, int newBits) { public void setBulk(int i, int newBits) {
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)