]> jfr.im git - irc/quakenet/newserv.git/commitdiff
Rename our crc32 and crc32i functions because they conflict with libz.
authorGunnar Beutner <redacted>
Thu, 13 Feb 2014 21:11:46 +0000 (22:11 +0100)
committerGunnar Beutner <redacted>
Thu, 13 Feb 2014 21:11:46 +0000 (22:11 +0100)
16 files changed:
authext/authext.c
chanfix/chanfix.c
chanindex/chanindex.c
channel/channel.c
chanserv/chancmds/giveowner.c
chanserv/database/chanservdb_hash.c
chanstats/chanstatshash.c
lib/irc_string.c
lib/irc_string.h
nick/nick.c
nick/nickhelpers.c
patricianick/patricianick.h
pqsql/pqsql.c
qabot/qabot.c
regexgline/regexgline.c
versionscan/versionscan.c

index b48c84e9da506f51f0a4470a6d55160b047ded76..7606832d9c9a8aabbe9dbb5981feb3847179a24f 100644 (file)
@@ -18,7 +18,7 @@ MODULE_VERSION("")
 CCASSERT(sizeof(unsigned long long) == sizeof(u_int64_t))
 
 #define authnamehash(x)   ((x)%AUTHNAMEHASHSIZE)
-#define authnamehashbyname(x) (crc32i(x)%AUTHNAMEHASHSIZE)
+#define authnamehashbyname(x) (irc_crc32i(x)%AUTHNAMEHASHSIZE)
 
 authname *authnametable[AUTHNAMEHASHSIZE];
 
index d7ad18901510d2d6d44bb504e862f61fa546db69..711c87714956d5e95616d64961a388a99adf7c32 100644 (file)
@@ -897,7 +897,7 @@ unsigned long cf_gethash(nick *np, int type) {
 
   if (IsAccount(np) && (type & CFACCOUNT)) {
     if (np->exts[cfnext] == NULL) {
-      np->exts[cfnext] = (void *)crc32(np->authname);
+      np->exts[cfnext] = (void *)irc_crc32(np->authname);
     }
 
     return (unsigned long)np->exts[cfnext];
@@ -909,7 +909,7 @@ unsigned long cf_gethash(nick *np, int type) {
       return (unsigned long)np->exts[cfnext];
     else {
       snprintf(buf, sizeof(buf), "%s@%s", np->ident, np->host->name->content);
-      hash = crc32(buf);
+      hash = irc_crc32(buf);
 
       /* if the user is not authed, update the hash */
       if (!IsAccount(np)) {
index fe4f621904960cc59d261176f09c319e0f70a467..2aa763ea666bbcbd4c41a34b2b4d4d73d5ffe986 100644 (file)
@@ -12,7 +12,7 @@
 
 MODULE_VERSION("")
 
-#define channelhash(x)  (crc32i(x)%CHANNELHASHSIZE)
+#define channelhash(x)  (irc_crc32i(x)%CHANNELHASHSIZE)
 
 chanindex *chantable[CHANNELHASHSIZE];
 sstring *extnames[MAXCHANNELEXTS];
index cf875d4bf2d75dab0860854bb94ebef57e8d1743..05ee1f43f643fab03b230406e0656d07448afe91 100644 (file)
@@ -16,7 +16,7 @@
 
 MODULE_VERSION("");
 
-#define channelhash(x)  (crc32i(x)%CHANNELHASHSIZE)
+#define channelhash(x)  (irc_crc32i(x)%CHANNELHASHSIZE)
 
 unsigned long nouser;
 
index 3416d48f9396e0621235a2f699ca54b7e6884fec..97eb693daa6eb1b88c7eb29360f907090ba045ae 100644 (file)
@@ -73,7 +73,7 @@ int csc_dogiveowner(void *source, int cargc, char **cargv) {
    
   /* Compute ze hash */
   sprintf(hashstr,"%u.%u.%u",rcp->ID,target->ID,rup->ID);
-  thehash=crc32(hashstr);
+  thehash=irc_crc32(hashstr);
   
   sprintf(hashstr,"%x",thehash);
 
index 34ab783ce5e6cc1c291394749d1fa6a081952b0b..7707433cd6dd8a8136726607ee8e93575cc940ba 100644 (file)
@@ -16,8 +16,8 @@ reguser *regusernicktable[REGUSERHASHSIZE];
 maildomain *maildomainnametable[MAILDOMAINHASHSIZE];
 maildomain *maildomainIDtable[MAILDOMAINHASHSIZE];
 
-#define regusernickhash(x)  ((crc32i(x))%REGUSERHASHSIZE)
-#define maildomainnamehash(x)   ((crc32i(x))%MAILDOMAINHASHSIZE)
+#define regusernickhash(x)  ((irc_crc32i(x))%REGUSERHASHSIZE)
+#define maildomainnamehash(x)   ((irc_crc32i(x))%MAILDOMAINHASHSIZE)
 #define maildomainIDhash(x)     ((x)%MAILDOMAINHASHSIZE)
 
 void chanservhashinit() {
index 00cdd8e493baa1d9a0ce95caaac04e92c540d49d..d7228062bf1d1ae4d2a5a1a62477097dd8a4599e 100644 (file)
@@ -3,7 +3,7 @@
 #include "../lib/irc_string.h"
 #include "../irc/irc_config.h"
 
-#define chanstatshash(x) (crc32i(x)%CHANSTATSHASHSIZE)
+#define chanstatshash(x) (irc_crc32i(x)%CHANSTATSHASHSIZE)
 
 /*
  * findchanstats:
@@ -56,4 +56,4 @@ chanstats *findchanstatsifexists(const char *channame) {
 }
 
   
-  
\ No newline at end of file
+  
index 28ac047e141bd9583af3c6f6f80ca27b13b0dcf9..1f0b588422f2bef961d7a42da8a19982b642cd1c 100644 (file)
@@ -122,7 +122,7 @@ int match2patterns(const char *patrn, const char *string) {
 /*  COPYRIGHT (C) 1986 Gary S. Brown.  You may use this program, or      */
 /*  code or tables extracted from it, as desired without restriction.    */
 /* Modified by Fox: no more length parameter, always does the whole string */
-unsigned long crc32(const char *s) {
+unsigned long irc_crc32(const char *s) {
   const char *cp;
   unsigned long crc32val;
   
@@ -134,7 +134,7 @@ unsigned long crc32(const char *s) {
 }
 
 /* Case insensitive version of the above */
-unsigned long crc32i(const char *s) {
+unsigned long irc_crc32i(const char *s) {
   const char *cp;
   unsigned long crc32val;
   
index 437e3d68f5d7994e925f820de80b5cff1462c049..161b235b89384c29e5d32ca0c05ec8a48740d182 100644 (file)
@@ -12,8 +12,8 @@ extern const char ToLowerTab_8859_1[];
 
 int match2strings(const char *patrn, const char *strng);
 int match2patterns(const char *patrn, const char *strng);
-unsigned long crc32(const char *s);
-unsigned long crc32i(const char *s);
+unsigned long irc_crc32(const char *s);
+unsigned long irc_crc32i(const char *s);
 int ircd_strcmp(const char *s1, const char *s2);
 int ircd_strncmp(const char *s1, const char *s2, size_t len);
 char *delchars(char *string, const char *badchars);
index 0dc14ac1855904f497393eb0a478f512c9006f35..b95d597cd826fc1207f13c2e976d06ad1fc78eca 100644 (file)
@@ -51,7 +51,7 @@ const flag accountflags[] = {
    { 'd', AFLAG_DEVELOPER },
    { '\0', 0 } };
 
-#define nickhash(x)       ((crc32i(x))%NICKHASHSIZE)
+#define nickhash(x)       ((irc_crc32i(x))%NICKHASHSIZE)
 
 nick *nicktable[NICKHASHSIZE];
 nick **servernicks[MAXSERVERS];
index d4081ce66e79a8c98cdb84ec3278fc90aa175683..6cf065dd071b7191632b065da9d9ad651690ba95 100644 (file)
@@ -9,8 +9,8 @@
 
 #include <string.h>
 
-#define hosthash(x)       ((crc32i(x))%HOSTHASHSIZE)
-#define realnamehash(x)   ((crc32(x))%REALNAMEHASHSIZE)
+#define hosthash(x)       ((irc_crc32i(x))%HOSTHASHSIZE)
+#define realnamehash(x)   ((irc_crc32(x))%REALNAMEHASHSIZE)
 
 host *hosttable[HOSTHASHSIZE];
 realname *realnametable[REALNAMEHASHSIZE];
index 339c20d10880f43b042543bbf98ec6955fbf285c..20867865bb9e9f5defeb7ecb70034bbf836da43a 100644 (file)
@@ -4,7 +4,7 @@
 #include "../nick/nick.h"
 
 #define PATRICIANICK_HASHSIZE   5
-#define pn_getidenthash(x)      ((crc32i(x)) % PATRICIANICK_HASHSIZE)
+#define pn_getidenthash(x)      ((irc_crc32i(x)) % PATRICIANICK_HASHSIZE)
 #define PATRICIANICK_MAXRESULTS 1000
 
 typedef struct patricianick_s {
index ea9fd102df9a9cf1aa18951bf22f6de1c55d3089..c2174da90c9e1e656dc25ec10fd036bca81f1d25 100644 (file)
@@ -308,7 +308,7 @@ void pqstartloadtable(PGconn *dbconn, void *arg)
     return;
   }
 
-  tablecrc=crc32(tli->tablename->content);
+  tablecrc=irc_crc32(tli->tablename->content);
   count=strtoul(PQgetvalue(res, 0, 0), NULL, 10);
   PQclear(res);
 
index ac472f3b1572886735f0e34b9bc933ce2ef092b4..0f26afca1f304925a757e2aeadfc041c541b4a42 100644 (file)
@@ -451,7 +451,7 @@ void qabot_child_handler(nick* me, int type, void** args) {
       }
       
       if (bot->flags & QAB_FLOODDETECT) {
-        crc = crc32i(text);
+        crc = irc_crc32i(text);
         if (crc == qab_lastq_crc) {
           qab_lastq_count++;
           if (qab_lastq_count >= 3) {
index bde5da5a508eb61ddfcbfb7d629447167c108569..565e33eb11e460fac6b157b2489a471e9efd9cc0 100644 (file)
@@ -1078,7 +1078,7 @@ struct rg_struct *rg_newsstruct(unsigned long id, char *mask, char *setby, char
       newrow->type = 0; /* just in case */
 
     snprintf(glineiddata, sizeof(glineiddata), "%s regexgline %s %s %s %d %d", mynumeric->content, mask, setby, reason, (int)iexpires, newrow->type);
-    newrow->glineid = crc32(glineiddata);
+    newrow->glineid = irc_crc32(glineiddata);
   }
   
   return newrow;
index 0473611b0f4ab7a62886a4588af398bf5f0a9369..2047de2b51ff57150577c1c664f6d647dc480bec 100644 (file)
@@ -23,7 +23,7 @@ void versionscan_addstat(char* reply) {
   vsstatistic* v, *pv;
   
   replylen = strlen(reply);
-  replycrc = crc32i(reply);
+  replycrc = irc_crc32i(reply);
   
   pv=NULL;
   for (v=vsstats; v; v=v->next) {