]> jfr.im git - irc/quakenet/newserv.git/commitdiff
should always be %jd and cast to intmax_t to stop warning on 32bit (gcc 4.2.3) -warni...
authorPaul <redacted>
Sun, 24 Aug 2008 19:53:39 +0000 (20:53 +0100)
committerPaul <redacted>
Sun, 24 Aug 2008 19:53:39 +0000 (20:53 +0100)
type ‘intmax_t’, but argument 4 has type ‘time_t’

chanserv/chanservdb_updates.c
chanstats/chanstats.c
localuser/localuser.c
localuser/localuserchannel.c
newsearch/ns-gline.c
nick/nickhandlers.c
regexgline/regexgline.c
trojanscan/trojanscan.c

index a8dcc02b42b49678589ac387cf6520f712ad60ca..9523725e8d593332a5278a3b5a389078bdf9866f 100644 (file)
@@ -89,7 +89,7 @@ void csdb_updatechannel(regchan *rcp) {
                  rcp->founder, rcp->addedby, rcp->suspendby, rcp->suspendtime,
                  rcp->chantype,rcp->totaljoins,rcp->tripjoins,
                  rcp->maxusers,rcp->tripusers,
-                 escwelcome,esctopic,esckey,escreason,esccomment,rcp->ltimestamp,rcp->ID);
+                 escwelcome,esctopic,esckey,escreason,esccomment,(intmax_t)rcp->ltimestamp,rcp->ID);
 }
 
 void csdb_updatechannelcounters(regchan *rcp) {
@@ -106,7 +106,7 @@ void csdb_updatechannelcounters(regchan *rcp) {
 void csdb_updatechanneltimestamp(regchan *rcp) {
   dbquery("UPDATE chanserv.channels SET "
                  "lasttimestamp=%jd WHERE ID=%u",
-                 rcp->ltimestamp, rcp->ID);
+                 (intmax_t)rcp->ltimestamp, rcp->ID);
 }
 
 void csdb_createchannel(regchan *rcp) {
@@ -159,7 +159,7 @@ void csdb_createchannel(regchan *rcp) {
                  rcp->founder, rcp->addedby, rcp->suspendby, rcp->suspendtime,
                  rcp->chantype,rcp->totaljoins,rcp->tripjoins,
                  rcp->maxusers,rcp->tripusers,
-                 escwelcome,esctopic,esckey,escreason,esccomment,rcp->ltimestamp);
+                 escwelcome,esctopic,esckey,escreason,esccomment,(intmax_t)rcp->ltimestamp);
 }
 
 void csdb_deletechannel(regchan *rcp) {
@@ -449,7 +449,7 @@ void csdb_createmaillock(maillock *mlp) {
     escreason[0]='\0';
 
   dbquery("INSERT INTO chanserv.maillocks (id, pattern, reason, createdby, created) VALUES(%u, '%s', '%s', %u, %jd)",
-          mlp->id,escpattern,escreason,mlp->createdby,mlp->created);
+          mlp->id,escpattern,escreason,mlp->createdby,(intmax_t)mlp->created);
 }
 
 void csdb_updatemaillock(maillock *mlp) {
@@ -462,6 +462,6 @@ void csdb_updatemaillock(maillock *mlp) {
   else
     escreason[0]='\0';
 
-  dbquery("UPDATE chanserv.maillocks SET pattern='%s', reason='%s', createdby=%u, created=%jd WHERE ID=%u", escpattern, escreason, mlp->createdby, mlp->created, mlp->id);
+  dbquery("UPDATE chanserv.maillocks SET pattern='%s', reason='%s', createdby=%u, created=%jd WHERE ID=%u", escpattern, escreason, mlp->createdby, (intmax_t)mlp->created, mlp->id);
 }
 
index 130191358c5944a5bb357cc93ca67d221ac4a781..e69c01390a4e98a1af04b402c213ae75cbe1f64b 100644 (file)
@@ -64,7 +64,7 @@ void _init() {
     /* Work out when to take the next sample */
     now=getnettime();
     if (now < chanstats_lastsample) {
-      Error("chanstats",ERR_WARNING,"Last sample time in future (%zu > %zu)",chanstats_lastsample,now);
+      Error("chanstats",ERR_WARNING,"Last sample time in future (%jd > %jd)",(intmax_t)chanstats_lastsample,(intmax_t)now);
       when=now;
     } else if (now<(chanstats_lastsample+SAMPLEINTERVAL)) {
       lastday=chanstats_lastsample/(24*3600);
index a0c5bc4b140f9880b632bd935da8c063d2bedc82..87b361f509338b0f99836756e15d083f781f1fb6 100644 (file)
@@ -192,7 +192,7 @@ int renamelocaluser(nick *np, char *newnick) {
       /* Case only name change */
       strncpy(np->nick,newnick,NICKLEN);
       np->nick[NICKLEN]='\0';
-      irc_send("%s N %s %jd",iptobase64(ipbuf, &(np->p_ipaddr), sizeof(ipbuf), 1),np->nick,np->timestamp);
+      irc_send("%s N %s %jd",iptobase64(ipbuf, &(np->p_ipaddr), sizeof(ipbuf), 1),np->nick,(intmax_t)np->timestamp);
       triggerhook(HOOK_NICK_RENAME,np);     
       return 0;
     } else {
@@ -207,7 +207,7 @@ int renamelocaluser(nick *np, char *newnick) {
   strncpy(np->nick,newnick,NICKLEN);
   np->nick[NICKLEN]='\0';
   addnicktohash(np);
-  irc_send("%s N %s %jd",longtonumeric(np->numeric,5),np->nick,np->timestamp);
+  irc_send("%s N %s %jd",longtonumeric(np->numeric,5),np->nick,(intmax_t)np->timestamp);
   triggerhook(HOOK_NICK_RENAME,np);
   
   return 0;
index 52701d719b93ad0d42067c9286b85b637130a422..bf52c4f3b9fac928e3ad0c272f3f0cc10428a923 100644 (file)
@@ -917,7 +917,7 @@ void localsettopic(nick *np, channel *cp, char *topic) {
   }
   
   if (connected) {
-    irc_send("%s T %s %jd %jd :%s",source,cp->index->name->content,cp->timestamp,cp->topictime,(cp->topic)?cp->topic->content:"");
+    irc_send("%s T %s %jd %jd :%s",source,cp->index->name->content,(intmax_t)cp->timestamp,(intmax_t)cp->topictime,(cp->topic)?cp->topic->content:"");
   }
 }
 
index 7dee207a8ee028a71f2808fee4b1c7cd90680900..6531b712427b71ca2916607237ad582a4da0dc56 100644 (file)
@@ -167,9 +167,9 @@ void gline_free(searchCtx *ctx, struct searchNode *thenode) {
               if (!IsOper(np) && !IsService(np) && !IsXOper(np)) {
                 nssnprintf(msgbuf, sizeof(msgbuf), localdata->reason, np);
                 if (np->host->clonecount <= NSMAX_GLINE_CLONES)
-                  irc_send("%s GL * +*@%s %u %zu :%s", mynumeric->content, IPtostr(np->p_ipaddr), localdata->duration, ti, msgbuf);
+                  irc_send("%s GL * +*@%s %u %jd :%s", mynumeric->content, IPtostr(np->p_ipaddr), localdata->duration, (intmax_t)ti, msgbuf);
                 else
-                  irc_send("%s GL * +%s@%s %u %zu :%s", mynumeric->content, np->ident, IPtostr(np->p_ipaddr), localdata->duration, ti, msgbuf);
+                  irc_send("%s GL * +%s@%s %u %jd :%s", mynumeric->content, np->ident, IPtostr(np->p_ipaddr), localdata->duration, (intmax_t)ti, msgbuf);
               }
               else
                 safe++;
@@ -187,9 +187,9 @@ void gline_free(searchCtx *ctx, struct searchNode *thenode) {
           if (!IsOper(np) && !IsService(np) && !IsXOper(np)) {
             nssnprintf(msgbuf, sizeof(msgbuf), localdata->reason, np);
             if (np->host->clonecount <= NSMAX_GLINE_CLONES)
-              irc_send("%s GL * +*@%s %u %zu :%s", mynumeric->content, IPtostr(np->p_ipaddr), localdata->duration, ti, msgbuf);
+              irc_send("%s GL * +*@%s %u %jd :%s", mynumeric->content, IPtostr(np->p_ipaddr), localdata->duration, (intmax_t)ti, msgbuf);
             else
-              irc_send("%s GL * +%s@%s %u %zu :%s", mynumeric->content, np->ident, IPtostr(np->p_ipaddr), localdata->duration, ti, msgbuf);
+              irc_send("%s GL * +%s@%s %u %jd :%s", mynumeric->content, np->ident, IPtostr(np->p_ipaddr), localdata->duration, (intmax_t)ti, msgbuf);
           }
           else
               safe++;
index b3c5212fe8d42d347ae34f9e862d4c3f0c07cb2b..eba13ff73ad0dd14abaa4e1b04e5a623c318a57c 100644 (file)
@@ -47,7 +47,7 @@ int handlenickmsg(void *source, int cargc, char **cargv) {
        * match the existing timestamp, and we can bypass all the collision checking and hash fettling. */
       if (np->timestamp!=timestamp) {
         Error("nick",ERR_WARNING,"Rename to same nickname with different timestamp (%s(%jd) -> %s(%jd))",
-                            np->nick,np->timestamp,cargv[0],timestamp);
+                            np->nick,(intmax_t)np->timestamp,cargv[0], (intmax_t)timestamp);
         np->timestamp=timestamp;
       }
       strncpy(np->nick,cargv[0],NICKLEN);
index 3d8f43164e783f5e0e52106db41131afe124a5cd..0c131f74d47cc3f8dfa59a066fcb051f58a3c5ab 100644 (file)
@@ -279,7 +279,7 @@ void rg_dodelay(void *arg) {
   }
   
   rg_shadowserver(delay->np, delay->reason, delay->reason->type);
-  irc_send("%s GL * +%s %d %zu :AUTO: %s (ID: %08lx)\r\n", mynumeric->content, hostname, rg_expiry_time, time(NULL), delay->reason->reason->content, delay->reason->glineid);
+  irc_send("%s GL * +%s %d %jd :AUTO: %s (ID: %08lx)\r\n", mynumeric->content, hostname, rg_expiry_time, (intmax_t)time(NULL), delay->reason->reason->content, delay->reason->glineid);
   rg_deletedelay(delay);
 }
 
@@ -1106,7 +1106,7 @@ int __rg_dogline(struct rg_glinelist *gll, nick *np, struct rg_struct *rp, char
   }
   
   rg_shadowserver(np, rp, rp->type);
-  irc_send("%s GL * +%s %d %zu :AUTO: %s (ID: %08lx)\r\n", mynumeric->content, hostname, rg_expiry_time, time(NULL), rp->reason->content, rp->glineid);
+  irc_send("%s GL * +%s %d %jd :AUTO: %s (ID: %08lx)\r\n", mynumeric->content, hostname, rg_expiry_time, (intmax_t)time(NULL), rp->reason->content, rp->glineid);
   return usercount;
 }
 
@@ -1211,7 +1211,7 @@ void rg_flush_schedule(void *arg) {
     if(!l->dirty)
       continue;
 
-    dbquery("UPDATE regexgline.glines SET lastseen = %zu, hits = %lu WHERE id = %d", l->lastseen, l->hitssaved, l->id);
+    dbquery("UPDATE regexgline.glines SET lastseen = %jd, hits = %lu WHERE id = %d", (intmax_t)l->lastseen, l->hitssaved, l->id);
 
     l->dirty = 0;
   }
index 159a6db887a3c9ce85b9616b6b71883b8bcef376..3fa8e820f76ea48c48a637d6fdc2bba6ef31a977 100644 (file)
@@ -2080,7 +2080,7 @@ void trojanscan_phrasematch(channel *chp, nick *sender, trojanscan_phrases *phra
     trojanscan_database_query("INSERT INTO hits (nickname, ident, host, phrase, messagetype, glined) VALUES ('%s', '%s', '%s', %d, '%c', %d)", enick, eident, ehost, phrase->id, messagetype, glining);
     trojanscan_database.glines++;
     
-    irc_send("%s GL * +%s %d %zu :You (%s!%s@%s) are infected with a trojan (%s/%d), see %s%d for details - banned for %d hours\r\n", mynumeric->content, glinemask, glinetime * 3600, time(NULL), sender->nick, sender->ident, sender->host->name->content, worm->name->content, phrase->id, TROJANSCAN_URL_PREFIX, worm->id, glinetime);
+    irc_send("%s GL * +%s %d %jd :You (%s!%s@%s) are infected with a trojan (%s/%d), see %s%d for details - banned for %d hours\r\n", mynumeric->content, glinemask, glinetime * 3600, (intmax_t)time(NULL), sender->nick, sender->ident, sender->host->name->content, worm->name->content, phrase->id, TROJANSCAN_URL_PREFIX, worm->id, glinetime);
 
     trojanscan_mainchanmsg("g: *!%s t: %c u: %s!%s@%s%s%s c: %d w: %s%s p: %d f: %d%s%s", glinemask, messagetype, sender->nick, sender->ident, sender->host->name->content, messagetype=='N'||messagetype=='M'||messagetype=='P'?" #: ":"", messagetype=='N'||messagetype=='M'||messagetype=='P'?chp->index->name->content:"", usercount, worm->name->content, worm->epidemic?"(E)":"", phrase->id, frequency, matchbuf[0]?" --: ":"", matchbuf[0]?matchbuf:"");
   }