[bdf] Use unsigned types. * src/bdf/bdf.h (bdf_glyph_t): Unsign `encoding'. (bdf_font_t): Unsign `default_char'. * src/bdf/bdfdrivr.h (BDF_encoding_el): Unsign `enc'. * src/bdf/bdflib.c (_bdf_add_property, _bdf_parse_glyphs, _bdf_parse_start): Updated accordingly. * src/bdf/bdfdrivr.c (bdf_cmap_char_{index,next}): Ditto.
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
diff --git a/ChangeLog b/ChangeLog
index ce5bf8e..5b43aa7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2018-08-13 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [bdf] Use unsigned types.
+
+ * src/bdf/bdf.h (bdf_glyph_t): Unsign `encoding'.
+ (bdf_font_t): Unsign `default_char'.
+ * src/bdf/bdfdrivr.h (BDF_encoding_el): Unsign `enc'.
+
+ * src/bdf/bdflib.c (_bdf_add_property, _bdf_parse_glyphs,
+ _bdf_parse_start): Updated accordingly.
+ * src/bdf/bdfdrivr.c (bdf_cmap_char_{index,next}): Ditto.
+
2018-08-13 Werner Lemberg <wl@gnu.org>
* src/type42/t42parse.c (t42_parse_sfnts): One more format check.
@@ -97,7 +109,7 @@
* src/pcf/pcf.h (PCF_ParsePropertyRec): Use unsigned `name' and
`value'.
- * src/pcf/pcfread.c (pcf_get_propeerties, pcf_load_font): Updated
+ * src/pcf/pcfread.c (pcf_get_properties, pcf_load_font): Updated
parsing code and handling of AVERAGE_WIDTH, POINT_SIZE, PIXEL_SIZE,
RESOLUTION_X and RESOLUTION_Y.
diff --git a/src/bdf/bdf.h b/src/bdf/bdf.h
index a6ba82e..45953ed 100644
--- a/src/bdf/bdf.h
+++ b/src/bdf/bdf.h
@@ -147,7 +147,7 @@ FT_BEGIN_HEADER
typedef struct bdf_glyph_t_
{
char* name; /* Glyph name. */
- long encoding; /* Glyph encoding. */
+ unsigned long encoding; /* Glyph encoding. */
unsigned short swidth; /* Scalable width. */
unsigned short dwidth; /* Device width. */
bdf_bbx_t bbx; /* Glyph bounding box. */
@@ -185,7 +185,7 @@ FT_BEGIN_HEADER
unsigned short monowidth; /* Logical width for monowidth font. */
- long default_char; /* Encoding of the default glyph. */
+ unsigned long default_char; /* Encoding of the default glyph. */
long font_ascent; /* Font ascent. */
long font_descent; /* Font descent. */
diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c
index 1e272b0..8e17bf5 100644
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -106,7 +106,7 @@ THE SOFTWARE.
mid = ( min + max ) >> 1;
- code = (FT_ULong)encodings[mid].enc;
+ code = encodings[mid].enc;
if ( charcode == code )
{
@@ -146,7 +146,7 @@ THE SOFTWARE.
mid = ( min + max ) >> 1;
- code = (FT_ULong)encodings[mid].enc;
+ code = encodings[mid].enc;
if ( charcode == code )
{
@@ -165,7 +165,7 @@ THE SOFTWARE.
charcode = 0;
if ( min < cmap->num_encodings )
{
- charcode = (FT_ULong)encodings[min].enc;
+ charcode = encodings[min].enc;
result = encodings[min].glyph + 1;
}
diff --git a/src/bdf/bdfdrivr.h b/src/bdf/bdfdrivr.h
index 4857316..37dd6f3 100644
--- a/src/bdf/bdfdrivr.h
+++ b/src/bdf/bdfdrivr.h
@@ -39,7 +39,7 @@ FT_BEGIN_HEADER
typedef struct BDF_encoding_el_
{
- FT_Long enc;
+ FT_ULong enc;
FT_UShort glyph;
} BDF_encoding_el;
diff --git a/src/bdf/bdflib.c b/src/bdf/bdflib.c
index 5c09591..d659c13 100644
--- a/src/bdf/bdflib.c
+++ b/src/bdf/bdflib.c
@@ -197,10 +197,10 @@
#define ACMSG10 "DWIDTH field missing at line %ld. Set to glyph width.\n"
#define ACMSG11 "SIZE bits per pixel field adjusted to %hd.\n"
#define ACMSG12 "Duplicate encoding %ld (%s) changed to unencoded.\n"
-#define ACMSG13 "Glyph %ld extra rows removed.\n"
-#define ACMSG14 "Glyph %ld extra columns removed.\n"
+#define ACMSG13 "Glyph %lu extra rows removed.\n"
+#define ACMSG14 "Glyph %lu extra columns removed.\n"
#define ACMSG15 "Incorrect glyph count: %ld indicated but %ld found.\n"
-#define ACMSG16 "Glyph %ld missing columns padded with zero bits.\n"
+#define ACMSG16 "Glyph %lu missing columns padded with zero bits.\n"
#define ACMSG17 "Adjusting number of glyphs to %ld.\n"
/* Error messages. */
@@ -1232,7 +1232,7 @@
/* present, and the SPACING property should override the default */
/* spacing. */
if ( _bdf_strncmp( name, "DEFAULT_CHAR", 12 ) == 0 )
- font->default_char = fp->value.l;
+ font->default_char = fp->value.ul;
else if ( _bdf_strncmp( name, "FONT_ASCENT", 11 ) == 0 )
font->font_ascent = fp->value.l;
else if ( _bdf_strncmp( name, "FONT_DESCENT", 12 ) == 0 )
@@ -1508,7 +1508,7 @@
glyph = font->glyphs + font->glyphs_used++;
glyph->name = p->glyph_name;
- glyph->encoding = p->glyph_enc;
+ glyph->encoding = (unsigned long)p->glyph_enc;
/* Reset the initial glyph info. */
p->glyph_name = NULL;
@@ -1532,7 +1532,7 @@
glyph = font->unencoded + font->unencoded_used;
glyph->name = p->glyph_name;
- glyph->encoding = (long)font->unencoded_used++;
+ glyph->encoding = font->unencoded_used++;
/* Reset the initial glyph info. */
p->glyph_name = NULL;
@@ -1983,7 +1983,7 @@
if ( error )
goto Exit;
p->font->spacing = p->opts->font_spacing;
- p->font->default_char = -1;
+ p->font->default_char = ~0UL;
goto Exit;
}