[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.
This commit is contained in:
Alexei Podtelezhnikov 2018-08-13 09:01:53 -04:00
parent 50486df1e6
commit f5fe6e2f17
5 changed files with 26 additions and 14 deletions

View File

@ -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.

View File

@ -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. */

View File

@ -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;
}

View File

@ -39,7 +39,7 @@ FT_BEGIN_HEADER
typedef struct BDF_encoding_el_
{
FT_Long enc;
FT_ULong enc;
FT_UShort glyph;
} BDF_encoding_el;

View File

@ -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;
}