Update to Blorb protocol 1.5
[projects/chimara/chimara.git] / libchimara / gi_blorb.c
index 329280dd1adfe44121a0a9640991e064530236a0..3f947f92bf1776c8bab6817e12d5cdd39ddcd6b8 100644 (file)
@@ -1,9 +1,9 @@
 /* gi_blorb.c: Blorb library layer for Glk API.
-    gi_blorb version 1.4.
+    gi_blorb version 1.5.
     Designed by Andrew Plotkin <erkyrath@eblong.com>
-    http://www.eblong.com/zarf/glk/index.html
+    http://eblong.com/zarf/glk/
 
-    This file is copyright 1998-2000 by Andrew Plotkin. You may copy,
+    This file is copyright 1998-2010 by Andrew Plotkin. You may copy,
     distribute, and incorporate it into your own programs, by any means
     and under any conditions, as long as you do not modify it. You may
     also modify this file, incorporate it into your own programs,
@@ -227,7 +227,6 @@ static giblorb_err_t giblorb_initialize_map(giblorb_map_t *map)
     giblorb_err_t err;
     char *ptr;
     glui32 len;
-    glui32 val;
     glui32 numres;
     int gotindex = FALSE; 
 
@@ -396,7 +395,6 @@ giblorb_err_t giblorb_load_chunk_by_number(giblorb_map_t *map,
             
         case giblorb_method_Memory:
             if (!chu->ptr) {
-                giblorb_err_t err;
                 glui32 readlen;
                 void *dat = giblorb_malloc(chu->len);
                 
@@ -515,7 +513,7 @@ static int sortsplot(giblorb_resdesc_t *v1, giblorb_resdesc_t *v2)
 
 static void giblorb_qsort(giblorb_resdesc_t **list, int len)
 {
-    int ix, jx, res, val;
+    int ix, jx, res;
     giblorb_resdesc_t *tmpptr, *pivot;
     
     if (len < 6) {
@@ -582,22 +580,20 @@ giblorb_resdesc_t *giblorb_bsearch(giblorb_resdesc_t *sample,
 /* Boring utility functions. If your platform doesn't support ANSI 
     malloc(), feel free to edit these however you like. */
 
-#include <stdlib.h> /* The OS-native header file -- you can edit 
+#include <glib.h> /* The OS-native header file -- you can edit 
     this too. */
 
 static void *giblorb_malloc(glui32 len)
 {
-    return malloc(len);
+    return g_malloc(len);
 }
 
 static void *giblorb_realloc(void *ptr, glui32 len)
 {
-    return realloc(ptr, len);
+    return g_realloc(ptr, len);
 }
 
 static void giblorb_free(void *ptr)
 {
-    free(ptr);
+    g_free(ptr);
 }
-
-