]> gitweb.fperrin.net Git - Dictionary.git/commitdiff
Fix bad shifts.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Mon, 14 Dec 2015 20:33:38 +0000 (21:33 +0100)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Mon, 14 Dec 2015 20:33:38 +0000 (21:33 +0100)
src/com/hughes/android/dictionary/engine/RowBase.java

index 2930fa721f2754c0a1c48f780fd4a10d200c2160..e4b630b4e782effb9b14832c38230faeb3e9082a 100644 (file)
@@ -46,7 +46,7 @@ public abstract class RowBase extends IndexedObject {
             throws IOException {
         super(thisRowIndex);
         this.index = index;
-        this.referenceIndex = extra == -1 ? raf.readInt() : ((extra << 24) + raf.readUnsignedShort()); // what this points to.
+        this.referenceIndex = extra == -1 ? raf.readInt() : ((extra << 16) + raf.readUnsignedShort()); // what this points to.
     }
 
     public RowBase(final int referenceIndex, final int thisRowIndex, final Index index) {
@@ -181,7 +181,7 @@ public abstract class RowBase extends IndexedObject {
                 type = 4;
             }
             assert t.referenceIndex < (1 << 21);
-            raf.writeByte(((type + 1) << 5) + (t.referenceIndex >> 24));
+            raf.writeByte(((type + 1) << 5) + (t.referenceIndex >> 16));
             raf.writeShort(t.referenceIndex);
         }
     }