make flate crc32 work when ulong is 64 bits

R=, rsc
CC=
http://codereview.appspot.com/203061
This commit is contained in:
Russ Cox 2010-02-07 16:51:28 -08:00
parent 28afa898ee
commit 9a05452085
7 changed files with 25 additions and 19 deletions

View file

@ -8,10 +8,10 @@ enum
ADLERBASE = 65521 /* largest prime smaller than 65536 */
};
ulong
adler32(ulong adler, void *vbuf, int n)
uint32
adler32(uint32 adler, void *vbuf, int n)
{
ulong s1, s2;
uint32 s1, s2;
uchar *buf, *ebuf;
int m;

View file

@ -2,11 +2,11 @@
#include <libc.h>
#include <flate.h>
ulong*
mkcrctab(ulong poly)
uint32*
mkcrctab(uint32 poly)
{
ulong *crctab;
ulong crc;
uint32 *crctab;
uint32 crc;
int i, j;
crctab = malloc(256 * sizeof(ulong));
@ -26,8 +26,8 @@ mkcrctab(ulong poly)
return crctab;
}
ulong
blockcrc(ulong *crctab, ulong crc, void *vbuf, int n)
uint32
blockcrc(uint32 *crctab, uint32 crc, void *vbuf, int n)
{
uchar *buf, *ebuf;