[squeak-dev] The Trunk: Compression-ul.17.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Apr 28 09:20:48 UTC 2010
Levente Uzonyi uploaded a new version of Compression to project The Trunk:
http://source.squeak.org/trunk/Compression-ul.17.mcz
==================== Summary ====================
Name: Compression-ul.17
Author: ul
Time: 28 April 2010, 11:20:40.424 am
UUID: fcec8c9d-a1f0-4f44-b48c-fc1f213051a8
Ancestors: Compression-nice.16
- added a missing primitive call (by Andreas)
=============== Diff against Compression-nice.16 ===============
Item was changed:
----- Method: ZLibWriteStream class>>updateAdler32:from:to:in: (in category 'crc') -----
updateAdler32: adler from: start to: stop in: aCollection
"Update crc using the Adler32 checksum technique from RFC1950"
"
unsigned long s1 = adler & 0xffff;
unsigned long s2 = (adler >> 16) & 0xffff;
int n;
for (n = 0; n < len; n++) {
s1 = (s1 + buf[n]) % BASE;
s2 = (s2 + s1) % BASE;
}
return (s2 << 16) + s1;
"
| s1 s2 |
+ <primitive: 'primitiveUpdateAdler32' module: 'ZipPlugin'>
s1 := adler bitAnd: 16rFFFF.
s2 := (adler bitShift: -16) bitAnd: 16rFFFF.
start to: stop do: [ :n | | b |
b := aCollection byteAt: n.
s1 := (s1 + b) \\ 65521.
s2 := (s2 + s1) \\ 65521. ].
^(s2 bitShift: 16) + s1!
More information about the Squeak-dev
mailing list
|