1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

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
This commit is contained in:
Timo Sirainen 2000-11-23 21:40:07 +00:00 committed by cras
parent 8fb2249f07
commit 8ce36c05ea
30 changed files with 80 additions and 72 deletions

View File

@ -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 */

View File

@ -11,7 +11,7 @@ typedef struct {
char *botmasks;
char *autosendcmd;
int autojoin:1;
unsigned int autojoin:1;
GHashTable *module_data;
} CHANNEL_SETUP_REC;

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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)

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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 */

View File

@ -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;

View File

@ -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;

View File

@ -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 */

View File

@ -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;

View File

@ -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);

View File

@ -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));

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 =

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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");

View File

@ -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 */

View File

@ -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 */

View File

@ -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)

View File

@ -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);

View File

@ -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);

View File

@ -3,7 +3,7 @@
#include <XSUB.h>
#undef _
#include "common.h"
#include "../module.h"
#include "network.h"
#include "commands.h"
#include "log.h"