]> jfr.im git - irc/quakenet/newserv.git/commitdiff
fixes for clang
authorChris Porter <redacted>
Thu, 7 Jun 2012 23:38:12 +0000 (00:38 +0100)
committerChris Porter <redacted>
Thu, 7 Jun 2012 23:38:12 +0000 (00:38 +0100)
13 files changed:
build.mk.in
chanserv/chancmds/chanlev.c
clonearmy/clonearmy.c
core/modules.c
core/nsmalloc.h
defaults.mk
irc/irc.c
lua/luasocket.c
nterfacer/nterfacer_chanstats.c
patriciasearch/patriciasearch.c
sqlite/sqlite.c
trusts/formats.c
trusts/trusts_commands.c

index 06318ee9f5537c8ce71f238618f6f5375f312a4a..fca81a56e433b620ae1a0f02129a21d3e546642a 100644 (file)
@@ -3,7 +3,6 @@ INCPATH=../
 @endif@
 
 CFLAGS=
-CC=gcc
 LEX=flex
 MFLAGS=
 
@@ -81,8 +80,13 @@ realchecksettings:
 @endif@
 MFLAGS+=CHECKEDSETTINGS=1
 
+CFLAGS+=-I./ -DBUILDID=$(BUILDID) -fPIC
 CFLAGS+=-Wall -g -finline-functions -funroll-loops -Werror=format-security
+
+@ifndef@ CLANG
 @ifndef@ NOC99
 CFLAGS+=-std=c99
 @endif@
-CFLAGS+=-I./ -DBUILDID=$(BUILDID) -fPIC -export-dynamic
+CFLAGS+=-export-dynamic
+@endif@
+
index 0d440bfd67c0bbffe9e6ef07633c1e954dd9f25b..ee0588e74662996afacfcc6bb078da6d7c0660e6 100644 (file)
@@ -101,7 +101,7 @@ int csc_dochanlev(void *source, int cargc, char **cargv) {
   int i,j;
   int newuser=0;
   int usercount;
-  void *args[2];
+  void *args[3];
 
   if (cargc<1) {
     chanservstdmessage(sender, QM_NOTENOUGHPARAMS, "chanlev");
index 6452265a0bc88d93df45bf103d4aa8b4ba7f4a88..824bb91de644790d329c5019ca85293151a2ea79 100644 (file)
@@ -65,7 +65,7 @@ void join(char *chan) {
 void spawnclones(unsigned int count) {
   nick *np;
   unsigned int i,j;
-  char nick[11], ident[10], host[40];
+  char nick[11], ident[11], host[40];
   channel *cp;
   
   for (i=0;i<count;i++) {
@@ -144,4 +144,4 @@ void _fini(void) {
   for(i=0;i<nclones;i++) {
     deregisterlocaluser(clones[i], NULL);
   }
-}
\ No newline at end of file
+}
index 4063669dfe1a7ae57500e9f5aff9ab28677d4089..08a1749710b593ba1e5098fd65164d5f746d81a8 100644 (file)
@@ -400,8 +400,7 @@ void preparereload(char *modulename) {
     moduledeps[i].reloading=0;
 
   /* Do nothing if this module is not loaded */
-  i=getindex(modulebuf);
-  if (i<0)
+  if (getindex(modulebuf)<0)
     return;
     
   if ((mdp=getmoduledep(modulebuf))) {
index c79748747289002c6854e4d27c481fe3f1f9867f..b62e6353d944446d3ac40a630583614cab325f8e 100644 (file)
@@ -33,10 +33,9 @@ struct nsminfo {
 };
 
 struct nsmpool {
-  struct nsminfo first;
-
   unsigned long count;
   size_t size;
+  struct nsminfo first;
 };
 
 extern struct nsmpool nsmpools[MAXPOOL];
index 8e7efe235e693e3abc623c01098fb2188ba9ff92..a01ef90ff8d5d72a8d9eea8493e31ee25b850810 100644 (file)
@@ -6,3 +6,4 @@ SSTRING_NEW=0
 SSTRING_MMAP=0
 HOOKS_NEW=0
 XSB_ENGINE=pre
+#CLANG=0   # remember to set CC
index 8ccff8b0c0bc35b9949d6d951e43402c49c46dbd..e14d808c1cd4e71df5066fa4c457138282c87109 100644 (file)
--- a/irc/irc.c
+++ b/irc/irc.c
@@ -239,7 +239,7 @@ void irc_connect(void *arg) {
   sstring *mydesc;
   char *conto,*conpass;
   long portnum,pingfreq;
-  socklen_t opt=1460;
+/*  socklen_t opt=1460;*/
 
   nextline=inbuf;
   bytesleft=0;
index b93af69e15ca6ea977e75f73950dd5e3063c3b17..d120c4b69dabd223e989aa257639810f16a87f3c 100644 (file)
@@ -6,7 +6,9 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 
+#ifndef __USE_MISC
 #define __USE_MISC /* inet_aton */
+#endif
 
 #include <arpa/inet.h>
 #include <sys/un.h>
index 6246e85ac41c620904dd9bc15236c8f8c60d6334..fae8cde6243301f2df94eb3367200f1f51e255cd 100644 (file)
@@ -34,7 +34,7 @@ int handle_chanstats(struct rline *li, int argc, char **argv) {
   int i,j,k,l;
   int tot,emp;
   int themax;
-  float details[13];
+  float details[14];
   
   cip=findchanindex(argv[0]);
   
index 678cfb35bbd1bb6ed29cc05fdb5a33db1fc426b1..5bccf563bd5ae5b0fe1cf4506affd59a5ac9f003 100644 (file)
@@ -12,6 +12,7 @@
 #include "../lib/strlfunc.h"
 #include "patriciasearch.h"
 #include "../lib/version.h"
+#include "../newsearch/newsearch.h"
 
 MODULE_VERSION("")
 
@@ -73,7 +74,11 @@ int do_pnodesearch_real(replyFunc reply, wallFunc wall, void *source, int cargc,
 
   tree = parse_string(reg_nodesearch, cargv[arg]);
   if(!tree) {
+#ifdef NEWSEARCH_NEWPARSER
     displaystrerror(reply, sender, cargv[arg]);
+#else
+    reply(sender,"Something went wrong.");
+#endif
     return CMD_ERROR;
   }
 
index 904ad13d79d05750e54602b39b7a7507a9648456..fa85257121488a0a70f5ea0b9a7a712a33dd0dda 100644 (file)
@@ -7,7 +7,10 @@
 #include <stdarg.h>
 #include <string.h>
 
+#ifndef __USE_POSIX199309
 #define __USE_POSIX199309
+#endif
+
 #include <time.h>
 
 #include "../core/config.h"
index 47f1d053d8c45278404dc5f077d1a9986af41d7d..5ca5a152d34b59b4d69eb22a1a007e78645955bc 100644 (file)
@@ -236,7 +236,7 @@ char *rtrim(char *buf) {
   size_t len = strlcpy(obuf, buf, sizeof(obuf));
 
   if((len < sizeof(obuf)) && (len > 0)) {
-    size_t i;
+    int i;
     for(i=len-1;i>=0;i--) {
       if(obuf[i] != ' ')
         break;
index 5620fab3491394e73f9f906a47e7107f3b07e3ff..95a986010062daaa8a1a5ab97a1a71efcbbc06b8 100644 (file)
@@ -213,7 +213,7 @@ static int trusts_cmdtrustdump(void *source, int argc, char **argv) {
     return CMD_ERROR;
   }
 
-  for(i=0,tg=tglist;i<totalcount&&th;tg=tg->next,i++)
+  for(i=0,tg=tglist;i<totalcount&&tg;tg=tg->next,i++)
     atg[i] = tg;
 
   qsort(atg, totalcount, sizeof(trustgroup *), comparetgs);