1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

added some pointer casting to get rid of warnings with some compilers.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2365 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-02-01 20:14:30 +00:00 committed by cras
parent f8221db7ca
commit 33d30268b4
6 changed files with 26 additions and 22 deletions

View File

@ -83,7 +83,7 @@ static COMMAND_MODULE_REC *command_module_find_func(COMMAND_REC *rec,
for (tmp = rec->modules; tmp != NULL; tmp = tmp->next) {
COMMAND_MODULE_REC *rec = tmp->data;
if (g_slist_find(rec->signals, func) != NULL)
if (g_slist_find(rec->signals, (void *) func) != NULL)
return rec;
}
@ -150,7 +150,7 @@ void command_bind_to(const char *module, int pos, const char *cmd,
}
modrec = command_module_get(rec, module, protocol);
modrec->signals = g_slist_append(modrec->signals, func);
modrec->signals = g_slist_append(modrec->signals, (void *) func);
if (func != NULL) {
str = g_strconcat("command ", cmd, NULL);
@ -226,7 +226,8 @@ void command_unbind(const char *cmd, SIGNAL_FUNC func)
modrec = command_module_find_func(rec, func);
g_return_if_fail(modrec != NULL);
modrec->signals = g_slist_remove(modrec->signals, func);
modrec->signals =
g_slist_remove(modrec->signals, (void *) func);
if (modrec->signals == NULL)
command_module_destroy(rec, modrec);
}
@ -764,7 +765,7 @@ static void command_module_unbind_all(COMMAND_REC *rec,
for (tmp = modrec->signals; tmp != NULL; tmp = next) {
next = tmp->next;
command_unbind(rec->cmd, tmp->data);
command_unbind(rec->cmd, (SIGNAL_FUNC) tmp->data);
}
if (g_slist_find(commands, rec) != NULL) {

View File

@ -51,7 +51,7 @@ void gui_register_indent_func(const char *name, INDENT_FUNC func)
list = NULL;
}
list = g_slist_append(list, func);
list = g_slist_append(list, (void *) func);
g_hash_table_insert(indent_functions, key, list);
}
@ -63,7 +63,7 @@ void gui_unregister_indent_func(const char *name, INDENT_FUNC func)
if (g_hash_table_lookup_extended(indent_functions, name, &key, &value)) {
list = value;
list = g_slist_remove(list, func);
list = g_slist_remove(list, (void *) func);
g_hash_table_remove(indent_functions, key);
if (list == NULL)
g_free(key);
@ -273,7 +273,8 @@ static void sig_gui_print_text(WINDOW_REC *window, void *fgcolor,
line_add_indent_func(view->buffer, &insert_after, str);
} else {
insert_after = textbuffer_insert(view->buffer, insert_after,
str, strlen(str), &lineinfo);
(unsigned char *) str,
strlen(str), &lineinfo);
}
if (gui->use_insert_after)
gui->insert_after = insert_after;

View File

@ -68,7 +68,7 @@ void statusbar_item_register(const char *name, const char *value,
if (func != NULL) {
if (g_hash_table_lookup(sbar_item_funcs, name) == NULL) {
g_hash_table_insert(sbar_item_funcs,
g_strdup(name), func);
g_strdup(name), (void *) func);
}
}
}
@ -859,7 +859,8 @@ SBAR_ITEM_REC *statusbar_item_create(STATUSBAR_REC *bar,
rec->bar = bar;
rec->config = config;
rec->func = g_hash_table_lookup(sbar_item_funcs, config->name);
rec->func = (STATUSBAR_FUNC) g_hash_table_lookup(sbar_item_funcs,
config->name);
if (rec->func == NULL)
rec->func = statusbar_item_default_func;
statusbar_item_default_signals(rec);

View File

@ -192,7 +192,8 @@ void textbuffer_reformat_line(WINDOW_REC *window, LINE_REC *line)
g_free(tmp);
line = textbuffer_insert(gui->view->buffer, gui->insert_after,
raw->str, raw->len, &line_info);
(unsigned char *) raw->str,
raw->len, &line_info);
textbuffer_view_insert_line(gui->view, line);
}
g_string_free(raw, TRUE);
@ -247,7 +248,8 @@ static void sig_gui_printtext_finished(WINDOW_REC *window)
gui->insert_after : gui->view->buffer->cur_line;
textbuffer_insert(gui->view->buffer, insert_after,
format->str, format->len, NULL);
(unsigned char *) format->str,
format->len, NULL);
g_string_truncate(format, 0);
}

View File

@ -173,7 +173,7 @@ view_update_line_cache(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line)
break;
if (cmd == LINE_CMD_CONTINUE) {
char *tmp;
unsigned char *tmp;
memcpy(&tmp, ptr, sizeof(char *));
ptr = tmp;
@ -308,7 +308,7 @@ static int view_line_draw(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line,
INDENT_FUNC indent_func;
LINE_CACHE_REC *cache;
const unsigned char *text, *text_newline;
char *tmp;
unsigned char *tmp;
int xpos, color, drawcount, first, need_move, need_clrtoeol;
if (view->dirty) /* don't bother drawing anything - redraw is coming */
@ -601,7 +601,7 @@ static void view_unregister_indent_func(TEXT_BUFFER_VIEW_REC *view,
void textbuffer_views_unregister_indent_func(INDENT_FUNC indent_func)
{
g_slist_foreach(views, (GFunc) view_unregister_indent_func,
indent_func);
(void *) indent_func);
}
void textbuffer_view_set_scroll(TEXT_BUFFER_VIEW_REC *view, int scroll)

View File

@ -73,7 +73,7 @@ static TEXT_CHUNK_REC *text_chunk_find(TEXT_BUFFER_REC *buffer,
static TEXT_CHUNK_REC *text_chunk_create(TEXT_BUFFER_REC *buffer)
{
TEXT_CHUNK_REC *rec;
char *buf, *ptr, **pptr;
unsigned char *buf, *ptr, **pptr;
rec = g_mem_chunk_alloc(text_chunk);
rec->pos = 0;
@ -90,7 +90,7 @@ static TEXT_CHUNK_REC *text_chunk_create(TEXT_BUFFER_REC *buffer)
breaks at least NetBSD/Alpha, so don't go "optimize"
it :) */
ptr = rec->buffer; pptr = &ptr;
memcpy(buf, pptr, sizeof(char *));
memcpy(buf, pptr, sizeof(unsigned char *));
} else {
/* just to be safe */
mark_temp_eol(rec);
@ -140,7 +140,7 @@ static void text_chunk_line_free(TEXT_BUFFER_REC *buffer, LINE_REC *line)
}
static void text_chunk_append(TEXT_BUFFER_REC *buffer,
const char *data, int len)
const unsigned char *data, int len)
{
TEXT_CHUNK_REC *chunk;
int left;
@ -382,8 +382,7 @@ static void set_color(GString *str, int cmd, int *last_fg, int *last_bg)
void textbuffer_line2text(LINE_REC *line, int coloring, GString *str)
{
unsigned char cmd;
char *ptr, *tmp;
unsigned char cmd, *ptr, *tmp;
int last_fg, last_bg;
g_return_if_fail(line != NULL);
@ -394,13 +393,13 @@ void textbuffer_line2text(LINE_REC *line, int coloring, GString *str)
last_fg = last_bg = -1;
for (ptr = line->text;;) {
if (*ptr != 0) {
g_string_append_c(str, *ptr);
g_string_append_c(str, (char) *ptr);
ptr++;
continue;
}
ptr++;
cmd = (unsigned char) *ptr;
cmd = *ptr;
ptr++;
if (cmd == LINE_CMD_EOL || cmd == LINE_CMD_FORMAT) {
@ -410,7 +409,7 @@ void textbuffer_line2text(LINE_REC *line, int coloring, GString *str)
if (cmd == LINE_CMD_CONTINUE) {
/* line continues in another address.. */
memcpy(&tmp, ptr, sizeof(char *));
memcpy(&tmp, ptr, sizeof(unsigned char *));
ptr = tmp;
continue;
}