Commit 9be656bb0c0baa8df8c9fa30100e1cbe865346db

Werner Lemberg 2018-09-01T11:01:52

Remove `FT_Outline_{New,Done}_Internal'. These public API functions(!) were always undocumented and have escaped all clean-up efforts until now. * include/freetype/ftoutln.h (FT_Outline_New_Internal, FT_Outline_Done_Internal): Removed. * src/base/ftoutln.h (FT_Outline_New_Internal, FT_Outline_Done_Internal): Merge into... (FT_Outline_New, FT_Outline_Done): ... these functions. * docs/README: Updated.

diff --git a/ChangeLog b/ChangeLog
index bc086cd..a748921 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2018-09-01  Werner Lemberg  <wl@gnu.org>
+
+	Remove `FT_Outline_{New,Done}_Internal'.
+
+	These public API functions(!) were always undocumented and have
+	escaped all clean-up efforts until now.
+
+	* include/freetype/ftoutln.h (FT_Outline_New_Internal,
+	FT_Outline_Done_Internal): Removed.
+
+	* src/base/ftoutln.h (FT_Outline_New_Internal,
+	FT_Outline_Done_Internal): Merge into...
+	(FT_Outline_New, FT_Outline_Done): ... these functions.
+
+	* docs/README: Updated.
+
 2018-08-30  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
 	* src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Check glyph format.
diff --git a/docs/CHANGES b/docs/CHANGES
index 70bfe7a..2b4f4d8 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -6,7 +6,7 @@ CHANGES BETWEEN 2.9.1 and 2.10
 
   II. IMPORTANT CHANGES
 
-    - A bunch of new functions has been added to access and process
+    - A bunch  of new functions has  been added to access  and process
       COLR/CPAL data of OpenType fonts with coloured glyph layers.
 
         FT_Palette_Data_Get
@@ -18,38 +18,43 @@ CHANGES BETWEEN 2.9.1 and 2.10
 
   III. MISCELLANEOUS
 
-    - `TT_Set_MM_Blend' could fail if call repeatedly with the same
+    - `TT_Set_MM_Blend' could  fail if  call repeatedly with  the same
       arguments.
 
-    - The precision of handling deltas in Variation Fonts has been
-      increased.  The problem did only show up with multidimensional
+    - The precision  of handling  deltas in  Variation Fonts  has been
+      increased.  The  problem did only show  up with multidimensional
       designspaces.
 
-    - New function `FT_Library_SetLcdGeometry' to set up the geometry
+    - New function `FT_Library_SetLcdGeometry' to  set up the geometry
       of LCD subpixels.
 
     - FreeType now uses the `defaultChar' property of PCF fonts to set
-      the glyph for the undefined character at glyph index 0 (as
+      the  glyph for  the undefined  character  at glyph  index 0  (as
       FreeType already does for all other supported font formats).  As
-      a consequence, the order of glyphs of a PCF font if accessed with
-      FreeType can be different now compared to previous versions.
+      a consequence,  the order of  glyphs of  a PCF font  if accessed
+      with  FreeType  can  be   different  now  compared  to  previous
+      versions.
 
       This change doesn't affect PCF font access with cmaps.
 
-    - `FT_Select_Charmap' has been changed to allow parameter value
+    - `FT_Select_Charmap' has  been changed  to allow  parameter value
       `FT_ENCODING_NONE', which is valid for BDF, PCF, and Windows FNT
-      formats to access built-in cmaps that don't have a predefined
+      formats to  access built-in cmaps  that don't have  a predefined
       `FT_Encoding' value.
 
-    - A previously reserved field in the `FT_GlyphSlotRec' structure
+    - A previously  reserved field in the  `FT_GlyphSlotRec' structure
       now holds the glyph index.
 
-    - On Win32 platforms, the use of `_DLL' to build the library has
+    - On Win32 platforms,  the use of `_DLL' to build  the library has
       been replaced with `DLL_EXPORT' and `DLL_IMPORT'.
 
-    - The usual round of fuzzer bug fixes to better reject malformed
+    - The usual round  of fuzzer bug fixes to  better reject malformed
       fonts.
 
+    - `FT_Outline_New_Internal'  and  `FT_Outline_Done_Internal'  have
+      been removed.  These two functions were public by oversight only
+      and were never documented either.
+
 
 ======================================================================
 
diff --git a/include/freetype/ftoutln.h b/include/freetype/ftoutln.h
index bbab07c..292616c 100644
--- a/include/freetype/ftoutln.h
+++ b/include/freetype/ftoutln.h
@@ -166,13 +166,6 @@ FT_BEGIN_HEADER
                   FT_Outline  *anoutline );
 
 
-  FT_EXPORT( FT_Error )
-  FT_Outline_New_Internal( FT_Memory    memory,
-                           FT_UInt      numPoints,
-                           FT_Int       numContours,
-                           FT_Outline  *anoutline );
-
-
   /**************************************************************************
    *
    * @function:
@@ -200,11 +193,6 @@ FT_BEGIN_HEADER
                    FT_Outline*  outline );
 
 
-  FT_EXPORT( FT_Error )
-  FT_Outline_Done_Internal( FT_Memory    memory,
-                            FT_Outline*  outline );
-
-
   /**************************************************************************
    *
    * @function:
diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
index 2266ce1..85a4697 100644
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -16,13 +16,6 @@
  */
 
 
-  /**************************************************************************
-   *
-   * All functions are declared in freetype.h.
-   *
-   */
-
-
 #include <ft2build.h>
 #include FT_OUTLINE_H
 #include FT_INTERNAL_OBJECTS_H
@@ -296,15 +289,23 @@
   }
 
 
+  /* documentation is in ftoutln.h */
+
   FT_EXPORT_DEF( FT_Error )
-  FT_Outline_New_Internal( FT_Memory    memory,
-                           FT_UInt      numPoints,
-                           FT_Int       numContours,
-                           FT_Outline  *anoutline )
+  FT_Outline_New( FT_Library   library,
+                  FT_UInt      numPoints,
+                  FT_Int       numContours,
+                  FT_Outline  *anoutline )
   {
-    FT_Error  error;
+    FT_Error   error;
+    FT_Memory  memory;
 
 
+    if ( !library )
+      return FT_THROW( Invalid_Library_Handle );
+
+    memory = library->memory;
+
     if ( !anoutline || !memory )
       return FT_THROW( Invalid_Argument );
 
@@ -330,7 +331,7 @@
 
   Fail:
     anoutline->flags |= FT_OUTLINE_OWNER;
-    FT_Outline_Done_Internal( memory, anoutline );
+    FT_Outline_Done( library, anoutline );
 
     return error;
   }
@@ -339,22 +340,6 @@
   /* documentation is in ftoutln.h */
 
   FT_EXPORT_DEF( FT_Error )
-  FT_Outline_New( FT_Library   library,
-                  FT_UInt      numPoints,
-                  FT_Int       numContours,
-                  FT_Outline  *anoutline )
-  {
-    if ( !library )
-      return FT_THROW( Invalid_Library_Handle );
-
-    return FT_Outline_New_Internal( library->memory, numPoints,
-                                    numContours, anoutline );
-  }
-
-
-  /* documentation is in ftoutln.h */
-
-  FT_EXPORT_DEF( FT_Error )
   FT_Outline_Check( FT_Outline*  outline )
   {
     if ( outline )
@@ -436,13 +421,23 @@
   }
 
 
+  /* documentation is in ftoutln.h */
+
   FT_EXPORT_DEF( FT_Error )
-  FT_Outline_Done_Internal( FT_Memory    memory,
-                            FT_Outline*  outline )
+  FT_Outline_Done( FT_Library   library,
+                   FT_Outline*  outline )
   {
+    FT_Memory  memory;
+
+
+    if ( !library )
+      return FT_THROW( Invalid_Library_Handle );
+
     if ( !outline )
       return FT_THROW( Invalid_Outline );
 
+    memory = library->memory;
+
     if ( !memory )
       return FT_THROW( Invalid_Argument );
 
@@ -460,21 +455,6 @@
 
   /* documentation is in ftoutln.h */
 
-  FT_EXPORT_DEF( FT_Error )
-  FT_Outline_Done( FT_Library   library,
-                   FT_Outline*  outline )
-  {
-    /* check for valid `outline' in FT_Outline_Done_Internal() */
-
-    if ( !library )
-      return FT_THROW( Invalid_Library_Handle );
-
-    return FT_Outline_Done_Internal( library->memory, outline );
-  }
-
-
-  /* documentation is in ftoutln.h */
-
   FT_EXPORT_DEF( void )
   FT_Outline_Get_CBox( const FT_Outline*  outline,
                        FT_BBox           *acbox )