Commit 3ad1c93ac1b111b76dc671181b1deab252cc1f1e

Antony Lee 2019-04-06T06:37:42

Make `glyph_name' parameter to `FT_Get_Name_Index' a `const'. * include/freetype/freetype.h (FT_Get_Name_Index), include/freetype/internal/ftobjs.h (FT_Face_GetGlyphNameIndexFunc), include/freetype/internal/services/svgldict.h (FT_GlyphDict_NameIndexFunc), src/base/ftobjs.c (FT_Get_Name_Index), src/cff/cffdrivr.c (cff_get_name_index), src/sfnt/sfdriver.c (sfnt_get_name_index), src/type1/t1driver.c (t1_get_name_index), src/type42/t42drivr.c (t42_get_name_index): Add `const' to second argument.

diff --git a/ChangeLog b/ChangeLog
index 8c048c2..ad9c3eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2019-04-06  Antony Lee  <anntzer.lee@gmail.com>
+
+	Make `glyph_name' parameter to `FT_Get_Name_Index' a `const'.
+
+	* include/freetype/freetype.h (FT_Get_Name_Index),
+	include/freetype/internal/ftobjs.h (FT_Face_GetGlyphNameIndexFunc),
+	include/freetype/internal/services/svgldict.h
+	(FT_GlyphDict_NameIndexFunc), src/base/ftobjs.c (FT_Get_Name_Index),
+	src/cff/cffdrivr.c (cff_get_name_index), src/sfnt/sfdriver.c
+	(sfnt_get_name_index), src/type1/t1driver.c (t1_get_name_index),
+	src/type42/t42drivr.c (t42_get_name_index): Add `const' to second
+	argument.
+
 2019-03-31  Armin Hasitzka  <prince.cherusker@gmail.com>
 
 	[cff] Fix boundary checks.
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 829f249..f758ea1 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -3932,8 +3932,8 @@ FT_BEGIN_HEADER
    *   The glyph index.  0~means 'undefined character code'.
    */
   FT_EXPORT( FT_UInt )
-  FT_Get_Name_Index( FT_Face     face,
-                     FT_String*  glyph_name );
+  FT_Get_Name_Index( FT_Face           face,
+                     const FT_String*  glyph_name );
 
 
   /**************************************************************************
diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h
index f3a41b3..0578dd8 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -941,8 +941,8 @@ FT_BEGIN_HEADER
                                FT_UInt     buffer_max );
 
   typedef FT_UInt
-  (*FT_Face_GetGlyphNameIndexFunc)( FT_Face     face,
-                                    FT_String*  glyph_name );
+  (*FT_Face_GetGlyphNameIndexFunc)( FT_Face           face,
+                                    const FT_String*  glyph_name );
 
 
 #ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
diff --git a/include/freetype/internal/services/svgldict.h b/include/freetype/internal/services/svgldict.h
index ca8edf0..0949621 100644
--- a/include/freetype/internal/services/svgldict.h
+++ b/include/freetype/internal/services/svgldict.h
@@ -41,8 +41,8 @@ FT_BEGIN_HEADER
                                FT_UInt     buffer_max );
 
   typedef FT_UInt
-  (*FT_GlyphDict_NameIndexFunc)( FT_Face     face,
-                                 FT_String*  glyph_name );
+  (*FT_GlyphDict_NameIndexFunc)( FT_Face           face,
+                                 const FT_String*  glyph_name );
 
 
   FT_DEFINE_SERVICE( GlyphDict )
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 3f8619d..e301f8f 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -4059,8 +4059,8 @@
   /* documentation is in freetype.h */
 
   FT_EXPORT_DEF( FT_UInt )
-  FT_Get_Name_Index( FT_Face     face,
-                     FT_String*  glyph_name )
+  FT_Get_Name_Index( FT_Face           face,
+                     const FT_String*  glyph_name )
   {
     FT_UInt  result = 0;
 
diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c
index bbd5c40..2324989 100644
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -381,8 +381,8 @@
 
 
   static FT_UInt
-  cff_get_name_index( CFF_Face    face,
-                      FT_String*  glyph_name )
+  cff_get_name_index( CFF_Face          face,
+                      const FT_String*  glyph_name )
   {
     CFF_Font            cff;
     CFF_Charset         charset;
diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c
index c467ff4..8149555 100644
--- a/src/sfnt/sfdriver.c
+++ b/src/sfnt/sfdriver.c
@@ -182,8 +182,8 @@
 
 
   static FT_UInt
-  sfnt_get_name_index( FT_Face     face,
-                       FT_String*  glyph_name )
+  sfnt_get_name_index( FT_Face           face,
+                       const FT_String*  glyph_name )
   {
     TT_Face  ttface = (TT_Face)face;
 
diff --git a/src/type1/t1driver.c b/src/type1/t1driver.c
index 8625db5..557733d 100644
--- a/src/type1/t1driver.c
+++ b/src/type1/t1driver.c
@@ -70,8 +70,8 @@
 
 
   static FT_UInt
-  t1_get_name_index( T1_Face     face,
-                     FT_String*  glyph_name )
+  t1_get_name_index( T1_Face           face,
+                     const FT_String*  glyph_name )
   {
     FT_Int  i;
 
diff --git a/src/type42/t42drivr.c b/src/type42/t42drivr.c
index 6d4e7a0..09ad632 100644
--- a/src/type42/t42drivr.c
+++ b/src/type42/t42drivr.c
@@ -69,8 +69,8 @@
 
 
   static FT_UInt
-  t42_get_name_index( T42_Face    face,
-                      FT_String*  glyph_name )
+  t42_get_name_index( T42_Face          face,
+                      const FT_String*  glyph_name )
   {
     FT_Int  i;