fixed mem leak in XFreeFontInfo() call
[mesa.git] / src / mesa / drivers / x11 / xfonts.c
index 6e73504ba5d253facb6eb1c99a469d26defe6953..3aa17fec849409a3750490d13983aa6b9555dcb2 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: xfonts.c,v 1.11 2001/01/08 04:06:20 keithw Exp $ */
+/* $Id: xfonts.c,v 1.14 2001/04/26 19:28:02 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -180,10 +180,10 @@ fill_bitmap (Display *dpy, Window win, GC gc,
  * determine if a given glyph is valid and return the
  * corresponding XCharStruct.
  */
-static XCharStruct *isvalid(XFontStruct *fs, int which)
+static XCharStruct *isvalid(XFontStruct *fs, unsigned int which)
 {
   unsigned int  rows,pages;
-  int           byte1 = 0,byte2 = 0;
+  unsigned int byte1 = 0,byte2 = 0;
   int           i,valid = 1;
 
   rows = fs->max_byte1 - fs->min_byte1 + 1;
@@ -244,7 +244,7 @@ void Fake_glXUseXFont( Font font, int first, int count, int listbase )
 
   fs = XQueryFont (dpy, font);
   if (!fs) {
-      gl_error(NULL, GL_INVALID_VALUE,
+      _mesa_error(NULL, GL_INVALID_VALUE,
                "Couldn't get font structure information");
       return;
   }
@@ -258,8 +258,8 @@ void Fake_glXUseXFont( Font font, int first, int count, int listbase )
   bm = (GLubyte *) MALLOC((max_bm_width * max_bm_height) * sizeof 
 (GLubyte));
   if (!bm) {
-      XFreeFontInfo( NULL, fs, 0 );
-      gl_error(NULL, GL_OUT_OF_MEMORY,
+      XFreeFontInfo( NULL, fs, 1 );
+      _mesa_error(NULL, GL_OUT_OF_MEMORY,
                 "Couldn't allocate bitmap in glXUseXFont()");
       return;
   }
@@ -373,7 +373,7 @@ bm_height);
     }
 
   FREE(bm);
-  XFreeFontInfo( NULL, fs, 0 );
+  XFreeFontInfo( NULL, fs, 1 );
   XFreeGC (dpy, gc);
 
   /* Restore saved packing modes.  */