[ircd-ratbox] [PATCH] ircd-ratbox 2.1.2: gcc 4.1 20050515

Ralf S. Engelschall rse at engelschall.com
Tue May 17 12:58:53 EDT 2005


The following patch against IRCd-Ratbox 2.1.2 fixes various static vs.
extern conflicts and few signed vs. unsigned conflicts as found by the
latest GCC 4.1 snapshot as of 20050515 under -Wall.

Index: modules/m_links.c
--- modules/m_links.c.orig	2005-05-17 18:21:45 +0200
+++ modules/m_links.c	2005-05-17 18:24:13 +0200
@@ -54,7 +54,6 @@
 	{ NULL, NULL }
 };

-static dlink_list links_cache_list;
 DECLARE_MODULE_AV1(links, NULL, NULL, links_clist, links_hlist, NULL, "$Revision: 1.70 $");

 static void send_links_cache(struct Client *source_p);
Index: src/client.c
--- src/client.c.orig	2005-05-17 18:26:36 +0200
+++ src/client.c	2005-05-17 18:26:40 +0200
@@ -98,7 +98,7 @@
   	char notice[REASONLEN];
 };

-static dlink_list abort_list;
+dlink_list abort_list;


 /*
Index: src/hash.c
--- src/hash.c.orig	2005-05-17 18:21:46 +0200
+++ src/hash.c	2005-05-17 18:37:33 +0200
@@ -166,7 +166,7 @@
 static u_int32_t
 hash_nick(const char *name)
 {
-	return fnv_hash_upper(name, U_MAX_BITS);
+	return fnv_hash_upper((const unsigned char *)name, U_MAX_BITS);
 }

 /* hash_id()
@@ -176,7 +176,7 @@
 static u_int32_t
 hash_id(const char *name)
 {
-	return fnv_hash(name, U_MAX_BITS);
+	return fnv_hash((const unsigned char *)name, U_MAX_BITS);
 }

 /* hash_channel()
@@ -186,7 +186,7 @@
 static u_int32_t
 hash_channel(const char *name)
 {
-	return fnv_hash_upper_len(name, CH_MAX_BITS, 30);
+	return fnv_hash_upper_len((const unsigned char *)name, CH_MAX_BITS, 30);
 }

 /* hash_hostname()
@@ -197,7 +197,7 @@
 static u_int32_t
 hash_hostname(const char *name)
 {
-	return fnv_hash_upper_len(name, HOST_MAX_BITS, 30);
+	return fnv_hash_upper_len((const unsigned char *)name, HOST_MAX_BITS, 30);
 }

 /* hash_resv()
@@ -207,7 +207,7 @@
 static u_int32_t
 hash_resv(const char *name)
 {
-	return fnv_hash_upper_len(name, R_MAX_BITS, 30);
+	return fnv_hash_upper_len((const unsigned char *)name, R_MAX_BITS, 30);
 }

 static unsigned int
Index: src/monitor.c
--- src/monitor.c.orig	2005-05-17 18:21:47 +0200
+++ src/monitor.c	2005-05-17 18:38:43 +0200
@@ -56,7 +56,7 @@
 static inline unsigned int
 hash_monitor_nick(const char *name)
 {
-	return fnv_hash_upper(name, MONITOR_HASH_BITS);
+	return fnv_hash_upper((const unsigned char *)name, MONITOR_HASH_BITS);
 }

 struct monitor *
Index: src/newconf.c
--- src/newconf.c.orig	2005-05-17 18:22:04 +0200
+++ src/newconf.c	2005-05-17 18:40:17 +0200
@@ -33,11 +33,11 @@
 #define CF_TYPE(x) ((x) & CF_MTYPE)

 struct TopConf *conf_cur_block;
-static char *conf_cur_block_name;
+char *conf_cur_block_name;

-static dlink_list conf_items;
+dlink_list conf_items;

-static struct ConfItem *yy_aconf = NULL;
+struct ConfItem *yy_aconf = NULL;

 static struct Class *yy_class = NULL;

Index: src/whowas.c
--- src/whowas.c.orig	2005-05-17 18:21:48 +0200
+++ src/whowas.c	2005-05-17 18:41:10 +0200
@@ -54,7 +54,7 @@
 unsigned int
 hash_whowas_name(const char *name)
 {
-	return fnv_hash_upper(name, WW_MAX_BITS);
+	return fnv_hash_upper((const unsigned char *)name, WW_MAX_BITS);
 }

 void

                                       Ralf S. Engelschall
                                       rse at engelschall.com
                                       www.engelschall.com



More information about the ircd-ratbox mailing list