diff --git a/include/h.h b/include/h.h index 7d5da2fbe..6e1cf431e 100644 --- a/include/h.h +++ b/include/h.h @@ -37,7 +37,7 @@ extern char *getreply(int); extern MODVAR Member *freemember; extern MODVAR Membership *freemembership; extern MODVAR Client me; -extern MODVAR Channel *channel; +extern MODVAR Channel *channels; extern MODVAR ModData local_variable_moddata[MODDATA_MAX_LOCAL_VARIABLE]; extern MODVAR ModData global_variable_moddata[MODDATA_MAX_GLOBAL_VARIABLE]; extern MODVAR IRCStatistics ircstats; diff --git a/src/api-channelmode.c b/src/api-channelmode.c index bfff0c585..310ac86fb 100644 --- a/src/api-channelmode.c +++ b/src/api-channelmode.c @@ -277,7 +277,7 @@ static void unload_extcmode_commit(Cmode *cmode) if (cmode->paracount == 0) { /* Paramless mode, easy */ - for (chptr = channel; chptr; chptr = chptr->nextch) + for (chptr = channels; chptr; chptr = chptr->nextch) { if (chptr->mode.extmode && cmode->mode) { @@ -298,7 +298,7 @@ static void unload_extcmode_commit(Cmode *cmode) } else { /* Parameter mode, more complicated */ - for (chptr = channel; chptr; chptr = chptr->nextch) + for (chptr = channels; chptr; chptr = chptr->nextch) { if (chptr->mode.extmode && cmode->mode) { diff --git a/src/api-moddata.c b/src/api-moddata.c index 3919bb3e7..d4555ccc6 100644 --- a/src/api-moddata.c +++ b/src/api-moddata.c @@ -208,7 +208,7 @@ void unload_moddata_commit(ModDataInfo *md) case MODDATATYPE_CHANNEL: { Channel *chptr; - for (chptr = channel; chptr; chptr=chptr->nextch) + for (chptr = channels; chptr; chptr=chptr->nextch) { if (md->free && moddata_channel(chptr, md).ptr) md->free(&moddata_channel(chptr, md)); @@ -220,7 +220,7 @@ void unload_moddata_commit(ModDataInfo *md) { Channel *chptr; Member *m; - for (chptr = channel; chptr; chptr=chptr->nextch) + for (chptr = channels; chptr; chptr=chptr->nextch) { for (m = chptr->members; m; m = m->next) { diff --git a/src/channel.c b/src/channel.c index 8d45440e4..9de668044 100644 --- a/src/channel.c +++ b/src/channel.c @@ -26,7 +26,7 @@ long opermode = 0; long sajoinmode = 0; -Channel *channel = NULL; +Channel *channels = NULL; /* some buffers for rebuilding channel/nick lists with comma's */ static char buf[BUFSIZE]; @@ -940,14 +940,14 @@ Channel *get_channel(Client *client, char *chname, int flag) { chptr = safe_alloc(sizeof(Channel) + len); strlcpy(chptr->chname, chname, len + 1); - if (channel) - channel->prevch = chptr; + if (channels) + channels->prevch = chptr; chptr->topic = NULL; chptr->topic_nick = NULL; chptr->prevch = NULL; - chptr->nextch = channel; + chptr->nextch = channels; chptr->creationtime = MyUser(client) ? TStime() : 0; - channel = chptr; + channels = chptr; (void)add_to_channel_hash_table(chname, chptr); irccounts.channels++; RunHook2(HOOKTYPE_CHANNEL_CREATE, client, chptr); @@ -1094,7 +1094,7 @@ int sub1_from_channel(Channel *chptr) if (chptr->prevch) chptr->prevch->nextch = chptr->nextch; else - channel = chptr->nextch; + channels = chptr->nextch; if (chptr->nextch) chptr->nextch->prevch = chptr->prevch; diff --git a/src/modules/channeldb.c b/src/modules/channeldb.c index 63eaecae1..e1f956d2f 100644 --- a/src/modules/channeldb.c +++ b/src/modules/channeldb.c @@ -211,12 +211,12 @@ int write_channeldb(void) W_SAFE(write_data(fd, &channeldb_version, sizeof(channeldb_version))); /* First, count +P channels and write the count to the database */ - for (chptr = channel; chptr; chptr=chptr->nextch) + for (chptr = channels; chptr; chptr=chptr->nextch) if (has_channel_mode(chptr, 'P')) cnt++; W_SAFE(write_int64(fd, cnt)); - for (chptr = channel; chptr; chptr=chptr->nextch) + for (chptr = channels; chptr; chptr=chptr->nextch) { /* We only care about +P (persistent) channels */ if (has_channel_mode(chptr, 'P')) diff --git a/src/modules/extbans/timedban.c b/src/modules/extbans/timedban.c index 1e1614e3e..5081c0957 100644 --- a/src/modules/extbans/timedban.c +++ b/src/modules/extbans/timedban.c @@ -392,7 +392,7 @@ EVENT(timedban_timeout) if (++current_iteration >= TIMEDBAN_TIMER_ITERATION_SPLIT) current_iteration = 0; - for (chptr = channel; chptr; chptr = chptr->nextch) + for (chptr = channels; chptr; chptr = chptr->nextch) { /* This is a very quick check, at the cost of it being * biased since there's always a tendency of more channel diff --git a/src/modules/md.c b/src/modules/md.c index b43c4048b..f5c516fb3 100644 --- a/src/modules/md.c +++ b/src/modules/md.c @@ -397,7 +397,7 @@ void _send_moddata_members(Client *srv) Channel *chptr; Client *client; - for (chptr = channel; chptr; chptr = chptr->nextch) + for (chptr = channels; chptr; chptr = chptr->nextch) { Member *m; for (m = chptr->members; m; m = m->next) diff --git a/src/modules/server.c b/src/modules/server.c index 8d9b1b360..4bd6edd5a 100644 --- a/src/modules/server.c +++ b/src/modules/server.c @@ -1056,7 +1056,7 @@ int server_sync(Client *cptr, ConfigItem_link *aconf) */ { Channel *chptr; - for (chptr = channel; chptr; chptr = chptr->nextch) + for (chptr = channels; chptr; chptr = chptr->nextch) { if (!SupportSJOIN(cptr)) send_channel_modes(cptr, chptr); diff --git a/src/modules/stats.c b/src/modules/stats.c index 605f242c9..67411ec8f 100644 --- a/src/modules/stats.c +++ b/src/modules/stats.c @@ -788,7 +788,7 @@ int stats_mem(Client *client, char *para) lcm = lc * sizeof(Client)+sizeof(LocalClient); rcm = rc * sizeof(Client); - for (chptr = channel; chptr; chptr = chptr->nextch) + for (chptr = channels; chptr; chptr = chptr->nextch) { Member *member;