[HarfBuzz] harfbuzz: Branch 'master'

Simon Hausmann hausmann at kemper.freedesktop.org
Sun Jun 20 13:08:49 PDT 2010


 src/harfbuzz-gpos.c         |   25 ++++++-------------------
 src/harfbuzz-open-private.h |    2 +-
 src/harfbuzz-open.c         |   14 +-------------
 3 files changed, 8 insertions(+), 33 deletions(-)

New commits:
commit ab9a897b688e991a8405cf938dea9d6a2f1ac072
Author: Andreas Kling <andreas.kling at nokia.com>
Date:   Sun Jun 20 19:56:33 2010 +0200

    Unbreak _HB_OPEN_Get_Device() and Get_ValueRecord()
    
    Fixes regression from 5ab1e41c + a1714c84
    "Get" functions should read from tables, not create them.
    
    Signed-off-by: Simon Hausmann <simon.hausmann at nokia.com>

diff --git a/src/harfbuzz-gpos.c b/src/harfbuzz-gpos.c
index d71a85e..31b9ae1 100644
--- a/src/harfbuzz-gpos.c
+++ b/src/harfbuzz-gpos.c
@@ -500,34 +500,24 @@ static HB_Error  Get_ValueRecord( GPOS_Instance*    gpi,
   {
     /* pixel -> fractional pixel */
 
-    if ( format & HB_GPOS_FORMAT_HAVE_DEVICE_TABLES )
-    {
-      if ( ALLOC_ARRAY( vr->DeviceTables, 4, HB_Device ) )
-        return error;
-      vr->DeviceTables[VR_X_ADVANCE_DEVICE] = 0;
-      vr->DeviceTables[VR_Y_ADVANCE_DEVICE] = 0;
-      vr->DeviceTables[VR_X_PLACEMENT_DEVICE] = 0;
-      vr->DeviceTables[VR_Y_PLACEMENT_DEVICE] = 0;
-    }
-
     if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE )
     {
-      _HB_OPEN_Get_Device( &vr->DeviceTables[VR_X_PLACEMENT_DEVICE], x_ppem, &pixel_value );
+      _HB_OPEN_Get_Device( vr->DeviceTables[VR_X_PLACEMENT_DEVICE], x_ppem, &pixel_value );
       gd->x_pos += pixel_value << 6;
     }
     if ( format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE )
     {
-      _HB_OPEN_Get_Device( &vr->DeviceTables[VR_Y_PLACEMENT_DEVICE], y_ppem, &pixel_value );
+      _HB_OPEN_Get_Device( vr->DeviceTables[VR_Y_PLACEMENT_DEVICE], y_ppem, &pixel_value );
       gd->y_pos += pixel_value << 6;
     }
     if ( format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE )
     {
-      _HB_OPEN_Get_Device( &vr->DeviceTables[VR_X_ADVANCE_DEVICE], x_ppem, &pixel_value );
+      _HB_OPEN_Get_Device( vr->DeviceTables[VR_X_ADVANCE_DEVICE], x_ppem, &pixel_value );
       gd->x_advance += pixel_value << 6;
     }
     if ( format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE )
     {
-      _HB_OPEN_Get_Device( &vr->DeviceTables[VR_Y_ADVANCE_DEVICE], y_ppem, &pixel_value );
+      _HB_OPEN_Get_Device( vr->DeviceTables[VR_Y_ADVANCE_DEVICE], y_ppem, &pixel_value );
       gd->y_advance += pixel_value << 6;
     }
   }
@@ -779,12 +769,9 @@ static HB_Error  Get_Anchor( GPOS_Instance*   gpi,
   case 3:
     if ( !gpi->dvi )
     {
-      if ( ALLOC_ARRAY( an->af.af3.DeviceTables, 2, HB_Device ) )
-        return error;
-
-      _HB_OPEN_Get_Device( &an->af.af3.DeviceTables[AF3_X_DEVICE_TABLE], x_ppem, &pixel_value );
+      _HB_OPEN_Get_Device( an->af.af3.DeviceTables[AF3_X_DEVICE_TABLE], x_ppem, &pixel_value );
       *x_value = pixel_value << 6;
-      _HB_OPEN_Get_Device( &an->af.af3.DeviceTables[AF3_Y_DEVICE_TABLE], y_ppem, &pixel_value );
+      _HB_OPEN_Get_Device( an->af.af3.DeviceTables[AF3_Y_DEVICE_TABLE], y_ppem, &pixel_value );
       *y_value = pixel_value << 6;
     }
     else
diff --git a/src/harfbuzz-open-private.h b/src/harfbuzz-open-private.h
index 1f7b353..65ca453 100644
--- a/src/harfbuzz-open-private.h
+++ b/src/harfbuzz-open-private.h
@@ -93,7 +93,7 @@ _HB_OPEN_Get_Class( HB_ClassDefinition* cd,
 		    HB_UShort*          klass,
 		     HB_UShort*            index );
 HB_INTERNAL HB_Error
-_HB_OPEN_Get_Device( HB_Device** d,
+_HB_OPEN_Get_Device( HB_Device* d,
 		      HB_UShort    size,
 		      HB_Short*    value );
 
diff --git a/src/harfbuzz-open.c b/src/harfbuzz-open.c
index 255b7e6..adc6cec 100644
--- a/src/harfbuzz-open.c
+++ b/src/harfbuzz-open.c
@@ -1399,21 +1399,11 @@ _HB_OPEN_Free_Device( HB_Device** d )
      mask = 0x00FF                                    */
 
 HB_INTERNAL HB_Error
-_HB_OPEN_Get_Device( HB_Device** device,
+_HB_OPEN_Get_Device( HB_Device* d,
 		      HB_UShort    size,
 		      HB_Short*    value )
 {
-  HB_Device* d;
   HB_UShort  byte, bits, mask, f, s;
-  HB_Error   error;
-
-  if ( ALLOC( *device, sizeof(HB_Device)) )
-  {
-    *device = 0;
-    return error;
-  }
-
-  d = *device;
 
   f = d->DeltaFormat;
 
@@ -1436,8 +1426,6 @@ _HB_OPEN_Get_Device( HB_Device** device,
   else
   {
     *value = 0;
-    FREE( *device );
-    *device = 0;
     return HB_Err_Not_Covered;
   }
 }



More information about the HarfBuzz mailing list