You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by tr...@apache.org on 2016/08/31 16:06:33 UTC

svn commit: r1758639 - /openoffice/trunk/main/vcl/source/fontsubset/sft.cxx

Author: truckman
Date: Wed Aug 31 16:06:33 2016
New Revision: 1758639

URL: http://svn.apache.org/viewvc?rev=1758639&view=rev
Log:
Fix -Wformat-security warnings.

CreateT3FromTTGlyphs() uses a bunch of "const char *" variables to hold
the format strings for its fprintf() calls resulting in warnings that
the format strings for these calls are not string literals.  Suppress
these warnings by changing the variables to be "const char * const".


Modified:
    openoffice/trunk/main/vcl/source/fontsubset/sft.cxx

Modified: openoffice/trunk/main/vcl/source/fontsubset/sft.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/fontsubset/sft.cxx?rev=1758639&r1=1758638&r2=1758639&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/source/fontsubset/sft.cxx (original)
+++ openoffice/trunk/main/vcl/source/fontsubset/sft.cxx Wed Aug 31 16:06:33 2016
@@ -2000,39 +2000,39 @@ int  CreateT3FromTTGlyphs(TrueTypeFont *
     TTGlyphMetrics metrics;
     int UPEm = ttf->unitsPerEm;
 
-    const char *h01 = "%%!PS-AdobeFont-%d.%d-%d.%d\n";
-    const char *h02 = "%% Creator: %s %s %s\n";
-    const char *h09 = "%% Original font name: %s\n";
+    const char * const h01 = "%%!PS-AdobeFont-%d.%d-%d.%d\n";
+    const char * const h02 = "%% Creator: %s %s %s\n";
+    const char * const h09 = "%% Original font name: %s\n";
 
-    const char *h10 =
+    const char * const h10 =
         "30 dict begin\n"
         "/PaintType 0 def\n"
         "/FontType 3 def\n"
         "/StrokeWidth 0 def\n";
 
-    const char *h11 = "/FontName (%s) cvn def\n";
+    const char * const h11 = "/FontName (%s) cvn def\n";
 
     /*
-      const char *h12 = "%/UniqueID %d def\n";
+      const char * const h12 = "%/UniqueID %d def\n";
     */
-    const char *h13 = "/FontMatrix [.001 0 0 .001 0 0] def\n";
-    const char *h14 = "/FontBBox [%d %d %d %d] def\n";
+    const char * const h13 = "/FontMatrix [.001 0 0 .001 0 0] def\n";
+    const char * const h14 = "/FontBBox [%d %d %d %d] def\n";
 
-    const char *h15=
+    const char * const h15=
         "/Encoding 256 array def\n"
         "    0 1 255 {Encoding exch /.notdef put} for\n";
 
-    const char *h16 = "    Encoding %d /glyph%d put\n";
-    const char *h17 = "/XUID [103 0 0 16#%08X %d 16#%08X 16#%08X] def\n";
+    const char * const h16 = "    Encoding %d /glyph%d put\n";
+    const char * const h17 = "/XUID [103 0 0 16#%08X %d 16#%08X 16#%08X] def\n";
 
-    const char *h30 = "/CharProcs %d dict def\n";
-    const char *h31 = "  CharProcs begin\n";
-    const char *h32 = "    /.notdef {} def\n";
-    const char *h33 = "    /glyph%d {\n";
-    const char *h34 = "    } bind def\n";
-    const char *h35 = "  end\n";
+    const char * const h30 = "/CharProcs %d dict def\n";
+    const char * const h31 = "  CharProcs begin\n";
+    const char * const h32 = "    /.notdef {} def\n";
+    const char * const h33 = "    /glyph%d {\n";
+    const char * const h34 = "    } bind def\n";
+    const char * const h35 = "  end\n";
 
-    const char *h40 =
+    const char * const h40 =
         "/BuildGlyph {\n"
         "  exch /CharProcs get exch\n"
         "  2 copy known not\n"
@@ -2045,7 +2045,7 @@ int  CreateT3FromTTGlyphs(TrueTypeFont *
         "} bind def\n"
         "currentdict end\n";
 
-    const char *h41 = "(%s) cvn exch definefont pop\n";
+    const char * const h41 = "(%s) cvn exch definefont pop\n";
 
 
     if (!((nGlyphs > 0) && (nGlyphs <= 256))) return SF_GLYPHNUM;