mirror of
https://github.com/revanced/smali.git
synced 2025-05-04 08:34:25 +02:00
use unsigned shift while writing an unsigned leb128
git-svn-id: https://smali.googlecode.com/svn/trunk@416 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
parent
2773319471
commit
e9c67dbb9c
@ -223,13 +223,13 @@ public final class ByteArrayOutput implements Output
|
|||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
public int writeUnsignedLeb128(int value) {
|
public int writeUnsignedLeb128(int value) {
|
||||||
int remaining = value >> 7;
|
int remaining = value >>> 7;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
while (remaining != 0) {
|
while (remaining != 0) {
|
||||||
writeByte((value & 0x7f) | 0x80);
|
writeByte((value & 0x7f) | 0x80);
|
||||||
value = remaining;
|
value = remaining;
|
||||||
remaining >>= 7;
|
remaining >>>= 7;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,12 +37,12 @@ public final class Leb128Utils {
|
|||||||
public static int unsignedLeb128Size(int value) {
|
public static int unsignedLeb128Size(int value) {
|
||||||
// TODO: This could be much cleverer.
|
// TODO: This could be much cleverer.
|
||||||
|
|
||||||
int remaining = value >> 7;
|
int remaining = value >>> 7;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
while (remaining != 0) {
|
while (remaining != 0) {
|
||||||
value = remaining;
|
value = remaining;
|
||||||
remaining >>= 7;
|
remaining >>>= 7;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user