[pfr] Minor. * src/pfr/pfrsbit.c, srf/pfr/pfrobjs.c: Use flag names instead of bare numbers.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
diff --git a/ChangeLog b/ChangeLog
index 9c05d3e..0769eeb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2016-03-25 Werner Lemberg <wl@gnu.org>
+ [pfr] Minor.
+
+ * src/pfr/pfrsbit.c, srf/pfr/pfrobjs.c: Use flag names instead of
+ bare numbers.
+
+2016-03-25 Werner Lemberg <wl@gnu.org>
+
[pfr] Various clang sanitizer fixes.
* src/pfr/pfrsbit.c (pfr_load_bitmap_metrics): Correctly handle
diff --git a/src/pfr/pfrobjs.c b/src/pfr/pfrobjs.c
index 81b1312..769a3b6 100644
--- a/src/pfr/pfrobjs.c
+++ b/src/pfr/pfrobjs.c
@@ -524,8 +524,8 @@
FT_UInt probe = power * size;
FT_UInt extra = count - power;
FT_Byte* base = stream->cursor;
- FT_Bool twobytes = FT_BOOL( item->flags & 1 );
- FT_Bool twobyte_adj = FT_BOOL( item->flags & 2 );
+ FT_Bool twobytes = FT_BOOL( item->flags & PFR_KERN_2BYTE_CHAR );
+ FT_Bool twobyte_adj = FT_BOOL( item->flags & PFR_KERN_2BYTE_ADJ );
FT_Byte* p;
FT_UInt32 cpair;
diff --git a/src/pfr/pfrsbit.c b/src/pfr/pfrsbit.c
index 8ec31ac..9bc5d41 100644
--- a/src/pfr/pfrsbit.c
+++ b/src/pfr/pfrsbit.c
@@ -283,14 +283,17 @@
FT_ULong* found_size )
{
FT_UInt left, right, char_len;
- FT_Bool two = FT_BOOL( flags & 1 );
+ FT_Bool two = FT_BOOL( flags & PFR_BITMAP_2BYTE_CHARCODE );
FT_Byte* buff;
char_len = 4;
- if ( two ) char_len += 1;
- if ( flags & 2 ) char_len += 1;
- if ( flags & 4 ) char_len += 1;
+ if ( two )
+ char_len += 1;
+ if ( flags & PFR_BITMAP_2BYTE_SIZE )
+ char_len += 1;
+ if ( flags & PFR_BITMAP_3BYTE_OFFSET )
+ char_len += 1;
left = 0;
right = count;
@@ -329,12 +332,12 @@
return;
Found_It:
- if ( flags & 2 )
+ if ( flags & PFR_BITMAP_2BYTE_SIZE )
*found_size = PFR_NEXT_USHORT( buff );
else
*found_size = PFR_NEXT_BYTE( buff );
- if ( flags & 4 )
+ if ( flags & PFR_BITMAP_3BYTE_OFFSET )
*found_offset = PFR_NEXT_ULONG( buff );
else
*found_offset = PFR_NEXT_USHORT( buff );
@@ -570,9 +573,12 @@
char_len = 4;
- if ( strike->flags & 1 ) char_len += 1;
- if ( strike->flags & 2 ) char_len += 1;
- if ( strike->flags & 4 ) char_len += 1;
+ if ( strike->flags & PFR_BITMAP_2BYTE_CHARCODE )
+ char_len += 1;
+ if ( strike->flags & PFR_BITMAP_2BYTE_SIZE )
+ char_len += 1;
+ if ( strike->flags & PFR_BITMAP_3BYTE_OFFSET )
+ char_len += 1;
/* access data directly in the frame to speed lookups */
if ( FT_STREAM_SEEK( phys->bct_offset + strike->bct_offset ) ||
@@ -733,7 +739,8 @@
p,
stream->limit,
format,
- FT_BOOL(face->header.color_flags & 2),
+ FT_BOOL( face->header.color_flags &
+ PFR_FLAG_INVERT_BITMAP ),
&glyph->root.bitmap );
}
}