source cleanup: remove trailing whitespaces

This commit is contained in:
Michael Vetter 2014-09-11 19:10:33 +02:00
commit 51239925ec
44 changed files with 92 additions and 92 deletions

View file

@ -309,7 +309,7 @@ static void cmd_unban(const char *data, IRC_SERVER_REC *server, void *item)
ban = g_strdup(BAN_LAST);
command_set_ban(ban ? ban : data, server, item, FALSE, 0);
g_free(ban);
cmd_params_free(free_arg);

View file

@ -123,10 +123,10 @@ static void channel_change_topic(IRC_SERVER_REC *server, const char *channel,
{
CHANNEL_REC *chanrec;
char *recoded = NULL;
chanrec = channel_find(SERVER(server), channel);
if (chanrec == NULL) return;
/* the topic may be send out encoded, so we need to
/* the topic may be send out encoded, so we need to
recode it back or /topic <tab> will not work properly */
recoded = recode_in(SERVER(server), topic, channel);
if (topic != NULL) {
@ -137,7 +137,7 @@ static void channel_change_topic(IRC_SERVER_REC *server, const char *channel,
g_free_not_null(chanrec->topic_by);
chanrec->topic_by = g_strdup(setby);
chanrec->topic_time = settime;
signal_emit("channel topic changed", 1, chanrec);

View file

@ -84,7 +84,7 @@ static int channel_rejoin(IRC_SERVER_REC *server, const char *channel)
channel_destroy(CHANNEL(chanrec));
return 0;
}
rec = rejoin_find(server, channel);
if (rec != NULL) {
/* already exists */

View file

@ -114,7 +114,7 @@ static void irc_channels_join(IRC_SERVER_REC *server, const char *data,
use_keys = TRUE;
key = schannel->password;
} else key = NULL;
g_string_append_printf(outkeys, "%s,", get_join_key(key));
channame = channel + (channel[0] == '!' &&
channel[1] == '!');
@ -126,11 +126,11 @@ static void irc_channels_join(IRC_SERVER_REC *server, const char *data,
if (*tmpkey != NULL)
tmpkey++;
tmpstr = tmp;
tmpstr++;
cmdlen = outchans->len-1;
if (use_keys)
cmdlen += outkeys->len;
if (*tmpstr != NULL)
@ -138,8 +138,8 @@ static void irc_channels_join(IRC_SERVER_REC *server, const char *data,
strlen(*tmpstr)+1;
if (*tmpkey != NULL)
cmdlen += strlen(*tmpkey);
/* don't try to send too long lines
/* don't try to send too long lines
make sure it's not longer than 510
so 510 - strlen("JOIN ") = 505 */
if (cmdlen < 505)

View file

@ -790,7 +790,7 @@ static void cmd_knockout(const char *data, IRC_SERVER_REC *server,
bancmd = *banmasks == '\0'? NULL :
g_strdup_printf("%s %s", channel->name, banmasks);
if (settings_get_bool("kick_first_on_kickban")) {
signal_emit("command kick", 3, kickcmd, server, channel);
if (bancmd != NULL)
@ -894,7 +894,7 @@ static void cmd_accept(const char *data, IRC_SERVER_REC *server)
{
CMD_IRC_SERVER(server);
if (*data == '\0')
if (*data == '\0')
irc_send_cmd(server, "ACCEPT *");
else
irc_send_cmdv(server, "ACCEPT %s", data);
@ -905,7 +905,7 @@ static void cmd_unsilence(const char *data, IRC_SERVER_REC *server)
{
CMD_IRC_SERVER(server);
if (*data == '\0')
if (*data == '\0')
cmd_return_error(CMDERR_NOT_ENOUGH_PARAMS);
irc_send_cmdv(server, "SILENCE -%s", data);

View file

@ -195,7 +195,7 @@ static void event_end_of_names(IRC_SERVER_REC *server, const char *data)
IRC_CHANNEL_REC *chanrec;
NICK_REC *ownnick;
int nicks;
g_return_if_fail(server != NULL);
params = event_get_params(data, 2, NULL, &channel);
@ -384,7 +384,7 @@ static void event_nick_in_use(IRC_SERVER_REC *server, const char *data)
cmd = g_strdup_printf("NICK %s", server->nick);
irc_send_cmd_now(server, cmd);
g_free(cmd);
g_free(cmd);
}
static void event_target_unavailable(IRC_SERVER_REC *server, const char *data)

View file

@ -71,7 +71,7 @@ static void sig_connected(IRC_SERVER_REC *server)
return;
if (server->connrec->away_reason != NULL)
irc_server_send_away(server, server->connrec->away_reason);
irc_server_send_away(server, server->connrec->away_reason);
}
static void event_nick_collision(IRC_SERVER_REC *server, const char *data)

View file

@ -753,7 +753,7 @@ static void event_isupport(IRC_SERVER_REC *server, const char *data)
char **item, *sptr, *eptr;
char **isupport;
gpointer key, value;
g_return_if_fail(server != NULL);
server->isupport_sent = TRUE;

View file

@ -69,7 +69,7 @@ static void sig_session_save_server(IRC_SERVER_REC *server, CONFIG_REC *config,
isupport = config_node_section(node, "isupport", NODE_TYPE_BLOCK);
isupport_data.config = config;
isupport_data.node = isupport;
g_hash_table_foreach(server->isupport, (GHFunc) session_isupport_foreach, &isupport_data);
}

View file

@ -78,7 +78,7 @@ void prefix_add(char prefixes[MAX_USER_PREFIXES+1], char newprefix, SERVER_REC *
if (*prefixlst == newprefix)
break; /* insert the new prefix here */
if (*prefixlst == prefixes[oldpos]) {
/* this prefix is present.
* the one we are inserting goes after it.
@ -88,7 +88,7 @@ void prefix_add(char prefixes[MAX_USER_PREFIXES+1], char newprefix, SERVER_REC *
}
prefixlst++;
}
/* newpos is now the position in which we wish to insert the prefix */
newprefixes[newpos++] = newprefix;
@ -274,7 +274,7 @@ void modes_type_b(IRC_CHANNEL_REC *channel, const char *setby, char type,
channel->key = g_strdup(arg);
}
}
mode_set_arg(channel->server, newmode, type, mode, arg, FALSE);
}
@ -285,7 +285,7 @@ void modes_type_c(IRC_CHANNEL_REC *channel, const char *setby,
if (mode == 'l') {
channel->limit = type == '-' ? 0 : atoi(arg);
}
mode_set_arg(channel->server, newmode, type, mode, arg, FALSE);
}

View file

@ -428,7 +428,7 @@ static void dcc_chat_passive(CHAT_DCC_REC *dcc)
dcc_ip2str(&own_ip, host);
irc_send_cmdv(dcc->server, "PRIVMSG %s :\001DCC CHAT CHAT %s %d %d\001",
dcc->nick, host, port, dcc->pasv_id);
}
/* SYNTAX: DCC CHAT [-passive] [<nick>] */
@ -615,7 +615,7 @@ static void ctcp_msg_dcc_chat(IRC_SERVER_REC *server, const char *data,
char **params;
int paramcount;
int passive, autoallow = FALSE;
/* CHAT <unused> <address> <port> */
/* CHAT <unused> <address> 0 <id> (DCC CHAT passive protocol) */
params = g_strsplit(data, " ", -1);
@ -656,14 +656,14 @@ static void ctcp_msg_dcc_chat(IRC_SERVER_REC *server, const char *data,
}
}
}
dcc = dcc_chat_create(server, chat, nick, params[0]);
dcc->target = g_strdup(target);
dcc->port = atoi(params[2]);
if (passive)
dcc->pasv_id = atoi(params[3]);
dcc_str2ip(params[1], &dcc->addr);
net_ip2host(&dcc->addr, dcc->addrstr);

View file

@ -454,7 +454,7 @@ static void ctcp_msg_dcc_send(IRC_SERVER_REC *server, const char *data,
g_memmove(fname, fname+1, len);
quoted = TRUE;
}
if (passive && port != 0) {
/* This is NOT a DCC SEND request! This is a reply to our
passive request. We MUST check the IDs and then connect to
@ -501,7 +501,7 @@ static void ctcp_msg_dcc_send(IRC_SERVER_REC *server, const char *data,
if (passive && port == 0)
dcc->pasv_id = p_id; /* Assign the ID to the DCC */
memcpy(&dcc->addr, &ip, sizeof(ip));
if (dcc->addr.family == AF_INET)
net_ip2host(&dcc->addr, dcc->addrstr);

View file

@ -94,7 +94,7 @@ static int dcc_ctcp_resume_parse(int type, const char *data, const char *nick,
return 0;
fileparams = get_file_params_count_resume(params, paramcount);
if (paramcount >= fileparams + 2) {
port = atoi(params[fileparams]);
*size = str_to_uofft(params[fileparams+1]);

View file

@ -194,7 +194,7 @@ static void cmd_dcc_send(const char *data, IRC_SERVER_REC *server,
cmd_param_error(CMDERR_NOT_CONNECTED);
passive = g_hash_table_lookup(optlist, "passive") != NULL;
if (g_hash_table_lookup(optlist, "rmhead") != NULL) {
queue = dcc_queue_old(nick, servertag);
if (queue != -1)
@ -217,7 +217,7 @@ static void cmd_dcc_send(const char *data, IRC_SERVER_REC *server,
if (*fileargs == '\0')
cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
dcc_send_add(servertag, chat, nick, fileargs, mode, passive);
}
@ -434,11 +434,11 @@ static int dcc_send_one_file(int queue, const char *target, const char *fname,
if (passive) {
dcc->pasv_id = rand() % 64;
}
/* send DCC request */
signal_emit("dcc request send", 1, dcc);
dcc_ip2str(&own_ip, host);
if (passive == FALSE) {
str = g_strdup_printf(dcc->file_quoted ?

View file

@ -90,9 +90,9 @@ void dcc_init_rec(DCC_REC *dcc, IRC_SERVER_REC *server, CHAT_DCC_REC *chat,
dcc->servertag = server != NULL ? g_strdup(server->tag) :
(chat == NULL ? NULL : g_strdup(chat->servertag));
dcc->pasv_id = -1; /* Not a passive DCC */
dcc_conns = g_slist_append(dcc_conns, dcc);
signal_emit("dcc created", 1, dcc);
}
@ -454,8 +454,8 @@ static int dcc_timeout_func(void)
/* Timed out - don't send DCC REJECT CTCP so CTCP
flooders won't affect us and it really doesn't
matter that much anyway if the other side doen't
get it..
get it..
We don't want dcc servers to time out. */
dcc_close(dcc);
}

View file

@ -27,7 +27,7 @@ typedef struct {
/* passive DCC */
#define dcc_is_passive(dcc) \
((dcc)->pasv_id >= 0)
extern GSList *dcc_conns;
void dcc_register_type(const char *type);

View file

@ -38,7 +38,7 @@ void autoignore_update(IGNORE_REC *rec, int level)
ignore_update_rec(rec);
}
void autoignore_add(IRC_SERVER_REC *server, char *mask, int level)
void autoignore_add(IRC_SERVER_REC *server, char *mask, int level)
{
IGNORE_REC *rec;

View file

@ -178,7 +178,7 @@ static void handle_client_cmd(CLIENT_REC *client, char *cmd, char *args,
rec->proxy_address, rec->nick, rec->listen->ircnet);
rec->want_ctcp = 0;
}
}
proxy_outdata(client, ":%s NOTICE %s :You're now receiving CTCPs sent to %s\n",
client->proxy_address, client->nick,client->listen->ircnet);
@ -421,7 +421,7 @@ static void sig_server_event(IRC_SERVER_REC *server, const char *line,
/* CTCP - either answer ourself or forward it to one client */
for (tmp = proxy_clients; tmp != NULL; tmp = tmp->next) {
CLIENT_REC *rec = tmp->data;
if (rec->want_ctcp == 1) {
/* only CTCP for the chatnet where client is connected to will be forwarded */
if (strstr(rec->proxy_address, server->connrec->chatnet) != NULL) {