]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcfreetype.c
Properly convert static charsets to dynamic charsets.
[fontconfig.git] / src / fcfreetype.c
index 455f059a89d43769350be3c39a9f858bb78e9c67..5d852a508bf210ceaf12f9a3a9bac469cd4ce721 100644 (file)
@@ -47,7 +47,6 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include <libgen.h>
 #include "fcint.h"
 #include <ft2build.h>
 #include FT_FREETYPE_H
@@ -1221,7 +1220,7 @@ FcFreeTypeQuery (const FcChar8    *file,
      * or which are simply a FC_FAMILY and FC_STYLE glued together
      */
     {
-       int     fn, fa, st;
+       int     fn, fa;
        FcChar8 *full;
        FcChar8 *fam;
        FcChar8 *style;
@@ -1281,7 +1280,7 @@ FcFreeTypeQuery (const FcChar8    *file,
     }
 
     file2 = FcStrCopy (file);
-    if (!FcPatternAddString (pat, FC_FILE, (FcChar8 *)basename((char *)file2)))
+    if (!FcPatternAddString (pat, FC_FILE, FcStrBasename(file2)))
     {
        FcStrFree (file2);
        goto bail1;
@@ -1438,7 +1437,6 @@ FcFreeTypeQuery (const FcChar8    *file,
     if (!foundry)
     {
        int             rc;
-       BDF_PropertyRec prop;
        rc = FT_Get_BDF_Property(face, "FOUNDRY", &prop);
        if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM)
            foundry = (FcChar8 *) prop.u.atom;
@@ -1606,7 +1604,6 @@ FcFreeTypeQuery (const FcChar8    *file,
         if(face->num_fixed_sizes == 1) {
             int rc;
             int value;
-            BDF_PropertyRec prop;
 
            /* skip bitmap fonts which do not even have a family name */
            rc =  FT_Get_BDF_Property(face, "FAMILY_NAME", &prop);
@@ -2747,11 +2744,13 @@ GetScriptTags(FT_Face face, FT_ULong tabletag, FT_ULong **stags, FT_UShort *scri
     FT_Stream  stream = face->stream;
     FT_Error   error;
     FT_UShort          n, p;
-    FT_Memory  memory = stream->memory;
+    FT_Memory  memory;
 
     if ( !stream )
        return TT_Err_Invalid_Face_Handle;
 
+    memory = stream->memory;
+
     if (( error = ftglue_face_goto_table( face, tabletag, stream ) ))
        return error;
 
@@ -2798,7 +2797,7 @@ GetScriptTags(FT_Face face, FT_ULong tabletag, FT_ULong **stags, FT_UShort *scri
 
        cur_offset = ftglue_stream_pos( stream );
 
-       if ( ftglue_stream_seek( stream, new_offset ) )
+       if (( error = ftglue_stream_seek( stream, new_offset ) ))
            goto Fail;
 
        if ( error == TT_Err_Ok )