unsigned int -> uint32_t
This commit is contained in:
parent
560cdc2330
commit
c8cc188b71
2 changed files with 8 additions and 5 deletions
|
@ -7,7 +7,7 @@
|
||||||
// unsigned long crc = -1L
|
// unsigned long crc = -1L
|
||||||
// crc = crc32(buffer, length, crc)
|
// crc = crc32(buffer, length, crc)
|
||||||
|
|
||||||
unsigned int stasis_crc32(const void *buffer, unsigned int count, unsigned int crc);
|
uint32_t stasis_crc32(const void *buffer, unsigned int count, uint32_t crc);
|
||||||
static int BuildCRCTable(void);
|
static int BuildCRCTable(void);
|
||||||
|
|
||||||
static unsigned int CRCTable[256]; // Table constructed for fast lookup.
|
static unsigned int CRCTable[256]; // Table constructed for fast lookup.
|
||||||
|
@ -34,9 +34,9 @@ static int BuildCRCTable(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* changed long to int, void to const void - rusty. */
|
/* changed long to int, void to const void - rusty. */
|
||||||
unsigned int stasis_crc32(const void *buffer, unsigned int count, unsigned int crc)
|
uint32_t stasis_crc32(const void *buffer, unsigned int count, uint32_t crc)
|
||||||
{
|
{
|
||||||
unsigned int temp1, temp2;
|
uint32_t temp1, temp2;
|
||||||
static int firsttime = 1;
|
static int firsttime = 1;
|
||||||
unsigned char *p = (unsigned char *)buffer;
|
unsigned char *p = (unsigned char *)buffer;
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#ifndef STASIS_CRC32_H
|
||||||
|
#define STASIS_CRC32_H
|
||||||
/* This CRC code was taken from: http://www.axlradius.com/freestuff/crc2.c
|
/* This CRC code was taken from: http://www.axlradius.com/freestuff/crc2.c
|
||||||
|
|
||||||
(It is presumably in the public domain. Other files under /freestuff/ are...)
|
(It is presumably in the public domain. Other files under /freestuff/ are...)
|
||||||
|
@ -13,5 +15,6 @@
|
||||||
unsigned int crc = -1L
|
unsigned int crc = -1L
|
||||||
crc = crc32(buffer, length, crc)
|
crc = crc32(buffer, length, crc)
|
||||||
*/
|
*/
|
||||||
|
#include <stasis/common.h>
|
||||||
unsigned int stasis_crc32(const void *buffer, unsigned int count, unsigned int crc);
|
uint32_t stasis_crc32(const void *buffer, unsigned int count, uint32_t crc);
|
||||||
|
#endif // STASIS_CRC32_H
|
||||||
|
|
Loading…
Reference in a new issue