From: fliep Date: Sun, 13 Jul 2008 16:31:54 +0000 (+0000) Subject: Oeps, nog enkele bugs X-Git-Tag: v0.9~460 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=be258466a9f733fda535554f9a5f24c5bf00d784;p=projects%2Fchimara%2Fchimara.git Oeps, nog enkele bugs --- diff --git a/src/gestalt.c b/src/gestalt.c index 1709e12..1bb7f7e 100644 --- a/src/gestalt.c +++ b/src/gestalt.c @@ -42,7 +42,7 @@ glk_gestalt_ext(glui32 sel, glui32 val, glui32 *arr, glui32 arrlen) { /* Version number */ case gestalt_Version: - return MAJOR_VERSION << 16 + MINOR_VERSION << 8 + SUB_VERSION; + return (MAJOR_VERSION << 16) + (MINOR_VERSION << 8) + SUB_VERSION; /* Which characters can we print? */ case gestalt_CharOutput: diff --git a/src/stream.c b/src/stream.c index 583b9a4..a6913e2 100644 --- a/src/stream.c +++ b/src/stream.c @@ -160,7 +160,7 @@ glk_put_char_stream(strid_t str, unsigned char ch) g_return_if_fail(str->file_mode != filemode_Read); /* Convert ch to a null-terminated string, call glk_put_string_stream() */ - gchar *s = g_strndup(&ch, 1); + gchar *s = g_strndup((gchar *)&ch, 1); glk_put_string_stream(str, s); g_free(s); } @@ -187,6 +187,7 @@ static gchar * convert_latin1_to_utf8(gchar *s) { GError *error = NULL; + gchar *utf8; gchar *canonical = remove_latin1_control_characters(s); utf8 = g_convert(canonical, -1, "UTF-8", "ISO-8859-1", NULL, NULL, &error); g_free(canonical); @@ -209,7 +210,7 @@ write_utf8_to_window(winid_t win, gchar *s) GtkTextIter iter; gtk_text_buffer_get_end_iter(buffer, &iter); - gtk_text_buffer_insert(buffer, &iter, utf8, -1); + gtk_text_buffer_insert(buffer, &iter, s, -1); } /** diff --git a/src/window.c b/src/window.c index 22cb2e3..67fc15b 100644 --- a/src/window.c +++ b/src/window.c @@ -78,7 +78,7 @@ glui32 glk_window_get_type(winid_t win) { g_return_val_if_fail(win != NULL, 0); - return win->wintype; + return win->window_type; } /** @@ -244,7 +244,7 @@ glk_window_clear(winid_t win) { g_return_if_fail(win != NULL); - switch(win->wintype) + switch(win->window_type) { case wintype_Blank: /* do nothing */ @@ -253,8 +253,8 @@ glk_window_clear(winid_t win) case wintype_TextBuffer: /* delete all text in the window */ { - GtkTextBuffer *buffer = gtk_text_view_get_buffer( - GTK_TEXT_VIEW(current_stream->window->widget) ); + GtkTextBuffer *buffer = + gtk_text_view_get_buffer( GTK_TEXT_VIEW(win->widget) ); GtkTextIter start, end; gtk_text_buffer_get_bounds(buffer, &start, &end); gtk_text_buffer_delete(buffer, &start, &end);