Enabled lots of GCC warnings, fixed those that were easy to fix.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@456 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-07-10 23:00:56 +00:00 committed by cras
commit dcc2e89b2e
25 changed files with 84 additions and 106 deletions

View file

@ -27,8 +27,8 @@
#include "completion.h"
#define wordreplace_find(replace) \
iconfig_list_find("replaces", "text", replace, "replace")
#define wordreplace_find(word) \
iconfig_list_find("replaces", "text", word, "replace")
#define completion_find(completion) \
iconfig_list_find("completions", "short", completion, "long")

View file

@ -67,7 +67,8 @@ static void cmd_set(char *data)
{
GHashTable *optlist;
GSList *sets, *tmp;
char *key, *value, *last_section;
const char *last_section;
char *key, *value;
void *free_arg;
int found, clear;

View file

@ -361,14 +361,16 @@ static void cmd_format(const char *data)
"format", &optlist, &module, &key, &value))
return;
modules = get_sorted_modules();
if (*module != '\0' && theme_search(modules, module) == NULL) {
modules = get_sorted_modules();
if (*module == '\0')
module = NULL;
else if (theme_search(modules, module) == NULL) {
/* first argument isn't module.. */
cmd_params_free(free_arg);
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST | PARAM_FLAG_OPTIONS,
"format", &optlist, &key, &value))
return;
module = "";
module = NULL;
}
reset = FALSE;
@ -383,7 +385,7 @@ static void cmd_format(const char *data)
for (tmp = modules; tmp != NULL; tmp = tmp->next) {
THEME_SEARCH_REC *rec = tmp->data;
if (*module == '\0' || g_strcasecmp(rec->short_name, module) == 0)
if (module == NULL || g_strcasecmp(rec->short_name, module) == 0)
theme_show(rec, key, value, reset);
}
g_slist_foreach(modules, (GFunc) g_free, NULL);

View file

@ -67,17 +67,23 @@ static void ctcp_time_msg(const char *data, IRC_SERVER_REC *server, const char *
static void ctcp_default_reply(const char *data, IRC_SERVER_REC *server, const char *nick, const char *addr, const char *target)
{
char *ptr, *str;
const char *ctcpdata;
char *ctcp, *ptr;
g_return_if_fail(data != NULL);
str = g_strdup(data);
ptr = strchr(str, ' ');
if (ptr != NULL) *ptr++ = '\0'; else ptr = "";
ctcp = g_strdup(data);
ptr = strchr(ctcp, ' ');
if (ptr == NULL)
ctcpdata = "";
else {
*ptr = '\0';
ctcpdata = ptr+1;
}
printformat(server, ischannel(*target) ? target : nick, MSGLEVEL_CTCPS,
ischannel(*target) ? IRCTXT_CTCP_REPLY_CHANNEL : IRCTXT_CTCP_REPLY, str, nick, ptr, target);
g_free(str);
ischannel(*target) ? IRCTXT_CTCP_REPLY_CHANNEL : IRCTXT_CTCP_REPLY, ctcp, nick, ctcpdata, target);
g_free(ctcp);
}
static void ctcp_ping_reply(const char *data, IRC_SERVER_REC *server, const char *nick, const char *addr, const char *target)

View file

@ -60,7 +60,8 @@ static void print_channel_msg(IRC_SERVER_REC *server, const char *msg,
CHANNEL_REC *chanrec;
NICK_REC *nickrec;
int for_me;
char *color, *nickmode;
const char *nickmode;
char *color;
chanrec = channel_find(server, target);
for_me = irc_nick_match(server->nick, msg);

View file

@ -165,7 +165,7 @@ static void cmd_ignore(const char *data)
if (ischannel(*mask)) {
chanarg = mask;
mask = "";
mask = NULL;
}
channels = (chanarg == NULL || *chanarg == '\0') ? NULL :
g_strsplit(replace_chars(chanarg, ',', ' '), " ", -1);
@ -176,7 +176,8 @@ static void cmd_ignore(const char *data)
if (rec == NULL) {
rec = g_new0(IGNORE_REC, 1);
rec->mask = *mask == '\0' ? NULL : g_strdup(mask);
rec->mask = (mask != NULL && *mask != '\0') ?
g_strdup(mask) : NULL;
rec->channels = channels;
} else {
g_free_and_null(rec->pattern);
@ -226,10 +227,10 @@ static void cmd_unignore(const char *data)
rec = tmp == NULL ? NULL : tmp->data;
} else {
/* with mask */
char *chans[2] = { "*", NULL };
const char *chans[2] = { "*", NULL };
if (ischannel(*data)) chans[0] = (char *) data;
rec = ignore_find("*", ischannel(*data) ? NULL : data, chans);
if (ischannel(*data)) chans[0] = data;
rec = ignore_find("*", ischannel(*data) ? NULL : data, (char **) chans);
}
if (rec == NULL)

View file

@ -95,7 +95,8 @@ static void cmd_msg(gchar *data, IRC_SERVER_REC *server, WI_ITEM_REC *item)
WINDOW_REC *window;
CHANNEL_REC *channel;
NICK_REC *nickrec;
char *target, *msg, *nickmode, *freestr, *newtarget;
const char *nickmode;
char *target, *msg, *freestr, *newtarget;
void *free_arg;
int free_ret;