diff --git a/src/stasis/crc32.c b/src/stasis/crc32.c index 92779fc..c184a6e 100644 --- a/src/stasis/crc32.c +++ b/src/stasis/crc32.c @@ -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; diff --git a/src/stasis/fifo.c b/src/stasis/fifo.c index 9dbdf82..04ee126 100644 --- a/src/stasis/fifo.c +++ b/src/stasis/fifo.c @@ -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) { diff --git a/src/stasis/graph.c b/src/stasis/graph.c index 04fc700..cfd5e3b 100644 --- a/src/stasis/graph.c +++ b/src/stasis/graph.c @@ -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); }*/ diff --git a/src/stasis/hash.c b/src/stasis/hash.c index 628efbb..dcde4e5 100644 --- a/src/stasis/hash.c +++ b/src/stasis/hash.c @@ -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, diff --git a/src/stasis/logger/logWriter.c b/src/stasis/logger/logWriter.c index a09b55f..05514d5 100644 --- a/src/stasis/logger/logWriter.c +++ b/src/stasis/logger/logWriter.c @@ -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(); diff --git a/stasis/crc32.h b/stasis/crc32.h index deca2a7..69c796f 100644 --- a/stasis/crc32.h +++ b/stasis/crc32.h @@ -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);