Oeps, nog enkele bugs
authorfliep <fliep@ddfedd41-794f-dd11-ae45-00112f111e67>
Sun, 13 Jul 2008 16:31:54 +0000 (16:31 +0000)
committerfliep <fliep@ddfedd41-794f-dd11-ae45-00112f111e67>
Sun, 13 Jul 2008 16:31:54 +0000 (16:31 +0000)
src/gestalt.c
src/stream.c
src/window.c

index 1709e12488994ba3d851439bd43c5327f503fbd5..1bb7f7e9c5bda60308a37c6b10e818ac5609562a 100644 (file)
@@ -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:
index 583b9a45f0eb0cc4e94d66f2169b8056065266b7..a6913e2f06ebde4e6a90c53f995f4d0f9f524cbd 100644 (file)
@@ -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);
 }
 
 /**
index 22cb2e3923343b9de5c37de193570598fa50403a..67fc15b0a393edc4f7bf19cc565d341d89d6f13e 100644 (file)
@@ -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);