Commit 168e39a15b4aed8705ca0105bad1b4854848922b

David Turner 2001-03-17T23:25:34

small update to remove compiler warnings

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;