From 96dfadc2e401ec75cb02f9a05fd1336c144ab628 Mon Sep 17 00:00:00 2001
From: Alexander Barton <alex@barton.de>
Date: Tue, 27 May 2008 14:49:49 +0200
Subject: [PATCH] Fix some GCC warnings detected using -Werror.

- cl2chan.c: In function 'Cl2Chan_Get':
  cl2chan.c:173: warning: unused variable 'res'

- client.c: In function 'Client_Destroy':
  lient.c:325: warning: ISO C90 forbids mixed declarations and code

- irc-channel.c: In function 'IRC_JOIN':
  irc-channel.c:241: warning: comparison between signed and unsigned
---
 src/ngircd/cl2chan.c     |    2 +-
 src/ngircd/client.c      |    7 ++++---
 src/ngircd/irc-channel.c |    3 ++-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/ngircd/cl2chan.c b/src/ngircd/cl2chan.c
index 899f089..6971955 100644
--- a/src/ngircd/cl2chan.c
+++ b/src/ngircd/cl2chan.c
@@ -169,7 +169,7 @@ CL2CHAN *
 Cl2Chan_Get( CHANNEL *Chan, CLIENT *Client )
 {
 	CL2CHAN cl2chan;
-#ifdef DEBUG
+#ifdef CL2CHAN_DEBUG
 	CL2CHAN *res;
 #endif
 	assert( Chan != NULL );
diff --git a/src/ngircd/client.c b/src/ngircd/client.c
index 65cc340..10fd178 100644
--- a/src/ngircd/client.c
+++ b/src/ngircd/client.c
@@ -246,11 +246,13 @@ Init_New_Client(CONN_ID Idx, CLIENT *Introducer, CLIENT *TopServer,
 } /* Init_New_Client */
 
 
+/**
+ * Remove/destroy client.
+ */
 GLOBAL void
 Client_Destroy( CLIENT *Client, char *LogMsg, char *FwdMsg, bool SendQuit )
 {
-	/* Client entfernen. */
-
+	CLIENT *c;
 	char msg[LINE_LEN], *txt;
 #ifdef DEBUG
 	char nickbuf[CLIENT_ID_LEN];
@@ -322,7 +324,6 @@ Client_Destroy( CLIENT *Client, char *LogMsg, char *FwdMsg, bool SendQuit )
 							Client->id, Client->conn_id, txt );
 			}
 
-			CLIENT *c;
 			hashtable_iterator_reset(&My_Clients);
 			while(( c = hashtable_iterator_getnext(&My_Clients)))
 			{
diff --git a/src/ngircd/irc-channel.c b/src/ngircd/irc-channel.c
index 1147fc4..5ab8124 100644
--- a/src/ngircd/irc-channel.c
+++ b/src/ngircd/irc-channel.c
@@ -238,7 +238,8 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
 		if (Client_Type(Client) == CLIENT_USER) {
 			/* Test if the user has reached his maximum channel count */
 
-			if ((Conf_MaxJoins > 0) && (Cl2Chan_CountForUser(Client) >= Conf_MaxJoins))
+			if (Conf_MaxJoins > 0 &&
+			    Cl2Chan_CountForUser(Client) >= (unsigned int)Conf_MaxJoins)
 				return IRC_WriteStrClient(Client, ERR_TOOMANYCHANNELS_MSG,
 							Client_ID(Client), channame);
 			if (!chan) {
-- 
1.5.5.1

