[ekg2-commit] r3844 - in trunk: ekg plugins/autoresponder plugins/feed plugins/gg plugins/gpg plugins/httprc_xajax plugins/irc plugins/jabber plugins/logs plugins/mail plugins/ncurses plugins/oss plugins/rc plugins/readline plugins/rot13 plugins/sms: trunk/ekg/audio.c trunk/ekg/commands.c trunk/ekg/dynstuff.c trunk/ekg/dynstuff.h trunk/ekg/emoticons.c trunk/ekg/events.c trunk/ekg/log.c trunk/ekg/metacontacts.c trunk/ekg/msgqueue.c trunk/ekg/plugins.c trunk/ekg/plugins.h trunk/ekg/protocol.c trunk/ekg/scripts.c trunk/ekg/scripts.h trunk/ekg/sessions.c trunk/ekg/stuff.c trunk/ekg/themes.c trunk/ekg/userlist.c trunk/ekg/vars.c trunk/ekg/windows.c trunk/plugins/autoresponder/autoresponder.c trunk/plugins/feed/nntp.c trunk/plugins/feed/rss.c trunk/plugins/gg/commands.c trunk/plugins/gg/images.c trunk/plugins/gg/pubdir.c trunk/plugins/gg/pubdir50.c trunk/plugins/gpg/gpg.c trunk/plugins/httprc_xajax/httprc_xajax.c trunk/plugins/irc/irc.c trunk/plugins/irc/misc.c trunk/plugins/irc/people.c trunk/plugins/jabber/commands.c trunk/plugins/jabber/jabber_handlers.c trunk/plugins/jabber/jabber_handlers_iq_result.c trunk/plugins/logs/main.c trunk/plugins/mail/main.c trunk/plugins/ncurses/bindings.c trunk/plugins/ncurses/contacts.c trunk/plugins/oss/oss.c trunk/plugins/rc/main.c trunk/plugins/readline/ui-readline.c trunk/plugins/rot13/rot13.c trunk/plugins/sms/sms.c

SVN commit svn w toxygen.net
Śro, 5 Mar 2008, 00:28:41 CET


Author: darkjames
Date: 2008-03-05 00:28:40 +0100 (Wed, 05 Mar 2008)
New Revision: 3844

Modified:
   trunk/ekg/audio.c
   trunk/ekg/commands.c
   trunk/ekg/dynstuff.c
   trunk/ekg/dynstuff.h
   trunk/ekg/emoticons.c
   trunk/ekg/events.c
   trunk/ekg/log.c
   trunk/ekg/metacontacts.c
   trunk/ekg/msgqueue.c
   trunk/ekg/plugins.c
   trunk/ekg/plugins.h
   trunk/ekg/protocol.c
   trunk/ekg/scripts.c
   trunk/ekg/scripts.h
   trunk/ekg/sessions.c
   trunk/ekg/stuff.c
   trunk/ekg/themes.c
   trunk/ekg/userlist.c
   trunk/ekg/vars.c
   trunk/ekg/windows.c
   trunk/plugins/autoresponder/autoresponder.c
   trunk/plugins/feed/nntp.c
   trunk/plugins/feed/rss.c
   trunk/plugins/gg/commands.c
   trunk/plugins/gg/images.c
   trunk/plugins/gg/pubdir.c
   trunk/plugins/gg/pubdir50.c
   trunk/plugins/gpg/gpg.c
   trunk/plugins/httprc_xajax/httprc_xajax.c
   trunk/plugins/irc/irc.c
   trunk/plugins/irc/misc.c
   trunk/plugins/irc/people.c
   trunk/plugins/jabber/commands.c
   trunk/plugins/jabber/jabber_handlers.c
   trunk/plugins/jabber/jabber_handlers_iq_result.c
   trunk/plugins/logs/main.c
   trunk/plugins/mail/main.c
   trunk/plugins/ncurses/bindings.c
   trunk/plugins/ncurses/contacts.c
   trunk/plugins/oss/oss.c
   trunk/plugins/rc/main.c
   trunk/plugins/readline/ui-readline.c
   trunk/plugins/rot13/rot13.c
   trunk/plugins/sms/sms.c
Log:
- remove alloc_size from list_add_*
it was almost always 0.

where it wasn't:
 - use xmemdup() [I'll try to remove as much as I can, and use proper method.]
 - use xstrdup() for strings.
 - use proper method xmalloc(sizeof(struct)) filling struct, and passing it.

- fix memleak in sms plugin.



Modified: trunk/ekg/audio.c
===================================================================
--- trunk/ekg/audio.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/ekg/audio.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -226,7 +226,7 @@
 int codec_register(codec_t *codec) {
 	if (!codec)			return -1;
 	if (codec_find(codec->name))	return -2;
-	list_add(&audio_codecs, codec, 0);
+	list_add(&audio_codecs, codec);
 	return 0;
 }
 
@@ -297,7 +297,7 @@
 	if (!audio)			return -1;
 	if (audio_find(audio->name))	return -2;
 
-	list_add(&audio_inputs, audio, 0);
+	list_add(&audio_inputs, audio);
 	return 0;
 }
 
@@ -688,7 +688,7 @@
 	s->codec	= co;
 	s->output	= out;
 
-	list_add(&streams, s, 0);
+	list_add(&streams, s);
 
 	watch_add(NULL, in->fd, WATCH_READ, stream_handle, s);
 /* allocate buffers */

Modified: trunk/ekg/commands.c
===================================================================
--- trunk/ekg/commands.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/ekg/commands.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -2904,7 +2904,7 @@
 				need_args = __need;
 		}
 
-		list_add(&m, tmp->data, (xstrlen(tmp->data) + 1)*sizeof(char));
+		list_add(&m, xstrdup(tmp->data));
 	}
 	
 	for (tmp = m; tmp; tmp = tmp->next) {
@@ -3593,7 +3593,7 @@
 			return -1;
 		}
 
-		list_add(&c->recipients, (void*) xstrdup(uid), 0);
+		list_add(&c->recipients, (void*) xstrdup(uid));
 
 		printq("conferences_joined", format_user(session, uid), params[1]);
 
@@ -4187,10 +4187,10 @@
 			/* then we need to find place where to add it.. */
 			for (; *commands_lock && (command_add_compare((*commands_lock)->data, c) < 0); commands_lock = &((*commands_lock)->next));
 		} else		commands_lock = &((*commands_lock)->next);	/* otherwise if we have list... move to next */
-		list_add_beginning(commands_lock, c, 0);	/* add to commands */
+		list_add_beginning(commands_lock, c);		/* add to commands */
 		return c;
 	}
-	return LIST_ADD_SORTED(&commands, c, 0, command_add_compare);
+	return LIST_ADD_SORTED(&commands, c, command_add_compare);
 }
 
 static LIST_FREE_ITEM(list_command_free, command_t *) {

Modified: trunk/ekg/dynstuff.c
===================================================================
--- trunk/ekg/dynstuff.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/ekg/dynstuff.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -40,7 +40,7 @@
  *
  * zwraca wskaźnik zaalokowanego elementu lub NULL w przpadku błędu.
  */
-void *list_add_sorted(list_t *list, void *data, int alloc_size, int (*comparision)(void *, void *))
+void *list_add_sorted(list_t *list, void *data, int (*comparision)(void *, void *))
 {
 	list_t new, tmp;
 
@@ -55,11 +55,6 @@
 	new->next = NULL;
 	/*new->prev = NULL;*/
 
-	if (alloc_size) {
-		new->data = xmalloc(alloc_size);
-		memcpy(new->data, data, alloc_size);
-	}
-
 	if (!(tmp = *list)) {
 		*list = new;
 	} else {
@@ -100,7 +95,7 @@
  * @sa list_remove()
  */
 
-void *list_add_beginning(list_t *list, void *data, int alloc_size) {
+void *list_add_beginning(list_t *list, void *data) {
 
 	list_t new;
 
@@ -113,10 +108,7 @@
 	new->next = *list;
 	*list	  = new;
 
-	if (alloc_size) {	/* xmemdup() ? */
-		new->data = xmalloc(alloc_size);
-		memcpy(new->data, data, alloc_size);
-	} else	new->data = data;
+	new->data = data;
 
 	return new->data;
 
@@ -134,9 +126,9 @@
  * @sa list_add_sorted()
  */
 
-void *list_add(list_t *list, void *data, int alloc_size)
+void *list_add(list_t *list, void *data)
 {
-	return list_add_sorted(list, data, alloc_size, NULL);
+	return list_add_sorted(list, data, NULL);
 }
 
 /**
@@ -289,7 +281,7 @@
 
 		l = l->next;
 
-		list_add_sorted(&tmplist, cur->data, 0, comparision);
+		list_add_sorted(&tmplist, cur->data, comparision);
 
 		xfree(cur);
 	}

Modified: trunk/ekg/dynstuff.h
===================================================================
--- trunk/ekg/dynstuff.h	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/ekg/dynstuff.h	2008-03-04 23:28:40 UTC (rev 3844)
@@ -52,7 +52,7 @@
 
 #ifndef EKG2_WIN32_NOFUNCTION
 #define LIST_ADD_COMPARE(x, type)			int x(const type data1, const type data2)
-#define LIST_ADD_SORTED(list, data, alloc_size, comp)	list_add_sorted(list, data, alloc_size, (void *) comp)
+#define LIST_ADD_SORTED(list, data, comp)		list_add_sorted(list, data, (void *) comp)
 
 #define LIST_RESORT(list, comp)				list_resort(list, (void *) comp)
 
@@ -61,9 +61,9 @@
 
 #define LIST_DESTROY(list, func)			list_destroy2(list, (void *) func)
 
-void *list_add(list_t *list, void *data, int alloc_size);
-void *list_add_beginning(list_t *list, void *data, int alloc_size);
-void *list_add_sorted(list_t *list, void *data, int alloc_size, int (*comparision)(void *, void *));
+void *list_add(list_t *list, void *data);
+void *list_add_beginning(list_t *list, void *data);
+void *list_add_sorted(list_t *list, void *data, int (*comparision)(void *, void *));
 
 int list_count(list_t list);
 void *list_get_nth(list_t list, int id);

Modified: trunk/ekg/emoticons.c
===================================================================
--- trunk/ekg/emoticons.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/ekg/emoticons.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -67,7 +67,7 @@
 	e->name = xstrdup(name);
 	e->value = xstrdup(value);
 
-	return (list_add_beginning(&emoticons, e, 0) ? 0 : -1);
+	return (list_add_beginning(&emoticons, e) ? 0 : -1);
 }
 
 /*

Modified: trunk/ekg/events.c
===================================================================
--- trunk/ekg/events.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/ekg/events.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -181,7 +181,7 @@
 	ev->prio 	= prio;
 	ev->target 	= xstrdup(target);
 	ev->action 	= xstrdup(action);
-	LIST_ADD_SORTED(&events, ev, 0, event_add_compare);
+	LIST_ADD_SORTED(&events, ev, event_add_compare);
 
 	tmp = xstrdup(name);
 	query_emit_id(NULL, EVENT_ADDED, &tmp);

Modified: trunk/ekg/log.c
===================================================================
--- trunk/ekg/log.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/ekg/log.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -102,7 +102,7 @@
 	ll->sent_time = st;
 	ll->message = xstrdup(msg);
 	
-	list_add(&lasts, ll, 0);
+	list_add(&lasts, ll);
 }
 
 /*

Modified: trunk/ekg/metacontacts.c
===================================================================
--- trunk/ekg/metacontacts.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/ekg/metacontacts.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -246,7 +246,7 @@
 	m = xmalloc(sizeof(metacontact_t));
 	m->name = xstrdup(name);
 
-	return LIST_ADD_SORTED(&metacontacts, m, 0, metacontact_add_compare);
+	return LIST_ADD_SORTED(&metacontacts, m, metacontact_add_compare);
 }
 
 /*
@@ -326,7 +326,7 @@
 	i->s_uid	= xstrdup(s->uid);
 	i->prio		= prio;
 
-	LIST_ADD_SORTED(&m->metacontact_items, i, 0, metacontact_add_item_compare);
+	LIST_ADD_SORTED(&m->metacontact_items, i, metacontact_add_item_compare);
 
 	return 1;
 }

Modified: trunk/ekg/msgqueue.c
===================================================================
--- trunk/ekg/msgqueue.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/ekg/msgqueue.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -62,7 +62,7 @@
 	m->seq 		= xstrdup(seq);
 	m->time 	= time(NULL);
 
-	return (list_add(&msg_queue, m, 0) ? 0 : -1);
+	return (list_add(&msg_queue, m) ? 0 : -1);
 }
 
 static LIST_FREE_ITEM(list_msg_queue_free, msg_queue_t *) {
@@ -341,7 +341,7 @@
 
 		m.message = string_free(msg, 0);
 
-		list_add(&msg_queue, &m, sizeof(m));
+		list_add(&msg_queue, xmemdup(&m, sizeof(m)));
 
 		fclose(f);
 		unlink(fn);

Modified: trunk/ekg/plugins.c
===================================================================
--- trunk/ekg/plugins.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/ekg/plugins.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -486,7 +486,7 @@
 		p->prio = prio;
 	}
 
-	LIST_ADD_SORTED(&plugins, p, 0, plugin_register_compare);
+	LIST_ADD_SORTED(&plugins, p, plugin_register_compare);
 
 	return 0;
 }
@@ -681,7 +681,7 @@
 	a->id 	= queries_count++;
 	a->name	= xstrdup(name);
 
-	list_add(&queries_external, a, 0);
+	list_add(&queries_external, a);
 
 	return a->id;
 }
@@ -748,7 +748,7 @@
 	q->handler	= handler;
 	q->data		= data;
 
-	return list_add(&queries[id >= QUERY_EXTERNAL ? QUERY_EXTERNAL : id], q, 0);
+	return list_add(&queries[id >= QUERY_EXTERNAL ? QUERY_EXTERNAL : id], q);
 }
 
 #define ID_AND_QUERY_EXTERNAL	\
@@ -1167,7 +1167,7 @@
 	w->handler = handler;
 	w->data    = data;
 
-	list_add_beginning(&watches, w, 0);
+	list_add_beginning(&watches, w);
 
 	return w;
 }
@@ -1220,7 +1220,7 @@
 			
 	} else {
 		/* add idler again [at end] */
-		list_add(&idles, i, 0);
+		list_add(&idles, i);
 	}
 }
 
@@ -1231,7 +1231,7 @@
 	i->data		= data;
 
 	/* XXX, prios? */
-	list_add_beginning(&idles, i, 0);		/* first item */
+	list_add_beginning(&idles, i);		/* first item */
 
 	return i;
 }

Modified: trunk/ekg/plugins.h
===================================================================
--- trunk/ekg/plugins.h	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/ekg/plugins.h	2008-03-04 23:28:40 UTC (rev 3844)
@@ -26,7 +26,7 @@
 #include "dynstuff.h"
 #include "sessions.h"
 
-#define EKG_ABI_VER 3836
+#define EKG_ABI_VER 3843
 
 #define EXPORT __attribute__ ((visibility("default")))
 

Modified: trunk/ekg/protocol.c
===================================================================
--- trunk/ekg/protocol.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/ekg/protocol.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -797,7 +797,7 @@
                                 list_remove(&autofinds, autofinds->data, 1);
                         }
 
-                        list_add(&autofinds, (void *) xstrdup(uid), 0);
+                        list_add(&autofinds, (void *) xstrdup(uid));
 
                         command_exec_format(target, session_class, 0, ("/find %s"), uid);
                 }
@@ -934,7 +934,7 @@
 	d->started = time(NULL);
 	d->id = id;
 
-	list_add(&dccs, d, 0);
+	list_add(&dccs, d);
 
 	return d;
 }

Modified: trunk/ekg/scripts.c
===================================================================
--- trunk/ekg/scripts.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/ekg/scripts.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -69,7 +69,7 @@
 
 int scriptlang_register(scriptlang_t *s)
 {
-	list_add(&scriptlang, s, 0);
+	list_add(&scriptlang, s);
 
 	s->init();
 	
@@ -401,7 +401,7 @@
 		scr->lang = slang;
 		scr->inited = 1;
 		
-		list_add(&scripts, scr, 0); /* BUG: this should be before `script_loaded`...  */
+		list_add(&scripts, scr); /* BUG: this should be before `script_loaded`...  */
 
 		ret = slang->script_load(scr);
 

Modified: trunk/ekg/scripts.h
===================================================================
--- trunk/ekg/scripts.h	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/ekg/scripts.h	2008-03-04 23:28:40 UTC (rev 3844)
@@ -213,7 +213,7 @@
 		xfree(temp);\
 		return NULL;\
 	}\
-	list_add(&y, temp, 0);\
+	list_add(&y, temp);\
 	return temp;
 
 /* HANDLERS */

Modified: trunk/ekg/sessions.c
===================================================================
--- trunk/ekg/sessions.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/ekg/sessions.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -161,7 +161,7 @@
 	s->lock_fd	= -1;
 #endif
 	
-	LIST_ADD_SORTED(&sessions, s, 0, session_compare);
+	LIST_ADD_SORTED(&sessions, s, session_compare);
 
 	/* XXX, wywalic sprawdzanie czy juz jest sesja? w koncu jak dodajemy sesje.. to moze chcemy sie od razu na nia przelaczyc? */
 	if (!window_current->session && (window_current->id == 0 || window_current->id == 1)) {
@@ -707,7 +707,7 @@
 	v->key = xstrdup(key);
 	v->value = xstrdup(value);
 
-	return (list_add_beginning(&s->local_vars, v, 0) != NULL) ? 0 : -1;
+	return (list_add_beginning(&s->local_vars, v) != NULL) ? 0 : -1;
 
 notify:
 	if (pa && pa->notify)

Modified: trunk/ekg/stuff.c
===================================================================
--- trunk/ekg/stuff.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/ekg/stuff.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -279,7 +279,7 @@
 			} else {
 				list_t l;
 
-				list_add(&j->commands, cmd, xstrlen(cmd) + 1);
+				list_add(&j->commands, xstrdup(cmd));
 				
 				/* przy wielu komendach trudno dopełniać, bo wg. której? */
 				for (l = commands; l; l = l->next) {
@@ -314,8 +314,8 @@
 	a = xmalloc(sizeof(struct alias));
 	a->name = xstrdup(string);
 	a->commands = NULL;
-	list_add(&(a->commands), cmd, (xstrlen(cmd) + 1) * sizeof(char));
-	list_add(&aliases, a, 0);
+	list_add(&(a->commands), xstrdup(cmd));
+	list_add(&aliases, a);
 
 	array = (params) ? array_join(params, (" ")) : xstrdup(("?"));
 	command_add(NULL, a->name, array, cmd_alias_exec, COMMAND_ISALIAS, NULL);
@@ -508,7 +508,7 @@
 	b->target = xstrdup(target);
 	b->line = xstrdup(line);
 
-	list_add(type, b, 0);		/* return x ? 0 : -1 -> list_add() can't fail if type is ok */
+	list_add(type, b);		/* return x ? 0 : -1 -> list_add() can't fail if type is ok */
 	return 0;			/* so always return success here */
 }
 
@@ -562,7 +562,7 @@
 	b->target	= xstrdup(target);
 	b->line		= xstrdup(sep+1);
 
-	list_add(type, b, 0);		/* return x ? 0 : -1 -> list_add() can't fail if type is ok */
+	list_add(type, b);		/* return x ? 0 : -1 -> list_add() can't fail if type is ok */
 	return 0;			/* so always return success here */
 }
 
@@ -761,7 +761,7 @@
 	c->session	= xstrdup(s->uid);
 	c->name		= xstrdup(name);
 	
-	return list_add(&newconferences, c, 0);
+	return list_add(&newconferences, c);
 }
 
 void newconference_destroy(newconference_t *conf, int kill_wnd) {
@@ -893,7 +893,7 @@
 		uid = get_uid(session, *p);
 
 		if (uid)
-			list_add(&(c.recipients), xstrdup(uid), 0);
+			list_add(&(c.recipients), xstrdup(uid));
 		i++;
 	}
 
@@ -912,7 +912,7 @@
 
 	tabnick_add(name);
 
-	return list_add(&conferences, &c, sizeof(c));
+	return list_add(&conferences, xmemdup(&c, sizeof(c)));
 }
 
 /*
@@ -1063,7 +1063,7 @@
 			int comma = 0;
 
 			if (xstrcasecmp(from, s->uid) && !conference_participant(c, from)) {
-				list_add(&c->recipients, &from, sizeof(from));
+				list_add(&c->recipients, xmemdup(&from, sizeof(from)));
 
 				comma++;
 				string_append(new, format_user(s, from));
@@ -1071,7 +1071,7 @@
 
 			for (i = 0; i < count; i++) {
 				if (xstrcasecmp(recipients[i], s->uid) && !conference_participant(c, recipients[i])) {
-					list_add(&c->recipients, &recipients[i], sizeof(recipients[0]));
+					list_add(&c->recipients, xmemdup(&recipients[i], sizeof(recipients[0])));
 			
 					if (comma++)
 						string_append(new, ", ");
@@ -1451,7 +1451,7 @@
 	c->handler	= handler;
 	c->private	= private;
 	
-	list_add(&children, c, 0);
+	list_add(&children, c);
 	return c;
 }
 
@@ -1931,7 +1931,7 @@
 	t->data = data;
 	t->plugin = plugin;
 
-	list_add(&timers, t, 0);
+	list_add(&timers, t);
 	return t;
 }
 
@@ -3066,7 +3066,7 @@
 				c->is_utf = 2;
 			else if (!xstrcasecmp(c->from, "UTF-8"))
 				c->is_utf = 1;
-			list_add(&ekg_converters, c, 0);
+			list_add(&ekg_converters, c);
 		}
 
 		return cd;

Modified: trunk/ekg/themes.c
===================================================================
--- trunk/ekg/themes.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/ekg/themes.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -933,7 +933,7 @@
 	f->name_hash	= hash;
 	f->value	= xstrdup(value);
 
-	list_add_beginning(&(formats[hash & 0xff]), f, 0);
+	list_add_beginning(&(formats[hash & 0xff]), f);
 	return;
 }
 

Modified: trunk/ekg/userlist.c
===================================================================
--- trunk/ekg/userlist.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/ekg/userlist.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -163,7 +163,7 @@
 		NULL;
 	
 	array_free_count(entry, count);
-	LIST_ADD_SORTED(&(session->userlist), u, 0, userlist_compare);
+	LIST_ADD_SORTED(&(session->userlist), u, userlist_compare);
 }
 
 /**
@@ -434,7 +434,7 @@
 	r->prio		= prio;				/* resource prio */
 	r->status	= EKG_STATUS_NA;		/* this is quite stupid but we must be legal with ekg2 ABI ? */
 
-	LIST_ADD_SORTED(&(u->resources), r, 0, userlist_resource_compare);	/* add to list sorted by prio && than by name */
+	LIST_ADD_SORTED(&(u->resources), r, userlist_resource_compare);	/* add to list sorted by prio && than by name */
 	return r;
 }
 
@@ -525,7 +525,7 @@
         u->nickname = xstrdup(nickname);
         u->status = EKG_STATUS_NA;
 
-        return LIST_ADD_SORTED(userlist, u, 0, userlist_compare);
+        return LIST_ADD_SORTED(userlist, u, userlist_compare);
 }
 
 /*
@@ -596,7 +596,7 @@
 		return -1;
 	if (list_remove(&(session->userlist), u, 0))
 		return -1;
-	if (!LIST_ADD_SORTED(&(session->userlist), u, 0, userlist_compare))
+	if (!LIST_ADD_SORTED(&(session->userlist), u, userlist_compare))
 		return -1;
 
 	return 0;
@@ -1092,7 +1092,7 @@
 	g = xmalloc(sizeof(struct ekg_group));
 	g->name = xstrdup(group);
 
-	LIST_ADD_SORTED(&u->groups, g, 0, group_compare);
+	LIST_ADD_SORTED(&u->groups, g, group_compare);
 
 	return 0;
 }
@@ -1177,7 +1177,7 @@
 		struct ekg_group *g = xmalloc(sizeof(struct ekg_group));
 
 		g->name = groups[i];
-		LIST_ADD_SORTED(&l, g, 0, group_compare);
+		LIST_ADD_SORTED(&l, g, group_compare);
 	}
 	/* NOTE: we don't call here array_free() cause we use items of this
 	 * 	array @ initing groups. We don't use strdup()

Modified: trunk/ekg/vars.c
===================================================================
--- trunk/ekg/vars.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/ekg/vars.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -335,11 +335,11 @@
 		if (*variables_lock == variables) {
 			for (; *variables_lock && (variable_add_compare((*variables_lock)->data, v) < 0); variables_lock = &((*variables_lock)->next));
 		} else		variables_lock = &((*variables_lock)->next);
-		list_add_beginning(variables_lock, v, 0);
+		list_add_beginning(variables_lock, v);
 		return v;
 	}
 
-	return LIST_ADD_SORTED(&variables, v, 0, variable_add_compare);
+	return LIST_ADD_SORTED(&variables, v, variable_add_compare);
 }
 
 /*

Modified: trunk/ekg/windows.c
===================================================================
--- trunk/ekg/windows.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/ekg/windows.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -336,7 +336,7 @@
 	w->session = session;
 /*	w->userlist = NULL; */		/* xmalloc memset() to 0 memory */
 
-	LIST_ADD_SORTED(&windows, w, 0, window_new_compare);
+	LIST_ADD_SORTED(&windows, w, window_new_compare);
 
 	query_emit_id(NULL, UI_WINDOW_NEW, &w);	/* XXX */
 
@@ -548,8 +548,8 @@
         list_remove(&windows, w2, 0);
 	w2->id = first;
 
-	LIST_ADD_SORTED(&windows, w1, 0, window_new_compare);
-	LIST_ADD_SORTED(&windows, w2, 0, window_new_compare);
+	LIST_ADD_SORTED(&windows, w1, window_new_compare);
+	LIST_ADD_SORTED(&windows, w2, window_new_compare);
 }
 
 /**

Modified: trunk/plugins/autoresponder/autoresponder.c
===================================================================
--- trunk/plugins/autoresponder/autoresponder.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/autoresponder/autoresponder.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -86,7 +86,7 @@
 
 	if (matchoccured) {
 		/* we've got the answer, hail the user! */
-		list_add(&autoresponder_allowed_uids, uid, xstrlen(uid)+1);
+		list_add(&autoresponder_allowed_uids, xstrdup(uid));
 		if (config_autoresponder_greeting && (*config_autoresponder_greeting))
 			command_exec_format(NULL, s, 1, "/msg %s %s", uid, config_autoresponder_greeting);
 	} else {

Modified: trunk/plugins/feed/nntp.c
===================================================================
--- trunk/plugins/feed/nntp.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/feed/nntp.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -107,7 +107,7 @@
 	article->header	= string_init(NULL);
 	article->body	= string_init(NULL);
 
-	list_add(&group->articles, article, 0);
+	list_add(&group->articles, article);
 	return article;
 }
 
@@ -129,7 +129,7 @@
 	newsgroup->uid	= saprintf("nntp:%s", name);
 	newsgroup->name = xstrdup(name);
 
-	list_add(&(j->newsgroups), newsgroup, 0);
+	list_add(&(j->newsgroups), newsgroup);
 	return newsgroup;
 }
 

Modified: trunk/plugins/feed/rss.c
===================================================================
--- trunk/plugins/feed/rss.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/feed/rss.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -198,7 +198,7 @@
 	item->other_tags= string_init(NULL);
 	item->new	= 1;
 	
-	list_add(&(c->rss_items), item, 0);
+	list_add(&(c->rss_items), item);
 	return item;
 }
 
@@ -237,7 +237,7 @@
 
 	channel->new	= 1;
 
-	list_add(&(f->rss_channels), channel, 0);
+	list_add(&(f->rss_channels), channel);
 	return channel;
 }
 
@@ -301,7 +301,7 @@
 
 	debug_white("[rss] proto: %d url: %s port: %d url: %s file: %s\n", feed->proto, feed->url, feed->port, feed->url, feed->file);
 
-	list_add(&(feeds), feed, 0);
+	list_add(&(feeds), feed);
 	return feed;
 }
 

Modified: trunk/plugins/gg/commands.c
===================================================================
--- trunk/plugins/gg/commands.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/gg/commands.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -1783,7 +1783,7 @@
         c.uid = c_timer->uid;
         c.session = session;
 
-	list_add(&gg_currently_checked, &c, sizeof(c));
+	list_add(&gg_currently_checked, xmemdup(&c, sizeof(c)));
 
 	/* if there is no reply after 15 secs user is not connected */
 	timer_add(&gg_plugin, NULL, 15, 0, gg_checked_timer_handler, c_timer);

Modified: trunk/plugins/gg/images.c
===================================================================
--- trunk/plugins/gg/images.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/gg/images.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -143,7 +143,7 @@
 	i->size = size;
 	i->crc32 = crc32; 
 
-	return list_add(&images, i, 0);
+	return list_add(&images, i);
 }
 
 void image_remove_queue(image_t *i)

Modified: trunk/plugins/gg/pubdir.c
===================================================================
--- trunk/plugins/gg/pubdir.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/gg/pubdir.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -150,7 +150,7 @@
 	w = watch_add(&gg_plugin, h->fd, h->check, gg_handle_register, h); 
 	watch_timeout_set(w, h->timeout);
 
-	list_add(&gg_registers, h, 0);
+	list_add(&gg_registers, h);
 
 	gg_register_email = xstrdup(params[0]);
 	gg_register_password = passwd_b;
@@ -237,7 +237,7 @@
 	w = watch_add(&gg_plugin, h->fd, h->check, gg_handle_unregister, h); 
 	watch_timeout_set(w, h->timeout);
 
-	list_add(&gg_unregisters, h, 0);
+	list_add(&gg_unregisters, h);
 
 	return 0;
 }
@@ -394,7 +394,7 @@
 	w = watch_add(&gg_plugin, h->fd, h->check, gg_handle_passwd, h); 
 	watch_timeout_set(w, h->timeout);
 
-	list_add(&g->passwds, h, 0);
+	list_add(&g->passwds, h);
 
 	xfree(newpasswd);
 	xfree(oldpasswd);
@@ -510,7 +510,7 @@
 	w = watch_add(&gg_plugin, h->fd, h->check, gg_handle_remind, h); 
 	watch_timeout_set(w, h->timeout);
 
-	list_add(&gg_reminds, h, 0);
+	list_add(&gg_reminds, h);
 
 	return 0;
 }

Modified: trunk/plugins/gg/pubdir50.c
===================================================================
--- trunk/plugins/gg/pubdir50.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/gg/pubdir50.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -182,7 +182,7 @@
 	}
 
 	if (all)
-		list_add(&g->searches, req, 0);
+		list_add(&g->searches, req);
 	else
 		gg_pubdir50_free(req);
 

Modified: trunk/plugins/gpg/gpg.c
===================================================================
--- trunk/plugins/gpg/gpg.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/gpg/gpg.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -72,7 +72,7 @@
 	a->keyid 	= xstrdup(keyid);
 	a->keynotok	= -1;
 	
-	list_add(&gpg_keydb, a, 0);
+	list_add(&gpg_keydb, a);
 
 	return a;
 }

Modified: trunk/plugins/httprc_xajax/httprc_xajax.c
===================================================================
--- trunk/plugins/httprc_xajax/httprc_xajax.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/httprc_xajax/httprc_xajax.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -587,7 +587,7 @@
 			client->cookie = generate_cookie();
 			client->httpver = ver;
 			client->fd	= fd;		/* XXX -1 ? */
-			list_add(&clients, client, 0);
+			list_add(&clients, client);
 			debug("Adding client %s!\n", client->cookie);
 		}
 		/* reszta, e.g POST */

Modified: trunk/plugins/irc/irc.c
===================================================================
--- trunk/plugins/irc/irc.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/irc/irc.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -592,7 +592,7 @@
 		listelem->address  = xstrdup(p[1]);
 		listelem->port     = (resolv->isbind ? 0 : -1);
 		listelem->family   = atoi(p[2]);
-		list_add_sorted((resolv->plist), listelem, 0, &irc_resolver_sort);
+		list_add_sorted((resolv->plist), listelem, &irc_resolver_sort);
 
 		debug("%s (%s %s) %x %x\n", p[0], p[1], p[2], resolv->plist, listelem); 
 		array_free(p);

Modified: trunk/plugins/irc/misc.c
===================================================================
--- trunk/plugins/irc/misc.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/irc/misc.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -876,7 +876,7 @@
 						*tlist = NULL;
 					}
 					/*debug("[IRC_LIST] Add to list (id=%d; co=%s) 0x%x\n", mode_act, IOK2(4), tlist);*/
-					list_add(tlist, xstrdup(IOK2(4)) , 0);
+					list_add(tlist, xstrdup(IOK2(4)));
 				}
 			default:
 				if (param[5] && *param[5] == ':') {
@@ -1126,7 +1126,7 @@
 			e->msg		= xstrdup(coloured);
 			e->t 		= time(NULL);
 
-			list_add(&(j->awaylog), e, 0);
+			list_add(&(j->awaylog), e);
 
 		}
 

Modified: trunk/plugins/irc/people.c
===================================================================
--- trunk/plugins/irc/people.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/irc/people.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -176,12 +176,12 @@
 		person = xmalloc(sizeof(people_t));
 		person->nick = xstrdup(ircnick);
 		/* K&Rv2 5.4 */
-		list_add(&(j->people), person, 0);
+		list_add(&(j->people), person);
 	}
 	/* add entry in private->channels->onchan if nick's not yet there */
 	if (!(peronchan = irc_find_person(chan->onchan, nick)))  {
 	/*	debug("+do kanału, "); */
-		list_add(&(chan->onchan), person, 0);
+		list_add(&(chan->onchan), person);
 	}
 	xfree(ircnick);
 
@@ -194,7 +194,7 @@
 		pch_tmp->mode = mode;
 		pch_tmp->chanp = chan;
 		irc_nick_prefix(j, pch_tmp, irccol);
-		list_add(&(person->channels), pch_tmp, 0);
+		list_add(&(person->channels), pch_tmp);
 	/*	debug(" %08X\n", person->channels); */
 	} //else { pch_tmp->mode = mode; }
 
@@ -459,7 +459,7 @@
 		debug("[irc] add_channel() WINDOW %08X\n", win);
 		if (session_int_get(s, "auto_channel_sync") != 0)
 			irc_sync_channel(s, j, p);
-		list_add(&(j->channels), p, 0);
+		list_add(&(j->channels), p);
 		return p;
 	}
 	return NULL;

Modified: trunk/plugins/jabber/commands.c
===================================================================
--- trunk/plugins/jabber/commands.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/jabber/commands.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -1316,7 +1316,7 @@
  				allowlist->type	 = xstrdup(type);
  				allowlist->allow = 1;
  				allowlist->order += order;
- 				LIST_ADD_SORTED(&j->privacy, allowlist, 0, jabber_privacy_add_compare);
+ 				LIST_ADD_SORTED(&j->privacy, allowlist, jabber_privacy_add_compare);
  			} 
   
  			if (denylist && !denylist->value) {
@@ -1324,7 +1324,7 @@
  				denylist->type	= xstrdup(type);
  /*				denylist->allow = 0; */
  				denylist->order += order;
- 				LIST_ADD_SORTED(&j->privacy, denylist, 0, jabber_privacy_add_compare);
+ 				LIST_ADD_SORTED(&j->privacy, denylist, jabber_privacy_add_compare);
  			} 
  		}
  		needsync = 1;
@@ -1458,7 +1458,7 @@
 							if (jabber_attr(splitted, "autojoin") && atoi(jabber_attr(splitted, "autojoin")))	book->private.conf->autojoin = 1;
 /*							else											book->private.conf->autojoin = 0; */
 						} else bookmark_sync = -1;
-						if (book) list_add(&(j->bookmarks), book, 0);
+						if (book) list_add(&(j->bookmarks), book);
 					}
 					break;
 				case (2):		/* modify item XXX */

Modified: trunk/plugins/jabber/jabber_handlers.c
===================================================================
--- trunk/plugins/jabber/jabber_handlers.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/jabber/jabber_handlers.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -1745,7 +1745,7 @@
 	tmp = jabber_iq_find_handler(jabber_iq_error_handlers, type, xmlns);
 	st->error = tmp ? tmp->handler : jabber_handle_iq_error_generic;
 
-	list_add_beginning(&(j->iq_stanzas), st, 0);
+	list_add_beginning(&(j->iq_stanzas), st);
 
 	return id;
 }

Modified: trunk/plugins/jabber/jabber_handlers_iq_result.c
===================================================================
--- trunk/plugins/jabber/jabber_handlers_iq_result.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/jabber/jabber_handlers_iq_result.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -217,7 +217,7 @@
 							if (presenceout)item->items |= PRIVACY_LIST_PRESENCE_OUT;
 							item->order = atoi(jabber_attr(temp->atts, "order"));
 
-							LIST_ADD_SORTED(lista, item, 0, jabber_privacy_add_compare);
+							LIST_ADD_SORTED(lista, item, jabber_privacy_add_compare);
 						}
 
 						print("jabber_privacy_item", session_name(s), j->server, 
@@ -342,7 +342,7 @@
 
 				} else { debug_error("[JABBER:IQ:PRIVATE:BOOKMARK UNKNOWNITEM=%s\n", child->name); xfree(book); book = NULL; }
 
-				if (book) list_add(&j->bookmarks, book, 0);
+				if (book) list_add(&j->bookmarks, book);
 			}
 		} else {
 			/* DISPLAY IT ? w jakim formacie?
@@ -992,7 +992,7 @@
 				streamhost.jid	= saprintf("%s/%s", s->uid+5, j->resource);
 				streamhost.ip	= xstrdup(jabber_dcc_ip);
 				streamhost.port	= jabber_dcc_port;
-				list_add(&(b->streamlist), &streamhost, sizeof(struct jabber_streamhost_item));
+				list_add(&(b->streamlist), xmemdup(&streamhost, sizeof(struct jabber_streamhost_item)));
 			}
 
 			/* 	... other, proxy, etc, etc..

Modified: trunk/plugins/logs/main.c
===================================================================
--- trunk/plugins/logs/main.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/logs/main.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -319,7 +319,7 @@
 					prepare_timestamp_format(IRSSI_LOG_EKG2_OPENED, t),
 					0, LOG_IRSSI_INFO);
 		} 
-		list_add(&log_logs, ll, 0);
+		list_add(&log_logs, ll);
 	}
 	return ll;
 }

Modified: trunk/plugins/mail/main.c
===================================================================
--- trunk/plugins/mail/main.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/mail/main.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -448,7 +448,7 @@
 			foo.fname = f[i];
 			foo.check = 1;
 
-			list_add(&mail_folders, &foo, sizeof(foo));
+			list_add(&mail_folders, xmemdup(&foo, sizeof(foo)));
 		}
 
 		xfree(f);
@@ -470,7 +470,7 @@
 		foo.fname = inbox;
 		foo.check = 1;
 
-		list_add(&mail_folders, &foo, sizeof(foo));
+		list_add(&mail_folders, xmemdup(&foo, sizeof(foo)));
 	} else {
 		if (config_check_mail & 2) {
 			char *inbox = saprintf("%s/Maildir", home_dir);
@@ -479,7 +479,7 @@
 			foo.fname = inbox;
 			foo.check = 1;
 
-			list_add(&mail_folders, &foo, sizeof(foo));
+			list_add(&mail_folders, xmemdup(&foo, sizeof(foo)));
 		}
 	}
 #endif

Modified: trunk/plugins/ncurses/bindings.c
===================================================================
--- trunk/plugins/ncurses/bindings.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/ncurses/bindings.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -796,14 +796,14 @@
 		if (!xstrcasecmp(key + 4, ("Enter"))) {
 			b->key = xstrdup(("Alt-Enter"));
 			if (add)
-				ncurses_binding_map_meta[13] = list_add(&bindings, b, sizeof(struct binding));
+				ncurses_binding_map_meta[13] = list_add(&bindings, xmemdup(b, sizeof(struct binding)));
 			return 0;
 		}
 
 		if (!xstrcasecmp(key + 4, ("Backspace"))) {
 			b->key = xstrdup(("Alt-Backspace"));
 			if (add) {
-				ncurses_binding_map_meta[KEY_BACKSPACE] = list_add(&bindings, b, sizeof(struct binding));
+				ncurses_binding_map_meta[KEY_BACKSPACE] = list_add(&bindings, xmemdup(b, sizeof(struct binding)));
 				ncurses_binding_map_meta[127] = ncurses_binding_map_meta[KEY_BACKSPACE];
 			}
 			return 0;
@@ -817,7 +817,7 @@
 		b->key = saprintf(("Alt-%c"), ch);
 
 		if (add) {
-			ncurses_binding_map_meta[ch] = list_add(&bindings, b, sizeof(struct binding));
+			ncurses_binding_map_meta[ch] = list_add(&bindings, xmemdup(b, sizeof(struct binding)));
 			if (xisalpha(ch))
 				ncurses_binding_map_meta[xtolower(ch)] = ncurses_binding_map_meta[ch];
 		}
@@ -834,7 +834,7 @@
         if (!xstrcasecmp(key + 5, (x))) { \
                 b->key = xstrdup(key); \
                 if (add) { \
-                        ncurses_binding_map[y] = list_add(&bindings, b, sizeof(struct binding)); \
+                        ncurses_binding_map[y] = list_add(&bindings, xmemdup(b, sizeof(struct binding))); \
                         if (z) \
                                 ncurses_binding_map[z] = ncurses_binding_map[y]; \
                 } \
@@ -856,7 +856,7 @@
 
 		if (add) {
                         if (xisalpha(ch))
-				ncurses_binding_map[ch - 64] = list_add(&bindings, b, sizeof(struct binding));
+				ncurses_binding_map[ch - 64] = list_add(&bindings, xmemdup(b, sizeof(struct binding)));
 			else
 				return -1;
 		}
@@ -873,7 +873,7 @@
 		b->key = saprintf(("F%d"), f);
 		
 		if (add)
-			ncurses_binding_map[KEY_F(f)] = list_add(&bindings, b, sizeof(struct binding));
+			ncurses_binding_map[KEY_F(f)] = list_add(&bindings, xmemdup(b, sizeof(struct binding)));
 		
 		return 0;
 	}
@@ -882,7 +882,7 @@
 	if (!xstrcasecmp(key, (x))) { \
 		b->key = xstrdup((x)); \
 		if (add) { \
-			ncurses_binding_map[y] = list_add(&bindings, b, sizeof(struct binding)); \
+			ncurses_binding_map[y] = list_add(&bindings, xmemdup(b, sizeof(struct binding))); \
 			if (z) \
 				ncurses_binding_map[z] = ncurses_binding_map[y]; \
 		} \
@@ -963,7 +963,7 @@
 
 	b->sequence = joined;
 	b->binding = binding_orginal;
-	list_add(&bindings_added, b, 0);
+	list_add(&bindings_added, b);
 end:
 	if (!in_autoexec)
 		config_changed = 1;

Modified: trunk/plugins/ncurses/contacts.c
===================================================================
--- trunk/plugins/ncurses/contacts.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/ncurses/contacts.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -240,7 +240,7 @@
 			for (lp = s->userlist; lp; lp = lp->next) {
 				userlist_t *u = lp->data;
 
-				list_add_sorted(&sorted_all, userlist_dup(u, u->uid, u->nickname, s), 0, comp);
+				list_add_sorted(&sorted_all, userlist_dup(u, u->uid, u->nickname, s), comp);
 			}
 
 			comp = contacts_compare;		/* turn on sorting */
@@ -249,7 +249,7 @@
 		for (l = c ? c->participants : window_current->userlist; l; l = l->next) {
 			userlist_t *u = l->data;
 
-			list_add_sorted(&sorted_all, userlist_dup(u, u->uid, u->nickname, w->session), 0, comp);
+			list_add_sorted(&sorted_all, userlist_dup(u, u->uid, u->nickname, w->session), comp);
 		}
 
 		if (sorted_all) comp = contacts_compare;	/* like above */
@@ -300,7 +300,7 @@
 			if (!(u = userlist_find_n(i->s_uid, i->name)))
 				continue;
 
-			list_add_sorted(&sorted_all, userlist_dup(u, NULL, m->name, (void *) 2), 0, comp);
+			list_add_sorted(&sorted_all, userlist_dup(u, NULL, m->name, (void *) 2), comp);
 		}
 	}
 

Modified: trunk/plugins/oss/oss.c
===================================================================
--- trunk/plugins/oss/oss.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/oss/oss.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -166,7 +166,7 @@
 	}
 //	dev->bufsize = 3200;
 
-	list_add(&oss_devices, dev, 0);
+	list_add(&oss_devices, dev);
 	return dev;
 }
 

Modified: trunk/plugins/rc/main.c
===================================================================
--- trunk/plugins/rc/main.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/rc/main.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -98,7 +98,7 @@
 	rn->fd		= cfd;
 	rn->path	= saprintf("%sc", r->path);	/* maybe ip:port of client or smth? */
 	rn->type	= (r->type == RC_INPUT_TCP) ? RC_INPUT_TCP_CLIENT : RC_INPUT_UNIX_CLIENT;
-	list_add(&rc_inputs, rn, 0);
+	list_add(&rc_inputs, rn);
 	watch_add_line(&rc_plugin, cfd, WATCH_READ_LINE, rc_input_handler_line, rn);
 	return 0;
 }
@@ -245,7 +245,7 @@
 			r->path	= xstrdup(paths[i]);
 			r->type	= type;
 			
-			list_add(&rc_inputs, r, 0);
+			list_add(&rc_inputs, r);
 
 			watch_add(&rc_plugin, rfd, 
 				((void *) rc_input_handler != (void *) rc_input_handler_line) ? WATCH_READ : WATCH_READ_LINE, 

Modified: trunk/plugins/readline/ui-readline.c
===================================================================
--- trunk/plugins/readline/ui-readline.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/readline/ui-readline.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -639,17 +639,18 @@
 	}
 
 	if (command) {
-		struct binding s;
+		struct binding *s;
+
+		s = xmalloc(sizeof(struct binding));
 		
-		s.key = nice_seq;
-		s.action = xstrdup(command);
-		s.internal = 0;
-		s.arg = s.default_action = s.default_arg = NULL;
+		s->key = nice_seq;
+		s->action = xstrdup(command);
+		s->internal = 0;
 
-		list_add(&bindings, &s, sizeof(s));
+		list_add(&bindings, s);
 
 		if (!quiet) {
-			print("bind_seq_add", s.key);
+			print("bind_seq_add", s->key);
 			config_changed = 1;
 		}
 	} else {

Modified: trunk/plugins/rot13/rot13.c
===================================================================
--- trunk/plugins/rot13/rot13.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/rot13/rot13.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -196,7 +196,7 @@
 			return -1;
 		}
 
-		list_add_sorted(&keys, rot13_key_parse(target, sesja, offset, offset2), 0, rot13_key_compare);
+		list_add_sorted(&keys, rot13_key_parse(target, sesja, offset, offset2), rot13_key_compare);
 
 		xfree(arr);
 		return 0;
@@ -230,7 +230,7 @@
 			char **arr = array_make(tmp, " ", 0, 1, 1);
 			
 			if (arr[0] && arr[1] && arr[2] && arr[3] && !arr[4]) {
-				list_add(&keys, rot13_key_parse(arr[0], arr[1], arr[2], arr[3]), 0);
+				list_add(&keys, rot13_key_parse(arr[0], arr[1], arr[2], arr[3]));
 
 				xfree(arr);
 			} else {

Modified: trunk/plugins/sms/sms.c
===================================================================
--- trunk/plugins/sms/sms.c	2008-03-04 20:52:12 UTC (rev 3843)
+++ trunk/plugins/sms/sms.c	2008-03-04 23:28:40 UTC (rev 3844)
@@ -135,15 +135,12 @@
  */
 static void sms_away_add(const char *uid)
 {
-        sms_away_t sa;
+	sms_away_t *sa;
         list_t l;
 
         if (!config_sms_away_limit)
                 return;
 
-        sa.uid = xstrdup(uid);
-        sa.count = 1;
-
         for (l = sms_away; l; l = l->next) {
                 sms_away_t *s = l->data;
 
@@ -153,7 +150,11 @@
                 }
         }
 
-        list_add(&sms_away, &sa, sizeof(sa));
+	sa = xmalloc(sizeof(sms_away_t));
+	sa->uid = xstrdup(uid);
+	sa->count = 1;
+
+	list_add(&sms_away, sa);
 }
 
 /*



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