[ekg2-commit] r4081 - in trunk: ekg plugins/irc: trunk/ekg/commands.c trunk/ekg/commands.h trunk/plugins/irc/autoacts.c trunk/plugins/irc/irc.h

SVN commit svn w toxygen.net
Śro, 9 Lip 2008, 16:58:09 CEST


Author: wiechu
Date: 2008-07-09 16:58:09 +0200 (Wed, 09 Jul 2008)
New Revision: 4081

Modified:
   trunk/ekg/commands.c
   trunk/ekg/commands.h
   trunk/plugins/irc/autoacts.c
   trunk/plugins/irc/irc.h
Log:
    code cleaninig

Modified: trunk/ekg/commands.c
===================================================================
--- trunk/ekg/commands.c	2008-07-09 14:51:44 UTC (rev 4080)
+++ trunk/ekg/commands.c	2008-07-09 14:58:09 UTC (rev 4081)
@@ -162,11 +162,9 @@
 		send_nicks_count--;
 	}
 
-	for (i = send_nicks_count; i > 0; i--)
-		send_nicks[i] = send_nicks[i - 1];
+	memmove(send_nicks[1], send_nicks[0], send_nicks_count * sizeof(send_nicks[0]) );
 
-	if (send_nicks_count != SEND_NICKS_MAX)
-		send_nicks_count++;
+	send_nicks_count++;
 	
 	send_nicks[0] = xstrdup(nick);
 }
@@ -200,7 +198,7 @@
  *
  * czyści listę nicków dopełnianych tabem.
  */
-void tabnick_flush()
+static void tabnick_flush()
 {
 	int i;
 
@@ -632,7 +630,7 @@
 	return 0;
 }
 
-void cmd_exec_child_handler(child_t *c, int pid, const char *name, int status, void *priv)
+static void cmd_exec_child_handler(child_t *c, int pid, const char *name, int status, void *priv)
 {
 	int quiet = (name && name[0] == '^');
 
@@ -1215,7 +1213,7 @@
 
 static COMMAND(cmd_ignore)
 {
-	const char *uid;
+	char *uid;
 
 	if (*name == 'i' || *name == 'I') {
 		int flags, modified = 0;
@@ -1281,7 +1279,6 @@
 
 	} else {
 		int unignore_all = ((params[0] && !xstrcmp(params[0], "*")) ? 1 : 0);
-		int level;
 
 		if (!params[0]) {
 			printq("not_enough_params", name);
@@ -1308,8 +1305,6 @@
 				if (!ignored_remove(session, u->uid))
 					x = 1;
 
-				level = ignored_check(session, u->uid);
-
 				ul = next;
 			}
 
@@ -1324,8 +1319,6 @@
 			return 0;
 		}
 
-		level = ignored_check(session, uid);
-		
 		if (!ignored_remove(session, uid)) {
 			printq("ignored_deleted", format_user(session, params[0]));
 			config_changed = 1;
@@ -1345,7 +1338,7 @@
 	char **argv = NULL, *show_group = NULL;
 	const char *tmp;
 	metacontact_t *m = NULL;
-	char *params0 = params[0];
+	const char *params0 = params[0];
 
         if (!params0 && window_current->target) { 
 		params0 = window_current->target;
@@ -4149,16 +4142,12 @@
 {
 	command_t *c;
 
-	for (c = commands; c;) {
-		command_t *next = c->next;
-
+	for (c = commands; c; c = c->next) {
 		if (!xstrcasecmp(name, c->name) && plugin == c->plugin) {
 			commands_remove(c);
 
 			return 0;
 		}
-
-		c = next;
 	}
 
 	return -1;

Modified: trunk/ekg/commands.h
===================================================================
--- trunk/ekg/commands.h	2008-07-09 14:51:44 UTC (rev 4080)
+++ trunk/ekg/commands.h	2008-07-09 14:58:09 UTC (rev 4081)
@@ -104,7 +104,6 @@
 #ifndef EKG2_WIN32_NOFUNCTION
 void tabnick_add(const char *nick);
 void tabnick_remove(const char *nick);
-void tabnick_flush();
 
 int binding_help(int a, int b);
 int binding_quick_list(int a, int b);

Modified: trunk/plugins/irc/autoacts.c
===================================================================
--- trunk/plugins/irc/autoacts.c	2008-07-09 14:51:44 UTC (rev 4080)
+++ trunk/plugins/irc/autoacts.c	2008-07-09 14:58:09 UTC (rev 4081)
@@ -25,7 +25,6 @@
 #include "irc.h"
 #include "autoacts.h"
 
-extern plugin_t irc_plugin; 
 static TIMER(irc_autorejoin_timer);
 
 /**

Modified: trunk/plugins/irc/irc.h
===================================================================
--- trunk/plugins/irc/irc.h	2008-07-09 14:51:44 UTC (rev 4080)
+++ trunk/plugins/irc/irc.h	2008-07-09 14:58:09 UTC (rev 4081)
@@ -36,8 +36,6 @@
 /* irc_private_t->casemapping values */
 enum { IRC_CASEMAPPING_ASCII, IRC_CASEMAPPING_RFC1459, IRC_CASEMAPPING_RFC1459_STRICT, IRC_CASEMAPPING_COUNT };
 
-extern char *sopt_keys[];
-
 typedef struct _irc_private_t {
 	int fd;				/* connection's fd */
 	int connecting;			/* are we connecting _now_ ? */



Więcej informacji o liście dyskusyjnej ekg2-commit