Fix linker namespace collision with libz

This commit is contained in:
Sears Russell 2007-12-06 21:52:37 +00:00
parent 588b9a8b25
commit ab4fb0df6c
6 changed files with 8 additions and 8 deletions

View file

@ -9,7 +9,7 @@
// unsigned long crc = -1L
// crc = crc32(buffer, length, crc)
unsigned int crc32(const void *buffer, unsigned int count, unsigned int crc);
unsigned int stasis_crc32(const void *buffer, unsigned int count, unsigned int crc);
static int BuildCRCTable(void);
static unsigned int CRCTable[256]; // Table constructed for fast lookup.
@ -36,7 +36,7 @@ static int BuildCRCTable(void)
return 0;
}
/* changed long to int, void to const void - rusty. */
unsigned int crc32(const void *buffer, unsigned int count, unsigned int crc)
unsigned int stasis_crc32(const void *buffer, unsigned int count, unsigned int crc)
{
unsigned int temp1, temp2;
static int firsttime = 1;

View file

@ -11,7 +11,7 @@
Obtain a member of a fifoPool based on the value of multiplexKey. Use CRC32 to assign the key to a consumer.
*/
lladdFifo_t * lladdFifoPool_getFifoCRC32( lladdFifoPool_t * pool, byte * multiplexKey, size_t multiplexKeySize) {
int memberId = crc32(multiplexKey, multiplexKeySize, (unsigned int)-1) % pool->fifoCount;
int memberId = stasis_crc32(multiplexKey, multiplexKeySize, (unsigned int)-1) % pool->fifoCount;
return pool->pool[memberId];
}
void lladdFifoPool_markDirty(int xid, lladdFifoPool_t * pool, lladdFifo_t * fifo) {

View file

@ -61,7 +61,7 @@ void multiTraverse(int xid, recordid arrayList, lladdFifo_t * local, lladdFifo_t
if(myFifo == -1) {
if(useCRC) {
myFifo = crc32((byte*)&(rid->page), sizeof(rid->page), (unsigned int)-1) % pool->fifoCount;
myFifo = stasis_crc32((byte*)&(rid->page), sizeof(rid->page), (unsigned int)-1) % pool->fifoCount;
} else {
myFifo = rid->page % pool->fifoCount;
}
@ -87,7 +87,7 @@ void multiTraverse(int xid, recordid arrayList, lladdFifo_t * local, lladdFifo_t
nextRid = dereferenceArrayListRid(xid, p, nextRid.slot);
releasePage(p);
int thisFifo = crc32((byte*)&(nextRid.page), sizeof(nextRid.page), (unsigned int)-1) % pool->fifoCount;
int thisFifo = stasis_crc32((byte*)&(nextRid.page), sizeof(nextRid.page), (unsigned int)-1) % pool->fifoCount;
/* if(nextRid.page == rid->page) {
assert(thisFifo == myFifo);
}*/

View file

@ -51,7 +51,7 @@ unsigned int hash(const void * val, long val_length,
unsigned char tableBits, unsigned int nextExtension) {
// Calculate the hash value as it was before this round of splitting.
unsigned int oldTableLength = twoToThe(tableBits - 1);
unsigned int unmixed = crc32(val, val_length, (unsigned int)-1);
unsigned int unmixed = stasis_crc32(val, val_length, (unsigned int)-1);
unsigned int ret = unmixed & (oldTableLength - 1);
// If the hash value is before the point in this round where we've split,

View file

@ -143,7 +143,7 @@ static unsigned int log_crc;
#define BUFSIZE (1024 * 1024)
static inline void update_log_crc(const LogEntry * le, unsigned int * crc) {
*crc = crc32(le, sizeofLogEntry(le), *crc);
*crc = stasis_crc32(le, sizeofLogEntry(le), *crc);
}
static LogEntry * readLogEntry();

View file

@ -14,4 +14,4 @@
crc = crc32(buffer, length, crc)
*/
unsigned int crc32(const void *buffer, unsigned int count, unsigned int crc);
unsigned int stasis_crc32(const void *buffer, unsigned int count, unsigned int crc);