diff options
author | Timo Sirainen <cras@irssi.org> | 2000-11-23 21:40:07 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-11-23 21:40:07 +0000 |
commit | 8ce36c05eab6c1787c4e62052fb8d2ba6369cbe8 (patch) | |
tree | 52324a388e270f22cef46fb5a5fcdcc1c3d71ac8 | |
parent | 8fb2249f0742cd391796b2a07c6611a696f7681a (diff) | |
download | irssi-8ce36c05eab6c1787c4e62052fb8d2ba6369cbe8.zip |
several fixes to make irssi compile without warnings with MIPSpro
also fixed ctcp_queue_clean() - it might have crashed sometimes..
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@859 dbcabf3a-b0e7-0310-adc4-f8d773084564
30 files changed, 80 insertions, 72 deletions
diff --git a/src/core/channel-rec.h b/src/core/channel-rec.h index e0d5b858..2f7c7dec 100644 --- a/src/core/channel-rec.h +++ b/src/core/channel-rec.h @@ -7,20 +7,20 @@ char *topic_by; time_t topic_time; GHashTable *nicks; /* list of nicks */ -int no_modes:1; /* channel doesn't support modes */ +unsigned int no_modes:1; /* channel doesn't support modes */ char *mode; int limit; /* user limit */ char *key; /* password key */ -int chanop:1; /* You're a channel operator */ -int names_got:1; /* Received /NAMES list */ -int wholist:1; /* WHO list got */ -int synced:1; /* Channel synced - all queries done */ +unsigned int chanop:1; /* You're a channel operator */ +unsigned int names_got:1; /* Received /NAMES list */ +unsigned int wholist:1; /* WHO list got */ +unsigned int synced:1; /* Channel synced - all queries done */ -int joined:1; /* Have we even received JOIN event for this channel? */ -int left:1; /* You just left the channel */ -int kicked:1; /* You just got kicked */ -int destroying:1; +unsigned int joined:1; /* Have we even received JOIN event for this channel? */ +unsigned int left:1; /* You just left the channel */ +unsigned int kicked:1; /* You just got kicked */ +unsigned int destroying:1; GSList *lastmsgs; /* List of nicks who last send message */ GSList *lastownmsgs; /* List of nicks who last send message to you */ diff --git a/src/core/channels-setup.h b/src/core/channels-setup.h index e30893fe..acb24242 100644 --- a/src/core/channels-setup.h +++ b/src/core/channels-setup.h @@ -11,7 +11,7 @@ typedef struct { char *botmasks; char *autosendcmd; - int autojoin:1; + unsigned int autojoin:1; GHashTable *module_data; } CHANNEL_SETUP_REC; diff --git a/src/core/ignore.c b/src/core/ignore.c index 16005111..420e91c7 100644 --- a/src/core/ignore.c +++ b/src/core/ignore.c @@ -100,7 +100,7 @@ int ignore_check(SERVER_REC *server, const char *nick, const char *host, mask_match_address(server, rec->mask, nick, host); if (!ok) { /* nick didn't match, but maybe this is a reply to nick? */ - if (!rec->replies || channel == NULL || text == NULL || + if (!rec->replies || chanrec == NULL || text == NULL || !ignore_check_replies(rec, chanrec, text)) continue; } diff --git a/src/core/ignore.h b/src/core/ignore.h index 6c336c00..db88d9a4 100644 --- a/src/core/ignore.h +++ b/src/core/ignore.h @@ -18,11 +18,11 @@ typedef struct { int time; /* time in sec for temp ignores */ int time_tag; - int regexp:1; - int fullword:1; - int replies:1; /* ignore replies to nick in channel */ + unsigned int regexp:1; + unsigned int fullword:1; + unsigned int replies:1; /* ignore replies to nick in channel */ #ifdef HAVE_REGEX_H - int regexp_compiled:1; /* should always be TRUE, unless regexp is invalid */ + unsigned int regexp_compiled:1; /* should always be TRUE, unless regexp is invalid */ regex_t preg; #endif } IGNORE_REC; diff --git a/src/core/log.h b/src/core/log.h index e3a801c3..8d151c26 100644 --- a/src/core/log.h +++ b/src/core/log.h @@ -25,9 +25,9 @@ typedef struct { time_t last; /* when last message was written */ - int autoopen:1; /* automatically start logging at startup */ - int failed:1; /* opening log failed last time */ - int temp:1; /* don't save this to config file */ + unsigned int autoopen:1; /* automatically start logging at startup */ + unsigned int failed:1; /* opening log failed last time */ + unsigned int temp:1; /* don't save this to config file */ } LOG_REC; extern GSList *logs; diff --git a/src/core/misc.c b/src/core/misc.c index 1212c602..80b60871 100644 --- a/src/core/misc.c +++ b/src/core/misc.c @@ -37,7 +37,7 @@ static int irssi_io_invoke(GIOChannel *source, GIOCondition condition, void *data) { IRSSI_INPUT_REC *rec = data; - GInputCondition icond = 0; + GInputCondition icond = (GInputCondition)0; if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) { /* error, we have to call the function.. */ @@ -73,7 +73,7 @@ int g_input_add_full(int source, int priority, GInputCondition condition, rec->function = function; rec->data = data; - cond = G_IO_ERR|G_IO_HUP|G_IO_NVAL; + cond = (GIOCondition) (G_IO_ERR|G_IO_HUP|G_IO_NVAL); if (condition & G_INPUT_READ) cond |= G_IO_IN|G_IO_PRI; if (condition & G_INPUT_WRITE) diff --git a/src/core/modules.c b/src/core/modules.c index bcb537b1..85bbf587 100644 --- a/src/core/modules.c +++ b/src/core/modules.c @@ -251,7 +251,7 @@ GModule *module_open(const char *name) g_free(str); if (stat(path, &statbuf) == 0) { - module = g_module_open(path, 0); + module = g_module_open(path, (GModuleFlags) 0); g_free(path); return module; } @@ -260,7 +260,7 @@ GModule *module_open(const char *name) path = g_module_build_path(MODULEDIR, name); } - module = g_module_open(path, 0); + module = g_module_open(path, (GModuleFlags) 0); g_free(path); return module; } diff --git a/src/core/net-nonblock.c b/src/core/net-nonblock.c index c6342e08..b21dca08 100644 --- a/src/core/net-nonblock.c +++ b/src/core/net-nonblock.c @@ -190,7 +190,8 @@ static void simple_readpipe(SIMPLE_THREAD_REC *rec, int pipe) return; } - rec->tag = g_input_add(handle, G_INPUT_READ | G_INPUT_WRITE, + rec->tag = g_input_add(handle, + (GInputCondition) (G_INPUT_READ|G_INPUT_WRITE), (GInputFunction) simple_init, rec); } diff --git a/src/core/nicklist.h b/src/core/nicklist.h index c9015ab7..3f7a272b 100644 --- a/src/core/nicklist.h +++ b/src/core/nicklist.h @@ -13,14 +13,14 @@ typedef struct { int hops; /* status in server */ - int gone:1; - int serverop:1; + unsigned int gone:1; + unsigned int serverop:1; /* status in channel */ - int send_massjoin:1; /* Waiting to be sent in massjoin signal */ - int op:1; - int halfop:1; - int voice:1; + unsigned int send_massjoin:1; /* Waiting to be sent in massjoin signal */ + unsigned int op:1; + unsigned int halfop:1; + unsigned int voice:1; } NICK_REC; /* Add new nick to list */ diff --git a/src/core/query-rec.h b/src/core/query-rec.h index 8b587f5e..12ef491c 100644 --- a/src/core/query-rec.h +++ b/src/core/query-rec.h @@ -4,6 +4,6 @@ char *address; char *server_tag; -int unwanted:1; /* TRUE if the other side closed or - some error occured (DCC chats!) */ -int destroying:1; +unsigned int unwanted:1; /* TRUE if the other side closed or + some error occured (DCC chats!) */ +unsigned int destroying:1; diff --git a/src/core/server-connect-rec.h b/src/core/server-connect-rec.h index eea6739b..0155dd2a 100644 --- a/src/core/server-connect-rec.h +++ b/src/core/server-connect-rec.h @@ -20,7 +20,7 @@ char *username; char *realname; /* when reconnecting, the old server status */ -int reconnection:1; /* we're trying to reconnect */ +unsigned int reconnection:1; /* we're trying to reconnect */ char *channels; char *away_reason; char *usermode; diff --git a/src/core/server-rec.h b/src/core/server-rec.h index c2c24ce3..58742e70 100644 --- a/src/core/server-rec.h +++ b/src/core/server-rec.h @@ -10,8 +10,8 @@ time_t real_connect_time; /* time when server replied that we really are connect char *tag; /* tag name for addressing server */ char *nick; /* current nick */ -int connected:1; /* connected to server */ -int connection_lost:1; /* Connection lost unintentionally */ +unsigned int connected:1; /* connected to server */ +unsigned int connection_lost:1; /* Connection lost unintentionally */ void *handle; /* NET_SENDBUF_REC socket */ int readtag; /* input tag */ @@ -33,9 +33,9 @@ GHashTable *module_data; char *version; /* server version */ char *away_reason; char *last_invite; /* channel where you were last invited */ -int server_operator:1; -int usermode_away:1; -int banned:1; /* not allowed to connect to this server */ +unsigned int server_operator:1; +unsigned int usermode_away:1; +unsigned int banned:1; /* not allowed to connect to this server */ time_t lag_sent; /* 0 or time when last lag query was sent to server */ time_t lag_last_check; /* last time we checked lag */ diff --git a/src/core/server-setup-rec.h b/src/core/server-setup-rec.h index 5e6edb7f..56df6106 100644 --- a/src/core/server-setup-rec.h +++ b/src/core/server-setup-rec.h @@ -12,8 +12,8 @@ IPADDR *own_ip; /* resolved own_address if not NULL */ time_t last_connect; /* to avoid reconnecting too fast.. */ -int autoconnect:1; -int last_failed:1; /* if last connection attempt failed */ -int banned:1; /* if we're banned from this server */ +unsigned int autoconnect:1; +unsigned int last_failed:1; /* if last connection attempt failed */ +unsigned int banned:1; /* if we're banned from this server */ GHashTable *module_data; diff --git a/src/core/servers.c b/src/core/servers.c index 9ec53902..1cdee751 100644 --- a/src/core/servers.c +++ b/src/core/servers.c @@ -200,7 +200,8 @@ static void server_connect_callback_readpipe(SERVER_REC *server) server->handle = net_sendbuffer_create(handle, 0); server->connect_tag = - g_input_add(handle, G_INPUT_WRITE | G_INPUT_READ, + g_input_add(handle, + (GInputCondition) (G_INPUT_WRITE|G_INPUT_READ), (GInputFunction) server_connect_callback_init, server); signal_emit("server connecting", 2, server, &iprec.ip); diff --git a/src/core/settings.c b/src/core/settings.c index 3bfddec5..65c7b1d9 100644 --- a/src/core/settings.c +++ b/src/core/settings.c @@ -76,12 +76,12 @@ const char *settings_get_str(const char *key) return iconfig_get_str("settings", key, settings_get_default_str(key)); } -const int settings_get_int(const char *key) +int settings_get_int(const char *key) { return iconfig_get_int("settings", key, settings_get_default_int(key)); } -const int settings_get_bool(const char *key) +int settings_get_bool(const char *key) { return iconfig_get_bool("settings", key, settings_get_default_int(key)); diff --git a/src/core/settings.h b/src/core/settings.h index 8409f607..b399846d 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -38,8 +38,8 @@ extern CONFIG_REC *mainconfig; /* Functions for handling the "settings" node of Irssi configuration */ const char *settings_get_str(const char *key); -const int settings_get_int(const char *key); -const int settings_get_bool(const char *key); +int settings_get_int(const char *key); +int settings_get_bool(const char *key); /* Functions to add/remove settings */ void settings_add_str(const char *section, const char *key, const char *def); diff --git a/src/fe-common/core/fe-core-commands.c b/src/fe-common/core/fe-core-commands.c index c942c3dd..6b3bfc90 100644 --- a/src/fe-common/core/fe-core-commands.c +++ b/src/fe-common/core/fe-core-commands.c @@ -69,7 +69,7 @@ static int commands_compare(COMMAND_REC *rec, COMMAND_REC *rec2) static void help_category(GSList *cmdlist, gint items, gint max) { - COMMAND_REC *rec, *last; + COMMAND_REC *rec; GString *str; GSList *tmp; gint lines, cols, line, col, skip; @@ -80,8 +80,8 @@ static void help_category(GSList *cmdlist, gint items, gint max) cols = max > 65 ? 1 : (65 / max); lines = items <= cols ? 1 : items / cols+1; - last = NULL; cmdbuf = g_malloc(max+1); cmdbuf[max] = '\0'; - for (line = 0, col = 0, skip = 1, tmp = cmdlist; line < lines; last = rec, tmp = tmp->next) + cmdbuf = g_malloc(max+1); cmdbuf[max] = '\0'; + for (line = 0, col = 0, skip = 1, tmp = cmdlist; line < lines; tmp = tmp->next) { rec = tmp->data; diff --git a/src/fe-common/irc/fe-events-numeric.c b/src/fe-common/irc/fe-events-numeric.c index 7fdbdbbe..4d57d8cb 100644 --- a/src/fe-common/irc/fe-events-numeric.c +++ b/src/fe-common/irc/fe-events-numeric.c @@ -75,7 +75,7 @@ static void event_names_list(const char *data, IRC_SERVER_REC *server) static void display_sorted_nicks(CHANNEL_REC *channel, GSList *nicklist, gint items, gint max) { - NICK_REC *rec, *last; + NICK_REC *rec; GString *str; GSList *tmp; gint lines, cols, line, col, skip; @@ -88,8 +88,8 @@ static void display_sorted_nicks(CHANNEL_REC *channel, GSList *nicklist, gint it lines = items <= cols ? 1 : items/cols + 1; if (lines > items) lines = items; - last = NULL; linebuf = g_malloc(max+1); linebuf[max] = '\0'; - for (line = 0, col = 0, skip = 1, tmp = nicklist; line < lines; last = rec, tmp = tmp->next) + linebuf = g_malloc(max+1); linebuf[max] = '\0'; + for (line = 0, col = 0, skip = 1, tmp = nicklist; line < lines; tmp = tmp->next) { rec = tmp->data; diff --git a/src/fe-text/gui-windows.h b/src/fe-text/gui-windows.h index ec2d8760..23085b92 100644 --- a/src/fe-text/gui-windows.h +++ b/src/fe-text/gui-windows.h @@ -31,7 +31,7 @@ typedef struct { char *start; int indent; int color; - int continues:1; /* first word in line belong to the end of the last word in previous line */ + unsigned int continues:1; /* first word in line belong to the end of the last word in previous line */ } LINE_CACHE_SUB_REC; typedef struct { @@ -79,8 +79,8 @@ typedef struct { int bottom_subline; int empty_linecount; /* how many empty lines are in screen. a screenful when started or used /CLEAR */ - int bottom:1; /* window is at the bottom of the text buffer */ - int eol_marked:1; /* last line marked for eol */ + unsigned int bottom:1; /* window is at the bottom of the text buffer */ + unsigned int eol_marked:1; /* last line marked for eol */ /* For /LAST -new and -away */ GList *lastlog_last_check; diff --git a/src/irc/core/ctcp.c b/src/irc/core/ctcp.c index a1d1f2df..3072e2f4 100644 --- a/src/irc/core/ctcp.c +++ b/src/irc/core/ctcp.c @@ -33,7 +33,7 @@ static void ctcp_queue_clean(IRC_SERVER_REC *server) { GSList *tmp, *next; - for (tmp = server->ctcpqueue; tmp != NULL; tmp = tmp->next) { + for (tmp = server->ctcpqueue; tmp != NULL; tmp = next) { next = tmp->next; if (!server_idle_find(server, GPOINTER_TO_INT(tmp->data))) { server->ctcpqueue = diff --git a/src/irc/core/irc-channels.c b/src/irc/core/irc-channels.c index 3bc57722..063ca501 100644 --- a/src/irc/core/irc-channels.c +++ b/src/irc/core/irc-channels.c @@ -192,8 +192,10 @@ static void sig_server_looking(SERVER_REC *server) if (!IS_IRC_SERVER(server)) return; - server->channel_find_func = (void *) irc_channel_find_server; - server->channels_join = (void *) irc_channels_join; + server->channel_find_func = + (void *(*)(void *, const char *)) irc_channel_find_server; + server->channels_join = + (void (*)(void *, const char *, int)) irc_channels_join; } void irc_channels_init(void) diff --git a/src/irc/core/irc-nicklist.c b/src/irc/core/irc-nicklist.c index a107d15a..9b8de036 100644 --- a/src/irc/core/irc-nicklist.c +++ b/src/irc/core/irc-nicklist.c @@ -343,8 +343,10 @@ static const char *get_nick_flags(void) static void sig_connected(IRC_SERVER_REC *server) { - if (IS_IRC_SERVER(server)) - server->get_nick_flags = (void *) get_nick_flags; + if (IS_IRC_SERVER(server)) { + server->get_nick_flags = + (const char *(*)(void)) get_nick_flags; + } } void irc_nicklist_init(void) diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c index fc7a99ec..84b40c76 100644 --- a/src/irc/core/irc-servers.c +++ b/src/irc/core/irc-servers.c @@ -93,7 +93,8 @@ static void sig_server_looking(IRC_SERVER_REC *server) server->isnickflag = isnickflag_func; server->ischannel = ischannel_func; - server->send_message = (void *) send_message; + server->send_message = + (void (*)(void *, const char *, const char *)) send_message; } static void server_init(IRC_SERVER_REC *server) diff --git a/src/irc/core/irc.c b/src/irc/core/irc.c index 69319783..efb9a8cd 100644 --- a/src/irc/core/irc.c +++ b/src/irc/core/irc.c @@ -31,7 +31,6 @@ #include "servers-redirect.h" char *current_server_event; -static int signal_send_command; static int signal_default_event; static int signal_server_event; static int signal_server_incoming; @@ -407,7 +406,6 @@ void irc_irc_init(void) signal_add("server incoming", (SIGNAL_FUNC) irc_parse_incoming_line); current_server_event = NULL; - signal_send_command = signal_get_uniq_id("send command"); signal_default_event = signal_get_uniq_id("default event"); signal_server_event = signal_get_uniq_id("server event"); signal_server_incoming = signal_get_uniq_id("server incoming"); diff --git a/src/irc/dcc/dcc-chat.c b/src/irc/dcc/dcc-chat.c index 7a331388..f1f82647 100644 --- a/src/irc/dcc/dcc-chat.c +++ b/src/irc/dcc/dcc-chat.c @@ -251,7 +251,8 @@ static void dcc_chat_connect(DCC_REC *dcc) dcc->handle = net_connect_ip(&dcc->addr, dcc->port, source_host_ok ? source_host_ip : NULL); if (dcc->handle != -1) { - dcc->tagconn = g_input_add(dcc->handle, G_INPUT_WRITE|G_INPUT_READ, + dcc->tagconn = g_input_add(dcc->handle, + (GInputCondition) (G_INPUT_WRITE|G_INPUT_READ), (GInputFunction) sig_chat_connected, dcc); } else { /* error connecting */ diff --git a/src/irc/dcc/dcc-files.c b/src/irc/dcc/dcc-files.c index 4eb3c5f3..166734d5 100644 --- a/src/irc/dcc/dcc-files.c +++ b/src/irc/dcc/dcc-files.c @@ -198,7 +198,8 @@ static void dcc_get_connect(DCC_REC *dcc) dcc->handle = net_connect_ip(&dcc->addr, dcc->port, source_host_ok ? source_host_ip : NULL); if (dcc->handle != -1) { - dcc->tagconn = g_input_add(dcc->handle, G_INPUT_WRITE|G_INPUT_READ, + dcc->tagconn = g_input_add(dcc->handle, + (GInputCondition) (G_INPUT_WRITE|G_INPUT_READ), (GInputFunction) sig_dccget_connected, dcc); } else { /* error connecting */ diff --git a/src/lib-config/get.c b/src/lib-config/get.c index 4db6b4b7..98e2a30b 100644 --- a/src/lib-config/get.c +++ b/src/lib-config/get.c @@ -203,7 +203,8 @@ char *config_node_get_str(CONFIG_NODE *parent, const char *key, const char *def) if (parent == NULL) return (char *) def; node = config_node_find(parent, key); - return (node == NULL || !has_node_value(node)) ? def : node->value; + return (char *) ((node != NULL && has_node_value(node)) ? + node->value : def); } int config_node_get_int(CONFIG_NODE *parent, const char *key, int def) diff --git a/src/lib-config/parse.c b/src/lib-config/parse.c index 05b76975..1c468ad8 100644 --- a/src/lib-config/parse.c +++ b/src/lib-config/parse.c @@ -134,8 +134,9 @@ static void config_parse_loop(CONFIG_REC *rec, CONFIG_NODE *node, GTokenType exp static int config_parse_symbol(CONFIG_REC *rec, CONFIG_NODE *node) { CONFIG_NODE *newnode; + GTokenType last_char; int print_warning; - char *key, last_char; + char *key; g_return_val_if_fail(rec != NULL, G_TOKEN_ERROR); g_return_val_if_fail(node != NULL, G_TOKEN_ERROR); @@ -182,7 +183,7 @@ static int config_parse_symbol(CONFIG_REC *rec, CONFIG_NODE *node) return G_TOKEN_ERROR; newnode = config_node_section(node, key, NODE_TYPE_BLOCK); - config_parse_loop(rec, newnode, '}'); + config_parse_loop(rec, newnode, (GTokenType) '}'); g_free_not_null(key); config_parse_get_token(rec->scanner, node); @@ -197,7 +198,7 @@ static int config_parse_symbol(CONFIG_REC *rec, CONFIG_NODE *node) if (key == NULL) return G_TOKEN_ERROR; newnode = config_node_section(node, key, NODE_TYPE_LIST); - config_parse_loop(rec, newnode, ')'); + config_parse_loop(rec, newnode, (GTokenType) ')'); g_free_not_null(key); config_parse_get_token(rec->scanner, node); @@ -218,7 +219,7 @@ static int config_parse_symbol(CONFIG_REC *rec, CONFIG_NODE *node) static void config_parse_loop(CONFIG_REC *rec, CONFIG_NODE *node, GTokenType expect) { - int expected_token; + GTokenType expected_token; g_return_if_fail(rec != NULL); g_return_if_fail(node != NULL); diff --git a/src/perl/common/Core.xs b/src/perl/common/Core.xs index 4be39a84..4b7c7d48 100644 --- a/src/perl/common/Core.xs +++ b/src/perl/common/Core.xs @@ -122,7 +122,6 @@ command_bind(cmd, category, func) char *func CODE: char *signal; - GSList *tmp; if (*category == '\0') category = "Perl scripts' commands"; command_bind(cmd, category, NULL); diff --git a/src/perl/common/module.h b/src/perl/common/module.h index 8a3e3271..f456834a 100644 --- a/src/perl/common/module.h +++ b/src/perl/common/module.h @@ -3,7 +3,7 @@ #include <XSUB.h> #undef _ -#include "common.h" +#include "../module.h" #include "network.h" #include "commands.h" #include "log.h" |