Commit da95af6cf67c65bd453fc19908a3f14ac2a8c0c5

David Turner 2006-03-20T13:32:33

* builds/win32/visualc/freetype.dsp: updating the project file, adding missing base source files (e.g. ftstroke.c, ftxf86.c, etc...) * src/autofit/afcjk.c, src/autofit/aflatin.c, src/base/ftobjs.c, src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrobjs.c, src/sfnt/sfobjs.c, src/sfnt/ttmtx.c, src/truetype/ttpload.c, src/truetype/ttpload.h, src/type1/t1afm.c, src/type1/t1objs.c: removing compiler warnings when building with Visual C++ 6 and /W4

diff --git a/ChangeLog b/ChangeLog
index 72be870..c6fa5aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2006-03-20 David Turner  <david@freetype.org>
 
+    * builds/win32/visualc/freetype.dsp: updating the project file, adding
+    missing base source files (e.g. ftstroke.c, ftxf86.c, etc...)
+
+    * src/autofit/afcjk.c, src/autofit/aflatin.c, src/base/ftobjs.c,
+    src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrobjs.c,
+    src/sfnt/sfobjs.c, src/sfnt/ttmtx.c, src/truetype/ttpload.c,
+    src/truetype/ttpload.h, src/type1/t1afm.c, src/type1/t1objs.c:
+      removing compiler warnings when building with Visual C++ 6 and /W4
+
     * builds/unix/install.mk:
       changing the installation procedure to remove the 'freetype/cache'
       from the target directory.
diff --git a/builds/win32/visualc/freetype.dsp b/builds/win32/visualc/freetype.dsp
index f796afb..5e56c8e 100644
--- a/builds/win32/visualc/freetype.dsp
+++ b/builds/win32/visualc/freetype.dsp
@@ -214,6 +214,14 @@ SOURCE=..\..\..\src\base\ftbase.c
 # End Source File
 # Begin Source File
 
+SOURCE=..\..\..\src\base\ftbbox.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\base\ftbdf.c
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\..\src\base\ftbitmap.c
 # End Source File
 # Begin Source File
@@ -234,6 +242,10 @@ SOURCE=..\..\..\src\base\ftglyph.c
 # End Source File
 # Begin Source File
 
+SOURCE=..\..\..\src\base\ftgxval.c
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\..\src\gzip\ftgzip.c
 # End Source File
 # Begin Source File
@@ -252,11 +264,39 @@ SOURCE=..\..\..\src\base\ftmm.c
 # End Source File
 # Begin Source File
 
+SOURCE=..\..\..\src\base\ftotval.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\base\ftpfr.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\base\ftstroke.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\base\ftsynth.c
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\..\src\base\ftsystem.c
 # SUBTRACT CPP /Fr
 # End Source File
 # Begin Source File
 
+SOURCE=..\..\..\src\base\fttype1.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\base\ftwinfnt.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\base\ftxf86.c
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\..\src\pcf\pcf.c
 # SUBTRACT CPP /Fr
 # End Source File
diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c
index 775f036..6a020e3 100644
--- a/src/autofit/afcjk.c
+++ b/src/autofit/afcjk.c
@@ -163,7 +163,7 @@
     AF_Segment    segment_limit = segments + axis->num_segments;
     AF_Direction  major_dir     = axis->major_dir;
     AF_Segment    seg1, seg2;
-    FT_UShort     len_threshold;
+    FT_Pos        len_threshold;
     FT_Pos        dist_threshold;
 
 
@@ -1275,10 +1275,10 @@
     FT_Bool       snapping;
 
 
-    snapping = ( ( dim == AF_DIMENSION_HORZ             &&
-                   AF_LATIN_HINTS_DO_HORZ_SNAP( hints ) ) ||
-                 ( dim == AF_DIMENSION_VERT             &&
-                   AF_LATIN_HINTS_DO_VERT_SNAP( hints ) ) );
+    snapping = FT_BOOL( ( dim == AF_DIMENSION_HORZ             &&
+                          AF_LATIN_HINTS_DO_HORZ_SNAP( hints ) )  ||
+                        ( dim == AF_DIMENSION_VERT             &&
+                          AF_LATIN_HINTS_DO_VERT_SNAP( hints ) )  );
 
     for ( edge = edges; edge < edge_limit; edge++ )
     {
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index 9c1beb3..94108df 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -856,7 +856,7 @@
     AF_Segment    segments      = axis->segments;
     AF_Segment    segment_limit = segments + axis->num_segments;
     AF_Direction  major_dir     = axis->major_dir;
-    FT_UShort     len_threshold, len_score;
+    FT_Pos        len_threshold, len_score;
     AF_Segment    seg1, seg2;
 
 
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 0ae061a..821571a 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -630,8 +630,7 @@
 #ifdef GRID_FIT_METRICS
         if ( !( load_flags & FT_LOAD_NO_HINTING ) )
           ft_glyphslot_grid_fit_metrics( slot,
-                                         load_flags
-                                           & FT_LOAD_VERTICAL_LAYOUT );
+              FT_BOOL( load_flags & FT_LOAD_VERTICAL_LAYOUT ) );
 #endif
       }
     }
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index 4ddbc3a..56c1fc0 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -471,7 +471,7 @@
 
         cffface->height = (FT_Short)( ( cffface->units_per_EM * 12 ) / 10 );
         if ( cffface->height < cffface->ascender - cffface->descender )
-          cffface->height = cffface->ascender - cffface->descender;
+          cffface->height = (FT_Short)( cffface->ascender - cffface->descender );
 
         cffface->underline_position  =
           (FT_Short)( dict->underline_position >> 16 );
diff --git a/src/cid/cidobjs.c b/src/cid/cidobjs.c
index 7d318a3..1b3bfbf 100644
--- a/src/cid/cidobjs.c
+++ b/src/cid/cidobjs.c
@@ -425,7 +425,7 @@
 
       cidface->height = (FT_Short)( ( cidface->units_per_EM * 12 ) / 10 );
       if ( cidface->height < cidface->ascender - cidface->descender )
-        cidface->height = cidface->ascender - cidface->descender;
+        cidface->height = (FT_Short)( cidface->ascender - cidface->descender );
 
       cidface->underline_position  = (FT_Short)info->underline_position;
       cidface->underline_thickness = (FT_Short)info->underline_thickness;
diff --git a/src/pfr/pfrobjs.c b/src/pfr/pfrobjs.c
index 3e2beee..6c0ce90 100644
--- a/src/pfr/pfrobjs.c
+++ b/src/pfr/pfrobjs.c
@@ -168,7 +168,7 @@
 
       pfrface->height = (FT_Short)( ( pfrface->units_per_EM * 12 ) / 10 );
       if ( pfrface->height < pfrface->ascender - pfrface->descender )
-        pfrface->height = pfrface->ascender - pfrface->descender;
+        pfrface->height = (FT_Short)(pfrface->ascender - pfrface->descender);
 
       if ( phy_font->num_strikes > 0 )
       {
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index 1516806..a29a0b6 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -567,7 +567,7 @@
     if ( !has_outline && sfnt->load_bhed )
     {
       LOAD_( bhed );
-      is_apple_sbit = !error;
+      is_apple_sbit = FT_BOOL(!error);
     }
 
     /* load the font header (`head' table) if this isn't an Apple */
@@ -947,7 +947,7 @@
             if ( error )
               goto Exit;
 
-            bsize->height = metrics.height >> 6;
+            bsize->height = (FT_Short)(metrics.height >> 6);
             bsize->width = (FT_Short)(
                 ( avgwidth * metrics.x_ppem + em_size / 2 ) / em_size );
 
diff --git a/src/sfnt/ttmtx.c b/src/sfnt/ttmtx.c
index 50825cc..d0140b3 100644
--- a/src/sfnt/ttmtx.c
+++ b/src/sfnt/ttmtx.c
@@ -214,9 +214,9 @@
     FT_FRAME_EXIT();
 
     if ( vertical )
-      face->vertical.number_Of_VMetrics = num_longs;
+      face->vertical.number_Of_VMetrics = (FT_UShort)num_longs;
     else
-      face->horizontal.number_Of_HMetrics = num_longs;
+      face->horizontal.number_Of_HMetrics = (FT_UShort)num_longs;
 
   Fail:
     return error;
diff --git a/src/truetype/ttpload.c b/src/truetype/ttpload.c
index da2677b..36e5a66 100644
--- a/src/truetype/ttpload.c
+++ b/src/truetype/ttpload.c
@@ -575,18 +575,18 @@
     {
       if ( p + record_size > limit )
         break;
-        
+
       face->hdmx_record_sizes[nn] = p[0];
       p                          += record_size;
     }
-    
+
     face->hdmx_record_count = nn;
     face->hdmx_table_size   = table_size;
     face->hdmx_record_size  = record_size;
 
   Exit:
     return error;
-    
+
   Fail:
     FT_FRAME_RELEASE( face->hdmx_table );
     face->hdmx_table_size = 0;
@@ -599,7 +599,7 @@
   {
     FT_Stream  stream = face->root.stream;
     FT_Memory  memory = stream->memory;
-    
+
 
     FT_FREE( face->hdmx_record_sizes );
     FT_FRAME_RELEASE( face->hdmx_table );
@@ -708,7 +708,7 @@
   /*                                                                       */
   FT_LOCAL_DEF( FT_Byte* )
   tt_face_get_device_metrics( TT_Face  face,
-                              FT_Byte  ppem,
+                              FT_UInt  ppem,
                               FT_UInt  gindex )
   {
 #ifdef FT_OPTIMIZE_MEMORY
diff --git a/src/truetype/ttpload.h b/src/truetype/ttpload.h
index b484f02..f61ac07 100644
--- a/src/truetype/ttpload.h
+++ b/src/truetype/ttpload.h
@@ -64,7 +64,7 @@ FT_BEGIN_HEADER
 
   FT_LOCAL( FT_Byte* )
   tt_face_get_device_metrics( TT_Face    face,
-                              FT_Byte    ppem,
+                              FT_UInt    ppem,
                               FT_UInt    gindex );
 
 FT_END_HEADER
diff --git a/src/type1/t1afm.c b/src/type1/t1afm.c
index 4071fff..25a2221 100644
--- a/src/type1/t1afm.c
+++ b/src/type1/t1afm.c
@@ -285,8 +285,8 @@
       t1_face->bbox.xMax = ( fi->FontBBox.xMax + 0xFFFFU ) >> 16;
       t1_face->bbox.yMax = ( fi->FontBBox.yMax + 0xFFFFU ) >> 16;
 
-      t1_face->ascender  = ( fi->Ascender  + 0x8000U ) >> 16;
-      t1_face->descender = ( fi->Descender + 0x8000U ) >> 16;
+      t1_face->ascender  = (FT_Short)(( fi->Ascender  + 0x8000U ) >> 16);
+      t1_face->descender = (FT_Short)(( fi->Descender + 0x8000U ) >> 16);
 
       if ( fi->NumKernPair )
       {
diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c
index fae69c1..aa95122 100644
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -420,7 +420,7 @@
 
       root->height = (FT_Short)( ( root->units_per_EM * 12 ) / 10 );
       if ( root->height < root->ascender - root->descender )
-        root->height = root->ascender - root->descender;
+        root->height = (FT_Short)( root->ascender - root->descender );
 
       /* now compute the maximum advance width */
       root->max_advance_width =