[lastmsg] Do not use ‘for’ loop initial declarations (C99)
authorMikael Berthe <mikael@lilotux.net>
Mon, 22 Mar 2010 22:29:28 +0100
changeset 15 d7cced6660a7
parent 14 e28cfd1d3084
child 16 c447081cb5b7
[lastmsg] Do not use ‘for’ loop initial declarations (C99)
lastmsg/lastmsg.c
--- a/lastmsg/lastmsg.c	Mon Mar 22 22:24:23 2010 +0100
+++ b/lastmsg/lastmsg.c	Mon Mar 22 22:29:28 2010 +0100
@@ -55,12 +55,14 @@
 
 static void do_lastmsg(char *args)
 {
+  GSList *li;
+
   if (!lastmsg_list) {
     scr_log_print(LPRINT_NORMAL, "You have no new message.");
     return;
   }
 
-  for (GSList *li = lastmsg_list; li ; li = g_slist_next(li)) {
+  for (li = lastmsg_list; li ; li = g_slist_next(li)) {
     struct lastm_T *lastm_item = li->data;
     scr_LogPrint(LPRINT_NORMAL, "In <#%s>, \"%s\" said:\n%s",
                  lastm_item->mucname, lastm_item->nickname,
@@ -155,12 +157,14 @@
 /* Uninitialization */
 static void lastmsg_uninit(void)
 {
+  GSList *li;
+
   /* Unregister command */
   cmd_del("lastmsg");
   hk_del_handler(HOOK_POST_MESSAGE_IN, last_message_hid);
   hk_del_handler(HOOK_MY_STATUS_CHANGE, last_status_hid);
 
-  for (GSList *li = lastmsg_list; li ; li = g_slist_next(li)) {
+  for (li = lastmsg_list; li ; li = g_slist_next(li)) {
     struct lastm_T *lastm_item = li->data;
     g_free(lastm_item->mucname);
     g_free(lastm_item->nickname);