summaryrefslogtreecommitdiff
path: root/src/core/expandos.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-01-15 23:36:11 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-01-15 23:36:11 +0000
commit0d62878d6ec1a3f07f31c2212bd3608bfc602cab (patch)
tree624f61f4ddbf6829883beb109fd594ca061b3c5a /src/core/expandos.c
parentae2bb54a42c9efc9050d930d1039f1cf5ee7a72e (diff)
downloadirssi-0d62878d6ec1a3f07f31c2212bd3608bfc602cab.zip
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
Diffstat (limited to 'src/core/expandos.c')
-rw-r--r--src/core/expandos.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/expandos.c b/src/core/expandos.c
index a0fd3a28..fe01b8df 100644
--- a/src/core/expandos.c
+++ b/src/core/expandos.c
@@ -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);