Minor
authorBehdad Esfahbod <behdad@src.gnome.org>
Sun, 18 Nov 2007 22:34:08 +0000 (22:34 +0000)
committerBehdad Esfahbod <behdad@src.gnome.org>
Sun, 18 Nov 2007 22:34:08 +0000 (22:34 +0000)
src/harfbuzz-dump-main.c
src/harfbuzz-stream.c

index 7e1b5a4..d19d6ea 100644 (file)
@@ -200,7 +200,7 @@ main (int argc, char **argv)
        croak ("HB_Done_GSUB_Table", error);
     }
   else if (error != HB_Err_Not_Covered)
-    fprintf (stderr, "HB_Load_GSUB_Table %x\n", error);
+    fprintf (stderr, "HB_Load_GSUB_Table: error 0x%x\n", error);
 
   if (!(error = HB_Load_GPOS_Table (font, &gpos, NULL)))
     {
@@ -210,7 +210,7 @@ main (int argc, char **argv)
        croak ("HB_Done_GPOS_Table", error);
     }
   else if (error != HB_Err_Not_Covered)
-    fprintf (stderr, "HB_Load_GPOS_Table %x\n", error);
+    fprintf (stderr, "HB_Load_GPOS_Table: error 0x%x\n", error);
 
   printf ("</OpenType>\n");
 
index 75e4d34..29d280a 100644 (file)
@@ -164,65 +164,64 @@ _hb_font_goto_table( HB_Font    font,
   {
     LOG(( "not a SFNT font !!\n" ));
     error = ERR(HB_Err_Invalid_Argument);
+    goto Exit;
   }
-  else
-  {
-   /* parse the directory table directly, without using
-    * FreeType's built-in data structures
-    */
-    HB_UInt  offset = 0;
-    HB_UInt   count, nn;
 
-    if ( font->num_faces > 1 )
-    {
-      /* deal with TrueType collections */
-      LOG(( ">> This is a TrueType Collection\n" ));
+ /* parse the directory table directly, without using
+  * FreeType's built-in data structures
+  */
+  HB_UInt  offset = 0;
+  HB_UInt   count, nn;
+
+  if ( font->num_faces > 1 )
+  {
+    /* deal with TrueType collections */
+    LOG(( ">> This is a TrueType Collection\n" ));
 
-      if ( FILE_Seek( 12 + font->face_index*4 ) ||
-           ACCESS_Frame( 4 )                    )
-        goto Exit;
+    if ( FILE_Seek( 12 + font->face_index*4 ) ||
+        ACCESS_Frame( 4 )                    )
+      goto Exit;
 
-      offset = GET_ULong();
+    offset = GET_ULong();
 
-      FORGET_Frame();
-    }
+    FORGET_Frame();
+  }
 
-    LOG(( "TrueType offset = %ld\n", offset ));
+  LOG(( "TrueType offset = %ld\n", offset ));
 
-    if ( FILE_Seek( offset+4 ) ||
-         ACCESS_Frame( 2 )     )
-      goto Exit;
+  if ( FILE_Seek( offset+4 ) ||
+       ACCESS_Frame( 2 )     )
+    goto Exit;
 
-    count = GET_UShort();
+  count = GET_UShort();
 
-    FORGET_Frame();
+  FORGET_Frame();
 
-    if ( FILE_Seek( offset+12 )   ||
-         ACCESS_Frame( count*16 ) )
-      goto Exit;
+  if ( FILE_Seek( offset+12 )   ||
+       ACCESS_Frame( count*16 ) )
+    goto Exit;
 
-    for ( nn = 0; nn < count; nn++ )
+  for ( nn = 0; nn < count; nn++ )
+  {
+    HB_UInt  tag      = GET_ULong();
+    HB_UInt  checksum = GET_ULong();
+    HB_UInt  start    = GET_ULong();
+    HB_UInt  size     = GET_ULong();
+
+    HB_UNUSED(checksum);
+    HB_UNUSED(size);
+    
+    if ( tag == the_tag )
     {
-      HB_UInt  tag      = GET_ULong();
-      HB_UInt  checksum = GET_ULong();
-      HB_UInt  start    = GET_ULong();
-      HB_UInt  size     = GET_ULong();
-
-      HB_UNUSED(checksum);
-      HB_UNUSED(size);
-      
-      if ( tag == the_tag )
-      {
-        LOG(( "TrueType table (start: %ld) (size: %ld)\n", start, size ));
-        error = _hb_stream_seek( stream, start );
-        goto FoundIt;
-      }
+      LOG(( "TrueType table (start: %ld) (size: %ld)\n", start, size ));
+      error = _hb_stream_seek( stream, start );
+      goto FoundIt;
     }
-    error = HB_Err_Not_Covered;
-
-  FoundIt:
-    FORGET_Frame();
   }
+  error = HB_Err_Not_Covered;
+
+FoundIt:
+  FORGET_Frame();
 
 Exit:
   LOG(( "TrueType error=%d\n", error ));