small update to remove compiler warnings
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
diff --git a/ChangeLog b/ChangeLog
index 403d3b8..d7e7cdf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-03-17 David Turner <david.turner@freetype.org>
+
+ * src/cid/cidobjs.c, src/cid/cidload.c, src/pcf/pcfread.c,
+ src/type1/t1load.c, src/type1/t1objs.c: added a few casts to remove
+ compiler warnings in pedantic modes..
+
2001-03-17 Tom Kacvinsky <tjk@ams.org>
* src/cff/cffparse.c (cff_parse_font_bbox): Obtain rounded FT_Fixed
diff --git a/src/cid/cidload.c b/src/cid/cidload.c
index 47469b7..b230f92 100644
--- a/src/cid/cidload.c
+++ b/src/cid/cidload.c
@@ -200,7 +200,7 @@
/* Set Units per EM based on FontMatrix values. We set the value to */
/* `1000/temp_scale', because temp_scale was already multiplied by */
/* 1000 (in t1_tofixed(), from psobjs.c). */
- root->units_per_EM = FT_DivFix( 0x10000L,
+ root->units_per_EM = (FT_UShort)FT_DivFix( 0x10000L,
FT_DivFix( temp_scale, 1000 ) );
/* we need to scale the values by 1.0/temp[3] */
diff --git a/src/cid/cidobjs.c b/src/cid/cidobjs.c
index f8ba3ae..1d87527 100644
--- a/src/cid/cidobjs.c
+++ b/src/cid/cidobjs.c
@@ -225,8 +225,8 @@
if ( !root->units_per_EM )
root->units_per_EM = 1000;
- root->ascender = face->cid.font_bbox.yMax >> 16;
- root->descender = face->cid.font_bbox.yMin >> 16;
+ root->ascender = (FT_Short)(face->cid.font_bbox.yMax >> 16);
+ root->descender = (FT_Short)(face->cid.font_bbox.yMin >> 16);
root->height = ( ( root->ascender + root->descender ) * 12 )
/ 10;
diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c
index f73346a..cf2c28a 100644
--- a/src/pcf/pcfread.c
+++ b/src/pcf/pcfread.c
@@ -980,10 +980,10 @@ THE SOFTWARE.
yres = find_property( face, "RESOLUTION_Y" );
if ( ( xres != NULL ) && ( yres != NULL ) )
{
- root->available_sizes->width =
- prop->value.integer * 75 / xres->value.integer;
- root->available_sizes->height =
- prop->value.integer * 75 / yres->value.integer;
+ root->available_sizes->width = (FT_Short)
+ (prop->value.integer * 75 / xres->value.integer);
+ root->available_sizes->height = (FT_Short)
+ (prop->value.integer * 75 / yres->value.integer);
}
}
else
diff --git a/src/type1/t1load.c b/src/type1/t1load.c
index f417563..5332000 100644
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -894,7 +894,8 @@
/* Set Units per EM based on FontMatrix values. We set the value to */
/* 1000 / temp_scale, because temp_scale was already multiplied by */
/* 1000 (in t1_tofixed, from psobjs.c). */
- root->units_per_EM = FT_DivFix( 0x10000L, FT_DivFix( temp_scale, 1000 ) );
+ root->units_per_EM = (FT_UShort)FT_DivFix( 0x10000L,
+ FT_DivFix( temp_scale, 1000 ) );
/* we need to scale the values by 1.0/temp_scale */
if ( temp_scale != 0x10000L )
diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c
index c8a6135..84fea49 100644
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -274,14 +274,14 @@
if ( !root->units_per_EM )
root->units_per_EM = 1000;
- root->ascender = face->type1.font_bbox.yMax >> 16;
- root->descender = face->type1.font_bbox.yMin >> 16;
+ root->ascender = (FT_Short)(face->type1.font_bbox.yMax >> 16);
+ root->descender = (FT_Short)(face->type1.font_bbox.yMin >> 16);
root->height = ( ( root->ascender - root->descender ) * 12 ) / 10;
/* now compute the maximum advance width */
- root->max_advance_width = face->type1.font_bbox.xMax >> 16;
+ root->max_advance_width = (FT_Short)(face->type1.font_bbox.xMax >> 16);
{
FT_Int max_advance;