diff options
author | Russ Cox <rsc@swtch.com> | 2010-02-07 16:51:28 -0800 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2010-02-07 16:51:28 -0800 |
commit | 9a054520852368c0a0d179bedfce60776587a645 (patch) | |
tree | 7e81f14ee45eb81ebbfbbd49e119d7f6ee7086c3 /src/cmd/jpg | |
parent | 28afa898ee3281afde739c9a09e59264680756ae (diff) | |
download | plan9port-9a054520852368c0a0d179bedfce60776587a645.tar.gz plan9port-9a054520852368c0a0d179bedfce60776587a645.tar.bz2 plan9port-9a054520852368c0a0d179bedfce60776587a645.zip |
make flate crc32 work when ulong is 64 bits
R=, rsc
CC=
http://codereview.appspot.com/203061
Diffstat (limited to 'src/cmd/jpg')
-rw-r--r-- | src/cmd/jpg/readpng.c | 6 | ||||
-rw-r--r-- | src/cmd/jpg/writepng.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/cmd/jpg/readpng.c b/src/cmd/jpg/readpng.c index 2985c5ff..5fdbc1db 100644 --- a/src/cmd/jpg/readpng.c +++ b/src/cmd/jpg/readpng.c @@ -44,11 +44,11 @@ typedef struct ZlibR{ ZlibW *w; } ZlibR; -static ulong *crctab; +static uint32 *crctab; static uchar PNGmagic[] = {137,80,78,71,13,10,26,10}; static char memerr[] = "ReadPNG: malloc failed: %r"; -static ulong +static uint32 get4(uchar *a) { return (a[0]<<24) | (a[1]<<16) | (a[2]<<8) | a[3]; @@ -87,7 +87,7 @@ static int getchunk(Biobuf *b, char *type, uchar *d, int m) { uchar buf[8]; - ulong crc = 0, crc2; + uint32 crc = 0, crc2; int n, nr; if(Bread(b, buf, 8) != 8) diff --git a/src/cmd/jpg/writepng.c b/src/cmd/jpg/writepng.c index 3b63bb7f..76835e01 100644 --- a/src/cmd/jpg/writepng.c +++ b/src/cmd/jpg/writepng.c @@ -31,11 +31,11 @@ typedef struct ZlibW{ uchar *e; /* past end of buf */ } ZlibW; -static ulong *crctab; +static uint32 *crctab; static uchar PNGmagic[] = {137,80,78,71,13,10,26,10}; static void -put4(uchar *a, ulong v) +put4(uchar *a, uint32 v) { a[0] = v>>24; a[1] = v>>16; @@ -47,7 +47,7 @@ static void chunk(Biobuf *bo, char *type, uchar *d, int n) { uchar buf[4]; - ulong crc = 0; + uint32 crc = 0; if(strlen(type) != 4) return; |