]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror 1.1.x changes.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 14 May 2003 18:22:54 +0000 (18:22 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Wed, 14 May 2003 18:22:54 +0000 (18:22 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@3723 7a7537e8-13f0-0310-91df-b6672ffda945

43 files changed:
CHANGES-1.1.txt
pdftops/BuiltinFont.cxx
pdftops/BuiltinFont.h
pdftops/CMap.cxx
pdftops/CMap.h
pdftops/CompactFontTables.h
pdftops/Dict.cxx
pdftops/Dict.h
pdftops/DisplayFontTable.h
pdftops/Error.cxx
pdftops/Error.h
pdftops/FontEncodingTables.cxx
pdftops/FontEncodingTables.h
pdftops/FontFile.cxx
pdftops/FontFile.h
pdftops/Function.cxx
pdftops/GfxFont.cxx
pdftops/GfxFont.h
pdftops/GfxState.cxx
pdftops/GfxState.h
pdftops/GlobalParams.cxx
pdftops/GlobalParams.h
pdftops/JBIG2Stream.cxx
pdftops/JBIG2Stream.h
pdftops/Makefile
pdftops/NameToCharCode.cxx
pdftops/NameToCharCode.h
pdftops/NameToUnicodeTable.h
pdftops/Object.cxx
pdftops/Object.h
pdftops/PSOutputDev.cxx
pdftops/PSOutputDev.h
pdftops/Page.cxx
pdftops/Page.h
pdftops/Stream.cxx
pdftops/Stream.h
pdftops/UnicodeMap.cxx
pdftops/UnicodeMap.h
pdftops/gfile.cxx
pdftops/gfile.h
pdftops/gmem.c
pdftops/gmem.h
pdftops/parseargs.c

index a8c9a9dc09e9f0f3c9aa643ee8ebda9bcb43aa9d..64a676faba4c4ce0f13a30654e280b8eb72e567f 100644 (file)
@@ -1,6 +1,11 @@
 CHANGES-1.1.txt
 ---------------
 
+CHANGES IN CUPS V1.1.19
+
+       - Fixed compiler warnings in pdftops filter (STR #96)
+
+
 CHANGES IN CUPS V1.1.19rc5
 
        - Jobs with banner pages that were printed to implicit
index 2af7afe8570d5dbdaa3c381d79ce854c6a4b1082..0525ab8ae50095afe6be8719c25d8737226c262e 100644 (file)
@@ -39,7 +39,7 @@ BuiltinFontWidths::~BuiltinFontWidths() {
   gfree(tab);
 }
 
-GBool BuiltinFontWidths::getWidth(char *name, Gushort *width) {
+GBool BuiltinFontWidths::getWidth(const char *name, Gushort *width) {
   int h;
   BuiltinFontWidth *p;
 
@@ -53,8 +53,8 @@ GBool BuiltinFontWidths::getWidth(char *name, Gushort *width) {
   return gFalse;
 }
 
-int BuiltinFontWidths::hash(char *name) {
-  char *p;
+int BuiltinFontWidths::hash(const char *name) {
+  const char *p;
   unsigned int h;
 
   h = 0;
index 3c036d7f3e87332d8f5d220d5751237df2bf42a0..3bae15db5f6d1f92ae99418b5c73e1fcb00e95b4 100644 (file)
@@ -23,8 +23,8 @@ class BuiltinFontWidths;
 //------------------------------------------------------------------------
 
 struct BuiltinFont {
-  char *name;
-  char **defaultBaseEnc;
+  const char *name;
+  const char **defaultBaseEnc;
   short ascent;
   short descent;
   short bbox[4];
@@ -34,7 +34,7 @@ struct BuiltinFont {
 //------------------------------------------------------------------------
 
 struct BuiltinFontWidth {
-  char *name;
+  const char *name;
   Gushort width;
   BuiltinFontWidth *next;
 };
@@ -44,11 +44,11 @@ public:
 
   BuiltinFontWidths(BuiltinFontWidth *widths, int sizeA);
   ~BuiltinFontWidths();
-  GBool getWidth(char *name, Gushort *width);
+  GBool getWidth(const char *name, Gushort *width);
 
 private:
 
-  int hash(char *name);
+  int hash(const char *name);
 
   BuiltinFontWidth **tab;
   int size;
index 67542fb6442892a4ffe4445f119192998301b69c..28dc3eae2b380004c9b2fac4b60add62e2312db8 100644 (file)
@@ -154,7 +154,7 @@ CMap::CMap(GString *collectionA, GString *cMapNameA, int wModeA) {
   refCnt = 1;
 }
 
-void CMap::useCMap(CMapCache *cache, char *useName) {
+void CMap::useCMap(CMapCache *cache, const char *useName) {
   GString *useNameStr;
   CMap *subCMap;
 
@@ -279,7 +279,7 @@ GBool CMap::match(GString *collectionA, GString *cMapNameA) {
   return !collection->cmp(collectionA) && !cMapName->cmp(cMapNameA);
 }
 
-CID CMap::getCID(char *s, int len, int *nUsed) {
+CID CMap::getCID(const char *s, int len, int *nUsed) {
   CMapVectorEntry *vec;
   int n, i;
 
index af40b99d719086449915f6831f282afae151c7f6..df44a2be862c5311477850ba21d032564a54c8f7 100644 (file)
@@ -47,7 +47,7 @@ public:
   // Return the CID corresponding to the character code starting at
   // <s>, which contains <len> bytes.  Sets *<nUsed> to the number of
   // bytes used by the char code.
-  CID getCID(char *s, int len, int *nUsed);
+  CID getCID(const char *s, int len, int *nUsed);
 
   // Return the writing mode (0=horizontal, 1=vertical).
   int getWMode() { return wMode; }
@@ -56,7 +56,7 @@ private:
 
   CMap(GString *collectionA, GString *cMapNameA);
   CMap(GString *collectionA, GString *cMapNameA, int wModeA);
-  void useCMap(CMapCache *cache, char *useName);
+  void useCMap(CMapCache *cache, const char *useName);
   void copyVector(CMapVectorEntry *dest, CMapVectorEntry *src);
   void addCodeSpace(CMapVectorEntry *vec, Guint start, Guint end,
                    Guint nBytes);
index 28e16e775ea332f1ed17b5517f3654afadacc527..4e267934935ce8f487a4312ae35876c8c598a496 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef COMPACTFONTINFO_H
 #define COMPACTFONTINFO_H
 
-static char *type1CStdStrings[391] = {
+static const char *type1CStdStrings[391] = {
   ".notdef",
   "space",
   "exclam",
index c9ec7f010e059f090cb3310bfdbffaaa0a330000..c773637a868461e6b08d481318d7205be1451513 100644 (file)
@@ -34,13 +34,13 @@ Dict::~Dict() {
   int i;
 
   for (i = 0; i < length; ++i) {
-    gfree(entries[i].key);
+    gfree((void *)entries[i].key);
     entries[i].val.free();
   }
   gfree(entries);
 }
 
-void Dict::add(char *key, Object *val) {
+void Dict::add(const char *key, Object *val) {
   if (length + 1 > size) {
     size += 8;
     entries = (DictEntry *)grealloc(entries, size * sizeof(DictEntry));
@@ -50,7 +50,7 @@ void Dict::add(char *key, Object *val) {
   ++length;
 }
 
-inline DictEntry *Dict::find(char *key) {
+inline DictEntry *Dict::find(const char *key) {
   int i;
 
   for (i = 0; i < length; ++i) {
@@ -60,25 +60,25 @@ inline DictEntry *Dict::find(char *key) {
   return NULL;
 }
 
-GBool Dict::is(char *type) {
+GBool Dict::is(const char *type) {
   DictEntry *e;
 
   return (e = find("Type")) && e->val.isName(type);
 }
 
-Object *Dict::lookup(char *key, Object *obj) {
+Object *Dict::lookup(const char *key, Object *obj) {
   DictEntry *e;
 
   return (e = find(key)) ? e->val.fetch(xref, obj) : obj->initNull();
 }
 
-Object *Dict::lookupNF(char *key, Object *obj) {
+Object *Dict::lookupNF(const char *key, Object *obj) {
   DictEntry *e;
 
   return (e = find(key)) ? e->val.copy(obj) : obj->initNull();
 }
 
-char *Dict::getKey(int i) {
+const char *Dict::getKey(int i) {
   return entries[i].key;
 }
 
index f63c98e007b747c3077378e93d2b8c7b40b618a6..5de03897b6a599647480e579f4765fa2bccdbbd4 100644 (file)
@@ -22,7 +22,7 @@
 //------------------------------------------------------------------------
 
 struct DictEntry {
-  char *key;
+  const char *key;
   Object val;
 };
 
@@ -43,18 +43,18 @@ public:
   int getLength() { return length; }
 
   // Add an entry.  NB: does not copy key.
-  void add(char *key, Object *val);
+  void add(const char *key, Object *val);
 
   // Check if dictionary is of specified type.
-  GBool is(char *type);
+  GBool is(const char *type);
 
   // Look up an entry and return the value.  Returns a null object
   // if <key> is not in the dictionary.
-  Object *lookup(char *key, Object *obj);
-  Object *lookupNF(char *key, Object *obj);
+  Object *lookup(const char *key, Object *obj);
+  Object *lookupNF(const char *key, Object *obj);
 
   // Iterative accessors.
-  char *getKey(int i);
+  const char *getKey(int i);
   Object *getVal(int i, Object *obj);
   Object *getValNF(int i, Object *obj);
 
@@ -71,7 +71,7 @@ private:
   int length;                  // number of entries in dictionary
   int ref;                     // reference count
 
-  DictEntry *find(char *key);
+  DictEntry *find(const char *key);
 };
 
 #endif
index 3c2379f3d717367ce2e81d38167718d29fcdcb80..f3803dd8549b40be87678beb8aa16ff8e15e439f 100644 (file)
@@ -7,9 +7,9 @@
 //========================================================================
 
 static struct {
-  char *name;
-  char *xlfd;
-  char *encoding;
+  const char *name;
+  const char *xlfd;
+  const char *encoding;
 } displayFontTab[] = {
   {"Courier",               "-*-courier-medium-r-normal-*-%s-*-*-*-*-*-iso8859-1",         "Latin1"},
   {"Courier-Bold",          "-*-courier-bold-r-normal-*-%s-*-*-*-*-*-iso8859-1",           "Latin1"},
index a871c36ea79b5c09567bfe8722854043577a7146..5f6ea93786f7c78bf16069ffb20f1db1d6be1829 100644 (file)
@@ -18,7 +18,7 @@
 #include "GlobalParams.h"
 #include "Error.h"
 
-void CDECL error(int pos, char *msg, ...) {
+void CDECL error(int pos, const char *msg, ...) {
   va_list args;
 
   // NB: this can be called before the globalParams object is created
index cc51e5febf8e55cd84ab1ddf6a2455fcf78cc853..ce2aeade933dbfe33ed1e397f90fb18215e59bd4 100644 (file)
@@ -18,6 +18,6 @@
 #include <stdio.h>
 #include "config.h"
 
-extern void CDECL error(int pos, char *msg, ...);
+extern void CDECL error(int pos, const char *msg, ...);
 
 #endif
index 14a84d430153ffc36e77ac2675d24640cff8853c..289d0c8d61aeafb59d2dbf7ad4aef534cb1d5fab 100644 (file)
@@ -10,7 +10,7 @@
 #include <stdlib.h>
 #include "FontEncodingTables.h"
 
-char *macRomanEncoding[256] = {
+const char *macRomanEncoding[256] = {
   NULL,
   NULL,
   NULL,
@@ -269,7 +269,7 @@ char *macRomanEncoding[256] = {
   "caron"
 };
 
-char *macExpertEncoding[256] = {
+const char *macExpertEncoding[256] = {
   NULL,
   NULL,
   NULL,
@@ -528,7 +528,7 @@ char *macExpertEncoding[256] = {
   NULL
 };
 
-char *winAnsiEncoding[256] = {
+const char *winAnsiEncoding[256] = {
   NULL,
   NULL,
   NULL,
@@ -787,7 +787,7 @@ char *winAnsiEncoding[256] = {
   "ydieresis"
 };
 
-char *standardEncoding[256] = {
+const char *standardEncoding[256] = {
   NULL,
   NULL,
   NULL,
@@ -1046,7 +1046,7 @@ char *standardEncoding[256] = {
   NULL
 };
 
-char *expertEncoding[256] = {
+const char *expertEncoding[256] = {
   NULL,
   NULL,
   NULL,
@@ -1305,7 +1305,7 @@ char *expertEncoding[256] = {
   "Ydieresissmall"
 };
 
-char *symbolEncoding[256] = {
+const char *symbolEncoding[256] = {
   NULL,
   NULL,
   NULL,
@@ -1564,7 +1564,7 @@ char *symbolEncoding[256] = {
   NULL
 };
 
-char *zapfDingbatsEncoding[256] = {
+const char *zapfDingbatsEncoding[256] = {
   NULL,
   NULL,
   NULL,
index 8b0a1e7e9933a1d0738381fa196d7dd17abf0786..a417b324e48087cbb6264cbe366a2c6bb1817c69 100644 (file)
@@ -9,12 +9,12 @@
 #ifndef FONTENCODINGTABLES_H
 #define FONTENCODINGTABLES_H
 
-extern char *macRomanEncoding[];
-extern char *macExpertEncoding[];
-extern char *winAnsiEncoding[];
-extern char *standardEncoding[];
-extern char *expertEncoding[];
-extern char *symbolEncoding[];
-extern char *zapfDingbatsEncoding[];
+extern const char *macRomanEncoding[];
+extern const char *macExpertEncoding[];
+extern const char *winAnsiEncoding[];
+extern const char *standardEncoding[];
+extern const char *expertEncoding[];
+extern const char *symbolEncoding[];
+extern const char *zapfDingbatsEncoding[];
 
 #endif
index d287be0f372c03b21d12318e203973ddea75b2ad..91700e0f61ad40cdc2a87958468e894401726b0a 100644 (file)
@@ -29,7 +29,7 @@
 
 //------------------------------------------------------------------------
 
-static inline char *nextLine(char *line, char *end) {
+static inline const char *nextLine(const char *line, const char *end) {
   while (line < end && *line != '\n' && *line != '\r')
     ++line;
   while (line < end && *line == '\n' || *line == '\r')
@@ -37,7 +37,7 @@ static inline char *nextLine(char *line, char *end) {
   return line;
 }
 
-static char hexChars[17] = "0123456789ABCDEF";
+static const char hexChars[17] = "0123456789ABCDEF";
 
 //------------------------------------------------------------------------
 // FontFile
@@ -53,8 +53,9 @@ FontFile::~FontFile() {
 // Type1FontFile
 //------------------------------------------------------------------------
 
-Type1FontFile::Type1FontFile(char *file, int len) {
-  char *line, *line1, *p, *p2;
+Type1FontFile::Type1FontFile(const char *file, int len) {
+  const char *line, *line1;
+  char *p, *p2;
   GBool haveEncoding;
   char buf[256];
   char c;
@@ -188,7 +189,7 @@ struct Type1CPrivateDict {
   GBool nominalWidthXFP;
 };
 
-Type1CFontFile::Type1CFontFile(char *fileA, int lenA) {
+Type1CFontFile::Type1CFontFile(const char *fileA, int lenA) {
   Guchar *nameIdxPtr, *idxPtr0, *idxPtr1;
 
   file = fileA;
@@ -228,15 +229,15 @@ Type1CFontFile::~Type1CFontFile() {
   }
 }
 
-char *Type1CFontFile::getName() {
+const char *Type1CFontFile::getName() {
   return name->getCString();
 }
 
-char **Type1CFontFile::getEncoding() {
+const char **Type1CFontFile::getEncoding() {
   if (!encoding) {
     readNameAndEncoding();
   }
-  return encoding;
+  return (const char **)encoding;
 }
 
 void Type1CFontFile::readNameAndEncoding() {
@@ -595,7 +596,7 @@ void Type1CFontFile::convertToType1(FontFileOutputFunc outputFuncA,
   }
 }
 
-void Type1CFontFile::convertToCIDType0(char *psName,
+void Type1CFontFile::convertToCIDType0(const char *psName,
                                       FontFileOutputFunc outputFuncA,
                                       void *outputStreamA) {
   Type1CTopDict dict;
@@ -883,7 +884,7 @@ void Type1CFontFile::convertToCIDType0(char *psName,
   gfree(fdSelect);
 }
 
-void Type1CFontFile::convertToType0(char *psName,
+void Type1CFontFile::convertToType0(const char *psName,
                                    FontFileOutputFunc outputFuncA,
                                    void *outputStreamA) {
   Type1CTopDict dict;
@@ -1405,7 +1406,7 @@ Gushort *Type1CFontFile::readCharset(int charset, int nGlyphs) {
   return glyphNames;
 }
 
-void Type1CFontFile::eexecWrite(char *s) {
+void Type1CFontFile::eexecWrite(const char *s) {
   Guchar *p;
   Guchar x;
 
@@ -1422,7 +1423,7 @@ void Type1CFontFile::eexecWrite(char *s) {
   }
 }
 
-void Type1CFontFile::eexecCvtGlyph(char *glyphName, Guchar *s, int n) {
+void Type1CFontFile::eexecCvtGlyph(const char *glyphName, Guchar *s, int n) {
   char eBuf[256];
 
   cvtGlyph(s, n);
@@ -2098,7 +2099,7 @@ void Type1CFontFile::eexecWriteCharstring(Guchar *s, int n) {
   }
 }
 
-void Type1CFontFile::getDeltaInt(char *buf, char *key, double *opA,
+void Type1CFontFile::getDeltaInt(char *buf, const char *key, double *opA,
                                 int n) {
   int x, i;
 
@@ -2113,7 +2114,7 @@ void Type1CFontFile::getDeltaInt(char *buf, char *key, double *opA,
   sprintf(buf, "] def\n");
 }
 
-void Type1CFontFile::getDeltaReal(char *buf, char *key, double *opA,
+void Type1CFontFile::getDeltaReal(char *buf, const char *key, double *opA,
                                  int n) {
   double x;
   int i;
@@ -2318,7 +2319,7 @@ struct TTFontTableHdr {
 };
 
 struct T42Table {
-  char *tag;                   // 4-byte tag
+  const char *tag;             // 4-byte tag
   GBool required;              // required by the TrueType spec?
 };
 
@@ -2344,7 +2345,7 @@ static T42Table t42Tables[nT42Tables] = {
 
 // Glyph names in some arbitrary standard that Apple uses for their
 // TrueType fonts.
-static char *macGlyphNames[258] = {
+static const char *macGlyphNames[258] = {
   ".notdef",
   "null",
   "CR",
@@ -2618,7 +2619,7 @@ struct TrueTypeLoca {
   int length;
 };
 
-TrueTypeFontFile::TrueTypeFontFile(char *fileA, int lenA) {
+TrueTypeFontFile::TrueTypeFontFile(const char *fileA, int lenA) {
   int pos, i, idx, n, length;
   Guint size, startPos, endPos;
 
@@ -2704,11 +2705,11 @@ TrueTypeFontFile::~TrueTypeFontFile() {
   gfree(tableHdrs);
 }
 
-char *TrueTypeFontFile::getName() {
+const char *TrueTypeFontFile::getName() {
   return NULL;
 }
 
-char **TrueTypeFontFile::getEncoding() {
+const char **TrueTypeFontFile::getEncoding() {
   int cmap[256];
   int nCmaps, cmapPlatform, cmapEncoding, cmapFmt;
   int cmapLen, cmapOffset, cmapFirst;
@@ -2719,7 +2720,7 @@ char **TrueTypeFontFile::getEncoding() {
   int stringIdx, stringPos, n;
 
   if (encoding) {
-    return encoding;
+    return (const char **)encoding;
   }
 
   //----- construct the (char code) -> (glyph idx) mapping
@@ -2877,10 +2878,10 @@ char **TrueTypeFontFile::getEncoding() {
     }
   }
 
-  return encoding;
+  return (const char **)encoding;
 }
 
-void TrueTypeFontFile::convertToType42(char *name, char **encodingA,
+void TrueTypeFontFile::convertToType42(const char *name, const char **encodingA,
                                       CharCodeToUnicode *toUnicode,
                                       GBool pdfFontHasEncoding,
                                       FontFileOutputFunc outputFunc,
@@ -2913,7 +2914,7 @@ void TrueTypeFontFile::convertToType42(char *name, char **encodingA,
   (*outputFunc)(outputStream, "FontName currentdict end definefont pop\n", 40);
 }
 
-void TrueTypeFontFile::convertToCIDType2(char *name, Gushort *cidMap,
+void TrueTypeFontFile::convertToCIDType2(const char *name, Gushort *cidMap,
                                         int nCIDs,
                                         FontFileOutputFunc outputFunc,
                                         void *outputStream) {
@@ -3021,7 +3022,7 @@ void TrueTypeFontFile::convertToCIDType2(char *name, Gushort *cidMap,
                56);
 }
 
-void TrueTypeFontFile::convertToType0(char *name, Gushort *cidMap,
+void TrueTypeFontFile::convertToType0(const char *name, Gushort *cidMap,
                                      int nCIDs,
                                      FontFileOutputFunc outputFunc,
                                      void *outputStream) {
@@ -3157,7 +3158,7 @@ double TrueTypeFontFile::getFixed(int pos) {
   return (double)x + (double)y / 65536;
 }
 
-int TrueTypeFontFile::seekTable(char *tag) {
+int TrueTypeFontFile::seekTable(const char *tag) {
   int i;
 
   for (i = 0; i < nTables; ++i) {
@@ -3168,7 +3169,7 @@ int TrueTypeFontFile::seekTable(char *tag) {
   return -1;
 }
 
-int TrueTypeFontFile::seekTableIdx(char *tag) {
+int TrueTypeFontFile::seekTableIdx(const char *tag) {
   int i;
 
   for (i = 0; i < nTables; ++i) {
@@ -3179,10 +3180,10 @@ int TrueTypeFontFile::seekTableIdx(char *tag) {
   return -1;
 }
 
-void TrueTypeFontFile::cvtEncoding(char **encodingA, GBool pdfFontHasEncoding,
+void TrueTypeFontFile::cvtEncoding(const char **encodingA, GBool pdfFontHasEncoding,
                                   FontFileOutputFunc outputFunc,
                                   void *outputStream) {
-  char *name;
+  const char *name;
   char buf[64];
   int i;
 
@@ -3206,7 +3207,7 @@ void TrueTypeFontFile::cvtEncoding(char **encodingA, GBool pdfFontHasEncoding,
   (*outputFunc)(outputStream, "readonly def\n", 13);
 }
 
-void TrueTypeFontFile::cvtCharStrings(char **encodingA,
+void TrueTypeFontFile::cvtCharStrings(const char **encodingA,
                                      CharCodeToUnicode *toUnicode,
                                      GBool pdfFontHasEncoding,
                                      FontFileOutputFunc outputFunc,
@@ -3214,7 +3215,7 @@ void TrueTypeFontFile::cvtCharStrings(char **encodingA,
   int unicodeCmap, macRomanCmap, msSymbolCmap;
   int nCmaps, cmapPlatform, cmapEncoding, cmapFmt, cmapOffset;
   T42FontIndexMode mode;
-  char *name;
+  const char *name;
   char buf[64], buf2[16];
   Unicode u;
   int pos, i, j, k;
@@ -3607,7 +3608,7 @@ void TrueTypeFontFile::cvtSfnts(FontFileOutputFunc outputFunc,
   gfree(locaTable);
 }
 
-void TrueTypeFontFile::dumpString(char *s, int length,
+void TrueTypeFontFile::dumpString(const char *s, int length,
                                  FontFileOutputFunc outputFunc,
                                  void *outputStream) {
   char buf[64];
@@ -3635,7 +3636,7 @@ void TrueTypeFontFile::dumpString(char *s, int length,
   (*outputFunc)(outputStream, "00>\n", 4);
 }
 
-Guint TrueTypeFontFile::computeTableChecksum(char *data, int length) {
+Guint TrueTypeFontFile::computeTableChecksum(const char *data, int length) {
   Guint checksum, word;
   int i;
 
index 80d6b1d8e2169dbb1fa392c4978808dab08135f6..f40e998e6635d88049b971bc58352b9b86ab20b1 100644 (file)
@@ -24,7 +24,7 @@ class CharCodeToUnicode;
 
 //------------------------------------------------------------------------
 
-typedef void (*FontFileOutputFunc)(void *stream, char *data, int len);
+typedef void (*FontFileOutputFunc)(void *stream, const char *data, int len);
 
 //------------------------------------------------------------------------
 // FontFile
@@ -38,11 +38,11 @@ public:
 
   // Returns the font name, as specified internally by the font file.
   // Returns NULL if no name is available.
-  virtual char *getName() = 0;
+  virtual const char *getName() = 0;
 
   // Returns the custom font encoding, or NULL if the encoding is not
   // available.
-  virtual char **getEncoding() = 0;
+  virtual const char **getEncoding() = 0;
 };
 
 //------------------------------------------------------------------------
@@ -52,10 +52,10 @@ public:
 class Type1FontFile: public FontFile {
 public:
 
-  Type1FontFile(char *file, int len);
+  Type1FontFile(const char *file, int len);
   virtual ~Type1FontFile();
-  virtual char *getName() { return name; }
-  virtual char **getEncoding() { return encoding; }
+  virtual const char *getName() { return name; }
+  virtual const char **getEncoding() { return (const char **)encoding; }
 
 private:
 
@@ -73,11 +73,11 @@ struct Type1CPrivateDict;
 class Type1CFontFile: public FontFile {
 public:
 
-  Type1CFontFile(char *fileA, int lenA);
+  Type1CFontFile(const char *fileA, int lenA);
   virtual ~Type1CFontFile();
 
-  virtual char *getName();
-  virtual char **getEncoding();
+  virtual const char *getName();
+  virtual const char **getEncoding();
 
   // Convert to a Type 1 font, suitable for embedding in a PostScript
   // file.  The name will be used as the PostScript font name.
@@ -86,13 +86,13 @@ public:
   // Convert to a Type 0 CIDFont, suitable for embedding in a
   // PostScript file.  The name will be used as the PostScript font
   // name.
-  void convertToCIDType0(char *psName,
+  void convertToCIDType0(const char *psName,
                         FontFileOutputFunc outputFuncA, void *outputStreamA);
 
   // Convert to a Type 0 (but non-CID) composite font, suitable for
   // embedding in a PostScript file.  The name will be used as the
   // PostScript font name.
-  void convertToType0(char *psName,
+  void convertToType0(const char *psName,
                      FontFileOutputFunc outputFuncA, void *outputStreamA);
 
 private:
@@ -102,16 +102,16 @@ private:
   void readPrivateDict(Type1CPrivateDict *privateDict,
                       int offset, int size);
   Gushort *readCharset(int charset, int nGlyphs);
-  void eexecWrite(char *s);
-  void eexecCvtGlyph(char *glyphName, Guchar *s, int n);
+  void eexecWrite(const char *s);
+  void eexecCvtGlyph(const char *glyphName, Guchar *s, int n);
   void cvtGlyph(Guchar *s, int n);
   void cvtGlyphWidth(GBool useOp);
   void eexecDumpNum(double x, GBool fpA);
   void eexecDumpOp1(int opA);
   void eexecDumpOp2(int opA);
   void eexecWriteCharstring(Guchar *s, int n);
-  void getDeltaInt(char *buf, char *key, double *opA, int n);
-  void getDeltaReal(char *buf, char *key, double *opA, int n);
+  void getDeltaInt(char *buf, const char *key, double *opA, int n);
+  void getDeltaReal(char *buf, const char *key, double *opA, int n);
   int getIndexLen(Guchar *indexPtr);
   Guchar *getIndexValPtr(Guchar *indexPtr, int i);
   Guchar *getIndexEnd(Guchar *indexPtr);
@@ -119,7 +119,7 @@ private:
   double getNum(Guchar **ptr, GBool *fp);
   char *getString(int sid, char *buf);
 
-  char *file;
+  const char *file;
   int len;
 
   GString *name;
@@ -153,22 +153,22 @@ struct TTFontTableHdr;
 class TrueTypeFontFile: public FontFile {
 public:
 
-  TrueTypeFontFile(char *fileA, int lenA);
+  TrueTypeFontFile(const char *fileA, int lenA);
   ~TrueTypeFontFile();
 
   // This always returns NULL, since it's probably better to trust the
   // font name in the PDF file rather than the one in the TrueType
   // font file.
-  virtual char *getName();
+  virtual const char *getName();
 
-  virtual char **getEncoding();
+  virtual const char **getEncoding();
 
   // Convert to a Type 42 font, suitable for embedding in a PostScript
   // file.  The name will be used as the PostScript font name (so we
   // don't need to depend on the 'name' table in the font).  The
   // encoding is needed because the PDF Font object can modify the
   // encoding.
-  void convertToType42(char *name, char **encodingA,
+  void convertToType42(const char *name, const char **encodingA,
                       CharCodeToUnicode *toUnicode,
                       GBool pdfFontHasEncoding,
                       FontFileOutputFunc outputFunc, void *outputStream);
@@ -177,14 +177,14 @@ public:
   // PostScript file.  The name will be used as the PostScript font
   // name (so we don't need to depend on the 'name' table in the
   // font).
-  void convertToCIDType2(char *name, Gushort *cidMap, int nCIDs,
+  void convertToCIDType2(const char *name, Gushort *cidMap, int nCIDs,
                         FontFileOutputFunc outputFunc, void *outputStream);
 
   // Convert to a Type 0 (but non-CID) composite font, suitable for
   // embedding in a PostScript file.  The name will be used as the
   // PostScript font name (so we don't need to depend on the 'name'
   // table in the font).
-  void convertToType0(char *name, Gushort *cidMap, int nCIDs,
+  void convertToType0(const char *name, Gushort *cidMap, int nCIDs,
                      FontFileOutputFunc outputFunc, void *outputStream);
 
   // Write a TTF file, filling in any missing tables that are required
@@ -194,7 +194,7 @@ public:
 
 private:
 
-  char *file;
+  const char *file;
   int len;
 
   char **encoding;
@@ -212,19 +212,19 @@ private:
   int getShort(int pos);
   Guint getULong(int pos);
   double getFixed(int pos);
-  int seekTable(char *tag);
-  int seekTableIdx(char *tag);
-  void cvtEncoding(char **encodingA, GBool pdfFontHasEncoding,
+  int seekTable(const char *tag);
+  int seekTableIdx(const char *tag);
+  void cvtEncoding(const char **encodingA, GBool pdfFontHasEncoding,
                   FontFileOutputFunc outputFunc, void *outputStream);
-  void cvtCharStrings(char **encodingA, CharCodeToUnicode *toUnicode,
+  void cvtCharStrings(const char **encodingA, CharCodeToUnicode *toUnicode,
                      GBool pdfFontHasEncoding,
                      FontFileOutputFunc outputFunc, void *outputStream);
   int getCmapEntry(int cmapFmt, int pos, int code);
   void cvtSfnts(FontFileOutputFunc outputFunc, void *outputStream,
                GString *name);
-  void dumpString(char *s, int length,
+  void dumpString(const char *s, int length,
                  FontFileOutputFunc outputFunc, void *outputStream);
-  Guint computeTableChecksum(char *data, int length);
+  Guint computeTableChecksum(const char *data, int length);
 };
 
 #endif
index d91efb7bb39c0c4b099cb48fa766338a9b5dea02..6882941fde1eea0697d8f191cecbaf6822fc666f 100644 (file)
@@ -720,7 +720,7 @@ enum PSOp {
 // Note: 'if' and 'ifelse' are parsed separately.
 // The rest are listed here in alphabetical order.
 // The index in this table is equivalent to the entry in PSOp.
-char *psOpNames[] = {
+const char *psOpNames[] = {
   "abs",
   "add",
   "and",
index 1b11ca5ca0ad1d2e777c986de2f2f3a0baceece9..376403c453d3037193a668b89af1ffee96c96c48 100644 (file)
@@ -31,8 +31,8 @@
 //------------------------------------------------------------------------
 
 struct StdFontMapEntry {
-  char *altName;
-  char *properName;
+  const char *altName;
+  const char *properName;
 };
 
 static StdFontMapEntry stdFontMap[] = {
@@ -90,7 +90,7 @@ static StdFontMapEntry stdFontMap[] = {
 // GfxFont
 //------------------------------------------------------------------------
 
-GfxFont *GfxFont::makeFont(XRef *xref, char *tagA, Ref idA, Dict *fontDict) {
+GfxFont *GfxFont::makeFont(XRef *xref, const char *tagA, Ref idA, Dict *fontDict) {
   GString *nameA;
   GfxFont *font;
   Object obj1;
@@ -126,7 +126,7 @@ GfxFont *GfxFont::makeFont(XRef *xref, char *tagA, Ref idA, Dict *fontDict) {
   return font;
 }
 
-GfxFont::GfxFont(char *tagA, Ref idA, GString *nameA) {
+GfxFont::GfxFont(const char *tagA, Ref idA, GString *nameA) {
   ok = gFalse;
   tag = new GString(tagA);
   id = idA;
@@ -373,18 +373,18 @@ char *GfxFont::readEmbFontFile(XRef *xref, int *len) {
 // Gfx8BitFont
 //------------------------------------------------------------------------
 
-Gfx8BitFont::Gfx8BitFont(XRef *xref, char *tagA, Ref idA, GString *nameA,
+Gfx8BitFont::Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, GString *nameA,
                         GfxFontType typeA, Dict *fontDict):
   GfxFont(tagA, idA, nameA)
 {
   BuiltinFont *builtinFont;
-  char **baseEnc;
+  const char **baseEnc;
   GBool baseEncFromFontFile;
   char *buf;
   int len;
   FontFile *fontFile;
   int code, code2;
-  char *charName;
+  const char *charName;
   GBool missing, hex;
   Unicode toUnicode[256];
   double mul;
@@ -601,7 +601,7 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, char *tagA, Ref idA, GString *nameA,
        } else if (obj3.isName()) {
          if (code < 256) {
            if (encFree[code]) {
-             gfree(enc[code]);
+             gfree((void *)enc[code]);
            }
            enc[code] = copyString(obj3.getName());
            encFree[code] = gTrue;
@@ -777,7 +777,7 @@ Gfx8BitFont::~Gfx8BitFont() {
 
   for (i = 0; i < 256; ++i) {
     if (encFree[i] && enc[i]) {
-      gfree(enc[i]);
+      gfree((void *)enc[i]);
     }
   }
   ctu->decRefCnt();
@@ -789,7 +789,7 @@ Gfx8BitFont::~Gfx8BitFont() {
   }
 }
 
-int Gfx8BitFont::getNextChar(char *s, int len, CharCode *code,
+int Gfx8BitFont::getNextChar(const char *s, int len, CharCode *code,
                             Unicode *u, int uSize, int *uLen,
                             double *dx, double *dy, double *ox, double *oy) {
   CharCode c;
@@ -837,7 +837,7 @@ static int cmpWidthExcepV(const void *w1, const void *w2) {
          ((GfxFontCIDWidthExcepV *)w2)->first;
 }
 
-GfxCIDFont::GfxCIDFont(XRef *xref, char *tagA, Ref idA, GString *nameA,
+GfxCIDFont::GfxCIDFont(XRef *xref, const char *tagA, Ref idA, GString *nameA,
                       Dict *fontDict):
   GfxFont(tagA, idA, nameA)
 {
@@ -1153,7 +1153,7 @@ GfxCIDFont::~GfxCIDFont() {
   }
 }
 
-int GfxCIDFont::getNextChar(char *s, int len, CharCode *code,
+int GfxCIDFont::getNextChar(const char *s, int len, CharCode *code,
                            Unicode *u, int uSize, int *uLen,
                            double *dx, double *dy, double *ox, double *oy) {
   CID cid;
@@ -1292,7 +1292,7 @@ GfxFontDict::~GfxFontDict() {
   gfree(fonts);
 }
 
-GfxFont *GfxFontDict::lookup(char *tag) {
+GfxFont *GfxFontDict::lookup(const char *tag) {
   int i;
 
   for (i = 0; i < numFonts; ++i) {
index 80a9e45864013a235433eb0e474689827af60046..d564e1922c7a7de16bdbeae2e4ceb497b93f1a7f 100644 (file)
@@ -84,9 +84,9 @@ class GfxFont {
 public:
 
   // Build a GfxFont object.
-  static GfxFont *makeFont(XRef *xref, char *tagA, Ref idA, Dict *fontDict);
+  static GfxFont *makeFont(XRef *xref, const char *tagA, Ref idA, Dict *fontDict);
 
-  GfxFont(char *tagA, Ref idA, GString *nameA);
+  GfxFont(const char *tagA, Ref idA, GString *nameA);
 
   virtual ~GfxFont();
 
@@ -99,7 +99,7 @@ public:
   Ref *getID() { return &id; }
 
   // Does this font match the tag?
-  GBool matches(char *tagA) { return !tag->cmp(tagA); }
+  GBool matches(const char *tagA) { return !tag->cmp(tagA); }
 
   // Get base font name.
   GString *getName() { return name; }
@@ -151,7 +151,7 @@ public:
   // is the number of entries available in <u>, and <uLen> is set to
   // the number actually used.  Returns the number of bytes used by
   // the char code.
-  virtual int getNextChar(char *s, int len, CharCode *code,
+  virtual int getNextChar(const char *s, int len, CharCode *code,
                          Unicode *u, int uSize, int *uLen,
                          double *dx, double *dy, double *ox, double *oy) = 0;
 
@@ -184,23 +184,23 @@ protected:
 class Gfx8BitFont: public GfxFont {
 public:
 
-  Gfx8BitFont(XRef *xref, char *tagA, Ref idA, GString *nameA,
+  Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, GString *nameA,
              GfxFontType typeA, Dict *fontDict);
 
   virtual ~Gfx8BitFont();
 
-  virtual int getNextChar(char *s, int len, CharCode *code,
+  virtual int getNextChar(const char *s, int len, CharCode *code,
                          Unicode *u, int uSize, int *uLen,
                          double *dx, double *dy, double *ox, double *oy);
 
   // Return the encoding.
-  char **getEncoding() { return enc; }
+  const char **getEncoding() { return enc; }
 
   // Return the Unicode map.
   CharCodeToUnicode *getToUnicode();
 
   // Return the character name associated with <code>.
-  char *getCharName(int code) { return enc[code]; }
+  const char *getCharName(int code) { return enc[code]; }
 
   // Returns true if the PDF font specified an encoding.
   GBool getHasEncoding() { return hasEncoding; }
@@ -219,7 +219,7 @@ public:
 
 private:
 
-  char *enc[256];              // char code --> char name
+  const char *enc[256];                // char code --> char name
   char encFree[256];           // boolean for each char name: if set,
                                //   the string is malloc'ed
   CharCodeToUnicode *ctu;      // char code --> Unicode
@@ -236,14 +236,14 @@ private:
 class GfxCIDFont: public GfxFont {
 public:
 
-  GfxCIDFont(XRef *xref, char *tagA, Ref idA, GString *nameA,
+  GfxCIDFont(XRef *xref, const char *tagA, Ref idA, GString *nameA,
             Dict *fontDict);
 
   virtual ~GfxCIDFont();
 
   virtual GBool isCIDFont() { return gTrue; }
 
-  virtual int getNextChar(char *s, int len, CharCode *code,
+  virtual int getNextChar(const char *s, int len, CharCode *code,
                          Unicode *u, int uSize, int *uLen,
                          double *dx, double *dy, double *ox, double *oy);
 
@@ -285,7 +285,7 @@ public:
   ~GfxFontDict();
 
   // Get the specified font.
-  GfxFont *lookup(char *tag);
+  GfxFont *lookup(const char *tag);
 
   // Iterative access.
   int getNumFonts() { return numFonts; }
index 9c3b5b44690f1c1a171dd66b844c15e15618233e..51e9326ac1cfd1d812b07a5806aa5d9dc22c1e44 100644 (file)
@@ -30,7 +30,7 @@ static inline double clip01(double x) {
 
 //------------------------------------------------------------------------
 
-static char *gfxColorSpaceModeNames[] = {
+static const char *gfxColorSpaceModeNames[] = {
   "DeviceGray",
   "CalGray",
   "DeviceRGB",
@@ -121,7 +121,7 @@ int GfxColorSpace::getNumColorSpaceModes() {
   return nGfxColorSpaceModes;
 }
 
-char *GfxColorSpace::getColorSpaceModeName(int idx) {
+const char *GfxColorSpace::getColorSpaceModeName(int idx) {
   return gfxColorSpaceModeNames[idx];
 }
 
index ffe25d3bd7108db90ce3c412222d9fd846f852ce..9283eb1ca6b35f2c3b615260db6c9730b9e207ed 100644 (file)
@@ -97,7 +97,7 @@ public:
   static int getNumColorSpaceModes();
 
   // Return the name of the <idx>th color space mode.
-  static char *getColorSpaceModeName(int idx);
+  static const char *getColorSpaceModeName(int idx);
 
 private:
 };
index dc8127a1ae45609ffd8a2d2deddc5fe6db15d714..0f723f1f6c018d81e9191313d997d8e900b0a941 100644 (file)
@@ -70,7 +70,7 @@ DisplayFontParam::DisplayFontParam(GString *nameA,
   }
 }
 
-DisplayFontParam::DisplayFontParam(char *nameA, char *xlfdA, char *encodingA) {
+DisplayFontParam::DisplayFontParam(const char *nameA, const char *xlfdA, const char *encodingA) {
   name = new GString(nameA);
   kind = displayFontX;
   x.xlfd = new GString(xlfdA);
@@ -125,7 +125,7 @@ PSFontParam::~PSFontParam() {
 // parsing
 //------------------------------------------------------------------------
 
-GlobalParams::GlobalParams(char *cfgFileName) {
+GlobalParams::GlobalParams(const char *cfgFileName) {
   UnicodeMap *map;
   DisplayFontParam *dfp;
   GString *fileName;
@@ -157,7 +157,7 @@ GlobalParams::GlobalParams(char *cfgFileName) {
   displayCIDFonts = new GHash();
   displayNamedCIDFonts = new GHash();
 #if HAVE_PAPER_H
-  char *paperName;
+  const char *paperName;
   const struct paper *paperType;
   paperinit();
   if ((paperName = systempapername())) {
@@ -644,7 +644,7 @@ void GlobalParams::parsePSFont(GList *tokens, GString *fileName, int line) {
   psFonts->add(param->pdfFontName, param);
 }
 
-void GlobalParams::parsePSFont16(char *cmdName, GList *fontList,
+void GlobalParams::parsePSFont16(const char *cmdName, GList *fontList,
                                 GList *tokens, GString *fileName, int line) {
   PSFontParam *param;
   int wMode;
@@ -724,7 +724,7 @@ void GlobalParams::parseInitialZoom(GList *tokens,
   initialZoom = ((GString *)tokens->get(1))->copy();
 }
 
-void GlobalParams::parseFontRastControl(char *cmdName, FontRastControl *val,
+void GlobalParams::parseFontRastControl(const char *cmdName, FontRastControl *val,
                                        GList *tokens, GString *fileName,
                                        int line) {
   GString *tok;
@@ -741,7 +741,7 @@ void GlobalParams::parseFontRastControl(char *cmdName, FontRastControl *val,
   }
 }
 
-void GlobalParams::parseCommand(char *cmdName, GString **val,
+void GlobalParams::parseCommand(const char *cmdName, GString **val,
                                GList *tokens, GString *fileName, int line) {
   if (tokens->getLength() != 2) {
     error(-1, "Bad '%s' config file command (%s:%d)",
@@ -754,7 +754,7 @@ void GlobalParams::parseCommand(char *cmdName, GString **val,
   *val = ((GString *)tokens->get(1))->copy();
 }
 
-void GlobalParams::parseYesNo(char *cmdName, GBool *flag,
+void GlobalParams::parseYesNo(const char *cmdName, GBool *flag,
                              GList *tokens, GString *fileName, int line) {
   GString *tok;
 
@@ -826,11 +826,11 @@ GlobalParams::~GlobalParams() {
 // accessors
 //------------------------------------------------------------------------
 
-CharCode GlobalParams::getMacRomanCharCode(char *charName) {
+CharCode GlobalParams::getMacRomanCharCode(const char *charName) {
   return macRomanReverseMap->lookup(charName);
 }
 
-Unicode GlobalParams::mapNameToUnicode(char *charName) {
+Unicode GlobalParams::mapNameToUnicode(const char *charName) {
   return nameToUnicode->lookup(charName);
 }
 
@@ -1076,7 +1076,7 @@ GBool GlobalParams::getTextKeepTinyChars() {
 }
 
 GString *GlobalParams::findFontFile(GString *fontName,
-                                   char *ext1, char *ext2) {
+                                   const char *ext1, const char *ext2) {
   GString *dir, *fileName;
   FILE *f;
   int i;
@@ -1221,7 +1221,7 @@ void GlobalParams::addDisplayFont(DisplayFontParam *param) {
   globalParamsUnlock;
 }
 
-void GlobalParams::setPSFile(char *file) {
+void GlobalParams::setPSFile(const char *file) {
   globalParamsLock;
   if (psFile) {
     delete psFile;
@@ -1239,7 +1239,7 @@ void GlobalParams::setPSImageableArea(int left, int bottom, int right, int top)
   globalParamsUnlock;
 }
 
-GBool GlobalParams::setPSPaperSize(char *size) {
+GBool GlobalParams::setPSPaperSize(const char *size) {
   globalParamsLock;
   if (!strcmp(size, "letter")) {
     psPaperWidth = 612;
@@ -1332,14 +1332,14 @@ void GlobalParams::setPSASCIIHex(GBool hex) {
   globalParamsUnlock;
 }
 
-void GlobalParams::setTextEncoding(char *encodingName) {
+void GlobalParams::setTextEncoding(const char *encodingName) {
   globalParamsLock;
   delete textEncoding;
   textEncoding = new GString(encodingName);
   globalParamsUnlock;
 }
 
-GBool GlobalParams::setTextEOL(char *s) {
+GBool GlobalParams::setTextEOL(const char *s) {
   globalParamsLock;
   if (!strcmp(s, "unix")) {
     textEOL = eolUnix;
@@ -1361,14 +1361,14 @@ void GlobalParams::setTextKeepTinyChars(GBool keep) {
   globalParamsUnlock;
 }
 
-void GlobalParams::setInitialZoom(char *s) {
+void GlobalParams::setInitialZoom(const char *s) {
   globalParamsLock;
   delete initialZoom;
   initialZoom = new GString(s);
   globalParamsUnlock;
 }
 
-GBool GlobalParams::setT1libControl(char *s) {
+GBool GlobalParams::setT1libControl(const char *s) {
   GBool ok;
 
   globalParamsLock;
@@ -1377,7 +1377,7 @@ GBool GlobalParams::setT1libControl(char *s) {
   return ok;
 }
 
-GBool GlobalParams::setFreeTypeControl(char *s) {
+GBool GlobalParams::setFreeTypeControl(const char *s) {
   GBool ok;
 
   globalParamsLock;
@@ -1386,7 +1386,7 @@ GBool GlobalParams::setFreeTypeControl(char *s) {
   return ok;
 }
 
-GBool GlobalParams::setFontRastControl(FontRastControl *val, char *s) {
+GBool GlobalParams::setFontRastControl(FontRastControl *val, const char *s) {
   if (!strcmp(s, "none")) {
     *val = fontRastNone;
   } else if (!strcmp(s, "plain")) {
index a37b49ff97d6948e00ad60c34a1badca06a9a1fb..6cb91b4c06df0a988a71571475aaba3e89db752d 100644 (file)
@@ -69,7 +69,7 @@ public:
   };
 
   DisplayFontParam(GString *nameA, DisplayFontParamKind kindA);
-  DisplayFontParam(char *nameA, char *xlfdA, char *encodingA);
+  DisplayFontParam(const char *nameA, const char *xlfdA, const char *encodingA);
   ~DisplayFontParam();
 };
 
@@ -125,15 +125,15 @@ public:
 
   // Initialize the global parameters by attempting to read a config
   // file.
-  GlobalParams(char *cfgFileName);
+  GlobalParams(const char *cfgFileName);
 
   ~GlobalParams();
 
   //----- accessors
 
-  CharCode getMacRomanCharCode(char *charName);
+  CharCode getMacRomanCharCode(const char *charName);
 
-  Unicode mapNameToUnicode(char *charName);
+  Unicode mapNameToUnicode(const char *charName);
   FILE *getCIDToUnicodeFile(GString *collection);
   UnicodeMap *getResidentUnicodeMap(GString *encodingName);
   FILE *getUnicodeMapFile(GString *encodingName);
@@ -157,7 +157,7 @@ public:
   GBool getPSASCIIHex();
   EndOfLineKind getTextEOL();
   GBool getTextKeepTinyChars();
-  GString *findFontFile(GString *fontName, char *ext1, char *ext2);
+  GString *findFontFile(GString *fontName, const char *ext1, const char *ext2);
   GString *getInitialZoom();
   FontRastControl getT1libControl();
   FontRastControl getFreeTypeControl();
@@ -175,8 +175,8 @@ public:
   //----- functions to set parameters
 
   void addDisplayFont(DisplayFontParam *param);
-  void setPSFile(char *file);
-  GBool setPSPaperSize(char *size);
+  void setPSFile(const char *file);
+  GBool setPSPaperSize(const char *size);
   void setPSImageableArea(int left, int bottom, int right, int top);
   void setPSPaperWidth(int width);
   void setPSPaperHeight(int height);
@@ -188,12 +188,12 @@ public:
   void setPSEmbedCIDTrueType(GBool embed);
   void setPSOPI(GBool opi);
   void setPSASCIIHex(GBool hex);
-  void setTextEncoding(char *encodingName);
-  GBool setTextEOL(char *s);
+  void setTextEncoding(const char *encodingName);
+  GBool setTextEOL(const char *s);
   void setTextKeepTinyChars(GBool keep);
-  void setInitialZoom(char *s);
-  GBool setT1libControl(char *s);
-  GBool setFreeTypeControl(char *s);
+  void setInitialZoom(const char *s);
+  GBool setT1libControl(const char *s);
+  GBool setFreeTypeControl(const char *s);
   void setMapNumericCharNames(GBool map);
   void setPrintCommands(GBool printCommandsA);
   void setErrQuiet(GBool errQuietA);
@@ -213,20 +213,20 @@ private:
   void parsePSPaperSize(GList *tokens, GString *fileName, int line);
   void parsePSLevel(GList *tokens, GString *fileName, int line);
   void parsePSFont(GList *tokens, GString *fileName, int line);
-  void parsePSFont16(char *cmdName, GList *fontList,
+  void parsePSFont16(const char *cmdName, GList *fontList,
                     GList *tokens, GString *fileName, int line);
   void parseTextEncoding(GList *tokens, GString *fileName, int line);
   void parseTextEOL(GList *tokens, GString *fileName, int line);
   void parseFontDir(GList *tokens, GString *fileName, int line);
   void parseInitialZoom(GList *tokens, GString *fileName, int line);
-  void parseFontRastControl(char *cmdName, FontRastControl *val,
+  void parseFontRastControl(const char *cmdName, FontRastControl *val,
                            GList *tokens, GString *fileName, int line);
-  void parseCommand(char *cmdName, GString **val,
+  void parseCommand(const char *cmdName, GString **val,
                    GList *tokens, GString *fileName, int line);
-  void parseYesNo(char *cmdName, GBool *flag,
+  void parseYesNo(const char *cmdName, GBool *flag,
                  GList *tokens, GString *fileName, int line);
   UnicodeMap *getUnicodeMap2(GString *encodingName);
-  GBool setFontRastControl(FontRastControl *val, char *s);
+  GBool setFontRastControl(FontRastControl *val, const char *s);
 
   //----- static tables
 
index 1334368f4c5217ddcb7e63eaa51588991841f740..25f8756d9f19d9568c3f4e1ebcdf58e2a0ef9066 100644 (file)
@@ -1452,7 +1452,7 @@ int JBIG2Stream::lookChar() {
   return EOF;
 }
 
-GString *JBIG2Stream::getPSFilter(char *indent) {
+GString *JBIG2Stream::getPSFilter(const char *indent) {
   return NULL;
 }
 
index b46a4db46e09e2bd4602a4fd9f65d90bde44753a..05a4d28c3298b7be7266c7d6018f71c950d3076c 100644 (file)
@@ -39,7 +39,7 @@ public:
   virtual void reset();
   virtual int getChar();
   virtual int lookChar();
-  virtual GString *getPSFilter(char *indent);
+  virtual GString *getPSFilter(const char *indent);
   virtual GBool isBinary(GBool last = gTrue);
 
 private:
index 71fd531782fab5afc9bf48a69a45fb709f551a44..583c4310905ffaeb6c066730c5161f79bd1b9c7f 100644 (file)
@@ -1,5 +1,5 @@
 #
-# "$Id: Makefile,v 1.6.2.8 2003/01/07 18:27:10 mike Exp $"
+# "$Id: Makefile,v 1.6.2.9 2003/05/14 18:22:50 mike Exp $"
 #
 #   pdftops filter Makefile for the Common UNIX Printing System (CUPS).
 #
@@ -10,6 +10,8 @@
 
 include ../Makedefs
 
+OPTIONS        =       -Wwrite-strings
+
 #
 # Object files...
 #
@@ -123,5 +125,5 @@ include Dependencies
 
 
 #
-# End of "$Id: Makefile,v 1.6.2.8 2003/01/07 18:27:10 mike Exp $".
+# End of "$Id: Makefile,v 1.6.2.9 2003/05/14 18:22:50 mike Exp $".
 #
index f4292f4277d7f1a118bc9ae6c405ae3335364e94..00998160b01ae1994e4a44f6aaf67e84f90298b0 100644 (file)
@@ -47,7 +47,7 @@ NameToCharCode::~NameToCharCode() {
   gfree(tab);
 }
 
-void NameToCharCode::add(char *name, CharCode c) {
+void NameToCharCode::add(const char *name, CharCode c) {
   NameToCharCodeEntry *oldTab;
   int h, i, oldSize;
 
@@ -89,7 +89,7 @@ void NameToCharCode::add(char *name, CharCode c) {
   ++len;
 }
 
-CharCode NameToCharCode::lookup(char *name) {
+CharCode NameToCharCode::lookup(const char *name) {
   int h;
 
   h = hash(name);
@@ -104,8 +104,8 @@ CharCode NameToCharCode::lookup(char *name) {
   return 0;
 }
 
-int NameToCharCode::hash(char *name) {
-  char *p;
+int NameToCharCode::hash(const char *name) {
+  const char *p;
   unsigned int h;
 
   h = 0;
index 30147fb07f0e94e9e2735b326a6cbecb1996b646..d5ab3a3a1be5e510a71381a3cc384a36592635ef 100644 (file)
@@ -27,12 +27,12 @@ public:
   NameToCharCode();
   ~NameToCharCode();
 
-  void add(char *name, CharCode c);
-  CharCode lookup(char *name);
+  void add(const char *name, CharCode c);
+  CharCode lookup(const char *name);
 
 private:
 
-  int hash(char *name);
+  int hash(const char *name);
 
   NameToCharCodeEntry *tab;
   int size;
index 4f28ffff9f78c9b8960564f2a91c944b84fe247c..6c24d12b3a34ff6b555ad4cbc224a907009e0cca 100644 (file)
@@ -8,7 +8,7 @@
 
 static struct {
   Unicode u;
-  char *name;
+  const char *name;
 } nameToUnicodeTab[] = {
   {0x0021, "!"},
   {0x0023, "#"},
index e25a70a8eba1b15383ccb50c26a7c008b2c4ba65..8d01b958c9f21f2ca338b85489e4070719ddda66 100644 (file)
@@ -24,7 +24,7 @@
 // Object
 //------------------------------------------------------------------------
 
-char *objTypeNames[numObjTypes] = {
+const char *objTypeNames[numObjTypes] = {
   "boolean",
   "integer",
   "real",
@@ -134,7 +134,7 @@ void Object::free() {
   type = objNone;
 }
 
-char *Object::getTypeName() {
+const char *Object::getTypeName() {
   return objTypeNames[type];
 }
 
index 64fff6537840bae31356a9462bd442564e0dfe51..61b7f6f1039130b5b66cd2360618d7af92f42ebd 100644 (file)
@@ -89,7 +89,7 @@ public:
     { initObj(objReal); real = realA; return this; }
   Object *initString(GString *stringA)
     { initObj(objString); string = stringA; return this; }
-  Object *initName(char *nameA)
+  Object *initName(const char *nameA)
     { initObj(objName); name = copyString(nameA); return this; }
   Object *initNull()
     { initObj(objNull); return this; }
@@ -98,7 +98,7 @@ public:
   Object *initStream(Stream *streamA);
   Object *initRef(int numA, int genA)
     { initObj(objRef); ref.num = numA; ref.gen = genA; return this; }
-  Object *initCmd(char *cmdA)
+  Object *initCmd(const char *cmdA)
     { initObj(objCmd); cmd = copyString(cmdA); return this; }
   Object *initError()
     { initObj(objError); return this; }
@@ -134,11 +134,11 @@ public:
   GBool isNone() { return type == objNone; }
 
   // Special type checking.
-  GBool isName(char *nameA)
+  GBool isName(const char *nameA)
     { return type == objName && !strcmp(name, nameA); }
-  GBool isDict(char *dictType);
-  GBool isStream(char *dictType);
-  GBool isCmd(char *cmdA)
+  GBool isDict(const char *dictType);
+  GBool isStream(const char *dictType);
+  GBool isCmd(const char *cmdA)
     { return type == objCmd && !strcmp(cmd, cmdA); }
 
   // Accessors.  NB: these assume object is of correct type.
@@ -164,16 +164,16 @@ public:
 
   // Dict accessors.
   int dictGetLength();
-  void dictAdd(char *key, Object *val);
-  GBool dictIs(char *dictType);
-  Object *dictLookup(char *key, Object *obj);
-  Object *dictLookupNF(char *key, Object *obj);
-  char *dictGetKey(int i);
+  void dictAdd(const char *key, Object *val);
+  GBool dictIs(const char *dictType);
+  Object *dictLookup(const char *key, Object *obj);
+  Object *dictLookupNF(const char *key, Object *obj);
+  const char *dictGetKey(int i);
   Object *dictGetVal(int i, Object *obj);
   Object *dictGetValNF(int i, Object *obj);
 
   // Stream accessors.
-  GBool streamIs(char *dictType);
+  GBool streamIs(const char *dictType);
   void streamReset();
   void streamClose();
   int streamGetChar();
@@ -184,7 +184,7 @@ public:
   Dict *streamGetDict();
 
   // Output.
-  char *getTypeName();
+  const char *getTypeName();
   void print(FILE *f = stdout);
 
   // Memory testing.
@@ -239,22 +239,22 @@ inline Object *Object::arrayGetNF(int i, Object *obj)
 inline int Object::dictGetLength()
   { return dict->getLength(); }
 
-inline void Object::dictAdd(char *key, Object *val)
+inline void Object::dictAdd(const char *key, Object *val)
   { dict->add(key, val); }
 
-inline GBool Object::dictIs(char *dictType)
+inline GBool Object::dictIs(const char *dictType)
   { return dict->is(dictType); }
 
-inline GBool Object::isDict(char *dictType)
+inline GBool Object::isDict(const char *dictType)
   { return type == objDict && dictIs(dictType); }
 
-inline Object *Object::dictLookup(char *key, Object *obj)
+inline Object *Object::dictLookup(const char *key, Object *obj)
   { return dict->lookup(key, obj); }
 
-inline Object *Object::dictLookupNF(char *key, Object *obj)
+inline Object *Object::dictLookupNF(const char *key, Object *obj)
   { return dict->lookupNF(key, obj); }
 
-inline char *Object::dictGetKey(int i)
+inline const char *Object::dictGetKey(int i)
   { return dict->getKey(i); }
 
 inline Object *Object::dictGetVal(int i, Object *obj)
@@ -269,10 +269,10 @@ inline Object *Object::dictGetValNF(int i, Object *obj)
 
 #include "Stream.h"
 
-inline GBool Object::streamIs(char *dictType)
+inline GBool Object::streamIs(const char *dictType)
   { return stream->getDict()->is(dictType); }
 
-inline GBool Object::isStream(char *dictType)
+inline GBool Object::isStream(const char *dictType)
   { return type == objStream && streamIs(dictType); }
 
 inline void Object::streamReset()
index c216b41e06baa66a6a7dc01e592deb57f2d85a36..386c84ef4689390c24dbbfc541a39721b2f2dd35 100644 (file)
@@ -44,7 +44,7 @@
 // PostScript prolog and setup
 //------------------------------------------------------------------------
 
-static char *prolog[] = {
+static const char *prolog[] = {
   "/xpdf 75 dict def xpdf begin",
   "% PDF special state",
   "/pdfDictSize 14 def",
@@ -353,7 +353,7 @@ static char *prolog[] = {
   NULL
 };
 
-static char *cmapProlog[] = {
+static const char *cmapProlog[] = {
   "/CIDInit /ProcSet findresource begin",
   "10 dict begin",
   "  begincmap",
@@ -403,11 +403,11 @@ static char *cmapProlog[] = {
 //------------------------------------------------------------------------
 
 struct PSSubstFont {
-  char *psName;                        // PostScript name
+  const char *psName;          // PostScript name
   double mWidth;               // width of 'm' character
 };
 
-static char *psFonts[] = {
+static const char *psFonts[] = {
   "Courier",
   "Courier-Bold",
   "Courier-Oblique",
@@ -494,11 +494,11 @@ extern "C" {
 typedef void (*SignalFunc)(int);
 }
 
-static void outputToFile(void *stream, char *data, int len) {
+static void outputToFile(void *stream, const char *data, int len) {
   fwrite(data, 1, len, (FILE *)stream);
 }
 
-PSOutputDev::PSOutputDev(char *fileName, XRef *xrefA, Catalog *catalog,
+PSOutputDev::PSOutputDev(const char *fileName, XRef *xrefA, Catalog *catalog,
                         int firstPage, int lastPage, PSOutMode modeA) {
   FILE *f;
   PSFileType fileTypeA;
@@ -566,7 +566,7 @@ void PSOutputDev::init(PSOutputFunc outputFuncA, void *outputStreamA,
   PDFRectangle *box;
   Dict *resDict;
   Annots *annots;
-  char **p;
+  const char **p;
   int pg;
   Object obj1, obj2;
   int i;
@@ -872,10 +872,10 @@ void PSOutputDev::setupFont(GfxFont *font, Dict *parentResDict) {
   GString *name;
   PSFontParam *fontParam;
   GString *psNameStr;
-  char *psName;
+  const char *psName;
   char type3Name[64], buf[16];
   UnicodeMap *uMap;
-  char *charName;
+  const char *charName;
   double xs, ys;
   int code;
   double w1, w2;
@@ -1086,9 +1086,9 @@ void PSOutputDev::setupFont(GfxFont *font, Dict *parentResDict) {
          }
        }
        writePS("/");
-       writePSName(charName ? charName : (char *)".notdef");
+       writePSName(charName ? charName : ".notdef");
       }
-      writePS((i == 256-8) ? (char *)"]\n" : (char *)"\n");
+      writePS((i == 256-8) ? "]\n" : "\n");
     }
     writePS("pdfMakeFont\n");
   }
@@ -1098,7 +1098,7 @@ void PSOutputDev::setupFont(GfxFont *font, Dict *parentResDict) {
   }
 }
 
-void PSOutputDev::setupEmbeddedType1Font(Ref *id, char *psName) {
+void PSOutputDev::setupEmbeddedType1Font(Ref *id, const char *psName) {
   static char hexChar[17] = "0123456789abcdef";
   Object refObj, strObj, obj1, obj2;
   Dict *dict;
@@ -1223,7 +1223,7 @@ void PSOutputDev::setupEmbeddedType1Font(Ref *id, char *psName) {
 
 //~ This doesn't handle .pfb files or binary eexec data (which only
 //~ happens in pfb files?).
-void PSOutputDev::setupExternalType1Font(GString *fileName, char *psName) {
+void PSOutputDev::setupExternalType1Font(GString *fileName, const char *psName) {
   FILE *fontFile;
   int c;
   int i;
@@ -1264,7 +1264,7 @@ void PSOutputDev::setupExternalType1Font(GString *fileName, char *psName) {
 }
 
 void PSOutputDev::setupEmbeddedType1CFont(GfxFont *font, Ref *id,
-                                         char *psName) {
+                                         const char *psName) {
   char *fontBuf;
   int fontLen;
   Type1CFontFile *t1cFile;
@@ -1302,7 +1302,7 @@ void PSOutputDev::setupEmbeddedType1CFont(GfxFont *font, Ref *id,
 }
 
 void PSOutputDev::setupEmbeddedTrueTypeFont(GfxFont *font, Ref *id,
-                                           char *psName) {
+                                           const char *psName) {
   char *fontBuf;
   int fontLen;
   TrueTypeFontFile *ttFile;
@@ -1344,7 +1344,7 @@ void PSOutputDev::setupEmbeddedTrueTypeFont(GfxFont *font, Ref *id,
   writePS("%%EndResource\n");
 }
 
-void PSOutputDev::setupExternalTrueTypeFont(GfxFont *font, char *psName) {
+void PSOutputDev::setupExternalTrueTypeFont(GfxFont *font, const char *psName) {
   GString *fileName;
   char *fontBuf;
   int fontLen;
@@ -1390,7 +1390,7 @@ void PSOutputDev::setupExternalTrueTypeFont(GfxFont *font, char *psName) {
 }
 
 void PSOutputDev::setupEmbeddedCIDType0Font(GfxFont *font, Ref *id,
-                                           char *psName) {
+                                           const char *psName) {
   char *fontBuf;
   int fontLen;
   Type1CFontFile *t1cFile;
@@ -1434,7 +1434,7 @@ void PSOutputDev::setupEmbeddedCIDType0Font(GfxFont *font, Ref *id,
 }
 
 void PSOutputDev::setupEmbeddedCIDTrueTypeFont(GfxFont *font, Ref *id,
-                                              char *psName) {
+                                              const char *psName) {
   char *fontBuf;
   int fontLen;
   TrueTypeFontFile *ttFile;
@@ -1481,7 +1481,7 @@ void PSOutputDev::setupEmbeddedCIDTrueTypeFont(GfxFont *font, Ref *id,
   writePS("%%EndResource\n");
 }
 
-void PSOutputDev::setupType3Font(GfxFont *font, char *psName,
+void PSOutputDev::setupType3Font(GfxFont *font, const char *psName,
                                 Dict *parentResDict) {
   Dict *resDict;
   Dict *charProcs;
@@ -3254,7 +3254,7 @@ void PSOutputDev::writePSChar(char c) {
   }
 }
 
-void PSOutputDev::writePS(char *s) {
+void PSOutputDev::writePS(const char *s) {
   if (t3String) {
     t3String->append(s);
   } else {
@@ -3300,8 +3300,8 @@ void PSOutputDev::writePSString(GString *s) {
   writePSChar(')');
 }
 
-void PSOutputDev::writePSName(char *s) {
-  char *p;
+void PSOutputDev::writePSName(const char *s) {
+  const char *p;
   char c;
 
   p = s;
index 70836cb4e0a42fca70f2b0d4863d930239480a7a..2ab12fc90ca4361ff9b29517968dc5050b8fc29a 100644 (file)
@@ -45,13 +45,13 @@ enum PSFileType {
   psGeneric                    // write to a generic stream
 };
 
-typedef void (*PSOutputFunc)(void *stream, char *data, int len);
+typedef void (*PSOutputFunc)(void *stream, const char *data, int len);
 
 class PSOutputDev: public OutputDev {
 public:
 
   // Open a PostScript output file, and write the prolog.
-  PSOutputDev(char *fileName, XRef *xrefA, Catalog *catalog,
+  PSOutputDev(const char *fileName, XRef *xrefA, Catalog *catalog,
              int firstPage, int lastPage, PSOutMode modeA);
 
   // Open a PSOutputDev that will write to a generic stream.
@@ -156,14 +156,14 @@ private:
   void setupResources(Dict *resDict);
   void setupFonts(Dict *resDict);
   void setupFont(GfxFont *font, Dict *parentResDict);
-  void setupEmbeddedType1Font(Ref *id, char *psName);
-  void setupExternalType1Font(GString *fileName, char *psName);
-  void setupEmbeddedType1CFont(GfxFont *font, Ref *id, char *psName);
-  void setupEmbeddedTrueTypeFont(GfxFont *font, Ref *id, char *psName);
-  void setupExternalTrueTypeFont(GfxFont *font, char *psName);
-  void setupEmbeddedCIDType0Font(GfxFont *font, Ref *id, char *psName);
-  void setupEmbeddedCIDTrueTypeFont(GfxFont *font, Ref *id, char *psName);
-  void setupType3Font(GfxFont *font, char *psName, Dict *parentResDict);
+  void setupEmbeddedType1Font(Ref *id, const char *psName);
+  void setupExternalType1Font(GString *fileName, const char *psName);
+  void setupEmbeddedType1CFont(GfxFont *font, Ref *id, const char *psName);
+  void setupEmbeddedTrueTypeFont(GfxFont *font, Ref *id, const char *psName);
+  void setupExternalTrueTypeFont(GfxFont *font, const char *psName);
+  void setupEmbeddedCIDType0Font(GfxFont *font, Ref *id, const char *psName);
+  void setupEmbeddedCIDTrueTypeFont(GfxFont *font, Ref *id, const char *psName);
+  void setupType3Font(GfxFont *font, const char *psName, Dict *parentResDict);
   void setupImages(Dict *resDict);
   void setupImage(Ref id, Stream *str);
   void addProcessColor(double c, double m, double y, double k);
@@ -187,10 +187,10 @@ private:
   GBool getFileSpec(Object *fileSpec, Object *fileName);
 #endif
   void writePSChar(char c);
-  void writePS(char *s);
+  void writePS(const char *s);
   void writePSFmt(const char *fmt, ...);
   void writePSString(GString *s);
-  void writePSName(char *s);
+  void writePSName(const char *s);
   GString *filterPSName(GString *name);
 
   PSLevel level;               // PostScript level (1, 2, separation)
index badf32f1ed76091cf2110dcdc9e1ba047e06062b..32dd4551c840b83175a760eb297aa0c8aa87f1b4 100644 (file)
@@ -122,7 +122,7 @@ PageAttrs::~PageAttrs() {
   resources.free();
 }
 
-GBool PageAttrs::readBox(Dict *dict, char *key, PDFRectangle *box) {
+GBool PageAttrs::readBox(Dict *dict, const char *key, PDFRectangle *box) {
   PDFRectangle tmp;
   Object obj1, obj2;
   GBool ok;
index 9714b357736b548f18e01e26419ea6853e7dc8c8..9537c8381ee7a480a3611b843f3af2a680c0a950 100644 (file)
@@ -78,7 +78,7 @@ public:
 
 private:
 
-  GBool readBox(Dict *dict, char *key, PDFRectangle *box);
+  GBool readBox(Dict *dict, const char *key, PDFRectangle *box);
 
   PDFRectangle mediaBox;
   PDFRectangle cropBox;
index f0206a41dfa6de664f96919bbef57fc7f8cfebd4..dc6e078438e2bbf9f36a09b51feb269ab4c654cc 100644 (file)
@@ -84,7 +84,7 @@ char *Stream::getLine(char *buf, int size) {
   return buf;
 }
 
-GString *Stream::getPSFilter(char *indent) {
+GString *Stream::getPSFilter(const char *indent) {
   return new GString();
 }
 
@@ -132,7 +132,7 @@ Stream *Stream::addFilters(Object *dict) {
   return str;
 }
 
-Stream *Stream::makeFilter(char *name, Stream *str, Object *params) {
+Stream *Stream::makeFilter(const char *name, Stream *str, Object *params) {
   int pred;                    // parameters
   int colors;
   int bits;
@@ -880,7 +880,7 @@ int ASCIIHexStream::lookChar() {
   return buf;
 }
 
-GString *ASCIIHexStream::getPSFilter(char *indent) {
+GString *ASCIIHexStream::getPSFilter(const char *indent) {
   GString *s;
 
   if (!(s = str->getPSFilter(indent))) {
@@ -958,7 +958,7 @@ int ASCII85Stream::lookChar() {
   return b[index];
 }
 
-GString *ASCII85Stream::getPSFilter(char *indent) {
+GString *ASCII85Stream::getPSFilter(const char *indent) {
   GString *s;
 
   if (!(s = str->getPSFilter(indent))) {
@@ -1137,7 +1137,7 @@ int LZWStream::getCode() {
   return code;
 }
 
-GString *LZWStream::getPSFilter(char *indent) {
+GString *LZWStream::getPSFilter(const char *indent) {
   GString *s;
 
   if (pred) {
@@ -1174,7 +1174,7 @@ void RunLengthStream::reset() {
   eof = gFalse;
 }
 
-GString *RunLengthStream::getPSFilter(char *indent) {
+GString *RunLengthStream::getPSFilter(const char *indent) {
   GString *s;
 
   if (!(s = str->getPSFilter(indent))) {
@@ -1724,7 +1724,7 @@ short CCITTFaxStream::lookBits(int n) {
   return (inputBuf >> (inputBits - n)) & (0xffff >> (16 - n));
 }
 
-GString *CCITTFaxStream::getPSFilter(char *indent) {
+GString *CCITTFaxStream::getPSFilter(const char *indent) {
   GString *s;
   char s1[50];
 
@@ -3086,7 +3086,7 @@ int DCTStream::read16() {
   return (c1 << 8) + c2;
 }
 
-GString *DCTStream::getPSFilter(char *indent) {
+GString *DCTStream::getPSFilter(const char *indent) {
   GString *s;
 
   if (!(s = str->getPSFilter(indent))) {
@@ -3276,7 +3276,7 @@ int FlateStream::getRawChar() {
   return c;
 }
 
-GString *FlateStream::getPSFilter(char *indent) {
+GString *FlateStream::getPSFilter(const char *indent) {
   return NULL;
 }
 
@@ -3684,7 +3684,7 @@ void ASCIIHexEncoder::close() {
 }
 
 GBool ASCIIHexEncoder::fillBuf() {
-  static char *hex = "0123456789abcdef";
+  static const char hex[] = "0123456789abcdef";
   int c;
 
   if (eof) {
index e5050815411aa6af383cf4f18d1de609d8dff1e1..e49012dbaaa0e32ef7f16c29bd31ac042e294e4b 100644 (file)
@@ -87,7 +87,7 @@ public:
   virtual void setPos(Guint pos, int dir = 0) = 0;
 
   // Get PostScript command for the filter(s).
-  virtual GString *getPSFilter(char *indent);
+  virtual GString *getPSFilter(const char *indent);
 
   // Does this stream type potentially contain non-printable chars?
   virtual GBool isBinary(GBool last = gTrue) = 0;
@@ -107,7 +107,7 @@ public:
 
 private:
 
-  Stream *makeFilter(char *name, Stream *str, Object *params);
+  Stream *makeFilter(const char *name, Stream *str, Object *params);
 
   int ref;                     // reference count
 };
@@ -370,7 +370,7 @@ public:
   virtual int getChar()
     { int c = lookChar(); buf = EOF; return c; }
   virtual int lookChar();
-  virtual GString *getPSFilter(char *indent);
+  virtual GString *getPSFilter(const char *indent);
   virtual GBool isBinary(GBool last = gTrue);
 
 private:
@@ -393,7 +393,7 @@ public:
   virtual int getChar()
     { int ch = lookChar(); ++index; return ch; }
   virtual int lookChar();
-  virtual GString *getPSFilter(char *indent);
+  virtual GString *getPSFilter(const char *indent);
   virtual GBool isBinary(GBool last = gTrue);
 
 private:
@@ -419,7 +419,7 @@ public:
   virtual int getChar();
   virtual int lookChar();
   virtual int getRawChar();
-  virtual GString *getPSFilter(char *indent);
+  virtual GString *getPSFilter(const char *indent);
   virtual GBool isBinary(GBool last = gTrue);
 
 private:
@@ -463,7 +463,7 @@ public:
     { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
   virtual int lookChar()
     { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
-  virtual GString *getPSFilter(char *indent);
+  virtual GString *getPSFilter(const char *indent);
   virtual GBool isBinary(GBool last = gTrue);
 
 private:
@@ -494,7 +494,7 @@ public:
   virtual int getChar()
     { int c = lookChar(); buf = EOF; return c; }
   virtual int lookChar();
-  virtual GString *getPSFilter(char *indent);
+  virtual GString *getPSFilter(const char *indent);
   virtual GBool isBinary(GBool last = gTrue);
 
 private:
@@ -564,7 +564,7 @@ public:
   virtual void reset();
   virtual int getChar();
   virtual int lookChar();
-  virtual GString *getPSFilter(char *indent);
+  virtual GString *getPSFilter(const char *indent);
   virtual GBool isBinary(GBool last = gTrue);
   Stream *getRawStream() { return str; }
 
@@ -663,7 +663,7 @@ public:
   virtual int getChar();
   virtual int lookChar();
   virtual int getRawChar();
-  virtual GString *getPSFilter(char *indent);
+  virtual GString *getPSFilter(const char *indent);
   virtual GBool isBinary(GBool last = gTrue);
 
 private:
@@ -712,7 +712,7 @@ public:
   virtual void reset() {}
   virtual int getChar() { return EOF; }
   virtual int lookChar() { return EOF; }
-  virtual GString *getPSFilter(char *indent)  { return NULL; }
+  virtual GString *getPSFilter(const char *indent)  { return NULL; }
   virtual GBool isBinary(GBool last = gTrue) { return gFalse; }
 };
 
@@ -730,7 +730,7 @@ public:
   virtual void close();
   virtual int getChar();
   virtual int lookChar();
-  virtual GString *getPSFilter(char *indent) { return NULL; }
+  virtual GString *getPSFilter(const char *indent) { return NULL; }
   virtual GBool isBinary(GBool last = gTrue) { return gFalse; }
   virtual GBool isEncoder() { return gTrue; }
 
@@ -756,7 +756,7 @@ public:
     { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
   virtual int lookChar()
     { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
-  virtual GString *getPSFilter(char *indent) { return NULL; }
+  virtual GString *getPSFilter(const char *indent) { return NULL; }
   virtual GBool isBinary(GBool last = gTrue) { return gFalse; }
   virtual GBool isEncoder() { return gTrue; }
 
@@ -787,7 +787,7 @@ public:
     { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
   virtual int lookChar()
     { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
-  virtual GString *getPSFilter(char *indent) { return NULL; }
+  virtual GString *getPSFilter(const char *indent) { return NULL; }
   virtual GBool isBinary(GBool last = gTrue) { return gFalse; }
   virtual GBool isEncoder() { return gTrue; }
 
@@ -818,7 +818,7 @@ public:
     { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
   virtual int lookChar()
     { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
-  virtual GString *getPSFilter(char *indent) { return NULL; }
+  virtual GString *getPSFilter(const char *indent) { return NULL; }
   virtual GBool isBinary(GBool last = gTrue) { return gFalse; }
   virtual GBool isEncoder() { return gTrue; }
 
index f010ea5eb27fee6694e175956fd876b3cd934759..a2c0d1d3a9666b7b866032a6359bf4241d0f796b 100644 (file)
@@ -118,7 +118,7 @@ UnicodeMap::UnicodeMap(GString *encodingNameA) {
   refCnt = 1;
 }
 
-UnicodeMap::UnicodeMap(char *encodingNameA, GBool unicodeOutA,
+UnicodeMap::UnicodeMap(const char *encodingNameA, GBool unicodeOutA,
                       UnicodeMapRange *rangesA, int lenA) {
   encodingName = new GString(encodingNameA);
   unicodeOut = unicodeOutA;
@@ -130,7 +130,7 @@ UnicodeMap::UnicodeMap(char *encodingNameA, GBool unicodeOutA,
   refCnt = 1;
 }
 
-UnicodeMap::UnicodeMap(char *encodingNameA, GBool unicodeOutA,
+UnicodeMap::UnicodeMap(const char *encodingNameA, GBool unicodeOutA,
                       UnicodeMapFunc funcA) {
   encodingName = new GString(encodingNameA);
   unicodeOut = unicodeOutA;
index 447215df9b8dbae5cd5e88a5b492d1daa39f540d..ea5038c81ef325386c8362004f1b6941285455ec 100644 (file)
@@ -49,12 +49,12 @@ public:
   static UnicodeMap *parse(GString *encodingNameA);
 
   // Create a resident UnicodeMap.
-  UnicodeMap(char *encodingNameA, GBool unicodeOutA,
+  UnicodeMap(const char *encodingNameA, GBool unicodeOutA,
             UnicodeMapRange *rangesA, int lenA);
 
   // Create a resident UnicodeMap that uses a function instead of a
   // list of ranges.
-  UnicodeMap(char *encodingNameA, GBool unicodeOutA,
+  UnicodeMap(const char *encodingNameA, GBool unicodeOutA,
             UnicodeMapFunc funcA);
 
   ~UnicodeMap();
index 8be546b37f2da374285ab57883da0d484e10b50a..9be53cef67f08e4e1024c25d328c970c1212d88f 100644 (file)
@@ -108,7 +108,7 @@ GString *getCurrentDir() {
   return new GString();
 }
 
-GString *appendToPath(GString *path, char *fileName) {
+GString *appendToPath(GString *path, const char *fileName) {
 #if defined(VMS)
   //---------- VMS ----------
   //~ this should handle everything necessary for file
@@ -274,7 +274,7 @@ GString *appendToPath(GString *path, char *fileName) {
 #endif
 }
 
-GString *grabPath(char *fileName) {
+GString *grabPath(const char *fileName) {
 #ifdef VMS
   //---------- VMS ----------
   char *p;
@@ -323,7 +323,7 @@ GString *grabPath(char *fileName) {
 #endif
 }
 
-GBool isAbsolutePath(char *path) {
+GBool isAbsolutePath(const char *path) {
 #ifdef VMS
   //---------- VMS ----------
   return strchr(path, ':') ||
@@ -429,7 +429,7 @@ GString *makePathAbsolute(GString *path) {
 #endif
 }
 
-time_t getModTime(char *fileName) {
+time_t getModTime(const char *fileName) {
 #ifdef WIN32
   //~ should implement this, but it's (currently) only used in xpdf
   return 0;
@@ -443,7 +443,7 @@ time_t getModTime(char *fileName) {
 #endif
 }
 
-GBool openTempFile(GString **name, FILE **f, char *mode, char *ext) {
+GBool openTempFile(GString **name, FILE **f, const char *mode, const char *ext) {
 #if defined(WIN32)
   //---------- Win32 ----------
   char *s;
@@ -528,7 +528,7 @@ GBool openTempFile(GString **name, FILE **f, char *mode, char *ext) {
 #endif
 }
 
-GBool executeCommand(char *cmd) {
+GBool executeCommand(const char *cmd) {
 #ifdef VMS
   return system(cmd) ? gTrue : gFalse;
 #else
@@ -569,7 +569,7 @@ char *getLine(char *buf, int size, FILE *f) {
 // GDir and GDirEntry
 //------------------------------------------------------------------------
 
-GDirEntry::GDirEntry(char *dirPath, char *nameA, GBool doStat) {
+GDirEntry::GDirEntry(const char *dirPath, const char *nameA, GBool doStat) {
 #ifdef VMS
   char *p;
 #elif defined(WIN32)
@@ -608,7 +608,7 @@ GDirEntry::~GDirEntry() {
   delete name;
 }
 
-GDir::GDir(char *name, GBool doStatA) {
+GDir::GDir(const char *name, GBool doStatA) {
   path = new GString(name);
   doStat = doStatA;
 #if defined(WIN32)
index 82f1d7a98e36129808ab01e08b87446ac7eee742..f5d592de3a20298cfa6764c0e98c9e85cce95651 100644 (file)
@@ -60,14 +60,14 @@ extern GString *getCurrentDir();
 
 // Append a file name to a path string.  <path> may be an empty
 // string, denoting the current directory).  Returns <path>.
-extern GString *appendToPath(GString *path, char *fileName);
+extern GString *appendToPath(GString *path, const char *fileName);
 
 // Grab the path from the front of the file name.  If there is no
 // directory component in <fileName>, returns an empty string.
-extern GString *grabPath(char *fileName);
+extern GString *grabPath(const char *fileName);
 
 // Is this an absolute path or file name?
-extern GBool isAbsolutePath(char *path);
+extern GBool isAbsolutePath(const char *path);
 
 // Make this path absolute by prepending current directory (if path is
 // relative) or prepending user's directory (if path starts with '~').
@@ -83,10 +83,10 @@ extern time_t getModTime(char *fileName);
 // should be done to the returned file pointer; the file may be
 // reopened later for reading, but not for writing.  The <mode> string
 // should be "w" or "wb".  Returns true on success.
-extern GBool openTempFile(GString **name, FILE **f, char *mode, char *ext);
+extern GBool openTempFile(GString **name, FILE **f, const char *mode, const char *ext);
 
 // Execute <command>.  Returns true on success.
-extern GBool executeCommand(char *cmd);
+extern GBool executeCommand(const char *cmd);
 
 // Just like fgets, but handles Unix, Mac, and/or DOS end-of-line
 // conventions.
@@ -99,7 +99,7 @@ extern char *getLine(char *buf, int size, FILE *f);
 class GDirEntry {
 public:
 
-  GDirEntry(char *dirPath, char *nameA, GBool doStat);
+  GDirEntry(const char *dirPath, const char *nameA, GBool doStat);
   ~GDirEntry();
   GString *getName() { return name; }
   GBool isDir() { return dir; }
@@ -113,7 +113,7 @@ private:
 class GDir {
 public:
 
-  GDir(char *name, GBool doStatA = gTrue);
+  GDir(const char *name, GBool doStatA = gTrue);
   ~GDir();
   GDirEntry *getNextEntry();
   void rewind();
index 5faa3ef24356d16a85ffe0d2ffd4358c0d9a1906..35bcc46f8414df6140b58c46451d368dd9d9d2e3 100644 (file)
@@ -195,7 +195,7 @@ void gMemReport(FILE *f) {
 }
 #endif
 
-char *copyString(char *s) {
+char *copyString(const char *s) {
   char *s1;
 
   s1 = (char *)gmalloc(strlen(s) + 1);
index 587e7fa43c9fd8c14eb1adc459f2369e0be83e3a..03fab6033d54c9f9966c88d8187f32931725934a 100644 (file)
@@ -44,7 +44,7 @@ extern void gMemReport(FILE *f);
 /*
  * Allocate memory and copy a string into it.
  */
-extern char *copyString(char *s);
+extern char *copyString(const char *s);
 
 #ifdef __cplusplus
 }
index 9f579436ad010bc2c641e8c7f6fff0bd23e26c51..52108113af47808d00de4982e9404da8b10d7228 100644 (file)
@@ -41,7 +41,7 @@ GBool parseArgs(ArgDesc *args, int *argc, char *argv[]) {
 
 void printUsage(char *program, char *otherArgs, ArgDesc *args) {
   ArgDesc *arg;
-  char *typ;
+  const char *typ;
   int w, w1;
 
   w = 0;