Fix warnings from gcc -pedantic.
authorMichael Poole <mdpoole@troilus.org>
Thu, 22 Jul 2004 01:04:02 +0000 (01:04 +0000)
committerMichael Poole <mdpoole@troilus.org>
Thu, 22 Jul 2004 01:04:02 +0000 (01:04 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1088 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
include/client.h
ircd/ircd_auth.c
ircd/ircd_crypt_smd5.c
ircd/ircd_reslib.c

index 5da4b42034f39e818b88b9313fd5f9adf24c30d1..9957d3798a2283aadac765fe7ddbc70713bbfc45 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-07-21  Michael Poole <mdpoole@troilus.org>
+
+       * include/client.h, ircd/ircd_auth.c, ircd/ircd_crypt_smd5.c,
+       ircd/ircd_reslib.c: Fix warnings from gcc -pedantic.
+
 2004-07-21  Michael Poole <mdpoole@troilus.org>
 
        New DNS resolver code, courtesy of Dianora and the rest of the
index 42049d84625965e6b96a28c379af734c639dd571..e5aa4a25b36b730b57fb23fc67a6aa54b018907c 100644 (file)
@@ -75,7 +75,7 @@ typedef unsigned long flagpage_t;
   struct name \
   { \
     unsigned long bits[((max + FLAGSET_NBITS - 1) / FLAGSET_NBITS)]; \
-  };
+  }
 
 #define FLAGSET_ISSET(set,flag) ((set).bits[FLAGSET_INDEX(flag)] & FLAGSET_MASK(flag))
 #define FLAGSET_SET(set, flag) (set).bits[FLAGSET_INDEX(flag)] |= FLAGSET_MASK(flag)
index c697e90fe45340746997085980551cedb96138e5..f15063ca3625a738d56467b8bc746206b407abb5 100644 (file)
@@ -140,14 +140,20 @@ struct IAuthCmd {
 
 struct IAuth *iauth_active;
 
-static const struct IAuthCmd iauth_cmdtab[];
-
 static void iauth_write(struct IAuth *iauth);
 static void iauth_reconnect(struct IAuth *iauth);
 static void iauth_disconnect(struct IAuth *iauth);
 static void iauth_sock_callback(struct Event *ev);
 static void iauth_send_request(struct IAuth *iauth, struct IAuthRequest *iar);
 static void iauth_dispose_request(struct IAuth *iauth, struct IAuthRequest *iar);
+static void iauth_cmd_doneauth(struct IAuth *iauth, int argc, char *argv[]);
+static void iauth_cmd_badauth(struct IAuth *iauth, int argc, char *argv[]);
+
+static const struct IAuthCmd iauth_cmdtab[] = {
+  { "DoneAuth", iauth_cmd_doneauth },
+  { "BadAuth", iauth_cmd_badauth },
+  { NULL, NULL }
+};
 
 struct IAuth *iauth_connect(char *host, unsigned short port, char *passwd, time_t reconnect, time_t timeout)
 {
@@ -688,9 +694,3 @@ static void iauth_cmd_badauth(struct IAuth *iauth, int argc, char *argv[])
   iauth_dispose_request(iauth, iar);
   exit_client(client, client, &me, reason);
 }
-
-static const struct IAuthCmd iauth_cmdtab[] = {
-  { "DoneAuth", iauth_cmd_doneauth },
-  { "BadAuth", iauth_cmd_badauth },
-  { NULL, NULL }
-};
index 423710fde1d28d1f36db558730033c52db2d2a8c..a5d3650697ce681c60f39a042c009bb2ac74f5f9 100644 (file)
@@ -116,9 +116,9 @@ unsigned long l;
   else
    MD5Name(MD5Update)(&ctx, (unsigned const char *)key+j, 1);
 
- /* Now make the output string */
-// strcpy(passwd, magic);
-// strncat(passwd, sp, sl);
+ /* Now make the output string
+ strcpy(passwd, magic);
+ strncat(passwd, sp, sl); */
  strncpy(passwd, sp, sl);
  strcat(passwd, "$");
 
index dac3b3e0652bb42e1fa55847705192296aee79f3..699a2d899d90343d7a187aba1900dcf2640e4bd8 100644 (file)
@@ -278,7 +278,7 @@ irc_ns_name_uncompress(const unsigned char *msg, const unsigned char *eom,
 
   if ((n = irc_ns_name_unpack(msg, eom, src, tmp, sizeof tmp)) == -1)
     return(-1);
-  if (irc_ns_name_ntop(tmp, dst, dstsiz) == -1)
+  if (irc_ns_name_ntop((char*)tmp, (char*)dst, dstsiz) == -1)
     return(-1);
   return(n);
 }
@@ -398,7 +398,7 @@ irc_ns_name_ntop(const char *src, char *dst, size_t dstsiz)
                        }
                        *dn++ = '.';
                }
-               if ((l = labellen(cp - 1)) < 0) {
+               if ((l = labellen((const unsigned char*)(cp - 1))) < 0) {
                        errno = EMSGSIZE; /* XXX */
                        return(-1);
                }
@@ -958,7 +958,7 @@ irc_encode_bitsring(const char **bp, const char *end, unsigned char **labelp,
   if (!isxdigit((*cp) & 0xff)) /* reject '\[x/BLEN]' */
     return(EINVAL);
 
-  for (tp = *dst + 1; cp < end && tp < eom; cp++) {
+  for (tp = (char*)(*dst + 1); cp < end && tp < eom; cp++) {
     switch((c = *cp)) {
     case ']': /* end of the bitstring */
       if (afterslash) {
@@ -1035,7 +1035,7 @@ irc_encode_bitsring(const char **bp, const char *end, unsigned char **labelp,
   **dst = blen;
 
   *bp = cp;
-  *dst = tp;
+  *dst = (unsigned char*)tp;
 
   return(0);
 }