forked from PsychoticNinja/irssi
Fixed some signedness warnings and memdebug.h should compile now fine
with -ansi. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1124 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
ae2bb54a42
commit
0d62878d6e
@ -36,6 +36,7 @@ libcore_a_SOURCES = \
|
||||
net-sendbuffer.c \
|
||||
network.c \
|
||||
nicklist.c \
|
||||
nickmatch-cache.c \
|
||||
pidwait.c \
|
||||
queries.c \
|
||||
rawlog.c \
|
||||
@ -81,6 +82,7 @@ noinst_HEADERS = \
|
||||
network.h \
|
||||
nick-rec.h \
|
||||
nicklist.h \
|
||||
nickmatch-cache.h \
|
||||
pidwait.h \
|
||||
queries.h \
|
||||
rawlog.h \
|
||||
|
@ -55,6 +55,9 @@ static char *last_sent_msg, *last_sent_msg_body;
|
||||
static char *last_privmsg_from, *last_public_from;
|
||||
static char *sysname, *sysrelease;
|
||||
|
||||
#define CHAR_EXPANDOS_COUNT \
|
||||
((int) (sizeof(char_expandos) / sizeof(char_expandos[0])))
|
||||
|
||||
/* Create expando - overrides any existing ones. */
|
||||
void expando_create(const char *key, EXPANDO_FUNC func, ...)
|
||||
{
|
||||
@ -207,8 +210,7 @@ void expando_unbind(const char *key, int funccount, SIGNAL_FUNC *funcs)
|
||||
|
||||
EXPANDO_FUNC expando_find_char(char chr)
|
||||
{
|
||||
g_return_val_if_fail(chr < sizeof(char_expandos) /
|
||||
sizeof(char_expandos[0]), NULL);
|
||||
g_return_val_if_fail(chr < CHAR_EXPANDOS_COUNT, NULL);
|
||||
|
||||
return char_expandos[(int) chr] == NULL ? NULL :
|
||||
char_expandos[(int) chr]->func;
|
||||
@ -533,7 +535,7 @@ void expandos_deinit(void)
|
||||
{
|
||||
int n;
|
||||
|
||||
for (n = 0; n < sizeof(char_expandos)/sizeof(char_expandos[0]); n++)
|
||||
for (n = 0; n < CHAR_EXPANDOS_COUNT; n++)
|
||||
g_free_not_null(char_expandos[n]);
|
||||
|
||||
expando_destroy("sysname", expando_sysname);
|
||||
|
@ -19,15 +19,18 @@ char *ig_dirname(const char *file, int line, const char *fname);
|
||||
|
||||
#define g_malloc(a) ig_malloc(a, __FILE__, __LINE__)
|
||||
#define g_malloc0(a) ig_malloc0(a, __FILE__, __LINE__)
|
||||
#define g_free ig_free
|
||||
#define g_realloc(a,b) ig_realloc(a, b, __FILE__, __LINE__)
|
||||
#define g_strdup(a) ig_strdup(a, __FILE__, __LINE__)
|
||||
#define g_strndup(a, b) ig_strndup(a, b, __FILE__, __LINE__)
|
||||
#define g_strconcat(a...) ig_strconcat(__FILE__, __LINE__, ##a)
|
||||
#define g_strdup_printf(a, b...) ig_strdup_printf(__FILE__, __LINE__, a, ##b)
|
||||
#define g_strdup_vprintf(a, b...) ig_strdup_vprintf(__FILE__, __LINE__, a, ##b)
|
||||
#define g_free ig_free
|
||||
#define g_string_new(a) ig_string_new(__FILE__, __LINE__, a)
|
||||
#define g_string_free(a, b) ig_string_free(__FILE__, __LINE__, a, b)
|
||||
#define g_strjoinv(a,b) ig_strjoinv(__FILE__, __LINE__, a, b)
|
||||
#define g_dirname(a) ig_dirname(__FILE__, __LINE__, a)
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
#define g_strconcat(a...) ig_strconcat(__FILE__, __LINE__, ##a)
|
||||
#define g_strdup_printf(a, b...) ig_strdup_printf(__FILE__, __LINE__, a, ##b)
|
||||
#define g_strdup_vprintf(a, b...) ig_strdup_vprintf(__FILE__, __LINE__, a, ##b)
|
||||
#endif
|
||||
#endif
|
||||
|
@ -40,7 +40,8 @@ typedef struct {
|
||||
|
||||
static int g_io_channel_write_block(GIOChannel *channel, void *data, int len)
|
||||
{
|
||||
int err, ret, sent;
|
||||
unsigned int ret;
|
||||
int err, sent;
|
||||
|
||||
sent = 0;
|
||||
do {
|
||||
@ -55,7 +56,8 @@ static int g_io_channel_write_block(GIOChannel *channel, void *data, int len)
|
||||
static int g_io_channel_read_block(GIOChannel *channel, void *data, int len)
|
||||
{
|
||||
time_t maxwait;
|
||||
int err, ret, received;
|
||||
unsigned int ret;
|
||||
int err, received;
|
||||
|
||||
maxwait = time(NULL)+2;
|
||||
received = 0;
|
||||
|
@ -124,7 +124,7 @@ int net_sendbuffer_send(NET_SENDBUF_REC *rec, const void *data, int size)
|
||||
ret = net_transmit(rec->handle, data, size);
|
||||
if (ret < 0) return -1;
|
||||
size -= ret;
|
||||
data = ((char *) data) + ret;
|
||||
data = ((const char *) data) + ret;
|
||||
}
|
||||
|
||||
if (size <= 0)
|
||||
|
@ -277,7 +277,8 @@ GIOChannel *net_accept(GIOChannel *handle, IPADDR *addr, int *port)
|
||||
/* Read data from socket, return number of bytes read, -1 = error */
|
||||
int net_receive(GIOChannel *handle, char *buf, int len)
|
||||
{
|
||||
int ret, err;
|
||||
unsigned int ret;
|
||||
int err;
|
||||
|
||||
g_return_val_if_fail(handle != NULL, -1);
|
||||
g_return_val_if_fail(buf != NULL, -1);
|
||||
@ -289,13 +290,14 @@ int net_receive(GIOChannel *handle, char *buf, int len)
|
||||
if (err == G_IO_ERROR_AGAIN || (err != 0 && errno == EINTR))
|
||||
return 0; /* no bytes received */
|
||||
|
||||
return err == 0 ? ret : -1;
|
||||
return err == 0 ? (int)ret : -1;
|
||||
}
|
||||
|
||||
/* Transmit data, return number of bytes sent, -1 = error */
|
||||
int net_transmit(GIOChannel *handle, const char *data, int len)
|
||||
{
|
||||
int ret, err;
|
||||
unsigned int ret;
|
||||
int err;
|
||||
|
||||
g_return_val_if_fail(handle != NULL, -1);
|
||||
g_return_val_if_fail(data != NULL, -1);
|
||||
@ -305,7 +307,7 @@ int net_transmit(GIOChannel *handle, const char *data, int len)
|
||||
(err != 0 && (errno == EINTR || errno == EPIPE)))
|
||||
return 0;
|
||||
|
||||
return err == 0 ? ret : -1;
|
||||
return err == 0 ? (int)ret : -1;
|
||||
}
|
||||
|
||||
/* Get socket address/port */
|
||||
|
@ -317,7 +317,8 @@ static void process_exec(PROCESS_REC *rec, const char *cmd)
|
||||
static void sig_exec_input_reader(PROCESS_REC *rec)
|
||||
{
|
||||
char tmpbuf[512], *str;
|
||||
int recvlen, err, ret;
|
||||
unsigned int recvlen;
|
||||
int err, ret;
|
||||
|
||||
g_return_if_fail(rec != NULL);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user