Module: ngircd.git Branch: master Commit: 0659503afd8b8ea4909e4609a7ae65d20de47091 URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=06595...
Author: Alexander Barton alex@barton.de Date: Sun Jan 4 15:25:07 2009 +0100
Clean up (reformat and comment) Delete_Channel() function.
---
src/ngircd/channel.c | 27 ++++++++++++++++----------- 1 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/src/ngircd/channel.c b/src/ngircd/channel.c index 6958831..b93f223 100644 --- a/src/ngircd/channel.c +++ b/src/ngircd/channel.c @@ -1067,35 +1067,40 @@ Get_Next_Cl2Chan( CL2CHAN *Start, CLIENT *Client, CHANNEL *Channel ) } /* Get_Next_Cl2Chan */
+/** + * Remove a channel and free all of its data structures. + */ static bool -Delete_Channel( CHANNEL *Chan ) +Delete_Channel(CHANNEL *Chan) { - /* delete channel structure */ - CHANNEL *chan, *last_chan;
last_chan = NULL; chan = My_Channels; - while( chan ) - { - if( chan == Chan ) break; + while (chan) { + if (chan == Chan) + break; last_chan = chan; chan = chan->next; } - if( ! chan ) return false; + if (!chan) + return false;
- Log( LOG_DEBUG, "Freed channel structure for "%s".", Chan->name ); + Log(LOG_DEBUG, "Freed channel structure for "%s".", Chan->name);
array_free(&chan->topic); Lists_Free(&chan->list_bans); Lists_Free(&chan->list_invites);
/* maintain channel list */ - if( last_chan ) last_chan->next = chan->next; - else My_Channels = chan->next; - free( chan ); + if (last_chan) + last_chan->next = chan->next; + else + My_Channels = chan->next; + free(chan);
return true; } /* Delete_Channel */
+ /* -eof- */