diff options
author | Timo Sirainen <cras@irssi.org> | 2002-02-01 20:14:30 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-02-01 20:14:30 +0000 |
commit | 33d30268b4dd7f5afe174d54f3f7e13459633348 (patch) | |
tree | d6a428619f51ad9cc219041f807a5589c39fe1e0 /src/fe-text | |
parent | f8221db7ca38a7ecca599c45dc70d70f1038b566 (diff) | |
download | irssi-33d30268b4dd7f5afe174d54f3f7e13459633348.zip |
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
Diffstat (limited to 'src/fe-text')
-rw-r--r-- | src/fe-text/gui-printtext.c | 7 | ||||
-rw-r--r-- | src/fe-text/statusbar.c | 5 | ||||
-rw-r--r-- | src/fe-text/textbuffer-reformat.c | 6 | ||||
-rw-r--r-- | src/fe-text/textbuffer-view.c | 6 | ||||
-rw-r--r-- | src/fe-text/textbuffer.c | 15 |
5 files changed, 21 insertions, 18 deletions
diff --git a/src/fe-text/gui-printtext.c b/src/fe-text/gui-printtext.c index 930ed4a5..3bd1de36 100644 --- a/src/fe-text/gui-printtext.c +++ b/src/fe-text/gui-printtext.c @@ -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; diff --git a/src/fe-text/statusbar.c b/src/fe-text/statusbar.c index 75aec846..a9271b3c 100644 --- a/src/fe-text/statusbar.c +++ b/src/fe-text/statusbar.c @@ -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); diff --git a/src/fe-text/textbuffer-reformat.c b/src/fe-text/textbuffer-reformat.c index 9bccbc5a..da75a5a8 100644 --- a/src/fe-text/textbuffer-reformat.c +++ b/src/fe-text/textbuffer-reformat.c @@ -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); } diff --git a/src/fe-text/textbuffer-view.c b/src/fe-text/textbuffer-view.c index 8e2ef8e0..a5d7f2ed 100644 --- a/src/fe-text/textbuffer-view.c +++ b/src/fe-text/textbuffer-view.c @@ -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) diff --git a/src/fe-text/textbuffer.c b/src/fe-text/textbuffer.c index 14524690..8ac8bf00 100644 --- a/src/fe-text/textbuffer.c +++ b/src/fe-text/textbuffer.c @@ -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; } |