SW: Replace old crc32 functions with Bcrc32, mirroring how it's used in Duke's grpscan.cpp.

Patch from Striker.

git-svn-id: https://svn.eduke32.com/eduke32@7510 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2019-04-08 06:26:40 +00:00 committed by Christoph Oelckers
parent b242259be1
commit 7991de2793

View file

@ -141,7 +141,7 @@ int ScanGroups(void)
{ {
int b, fh; int b, fh;
unsigned int crcval; unsigned int crcval = 0;
unsigned char buf[16*512]; unsigned char buf[16*512];
fh = openfrompath(sidx->name, BO_RDONLY|BO_BINARY, BS_IREAD); fh = openfrompath(sidx->name, BO_RDONLY|BO_BINARY, BS_IREAD);
@ -149,14 +149,12 @@ int ScanGroups(void)
if (fstat(fh, &st)) continue; if (fstat(fh, &st)) continue;
buildprintf(" Checksumming %s...", sidx->name); buildprintf(" Checksumming %s...", sidx->name);
crc32init(&crcval);
do do
{ {
b = read(fh, buf, sizeof(buf)); b = read(fh, buf, sizeof(buf));
if (b > 0) crc32block(&crcval, buf, b); if (b > 0) crcval = Bcrc32(buf, b, crcval);
} }
while (b == sizeof(buf)); while (b == sizeof(buf));
crc32finish(&crcval);
close(fh); close(fh);
buildputs(" Done\n"); buildputs(" Done\n");