From 706aec5527cd905493fb391f9a9378f06361913b Mon Sep 17 00:00:00 2001 From: terminx Date: Wed, 1 Oct 2014 17:09:54 +0000 Subject: [PATCH] Rename crc32() to Bcrc32() to avoid conflicts with the crc32() function in libpng/libz. DONT_BUILD. git-svn-id: https://svn.eduke32.com/eduke32@4642 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/crc32.h | 2 +- polymer/eduke32/build/src/crc32.c | 2 +- polymer/eduke32/build/src/engine.c | 6 +++--- polymer/eduke32/build/src/osd.c | 2 +- polymer/eduke32/source/grpscan.c | 2 +- polymer/eduke32/source/net.c | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/polymer/eduke32/build/include/crc32.h b/polymer/eduke32/build/include/crc32.h index bfe48dffd..3029128b9 100644 --- a/polymer/eduke32/build/include/crc32.h +++ b/polymer/eduke32/build/include/crc32.h @@ -15,7 +15,7 @@ extern uint32_t crc32table[8][256]; extern uint32_t crc32table[4][256]; #endif -extern uint32_t crc32(const void* data, size_t length, uint32_t crc); +extern uint32_t Bcrc32(const void* data, size_t length, uint32_t crc); extern void initcrc32table(void); #ifdef EXTERNC diff --git a/polymer/eduke32/build/src/crc32.c b/polymer/eduke32/build/src/crc32.c index ee2820ef3..2571e71c6 100644 --- a/polymer/eduke32/build/src/crc32.c +++ b/polymer/eduke32/build/src/crc32.c @@ -3,7 +3,7 @@ #include "compat.h" #include "crc32.h" -uint32_t crc32(const void* data, size_t length, uint32_t crc) +uint32_t Bcrc32(const void* data, size_t length, uint32_t crc) { const uint32_t* current = (const uint32_t*) data; uint8_t *currentChar; diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 40410e55b..e3aaf5b19 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -7938,9 +7938,9 @@ static int32_t loadtables(void) #ifdef B_LITTLE_ENDIAN i = 0; - if (crc32((uint8_t *)sintable, sizeof(sintable), 0) != 0xee1e7aba) + if (Bcrc32((uint8_t *)sintable, sizeof(sintable), 0) != 0xee1e7aba) i |= 1; - if (crc32((uint8_t *)radarang, 640*sizeof(radarang[0]), 0) != 0xee893d92) + if (Bcrc32((uint8_t *)radarang, 640*sizeof(radarang[0]), 0) != 0xee893d92) i |= 2; if (i != 0) @@ -8157,7 +8157,7 @@ static int32_t loadpalette(void) #endif // If Duke3D 1.5 GRP or LameDuke, ... - if (crc32((uint8_t *)transluc, 65536, 0)==0x94a1fac6 || lamedukep) + if (Bcrc32((uint8_t *)transluc, 65536, 0)==0x94a1fac6 || lamedukep) { int32_t i; // ... fix up translucency table so that transluc(255,x) diff --git a/polymer/eduke32/build/src/osd.c b/polymer/eduke32/build/src/osd.c index 571312fa0..9f42d80b7 100644 --- a/polymer/eduke32/build/src/osd.c +++ b/polymer/eduke32/build/src/osd.c @@ -343,7 +343,7 @@ static int32_t _internal_osdfunc_fileinfo(const osdfuncparm_t *parm) do { j = kread(i,buf,256); - crc = crc32((uint8_t *)buf,j,crc); + crc = Bcrc32((uint8_t *)buf,j,crc); } while (j == 256); crctime = getticks() - crctime; diff --git a/polymer/eduke32/source/grpscan.c b/polymer/eduke32/source/grpscan.c index db853b36a..0069869ce 100644 --- a/polymer/eduke32/source/grpscan.c +++ b/polymer/eduke32/source/grpscan.c @@ -394,7 +394,7 @@ int32_t ScanGroups(void) do { b = read(fh, buf, BUFFER_SIZE); - if (b > 0) crcval = crc32((uint8_t *)buf, b, crcval); + if (b > 0) crcval = Bcrc32((uint8_t *)buf, b, crcval); } while (b == BUFFER_SIZE); close(fh); diff --git a/polymer/eduke32/source/net.c b/polymer/eduke32/source/net.c index ba44f083a..6795e70b9 100644 --- a/polymer/eduke32/source/net.c +++ b/polymer/eduke32/source/net.c @@ -766,7 +766,7 @@ void Net_SendChallenge() tempnetbuf[0] = PACKET_AUTH; B_BUF16(&tempnetbuf[1], BYTEVERSION); B_BUF16(&tempnetbuf[3], NETVERSION); - B_BUF32(&tempnetbuf[5], crc32((uint8_t *)g_netPassword, Bstrlen(g_netPassword), 0)); + B_BUF32(&tempnetbuf[5], Bcrc32((uint8_t *)g_netPassword, Bstrlen(g_netPassword), 0)); tempnetbuf[9] = myconnectindex; enet_peer_send(g_netClientPeer, CHAN_GAMESTATE, enet_packet_create(&tempnetbuf[0], 10, ENET_PACKET_FLAG_RELIABLE)); @@ -786,7 +786,7 @@ void Net_ReceiveChallenge(uint8_t *pbuf, int32_t packbufleng, ENetEvent *event) initprintf("Bad client protocol: version %u.%u\n", byteVersion, netVersion); return; } - if (crc != crc32((uint8_t *)g_netPassword, Bstrlen(g_netPassword), 0)) + if (crc != Bcrc32((uint8_t *)g_netPassword, Bstrlen(g_netPassword), 0)) { enet_peer_disconnect_later(event->peer, DISC_BAD_PASSWORD); initprintf("Bad password from client.\n");