# HG changeset patch # User Mikael Berthe # Date 1269293368 -3600 # Node ID d7cced6660a711269bc3a9abf373d401e417011f # Parent e28cfd1d30845bde5a9704ec1be2727d627bcc5b [lastmsg] Do not use ‘for’ loop initial declarations (C99) diff -r e28cfd1d3084 -r d7cced6660a7 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);