diff options
author | jfrijters <jfrijters> | 2012-11-01 15:20:52 +0400 |
---|---|---|
committer | jfrijters <jfrijters> | 2012-11-01 15:20:52 +0400 |
commit | eb04c65227d2ffacf7e395592ba9c0c52060c549 (patch) | |
tree | e3de30c0cad8ac8e61a3ed7c110a0b95761926da /openjdk/java | |
parent | 3af783e713021013e9bab1205e973b209bfbff15 (diff) |
Renamed "checksum" field to "adler", because JRuby depends on this.
Diffstat (limited to 'openjdk/java')
-rw-r--r-- | openjdk/java/util/zip/Adler32.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/openjdk/java/util/zip/Adler32.java b/openjdk/java/util/zip/Adler32.java index 5e6e1481..fc1536aa 100644 --- a/openjdk/java/util/zip/Adler32.java +++ b/openjdk/java/util/zip/Adler32.java @@ -100,7 +100,7 @@ public class Adler32 implements Checksum /** largest prime smaller than 65536 */ private static final int BASE = 65521; - private int checksum; //we do all in int. + private int adler; //we do all in int. //Note that java doesn't have unsigned integers, //so we have to be careful with what arithmetic @@ -121,7 +121,7 @@ public class Adler32 implements Checksum */ public void reset () { - checksum = 1; //Initialize to 1 + adler = 1; //Initialize to 1 } /** @@ -133,13 +133,13 @@ public class Adler32 implements Checksum { //We could make a length 1 byte array and call update again, but I //would rather not have that overhead - int s1 = checksum & 0xffff; - int s2 = checksum >>> 16; + int s1 = adler & 0xffff; + int s2 = adler >>> 16; s1 = (s1 + (bval & 0xFF)) % BASE; s2 = (s1 + s2) % BASE; - checksum = (s2 << 16) + s1; + adler = (s2 << 16) + s1; } /** @@ -162,8 +162,8 @@ public class Adler32 implements Checksum public void update (byte[] buf, int off, int len) { //(By Per Bothner) - int s1 = checksum & 0xffff; - int s2 = checksum >>> 16; + int s1 = adler & 0xffff; + int s2 = adler >>> 16; while (len > 0) { @@ -192,7 +192,7 @@ public class Adler32 implements Checksum s2 = (s2 + s1) % BASE; }*/ - checksum = (s2 << 16) | s1; + adler = (s2 << 16) | s1; } /** @@ -200,6 +200,6 @@ public class Adler32 implements Checksum */ public long getValue() { - return (long) checksum & 0xffffffffL; + return (long) adler & 0xffffffffL; } } |