[poppler] Branch 'xpdf303merge' - cmake/modules configure.ac cpp/poppler-private.cpp cpp/poppler-private.h fofi/FoFiBase.h fofi/FoFiEncodings.cc fofi/FoFiEncodings.h fofi/FoFiTrueType.cc fofi/FoFiTrueType.h fofi/FoFiType1.cc fofi/FoFiType1C.cc fofi/FoFiType1C.h fofi/FoFiType1.h goo/gfile.cc goo/gfile.h goo/gmem.cc goo/gmem.h goo/GooHash.cc goo/GooHash.h goo/GooString.cc goo/GooString.h poppler/Annot.cc poppler/Annot.h poppler/ArthurOutputDev.cc poppler/BuiltinFont.cc poppler/BuiltinFont.h poppler/DCTStream.cc poppler/DCTStream.h poppler/Dict.cc poppler/Dict.h poppler/Error.cc poppler/Error.h poppler/FileSpec.cc poppler/FlateStream.cc poppler/FlateStream.h poppler/FontEncodingTables.cc poppler/FontEncodingTables.h poppler/FontInfo.cc poppler/Form.cc poppler/Form.h poppler/Gfx.cc poppler/GfxFont.cc poppler/GfxFont.h poppler/Gfx.h poppler/GfxState.cc poppler/GfxState.h poppler/GlobalParams.cc poppler/GlobalParams.h poppler/GlobalParamsWin.cc poppler/JBIG2Stream.cc poppler/JBIG2St ream.h poppler/JPEG2000Stream.cc poppler/JPEG2000Stream.h poppler/JPXStream.h poppler/NameToCharCode.cc poppler/NameToCharCode.h poppler/NameToUnicodeTable.h poppler/Object.cc poppler/Object.h poppler/Page.cc poppler/Page.h poppler/PDFDoc.cc poppler/PSOutputDev.cc poppler/PSOutputDev.h poppler/SplashOutputDev.cc poppler/Stream.cc poppler/Stream.h poppler/TextOutputDev.cc poppler/TextOutputDev.h poppler/UnicodeMap.cc poppler/UnicodeMap.h poppler/UnicodeTypeTable.cc qt4/src splash/SplashFontEngine.cc splash/SplashFontEngine.h splash/SplashFTFontEngine.cc splash/SplashFTFontEngine.h splash/SplashFTFontFile.cc splash/SplashFTFontFile.h splash/SplashT1FontEngine.cc splash/SplashT1FontEngine.h splash/SplashT1FontFile.cc splash/SplashT1FontFile.h test/pdf-operators.c test/perf-test.cc utils/HtmlFonts.cc utils/HtmlOutputDev.cc utils/HtmlOutputDev.h utils/parseargs.cc utils/parseargs.h utils/pdffonts.cc utils/pdfinfo.cc utils/pdftocairo.cc utils/pdftohtml.cc utils/pdftotext.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Tue Aug 30 05:46:34 PDT 2011


 cmake/modules/PopplerMacros.cmake |    2 -
 configure.ac                      |    2 -
 cpp/poppler-private.cpp           |    2 -
 cpp/poppler-private.h             |    2 -
 fofi/FoFiBase.h                   |    2 -
 fofi/FoFiEncodings.cc             |    6 ++--
 fofi/FoFiEncodings.h              |    6 ++--
 fofi/FoFiTrueType.cc              |   10 ++++----
 fofi/FoFiTrueType.h               |    4 +--
 fofi/FoFiType1.cc                 |    4 +--
 fofi/FoFiType1.h                  |    2 -
 fofi/FoFiType1C.cc                |   14 +++++------
 fofi/FoFiType1C.h                 |    6 ++--
 goo/GooHash.cc                    |   16 ++++++-------
 goo/GooHash.h                     |   12 ++++-----
 goo/GooString.cc                  |   22 +++++++++---------
 goo/GooString.h                   |   16 ++++++-------
 goo/gfile.cc                      |    4 +--
 goo/gfile.h                       |    4 +--
 goo/gmem.cc                       |    2 -
 goo/gmem.h                        |    2 -
 poppler/Annot.cc                  |    8 +++---
 poppler/Annot.h                   |    6 ++--
 poppler/ArthurOutputDev.cc        |    6 ++--
 poppler/BuiltinFont.cc            |    6 ++--
 poppler/BuiltinFont.h             |   10 ++++----
 poppler/DCTStream.cc              |    2 -
 poppler/DCTStream.h               |    2 -
 poppler/Dict.cc                   |   14 +++++------
 poppler/Dict.h                    |   14 +++++------
 poppler/Error.cc                  |   10 ++++----
 poppler/Error.h                   |    6 ++--
 poppler/FileSpec.cc               |    2 -
 poppler/FlateStream.cc            |    2 -
 poppler/FlateStream.h             |    2 -
 poppler/FontEncodingTables.cc     |   14 +++++------
 poppler/FontEncodingTables.h      |   14 +++++------
 poppler/FontInfo.cc               |    2 -
 poppler/Form.cc                   |    6 ++--
 poppler/Form.h                    |    4 +--
 poppler/Gfx.cc                    |    2 -
 poppler/Gfx.h                     |    2 -
 poppler/GfxFont.cc                |   46 +++++++++++++++++++-------------------
 poppler/GfxFont.h                 |    8 +++---
 poppler/GfxState.cc               |    6 ++--
 poppler/GfxState.h                |    2 -
 poppler/GlobalParams.cc           |   21 ++++++++---------
 poppler/GlobalParams.h            |    8 +++---
 poppler/GlobalParamsWin.cc        |    6 ++--
 poppler/JBIG2Stream.cc            |    2 -
 poppler/JBIG2Stream.h             |    2 -
 poppler/JPEG2000Stream.cc         |    2 -
 poppler/JPEG2000Stream.h          |    2 -
 poppler/JPXStream.h               |    2 -
 poppler/NameToCharCode.cc         |    8 +++---
 poppler/NameToCharCode.h          |    6 ++--
 poppler/NameToUnicodeTable.h      |    2 -
 poppler/Object.cc                 |    4 +--
 poppler/Object.h                  |   28 +++++++++++------------
 poppler/PDFDoc.cc                 |    2 -
 poppler/PSOutputDev.cc            |   24 +++++++++----------
 poppler/PSOutputDev.h             |    8 +++---
 poppler/Page.cc                   |    2 -
 poppler/Page.h                    |    2 -
 poppler/SplashOutputDev.cc        |    6 ++--
 poppler/Stream.cc                 |   16 ++++++-------
 poppler/Stream.h                  |   28 +++++++++++------------
 poppler/TextOutputDev.cc          |    2 -
 poppler/TextOutputDev.h           |    2 -
 poppler/UnicodeMap.cc             |    4 +--
 poppler/UnicodeMap.h              |    4 +--
 poppler/UnicodeTypeTable.cc       |    4 +--
 qt4/src/poppler-private.cc        |    2 -
 qt4/src/poppler-ps-converter.cc   |    2 -
 splash/SplashFTFontEngine.cc      |    8 +++---
 splash/SplashFTFontEngine.h       |    6 ++--
 splash/SplashFTFontFile.cc        |    6 ++--
 splash/SplashFTFontFile.h         |    2 -
 splash/SplashFontEngine.cc        |    6 ++--
 splash/SplashFontEngine.h         |    6 ++--
 splash/SplashT1FontEngine.cc      |    6 ++--
 splash/SplashT1FontEngine.h       |    4 +--
 splash/SplashT1FontFile.cc        |   10 ++++----
 splash/SplashT1FontFile.h         |    6 ++--
 test/pdf-operators.c              |    4 +--
 test/perf-test.cc                 |    4 +--
 utils/HtmlFonts.cc                |    4 +--
 utils/HtmlOutputDev.cc            |   12 ++++-----
 utils/HtmlOutputDev.h             |    4 +--
 utils/parseargs.cc                |    4 +--
 utils/parseargs.h                 |    6 ++--
 utils/pdffonts.cc                 |    2 -
 utils/pdfinfo.cc                  |   12 ++++-----
 utils/pdftocairo.cc               |    4 +--
 utils/pdftohtml.cc                |   10 ++++----
 utils/pdftotext.cc                |   12 ++++-----
 96 files changed, 337 insertions(+), 338 deletions(-)

New commits:
commit 2658030836f3a15dadadd7f1989dfaa858bf876f
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Aug 30 14:49:23 2011 +0200

    xpdf303: char * -> const char *

diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
index 83b103e..04dfc46 100644
--- a/cmake/modules/PopplerMacros.cmake
+++ b/cmake/modules/PopplerMacros.cmake
@@ -101,7 +101,7 @@ endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
 if(CMAKE_COMPILER_IS_GNUCXX)
   # set the default compile warnings
   set(DEFAULT_COMPILE_WARNINGS_NO)
-  set(DEFAULT_COMPILE_WARNINGS_YES "-Wall -Wno-write-strings -Wcast-align -fno-exceptions -fno-check-new -fno-common")
+  set(DEFAULT_COMPILE_WARNINGS_YES "-Wall -Wcast-align -fno-exceptions -fno-check-new -fno-common")
   set(DEFAULT_COMPILE_WARNINGS_KDE "-Wno-long-long -Wundef -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -Wcast-align -Wconversion -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common")
 
   set(CMAKE_CXX_FLAGS                "-Wnon-virtual-dtor -Woverloaded-virtual ${CMAKE_CXX_FLAGS}")
diff --git a/configure.ac b/configure.ac
index 6d4332d..118156d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -568,7 +568,7 @@ if test "x$GCC" != xyes; then
 fi
 case "$enable_compile_warnings" in
   no)	;;
-  yes)	CXXFLAGS="-Wall -Wno-write-strings -Woverloaded-virtual -Wnon-virtual-dtor -Wcast-align -fno-exceptions -fno-check-new -fno-common $CXXFLAGS" ;;
+  yes)	CXXFLAGS="-Wall -Woverloaded-virtual -Wnon-virtual-dtor -Wcast-align -fno-exceptions -fno-check-new -fno-common $CXXFLAGS" ;;
   kde)	CXXFLAGS="-Wnon-virtual-dtor -Wno-long-long -Wundef \
 		-D_XOPEN_SOURCE=600 -D_BSD_SOURCE -Wcast-align \
 		-Wconversion -Wall -W -Wpointer-arith \
diff --git a/cpp/poppler-private.cpp b/cpp/poppler-private.cpp
index 67fb14e..2fc7d92 100644
--- a/cpp/poppler-private.cpp
+++ b/cpp/poppler-private.cpp
@@ -28,7 +28,7 @@
 
 using namespace poppler;
 
-void detail::error_function(int pos, char *msg, va_list args)
+void detail::error_function(int pos, const char *msg, va_list args)
 {
     std::ostringstream oss;
     if (pos >= 0) {
diff --git a/cpp/poppler-private.h b/cpp/poppler-private.h
index 9f7952b..0aca69e 100644
--- a/cpp/poppler-private.h
+++ b/cpp/poppler-private.h
@@ -37,7 +37,7 @@ namespace poppler
 namespace detail
 {
 
-void error_function(int pos, char *msg, va_list args);
+void error_function(int pos, const char *msg, va_list args);
 
 rectf pdfrectangle_to_rectf(const PDFRectangle &pdfrect);
 
diff --git a/fofi/FoFiBase.h b/fofi/FoFiBase.h
index e255001..4babb63 100644
--- a/fofi/FoFiBase.h
+++ b/fofi/FoFiBase.h
@@ -17,7 +17,7 @@
 
 //------------------------------------------------------------------------
 
-typedef void (*FoFiOutputFunc)(void *stream, char *data, int len);
+typedef void (*FoFiOutputFunc)(void *stream, const char *data, int len);
 
 //------------------------------------------------------------------------
 // FoFiBase
diff --git a/fofi/FoFiEncodings.cc b/fofi/FoFiEncodings.cc
index 946b56c..5cea6fa 100644
--- a/fofi/FoFiEncodings.cc
+++ b/fofi/FoFiEncodings.cc
@@ -19,7 +19,7 @@
 // Type 1 and 1C font data
 //------------------------------------------------------------------------
 
-char *fofiType1StandardEncoding[256] = {
+const char *fofiType1StandardEncoding[256] = {
   NULL,
   NULL,
   NULL,
@@ -278,7 +278,7 @@ char *fofiType1StandardEncoding[256] = {
   NULL
 };
 
-char *fofiType1ExpertEncoding[256] = {
+const char *fofiType1ExpertEncoding[256] = {
   NULL,
   NULL,
   NULL,
@@ -541,7 +541,7 @@ char *fofiType1ExpertEncoding[256] = {
 // Type 1C font data
 //------------------------------------------------------------------------
 
-char *fofiType1CStdStrings[391] = {
+const char *fofiType1CStdStrings[391] = {
   ".notdef",
   "space",
   "exclam",
diff --git a/fofi/FoFiEncodings.h b/fofi/FoFiEncodings.h
index fb4eca8..ab80ad3 100644
--- a/fofi/FoFiEncodings.h
+++ b/fofi/FoFiEncodings.h
@@ -19,14 +19,14 @@
 // Type 1 and 1C font data
 //------------------------------------------------------------------------
 
-extern char *fofiType1StandardEncoding[256];
-extern char *fofiType1ExpertEncoding[256];
+extern const char *fofiType1StandardEncoding[256];
+extern const char *fofiType1ExpertEncoding[256];
 
 //------------------------------------------------------------------------
 // Type 1C font data
 //------------------------------------------------------------------------
 
-extern char *fofiType1CStdStrings[391];
+extern const char *fofiType1CStdStrings[391];
 extern Gushort fofiType1CISOAdobeCharset[229];
 extern Gushort fofiType1CExpertCharset[166];
 extern Gushort fofiType1CExpertSubsetCharset[87];
diff --git a/fofi/FoFiTrueType.cc b/fofi/FoFiTrueType.cc
index d716638..4793acf 100644
--- a/fofi/FoFiTrueType.cc
+++ b/fofi/FoFiTrueType.cc
@@ -164,7 +164,7 @@ static int cmpTrueTypeTableTag(const void *p1, const void *p2) {
 //------------------------------------------------------------------------
 
 struct T42Table {
-  char *tag;			// 4-byte tag
+  const char *tag;		// 4-byte tag
   GBool required;		// required by the TrueType spec?
 };
 
@@ -194,7 +194,7 @@ static T42Table t42Tables[nT42Tables] = {
 
 // Glyph names in some arbitrary standard order that Apple uses for
 // their TrueType fonts.
-static char *macGlyphNames[258] = {
+static const char *macGlyphNames[258] = {
   ".notdef",        "null",           "CR",             "space",
   "exclam",         "quotedbl",       "numbersign",     "dollar",
   "percent",        "ampersand",      "quotesingle",    "parenleft",
@@ -530,7 +530,7 @@ void FoFiTrueType::convertToType42(char *psName, char **encoding,
   (*outputFunc)(outputStream, "FontName currentdict end definefont pop\n", 40);
 }
 
-void FoFiTrueType::convertToType1(char *psName, char **newEncoding,
+void FoFiTrueType::convertToType1(char *psName, const char **newEncoding,
 				  GBool ascii, FoFiOutputFunc outputFunc,
 				  void *outputStream) {
   FoFiType1C *ff;
@@ -1424,7 +1424,7 @@ void FoFiTrueType::writeTTF(FoFiOutputFunc outputFunc,
 void FoFiTrueType::cvtEncoding(char **encoding,
 			       FoFiOutputFunc outputFunc,
 			       void *outputStream) {
-  char *name;
+  const char *name;
   GooString *buf;
   int i;
 
@@ -2085,7 +2085,7 @@ void FoFiTrueType::readPostTable() {
   }
 }
 
-int FoFiTrueType::seekTable(char *tag) {
+int FoFiTrueType::seekTable(const char *tag) {
   Guint tagI;
   int i;
 
diff --git a/fofi/FoFiTrueType.h b/fofi/FoFiTrueType.h
index 4ba9b1f..c4fb840 100644
--- a/fofi/FoFiTrueType.h
+++ b/fofi/FoFiTrueType.h
@@ -114,7 +114,7 @@ public:
   // otherwise it will be left as binary data.  If <psName> is
   // non-NULL, it will be used as the PostScript font name.  (Only
   // useful for OpenType CFF fonts.)
-  void convertToType1(char *psName, char **newEncoding, GBool ascii,
+  void convertToType1(char *psName, const char **newEncoding, GBool ascii,
 		      FoFiOutputFunc outputFunc, void *outputStream);
 
   // Convert to a Type 2 CIDFont, suitable for embedding in a
@@ -176,7 +176,7 @@ private:
   Guint computeTableChecksum(Guchar *data, int length);
   void parse();
   void readPostTable();
-  int seekTable(char *tag);
+  int seekTable(const char *tag);
   Guint charToTag(const char *tagName);
   Guint doMapToVertGID(Guint orgGID);
   Guint scanLookupList(Guint listIndex, Guint orgGID);
diff --git a/fofi/FoFiType1.cc b/fofi/FoFiType1.cc
index 3fe7f4f..b6c3408 100644
--- a/fofi/FoFiType1.cc
+++ b/fofi/FoFiType1.cc
@@ -90,7 +90,7 @@ char **FoFiType1::getEncoding() {
   return encoding;
 }
 
-void FoFiType1::writeEncoded(char **newEncoding,
+void FoFiType1::writeEncoded(const char **newEncoding,
 			     FoFiOutputFunc outputFunc, void *outputStream) {
   char buf[512];
   char *line, *line2, *p;
@@ -213,7 +213,7 @@ void FoFiType1::parse() {
     // get encoding
     } else if (!encoding &&
 	       !strncmp(line, "/Encoding StandardEncoding def", 30)) {
-      encoding = fofiType1StandardEncoding;
+      encoding = (char **)fofiType1StandardEncoding;
     } else if (!encoding &&
 	       !strncmp(line, "/Encoding 256 array", 19)) {
       encoding = (char **)gmallocn(256, sizeof(char *));
diff --git a/fofi/FoFiType1.h b/fofi/FoFiType1.h
index 85e67b1..5abdfb2 100644
--- a/fofi/FoFiType1.h
+++ b/fofi/FoFiType1.h
@@ -39,7 +39,7 @@ public:
   char **getEncoding();
 
   // Write a version of the Type 1 font file with a new encoding.
-  void writeEncoded(char **newEncoding,
+  void writeEncoded(const char **newEncoding,
 		    FoFiOutputFunc outputFunc, void *outputStream);
 
 private:
diff --git a/fofi/FoFiType1C.cc b/fofi/FoFiType1C.cc
index 9c5b10c..401d70b 100644
--- a/fofi/FoFiType1C.cc
+++ b/fofi/FoFiType1C.cc
@@ -144,7 +144,7 @@ Gushort *FoFiType1C::getCIDToGIDMap(int *nCIDs) {
   return map;
 }
 
-void FoFiType1C::convertToType1(char *psName, char **newEncoding, GBool ascii,
+void FoFiType1C::convertToType1(char *psName, const char **newEncoding, GBool ascii,
 				FoFiOutputFunc outputFunc,
 				void *outputStream) {
   int psNameLen;
@@ -153,7 +153,7 @@ void FoFiType1C::convertToType1(char *psName, char **newEncoding, GBool ascii,
   Type1CIndexVal val;
   GooString *buf;
   char buf2[256];
-  char **enc;
+  const char **enc;
   GBool ok;
   int i;
 
@@ -265,7 +265,7 @@ void FoFiType1C::convertToType1(char *psName, char **newEncoding, GBool ascii,
     (*outputFunc)(outputStream, "256 array\n", 10);
     (*outputFunc)(outputStream,
 		  "0 1 255 {1 index exch /.notdef put} for\n", 40);
-    enc = newEncoding ? newEncoding : encoding;
+    enc = newEncoding ? newEncoding : (const char **)encoding;
     for (i = 0; i < 256; ++i) {
       if (enc[i]) {
 	buf = GooString::format("dup {0:d} /{1:s} put\n", i, enc[i]);
@@ -1083,7 +1083,7 @@ void FoFiType1C::convertToType0(char *psName,
   gfree(cidMap);
 }
 
-void FoFiType1C::eexecCvtGlyph(Type1CEexecBuf *eb, char *glyphName,
+void FoFiType1C::eexecCvtGlyph(Type1CEexecBuf *eb, const char *glyphName,
 			       int offset, int nBytes,
 			       Type1CIndex *subrIdx,
 			       Type1CPrivateDict *pDict) {
@@ -1809,7 +1809,7 @@ void FoFiType1C::cvtNum(double x, GBool isFP, GooString *charBuf) {
   charBuf->append((char *)buf, n);
 }
 
-void FoFiType1C::eexecWrite(Type1CEexecBuf *eb, char *s) {
+void FoFiType1C::eexecWrite(Type1CEexecBuf *eb, const char *s) {
   Guchar *p;
   Guchar x;
 
@@ -2278,10 +2278,10 @@ void FoFiType1C::buildEncoding() {
   int pos, c, sid, nLeft, nSups, i, j;
 
   if (topDict.encodingOffset == 0) {
-    encoding = fofiType1StandardEncoding;
+    encoding = (char **)fofiType1StandardEncoding;
 
   } else if (topDict.encodingOffset == 1) {
-    encoding = fofiType1ExpertEncoding;
+    encoding = (char **)fofiType1ExpertEncoding;
 
   } else {
     encoding = (char **)gmallocn(256, sizeof(char *));
diff --git a/fofi/FoFiType1C.h b/fofi/FoFiType1C.h
index 694d5cc..d48340b 100644
--- a/fofi/FoFiType1C.h
+++ b/fofi/FoFiType1C.h
@@ -171,7 +171,7 @@ public:
   // font.  If <ascii> is true the eexec section will be hex-encoded,
   // otherwise it will be left as binary data.  If <psName> is non-NULL,
   // it will be used as the PostScript font name.
-  void convertToType1(char *psName, char **newEncoding, GBool ascii,
+  void convertToType1(char *psName, const char **newEncoding, GBool ascii,
 		      FoFiOutputFunc outputFunc, void *outputStream);
 
   // Convert to a Type 0 CIDFont, suitable for embedding in a
@@ -189,7 +189,7 @@ public:
 private:
 
   FoFiType1C(char *fileA, int lenA, GBool freeFileDataA);
-  void eexecCvtGlyph(Type1CEexecBuf *eb, char *glyphName,
+  void eexecCvtGlyph(Type1CEexecBuf *eb, const char *glyphName,
 		     int offset, int nBytes,
 		     Type1CIndex *subrIdx,
 		     Type1CPrivateDict *pDict);
@@ -199,7 +199,7 @@ private:
   void cvtGlyphWidth(GBool useOp, GooString *charBuf,
 		     Type1CPrivateDict *pDict);
   void cvtNum(double x, GBool isFP, GooString *charBuf);
-  void eexecWrite(Type1CEexecBuf *eb, char *s);
+  void eexecWrite(Type1CEexecBuf *eb, const char *s);
   void eexecWriteCharstring(Type1CEexecBuf *eb, Guchar *s, int n);
   GBool parse();
   void readTopDict();
diff --git a/goo/GooHash.cc b/goo/GooHash.cc
index 5da9d69..0b96920 100644
--- a/goo/GooHash.cc
+++ b/goo/GooHash.cc
@@ -145,7 +145,7 @@ int GooHash::lookupInt(GooString *key) {
   return p->val.i;
 }
 
-void *GooHash::lookup(char *key) {
+void *GooHash::lookup(const char *key) {
   GooHashBucket *p;
   int h;
 
@@ -155,7 +155,7 @@ void *GooHash::lookup(char *key) {
   return p->val.p;
 }
 
-int GooHash::lookupInt(char *key) {
+int GooHash::lookupInt(const char *key) {
   GooHashBucket *p;
   int h;
 
@@ -211,7 +211,7 @@ int GooHash::removeInt(GooString *key) {
   return val;
 }
 
-void *GooHash::remove(char *key) {
+void *GooHash::remove(const char *key) {
   GooHashBucket *p;
   GooHashBucket **q;
   void *val;
@@ -234,7 +234,7 @@ void *GooHash::remove(char *key) {
   return val;
 }
 
-int GooHash::removeInt(char *key) {
+int GooHash::removeInt(const char *key) {
   GooHashBucket *p;
   GooHashBucket **q;
   int val;
@@ -344,7 +344,7 @@ GooHashBucket *GooHash::find(GooString *key, int *h) {
   return NULL;
 }
 
-GooHashBucket *GooHash::find(char *key, int *h) {
+GooHashBucket *GooHash::find(const char *key, int *h) {
   GooHashBucket *p;
 
   *h = hash(key);
@@ -357,7 +357,7 @@ GooHashBucket *GooHash::find(char *key, int *h) {
 }
 
 int GooHash::hash(GooString *key) {
-  char *p;
+  const char *p;
   unsigned int h;
   int i;
 
@@ -368,8 +368,8 @@ int GooHash::hash(GooString *key) {
   return (int)(h % size);
 }
 
-int GooHash::hash(char *key) {
-  char *p;
+int GooHash::hash(const char *key) {
+  const char *p;
   unsigned int h;
 
   h = 0;
diff --git a/goo/GooHash.h b/goo/GooHash.h
index bdcf1c4..b973a93 100644
--- a/goo/GooHash.h
+++ b/goo/GooHash.h
@@ -32,12 +32,12 @@ public:
   void replace(GooString *key, int val);
   void *lookup(GooString *key);
   int lookupInt(GooString *key);
-  void *lookup(char *key);
-  int lookupInt(char *key);
+  void *lookup(const char *key);
+  int lookupInt(const char *key);
   void *remove(GooString *key);
   int removeInt(GooString *key);
-  void *remove(char *key);
-  int removeInt(char *key);
+  void *remove(const char *key);
+  int removeInt(const char *key);
   int getLength() { return len; }
   void startIter(GooHashIter **iter);
   GBool getNext(GooHashIter **iter, GooString **key, void **val);
@@ -48,9 +48,9 @@ private:
 
   void expand();
   GooHashBucket *find(GooString *key, int *h);
-  GooHashBucket *find(char *key, int *h);
+  GooHashBucket *find(const char *key, int *h);
   int hash(GooString *key);
-  int hash(char *key);
+  int hash(const char *key);
 
   GBool deleteKeys;		// set if key strings should be deleted
   int size;			// number of buckets
diff --git a/goo/GooString.cc b/goo/GooString.cc
index a96b792..1842565 100644
--- a/goo/GooString.cc
+++ b/goo/GooString.cc
@@ -81,7 +81,7 @@ enum GooStringFormatType {
   fmtSpace
 };
 
-static char *formatStrings[] = {
+static const char *formatStrings[] = {
   "d", "x", "o", "b", "ud", "ux", "uo", "ub",
   "ld", "lx", "lo", "lb", "uld", "ulx", "ulo", "ulb",
   "f", "gs", "g",
@@ -211,13 +211,13 @@ GooString::GooString(GooString *str1, GooString *str2) {
 
 GooString *GooString::fromInt(int x) {
   char buf[24]; // enough space for 64-bit ints plus a little extra
-  char *p;
+  const char *p;
   int len;
   formatInt(x, buf, sizeof(buf), gFalse, 0, 10, &p, &len);
   return new GooString(p, len);
 }
 
-GooString *GooString::format(char *fmt, ...) {
+GooString *GooString::format(const char *fmt, ...) {
   va_list argList;
   GooString *s;
 
@@ -228,7 +228,7 @@ GooString *GooString::format(char *fmt, ...) {
   return s;
 }
 
-GooString *GooString::formatv(char *fmt, va_list argList) {
+GooString *GooString::formatv(const char *fmt, va_list argList) {
   GooString *s;
 
   s = new GooString();
@@ -263,7 +263,7 @@ GooString *GooString::append(const char *str, int lengthA) {
   return this;
 }
 
-GooString *GooString::appendf(char *fmt, ...) {
+GooString *GooString::appendf(const char *fmt, ...) {
   va_list argList;
 
   va_start(argList, fmt);
@@ -272,7 +272,7 @@ GooString *GooString::appendf(char *fmt, ...) {
   return this;
 }
 
-GooString *GooString::appendfv(char *fmt, va_list argList) {
+GooString *GooString::appendfv(const char *fmt, va_list argList) {
   GooStringFormatArg *args;
   int argsLen, argsSize;
   GooStringFormatArg arg;
@@ -281,7 +281,7 @@ GooString *GooString::appendfv(char *fmt, va_list argList) {
   GooStringFormatType ft;
   char buf[65];
   int len, i;
-  char *p0, *p1, *str;
+  const char *p0, *p1, *str;
 
   argsLen = 0;
   argsSize = 8;
@@ -519,7 +519,7 @@ GooString *GooString::appendfv(char *fmt, va_list argList) {
 
 void GooString::formatInt(long x, char *buf, int bufSize,
 			GBool zeroFill, int width, int base,
-			char **p, int *len) {
+			const char **p, int *len) {
   static char vals[17] = "0123456789abcdef";
   GBool neg;
   int start, i, j;
@@ -551,7 +551,7 @@ void GooString::formatInt(long x, char *buf, int bufSize,
 
 void GooString::formatUInt(Gulong x, char *buf, int bufSize,
 			 GBool zeroFill, int width, int base,
-			 char **p, int *len) {
+			 const char **p, int *len) {
   static char vals[17] = "0123456789abcdef";
   int i, j;
 
@@ -574,7 +574,7 @@ void GooString::formatUInt(Gulong x, char *buf, int bufSize,
 }
 
 void GooString::formatDouble(double x, char *buf, int bufSize, int prec,
-			   GBool trim, char **p, int *len) {
+			   GBool trim, const char **p, int *len) {
   GBool neg, started;
   double x2;
   int d, i, j;
@@ -613,7 +613,7 @@ void GooString::formatDouble(double x, char *buf, int bufSize, int prec,
 }
 
 void GooString::formatDoubleSmallAware(double x, char *buf, int bufSize, int prec,
-				      GBool trim, char **p, int *len)
+				      GBool trim, const char **p, int *len)
 {
   double absX = fabs(x);
   if (absX >= 0.1) {
diff --git a/goo/GooString.h b/goo/GooString.h
index e77308d..aac7872 100644
--- a/goo/GooString.h
+++ b/goo/GooString.h
@@ -88,8 +88,8 @@ public:
   //     t -- GooString *
   //     w -- blank space; arg determines width
   // To get literal curly braces, use {{ or }}.
-  static GooString *format(char *fmt, ...);
-  static GooString *formatv(char *fmt, va_list argList);
+  static GooString *format(const char *fmt, ...);
+  static GooString *formatv(const char *fmt, va_list argList);
 
   // Destructor.
   ~GooString();
@@ -115,8 +115,8 @@ public:
   GooString *append(const char *str, int lengthA=CALC_STRING_LEN);
 
   // Append a formatted string.
-  GooString *appendf(char *fmt, ...);
-  GooString *appendfv(char *fmt, va_list argList);
+  GooString *appendf(const char *fmt, ...);
+  GooString *appendfv(const char *fmt, va_list argList);
 
   // Insert a character or string.
   GooString *insert(int i, char c);
@@ -166,14 +166,14 @@ private:
   void resize(int newLength);
   static void formatInt(long x, char *buf, int bufSize,
 			GBool zeroFill, int width, int base,
-			char **p, int *len);
+			const char **p, int *len);
   static void formatUInt(Gulong x, char *buf, int bufSize,
 			 GBool zeroFill, int width, int base,
-			 char **p, int *len);
+			 const char **p, int *len);
   static void formatDouble(double x, char *buf, int bufSize, int prec,
-			   GBool trim, char **p, int *len);
+			   GBool trim, const char **p, int *len);
   static void formatDoubleSmallAware(double x, char *buf, int bufSize, int prec,
-				     GBool trim, char **p, int *len);
+				     GBool trim, const char **p, int *len);
 };
 
 #endif
diff --git a/goo/gfile.cc b/goo/gfile.cc
index f48f9f3..0a23f50 100644
--- a/goo/gfile.cc
+++ b/goo/gfile.cc
@@ -123,7 +123,7 @@ GooString *getCurrentDir() {
   return new GooString();
 }
 
-GooString *appendToPath(GooString *path, char *fileName) {
+GooString *appendToPath(GooString *path, const char *fileName) {
 #if defined(VMS)
   //---------- VMS ----------
   //~ this should handle everything necessary for file
@@ -458,7 +458,7 @@ time_t getModTime(char *fileName) {
 #endif
 }
 
-GBool openTempFile(GooString **name, FILE **f, char *mode) {
+GBool openTempFile(GooString **name, FILE **f, const char *mode) {
 #if defined(_WIN32)
   //---------- Win32 ----------
   char *tempDir;
diff --git a/goo/gfile.h b/goo/gfile.h
index 0bc010e..208d391 100644
--- a/goo/gfile.h
+++ b/goo/gfile.h
@@ -79,7 +79,7 @@ extern GooString *getCurrentDir();
 
 // Append a file name to a path string.  <path> may be an empty
 // string, denoting the current directory).  Returns <path>.
-extern GooString *appendToPath(GooString *path, char *fileName);
+extern GooString *appendToPath(GooString *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.
@@ -102,7 +102,7 @@ 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(GooString **name, FILE **f, char *mode);
+extern GBool openTempFile(GooString **name, FILE **f, const char *mode);
 
 // Execute <command>.  Returns true on success.
 extern GBool executeCommand(char *cmd);
diff --git a/goo/gmem.cc b/goo/gmem.cc
index 3e9adb0..4189ac1 100644
--- a/goo/gmem.cc
+++ b/goo/gmem.cc
@@ -310,7 +310,7 @@ void gMemReport(FILE *f) {
 }
 #endif
 
-char *copyString(char *s) {
+char *copyString(const char *s) {
   char *s1;
 
   s1 = (char *)gmalloc(strlen(s) + 1);
diff --git a/goo/gmem.h b/goo/gmem.h
index 405c829..d5bb2ae 100644
--- a/goo/gmem.h
+++ b/goo/gmem.h
@@ -78,7 +78,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);
 
 /*
  * Allocate memory and copy a limited-length string to it.
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 1d12aee..7f92c18 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -1079,7 +1079,7 @@ void Annot::setPage(Ref *pageRef, int pageIndex)
   page = pageIndex;
 }
 
-void Annot::setAppearanceState(char *state) {
+void Annot::setAppearanceState(const char *state) {
   if (!state)
     return;
 
@@ -1298,9 +1298,9 @@ void Annot::createForm(double *bbox, GBool transparencyGroup, Object *resDict, O
   aStream->initStream(mStream);
 }
 
-void Annot::createResourcesDict(char *formName, Object *formStream,
-				char *stateName,
-				double opacity,	char *blendMode,
+void Annot::createResourcesDict(const char *formName, Object *formStream,
+				const char *stateName,
+				double opacity, const char *blendMode,
 				Object *resDict) {
   Object gsDict, stateDict, formDict, obj1;
 
diff --git a/poppler/Annot.h b/poppler/Annot.h
index 59d610b..5796acb 100644
--- a/poppler/Annot.h
+++ b/poppler/Annot.h
@@ -485,7 +485,7 @@ public:
 
   void setPage(Ref *pageRef, int pageIndex);
 
-  void setAppearanceState(char *state);
+  void setAppearanceState(const char *state);
 
   // getters
   XRef *getXRef() const { return xref; }
@@ -524,8 +524,8 @@ protected:
   void drawCircleTopLeft(double cx, double cy, double r);
   void drawCircleBottomRight(double cx, double cy, double r);
   void createForm(double *bbox, GBool transparencyGroup, Object *resDict, Object *aStream);
-  void createResourcesDict(char *formName, Object *formStream, char *stateName,
-			   double opacity, char *blendMode, Object *resDict);
+  void createResourcesDict(const char *formName, Object *formStream, const char *stateName,
+			   double opacity, const char *blendMode, Object *resDict);
   GBool isVisible(GBool printing);
 
   // Updates the field key of the annotation dictionary
diff --git a/poppler/ArthurOutputDev.cc b/poppler/ArthurOutputDev.cc
index 68a1c71..cb3ea1c 100644
--- a/poppler/ArthurOutputDev.cc
+++ b/poppler/ArthurOutputDev.cc
@@ -352,7 +352,7 @@ void ArthurOutputDev::updateFont(GfxState *state)
       if (!(fontFile = m_fontEngine->loadType1Font(
 			   id,
 			   fontsrc,
-			   ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
+			   (const char **)((Gfx8BitFont *)gfxFont)->getEncoding()))) {
 	error(-1, "Couldn't create a font for '%s'",
 	      gfxFont->getName() ? gfxFont->getName()->getCString()
 	                         : "(unnamed)");
@@ -363,7 +363,7 @@ void ArthurOutputDev::updateFont(GfxState *state)
       if (!(fontFile = m_fontEngine->loadType1CFont(
 			   id,
 			   fontsrc,
-			   ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
+			   (const char **)((Gfx8BitFont *)gfxFont)->getEncoding()))) {
 	error(-1, "Couldn't create a font for '%s'",
 	      gfxFont->getName() ? gfxFont->getName()->getCString()
 	                         : "(unnamed)");
@@ -374,7 +374,7 @@ void ArthurOutputDev::updateFont(GfxState *state)
       if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
 			   id,
 			   fontsrc,
-			   ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
+			   (const char **)((Gfx8BitFont *)gfxFont)->getEncoding()))) {
 	error(-1, "Couldn't create a font for '%s'",
 	      gfxFont->getName() ? gfxFont->getName()->getCString()
 	                         : "(unnamed)");
diff --git a/poppler/BuiltinFont.cc b/poppler/BuiltinFont.cc
index 329ff62..20a297d 100644
--- a/poppler/BuiltinFont.cc
+++ b/poppler/BuiltinFont.cc
@@ -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;
diff --git a/poppler/BuiltinFont.h b/poppler/BuiltinFont.h
index 8652034..bbdd055 100644
--- a/poppler/BuiltinFont.h
+++ b/poppler/BuiltinFont.h
@@ -21,8 +21,8 @@ class BuiltinFontWidths;
 //------------------------------------------------------------------------
 
 struct BuiltinFont {
-  char *name;
-  char **defaultBaseEnc;
+  const char *name;
+  const char **defaultBaseEnc;
   short ascent;
   short descent;
   short bbox[4];
@@ -32,7 +32,7 @@ struct BuiltinFont {
 //------------------------------------------------------------------------
 
 struct BuiltinFontWidth {
-  char *name;
+  const char *name;
   Gushort width;
   BuiltinFontWidth *next;
 };
@@ -42,11 +42,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;
diff --git a/poppler/DCTStream.cc b/poppler/DCTStream.cc
index c0ef81d..a7422db 100644
--- a/poppler/DCTStream.cc
+++ b/poppler/DCTStream.cc
@@ -225,7 +225,7 @@ int DCTStream::lookChar() {
   return *current;
 }
 
-GooString *DCTStream::getPSFilter(int psLevel, char *indent) {
+GooString *DCTStream::getPSFilter(int psLevel, const char *indent) {
   GooString *s;
 
   if (psLevel < 2) {
diff --git a/poppler/DCTStream.h b/poppler/DCTStream.h
index 8f1fc85..558b726 100644
--- a/poppler/DCTStream.h
+++ b/poppler/DCTStream.h
@@ -66,7 +66,7 @@ public:
   virtual void reset();
   virtual int getChar();
   virtual int lookChar();
-  virtual GooString *getPSFilter(int psLevel, char *indent);
+  virtual GooString *getPSFilter(int psLevel, const char *indent);
   virtual GBool isBinary(GBool last = gTrue);
   Stream *getRawStream() { return str; }
 
diff --git a/poppler/Dict.cc b/poppler/Dict.cc
index 1428113..d0d4b85 100644
--- a/poppler/Dict.cc
+++ b/poppler/Dict.cc
@@ -118,7 +118,7 @@ void Dict::add(char *key, Object *val) {
   ++length;
 }
 
-inline DictEntry *Dict::find(char *key) {
+inline DictEntry *Dict::find(const char *key) {
   if (!sorted && length >= SORT_LENGTH_LOWER_LIMIT)
   {
       sorted = gTrue;
@@ -141,11 +141,11 @@ inline DictEntry *Dict::find(char *key) {
   return NULL;
 }
 
-GBool Dict::hasKey(char *key) {
+GBool Dict::hasKey(const char *key) {
   return find(key) != NULL;
 }
 
-void Dict::remove(char *key) {
+void Dict::remove(const char *key) {
   if (sorted) {
     const int pos = binarySearch(key, entries, length);
     if (pos != -1) {
@@ -175,7 +175,7 @@ void Dict::remove(char *key) {
   }
 }
 
-void Dict::set(char *key, Object *val) {
+void Dict::set(const char *key, Object *val) {
   DictEntry *e;
   e = find (key);
   if (e) {
@@ -187,19 +187,19 @@ void Dict::set(char *key, Object *val) {
 }
 
 
-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, std::set<int> *fetchOriginatorNums) {
+Object *Dict::lookup(const char *key, Object *obj, std::set<int> *fetchOriginatorNums) {
   DictEntry *e;
 
   return (e = find(key)) ? e->val.fetch(xref, obj, fetchOriginatorNums) : 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();
diff --git a/poppler/Dict.h b/poppler/Dict.h
index f4ed64a..a589377 100644
--- a/poppler/Dict.h
+++ b/poppler/Dict.h
@@ -63,17 +63,17 @@ public:
   void add(char *key, Object *val);
 
   // Update the value of an existing entry, otherwise create it
-  void set(char *key, Object *val);
+  void set(const char *key, Object *val);
   // Remove an entry. This invalidate indexes
-  void remove(char *key);
+  void remove(const char *key);
 
   // 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, std::set<int> *fetchOriginatorNums = NULL);
-  Object *lookupNF(char *key, Object *obj);
+  Object *lookup(const char *key, Object *obj, std::set<int> *fetchOriginatorNums = NULL);
+  Object *lookupNF(const char *key, Object *obj);
   GBool lookupInt(const char *key, const char *alt_key, int *value);
 
   // Iterative accessors.
@@ -88,7 +88,7 @@ public:
   
   XRef *getXRef() { return xref; }
   
-  GBool hasKey(char *key);
+  GBool hasKey(const char *key);
 
 private:
 
@@ -99,7 +99,7 @@ private:
   int length;			// number of entries in dictionary
   int ref;			// reference count
 
-  DictEntry *find(char *key);
+  DictEntry *find(const char *key);
 };
 
 #endif
diff --git a/poppler/Error.cc b/poppler/Error.cc
index fc2bef4..7a2db19 100644
--- a/poppler/Error.cc
+++ b/poppler/Error.cc
@@ -34,7 +34,7 @@
 #include "GlobalParams.h"
 #include "Error.h"
 
-static void defaultErrorFunction(int pos, char *msg, va_list args)
+static void defaultErrorFunction(int pos, const char *msg, va_list args)
 {
   if (pos >= 0) {
     fprintf(stderr, "Error (%d): ", pos);
@@ -46,14 +46,14 @@ static void defaultErrorFunction(int pos, char *msg, va_list args)
   fflush(stderr);
 }
 
-static void (*errorFunction)(int, char *, va_list args) = defaultErrorFunction;
+static void (*errorFunction)(int, const char *, va_list args) = defaultErrorFunction;
 
-void setErrorFunction(void (* f)(int, char *, va_list args))
+void setErrorFunction(void (* f)(int, const char *, va_list args))
 {
     errorFunction = f;
 }
 
-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
   if (globalParams && globalParams->getErrQuiet()) {
@@ -64,7 +64,7 @@ void CDECL error(int pos, char *msg, ...) {
   va_end(args);
 }
 
-void warning(char *msg, ...) {
+void warning(const char *msg, ...) {
   va_list args;
   va_start(args, msg);
   vprintf(msg, args);
diff --git a/poppler/Error.h b/poppler/Error.h
index 07f3d1f..da7913c 100644
--- a/poppler/Error.h
+++ b/poppler/Error.h
@@ -32,9 +32,9 @@
 #include <stdarg.h>
 #include "poppler-config.h"
 
-extern void CDECL error(int pos, char *msg, ...) GCC_PRINTF_FORMAT (2, 3);
-void warning(char *msg, ...) GCC_PRINTF_FORMAT (1, 2);
+extern void CDECL error(int pos, const char *msg, ...) GCC_PRINTF_FORMAT (2, 3);
+void warning(const char *msg, ...) GCC_PRINTF_FORMAT (1, 2);
 
-void setErrorFunction(void (* f)(int , char *, va_list args));
+void setErrorFunction(void (* f)(int , const char *, va_list args));
 
 #endif
diff --git a/poppler/FileSpec.cc b/poppler/FileSpec.cc
index 7807864..7993ab5 100644
--- a/poppler/FileSpec.cc
+++ b/poppler/FileSpec.cc
@@ -205,7 +205,7 @@ GBool getFileSpecNameForPlatform (Object *fileSpec, Object *fileName)
 #ifdef _WIN32
 	char *platform = "DOS";
 #else
-	char *platform = "Unix";
+	const char *platform = "Unix";
 #endif
 	if (!fileSpec->dictLookup(platform, fileName)->isString ()) {
 	  fileName->free();
diff --git a/poppler/FlateStream.cc b/poppler/FlateStream.cc
index ef477b3..7990dad 100644
--- a/poppler/FlateStream.cc
+++ b/poppler/FlateStream.cc
@@ -110,7 +110,7 @@ int FlateStream::fill_buffer() {
   return 0;
 }
 
-GooString *FlateStream::getPSFilter(int psLevel, char *indent) {
+GooString *FlateStream::getPSFilter(int psLevel, const char *indent) {
   GooString *s;
 
   if (psLevel < 3 || pred) {
diff --git a/poppler/FlateStream.h b/poppler/FlateStream.h
index dba00d0..9e3835f 100644
--- a/poppler/FlateStream.h
+++ b/poppler/FlateStream.h
@@ -52,7 +52,7 @@ public:
   virtual int lookChar();
   virtual int getRawChar();
   virtual void getRawChars(int nChars, int *buffer);
-  virtual GooString *getPSFilter(int psLevel, char *indent);
+  virtual GooString *getPSFilter(int psLevel, const char *indent);
   virtual GBool isBinary(GBool last = gTrue);
 
 private:
diff --git a/poppler/FontEncodingTables.cc b/poppler/FontEncodingTables.cc
index cd8d892..6ebef78 100644
--- a/poppler/FontEncodingTables.cc
+++ b/poppler/FontEncodingTables.cc
@@ -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,
diff --git a/poppler/FontEncodingTables.h b/poppler/FontEncodingTables.h
index 8b0a1e7..a417b32 100644
--- a/poppler/FontEncodingTables.h
+++ b/poppler/FontEncodingTables.h
@@ -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
diff --git a/poppler/FontInfo.cc b/poppler/FontInfo.cc
index 440e6f5..0fd8966 100644
--- a/poppler/FontInfo.cc
+++ b/poppler/FontInfo.cc
@@ -130,7 +130,7 @@ void FontInfoScanner::scanFonts(Dict *resDict, GooList *fontsList) {
 
   // recursively scan any resource dictionaries in objects in this
   // resource dictionary
-  char *resTypes[] = { "XObject", "Pattern" };
+  const char *resTypes[] = { "XObject", "Pattern" };
   for (Guint resType = 0; resType < sizeof(resTypes) / sizeof(resTypes[0]); ++resType) {
     resDict->lookup(resTypes[resType], &objDict);
     if (objDict.isDict()) {
diff --git a/poppler/Form.cc b/poppler/Form.cc
index 1f8b064..6137c34 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -199,7 +199,7 @@ FormButtonType FormWidgetButton::getButtonType () const
   return parent->getButtonType ();
 }
 
-void FormWidgetButton::setAppearanceState(char *state) {
+void FormWidgetButton::setAppearanceState(const char *state) {
   if (!widget)
     return;
   widget->setAppearanceState(state);
@@ -1335,7 +1335,7 @@ Form::~Form() {
 }
 
 // Look up an inheritable field dictionary entry.
-static Object *fieldLookup(Dict *field, char *key, Object *obj, std::set<int> *usedParents) {
+static Object *fieldLookup(Dict *field, const char *key, Object *obj, std::set<int> *usedParents) {
   Dict *dict;
   Object parent;
 
@@ -1368,7 +1368,7 @@ static Object *fieldLookup(Dict *field, char *key, Object *obj, std::set<int> *u
   return obj;
 }
 
-Object *Form::fieldLookup(Dict *field, char *key, Object *obj) {
+Object *Form::fieldLookup(Dict *field, const char *key, Object *obj) {
   std::set<int> usedParents;
   return ::fieldLookup(field, key, obj, &usedParents);
 }
diff --git a/poppler/Form.h b/poppler/Form.h
index 0cfc95b..ba802ec 100644
--- a/poppler/Form.h
+++ b/poppler/Form.h
@@ -152,7 +152,7 @@ public:
   GBool getState ();
 
   char* getOnStr();
-  void setAppearanceState(char *state);
+  void setAppearanceState(const char *state);
 
   void setNumSiblingsID (int i);
   void setSiblingsID (int i, unsigned id) { siblingsID[i] = id; }
@@ -494,7 +494,7 @@ public:
   ~Form();
 
   // Look up an inheritable field dictionary entry.
-  static Object *fieldLookup(Dict *field, char *key, Object *obj);
+  static Object *fieldLookup(Dict *field, const char *key, Object *obj);
   
   /* Creates a new Field of the type specified in obj's dict.
      used in Form::Form and FormField::FormField */
diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index 94f5e55..c791fb4 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -438,7 +438,7 @@ GBool GfxResources::lookupMarkedContentNF(char *name, Object *obj) {
   return gFalse;
 }
 
-void GfxResources::lookupColorSpace(char *name, Object *obj) {
+void GfxResources::lookupColorSpace(const char *name, Object *obj) {
   GfxResources *resPtr;
 
   for (resPtr = this; resPtr; resPtr = resPtr->next) {
diff --git a/poppler/Gfx.h b/poppler/Gfx.h
index ce7b2d8..9cca8bd 100644
--- a/poppler/Gfx.h
+++ b/poppler/Gfx.h
@@ -114,7 +114,7 @@ public:
   GBool lookupXObject(char *name, Object *obj);
   GBool lookupXObjectNF(char *name, Object *obj);
   GBool lookupMarkedContentNF(char *name, Object *obj);
-  void lookupColorSpace(char *name, Object *obj);
+  void lookupColorSpace(const char *name, Object *obj);
   GfxPattern *lookupPattern(char *name, Gfx *gfx);
   GfxShading *lookupShading(char *name, Gfx *gfx);
   GBool lookupGState(char *name, Object *obj);
diff --git a/poppler/GfxFont.cc b/poppler/GfxFont.cc
index 114c797..d77047d 100644
--- a/poppler/GfxFont.cc
+++ b/poppler/GfxFont.cc
@@ -61,8 +61,8 @@
 //------------------------------------------------------------------------
 
 struct StdFontMapEntry {
-  char *altName;
-  char *properName;
+  const char *altName;
+  const char *properName;
 };
 
 // Acrobat 4.0 and earlier substituted Base14-compatible fonts without
@@ -132,7 +132,7 @@ static int parseCharName(char *charName, Unicode *uBuf, int uLen,
 // GfxFont
 //------------------------------------------------------------------------
 
-GfxFont *GfxFont::makeFont(XRef *xref, char *tagA, Ref idA, Dict *fontDict) {
+GfxFont *GfxFont::makeFont(XRef *xref, const char *tagA, Ref idA, Dict *fontDict) {
   GooString *nameA;
   GfxFont *font;
   Object obj1;
@@ -168,7 +168,7 @@ GfxFont *GfxFont::makeFont(XRef *xref, char *tagA, Ref idA, Dict *fontDict) {
   return font;
 }
 
-GfxFont::GfxFont(char *tagA, Ref idA, GooString *nameA) {
+GfxFont::GfxFont(const char *tagA, Ref idA, GooString *nameA) {
   ok = gFalse;
   tag = new GooString(tagA);
   id = idA;
@@ -448,8 +448,8 @@ CharCodeToUnicode *GfxFont::readToUnicodeCMap(Dict *fontDict, int nBits,
 }
 
 void GfxFont::findExtFontFile() {
-  static char *type1Exts[] = { ".pfa", ".pfb", ".ps", "", NULL };
-  static char *ttExts[] = { ".ttf", ".ttc", NULL };
+  static const char *type1Exts[] = { ".pfa", ".pfb", ".ps", "", NULL };
+  static const char *ttExts[] = { ".ttf", ".ttc", NULL };
 
   if (name) {
     if (type == fontType1) {
@@ -518,13 +518,13 @@ char *GfxFont::readEmbFontFile(XRef *xref, int *len) {
 // Gfx8BitFont
 //------------------------------------------------------------------------
 
-Gfx8BitFont::Gfx8BitFont(XRef *xref, char *tagA, Ref idA, GooString *nameA,
+Gfx8BitFont::Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA,
 			 GfxFontType typeA, Dict *fontDict):
   GfxFont(tagA, idA, nameA)
 {
   GooString *name2;
   BuiltinFont *builtinFont;
-  char **baseEnc;
+  const char **baseEnc;
   GBool baseEncFromFontFile;
   char *buf;
   int len;
@@ -717,7 +717,7 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, char *tagA, Ref idA, GooString *nameA,
 	embFontName = new GooString(ffT1->getName());
       }
       if (!baseEnc) {
-	baseEnc = ffT1->getEncoding();
+	baseEnc = (const char **)ffT1->getEncoding();
 	baseEncFromFontFile = gTrue;
       }
     }
@@ -736,7 +736,7 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, char *tagA, Ref idA, GooString *nameA,
 	embFontName = new GooString(ffT1C->getName());
       }
       if (!baseEnc) {
-	baseEnc = ffT1C->getEncoding();
+	baseEnc = (const char **)ffT1C->getEncoding();
 	baseEncFromFontFile = gTrue;
       }
     }
@@ -759,7 +759,7 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, char *tagA, Ref idA, GooString *nameA,
 
   // copy the base encoding
   for (i = 0; i < 256; ++i) {
-    enc[i] = baseEnc[i];
+    enc[i] = (char *)baseEnc[i];
     if ((encFree[i] = baseEncFromFontFile) && enc[i]) {
       enc[i] = copyString(baseEnc[i]);
     }
@@ -773,7 +773,7 @@ Gfx8BitFont::Gfx8BitFont(XRef *xref, char *tagA, Ref idA, GooString *nameA,
       baseEncFromFontFile) {
     for (i = 0; i < 256; ++i) {
       if (!enc[i] && standardEncoding[i]) {
-	enc[i] = standardEncoding[i];
+	enc[i] = (char *)standardEncoding[i];
 	encFree[i] = gFalse;
       }
     }
@@ -1315,7 +1315,7 @@ static bool cmpWidthExcepV(const GfxFontCIDWidthExcepV &w1, const GfxFontCIDWidt
   return w1.first < w2.first;
 }
 
-GfxCIDFont::GfxCIDFont(XRef *xref, char *tagA, Ref idA, GooString *nameA,
+GfxCIDFont::GfxCIDFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA,
 		       Dict *fontDict):
   GfxFont(tagA, idA, nameA)
 {
@@ -1806,35 +1806,35 @@ Gushort *GfxCIDFont::getCodeToGIDMap(FoFiTrueType *ff, int *mapsizep) {
     0x2008,0x2009,0x200A,0x00A0,0x200B,0x2060,0x3000,0xFEFF,
     0
   };
-  static char *adobe_cns1_cmaps[] = {
+  static const char *adobe_cns1_cmaps[] = {
     "UniCNS-UTF32-V",
     "UniCNS-UCS2-V",
     "UniCNS-UTF32-H",
     "UniCNS-UCS2-H",
     0
   };
-  static char *adobe_gb1_cmaps[] = {
+  static const char *adobe_gb1_cmaps[] = {
     "UniGB-UTF32-V",
     "UniGB-UCS2-V",
     "UniGB-UTF32-H",
     "UniGB-UCS2-H",
     0
   };
-  static char *adobe_japan1_cmaps[] = {
+  static const char *adobe_japan1_cmaps[] = {
     "UniJIS-UTF32-V",
     "UniJIS-UCS2-V",
     "UniJIS-UTF32-H",
     "UniJIS-UCS2-H",
     0
   };
-  static char *adobe_japan2_cmaps[] = {
+  static const char *adobe_japan2_cmaps[] = {
     "UniHojo-UTF32-V",
     "UniHojo-UCS2-V",
     "UniHojo-UTF32-H",
     "UniHojo-UCS2-H",
     0
   };
-  static char *adobe_korea1_cmaps[] = {
+  static const char *adobe_korea1_cmaps[] = {
     "UniKS-UTF32-V",
     "UniKS-UCS2-V",
     "UniKS-UTF32-H",
@@ -1842,10 +1842,10 @@ Gushort *GfxCIDFont::getCodeToGIDMap(FoFiTrueType *ff, int *mapsizep) {
     0
   };
   static struct CMapListEntry {
-    char *collection;
-    char *scriptTag;
-    char *toUnicodeMap;
-    char **CMaps;
+    const char *collection;
+    const char *scriptTag;
+    const char *toUnicodeMap;
+    const char **CMaps;
   } CMapList[] = {
     {
       "Adobe-CNS1",
@@ -1887,7 +1887,7 @@ Gushort *GfxCIDFont::getCodeToGIDMap(FoFiTrueType *ff, int *mapsizep) {
   int i;
   unsigned long code;
   int wmode;
-  char **cmapName;
+  const char **cmapName;
   CMap *cMap;
   CMapListEntry *lp;
   int cmap;
diff --git a/poppler/GfxFont.h b/poppler/GfxFont.h
index fe4f7ea..b94e597 100644
--- a/poppler/GfxFont.h
+++ b/poppler/GfxFont.h
@@ -133,9 +133,9 @@ public:
 	W900 };
 
   // 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, GooString *nameA);
+  GfxFont(const char *tagA, Ref idA, GooString *nameA);
 
   GBool isOk() { return ok; }
 
@@ -268,7 +268,7 @@ protected:
 class Gfx8BitFont: public GfxFont {
 public:
 
-  Gfx8BitFont(XRef *xref, char *tagA, Ref idA, GooString *nameA,
+  Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA,
 	      GfxFontType typeA, Dict *fontDict);
 
   virtual int getNextChar(char *s, int len, CharCode *code,
@@ -327,7 +327,7 @@ private:
 class GfxCIDFont: public GfxFont {
 public:
 
-  GfxCIDFont(XRef *xref, char *tagA, Ref idA, GooString *nameA,
+  GfxCIDFont(XRef *xref, const char *tagA, Ref idA, GooString *nameA,
 	     Dict *fontDict);
 
   virtual GBool isCIDFont() { return gTrue; }
diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index bce57cc..6626d26 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -97,7 +97,7 @@ double Matrix::norm() const
 //------------------------------------------------------------------------
 
 struct GfxBlendModeInfo {
-  char *name;
+  const char *name;
   GfxBlendMode mode;
 };
 
@@ -128,7 +128,7 @@ static const GfxBlendModeInfo gfxBlendModeNames[] = {
 // 
 // NB: This must match the GfxColorSpaceMode enum defined in
 // GfxState.h
-static char *gfxColorSpaceModeNames[] = {
+static const char *gfxColorSpaceModeNames[] = {
   "DeviceGray",
   "CalGray",
   "DeviceRGB",
@@ -277,7 +277,7 @@ int GfxColorSpace::getNumColorSpaceModes() {
   return nGfxColorSpaceModes;
 }
 
-char *GfxColorSpace::getColorSpaceModeName(int idx) {
+const char *GfxColorSpace::getColorSpaceModeName(int idx) {
   return gfxColorSpaceModeNames[idx];
 }
 
diff --git a/poppler/GfxState.h b/poppler/GfxState.h
index c2bb1be..3d692a1 100644
--- a/poppler/GfxState.h
+++ b/poppler/GfxState.h
@@ -231,7 +231,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);
 
 #ifdef USE_CMS
   static int setupColorProfiles();
diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
index 2e11bb0..9bb3b64 100644
--- a/poppler/GlobalParams.cc
+++ b/poppler/GlobalParams.cc
@@ -851,7 +851,7 @@ void GlobalParams::addCMapDir(GooString *collection, GooString *dir) {
   list->append(dir->copy());
 }
 
-GBool GlobalParams::parseYesNo2(char *token, GBool *flag) {
+GBool GlobalParams::parseYesNo2(const char *token, GBool *flag) {
   if (!strcmp(token, "yes")) {
     *flag = gTrue;
   } else if (!strcmp(token, "no")) {
@@ -913,7 +913,7 @@ GlobalParams::~GlobalParams() {
 
 //------------------------------------------------------------------------
 
-void GlobalParams::setBaseDir(char *dir) {
+void GlobalParams::setBaseDir(const char *dir) {
   delete baseDir;
   baseDir = new GooString(dir);
 }
@@ -936,7 +936,7 @@ GooString *GlobalParams::getBaseDir() {
   return s;
 }
 
-Unicode GlobalParams::mapNameToUnicode(char *charName) {
+Unicode GlobalParams::mapNameToUnicode(const char *charName) {
   // no need to lock - nameToUnicode is constant
   return nameToUnicode->lookup(charName);
 }
@@ -1032,9 +1032,9 @@ static GBool findModifier(const char *name, const char *modifier, const char **s
   }
 }
 
-static char *getFontLang(GfxFont *font)
+static const char *getFontLang(GfxFont *font)
 {
-  char *lang;
+  const char *lang;
 
   // find the language we want the font to support
   if (font->isCIDFont())
@@ -1075,7 +1075,7 @@ static FcPattern *buildFcPattern(GfxFont *font)
       width = -1,
       spacing = -1;
   bool deleteFamily = false;
-  char *family, *name, *lang, *modifiers;
+  char *family, *name, *modifiers;
   const char *start;
   FcPattern *p;
 
@@ -1169,7 +1169,7 @@ static FcPattern *buildFcPattern(GfxFont *font)
     default: break; 
   }
   
-  lang = getFontLang(font);
+  const char *lang = getFontLang(font);
   
   p = FcPatternBuild(NULL,
                     FC_FAMILY, FcTypeString, family,
@@ -1207,7 +1207,6 @@ DisplayFontParam *GlobalParams::getDisplayFont(GfxFont *font) {
     FcFontSet *set;
     int i;
     FcLangSet *lb = NULL;
-    char *lang;
     p = buildFcPattern(font);
 
     if (!p)
@@ -1219,7 +1218,7 @@ DisplayFontParam *GlobalParams::getDisplayFont(GfxFont *font) {
       goto fin;
 
     // find the language we want the font to support
-    lang = getFontLang(font);
+    const char *lang = getFontLang(font);
     if (strcmp(lang,"xx") != 0) {
       lb = FcLangSetCreate();
       FcLangSetAdd(lb,(FcChar8 *)lang);
@@ -1478,9 +1477,9 @@ GBool GlobalParams::getTextKeepTinyChars() {
   return tiny;
 }
 
-GooString *GlobalParams::findFontFile(GooString *fontName, char **exts) {
+GooString *GlobalParams::findFontFile(GooString *fontName, const char **exts) {
   GooString *dir, *fileName;
-  char **ext;
+  const char **ext;
   FILE *f;
   int i;
 
diff --git a/poppler/GlobalParams.h b/poppler/GlobalParams.h
index 5fff49d..815269b 100644
--- a/poppler/GlobalParams.h
+++ b/poppler/GlobalParams.h
@@ -166,7 +166,7 @@ public:
 
   ~GlobalParams();
 
-  void setBaseDir(char *dir);
+  void setBaseDir(const char *dir);
 
 #if WITH_FONTCONFIGURATION_WIN32
   void setupBaseFonts(char *dir);
@@ -177,7 +177,7 @@ public:
   CharCode getMacRomanCharCode(char *charName);
 
   GooString *getBaseDir();
-  Unicode mapNameToUnicode(char *charName);
+  Unicode mapNameToUnicode(const char *charName);
   UnicodeMap *getResidentUnicodeMap(GooString *encodingName);
   FILE *getUnicodeMapFile(GooString *encodingName);
   FILE *findCMapFile(GooString *collection, GooString *cMapName);
@@ -202,7 +202,7 @@ public:
   EndOfLineKind getTextEOL();
   GBool getTextPageBreaks();
   GBool getTextKeepTinyChars();
-  GooString *findFontFile(GooString *fontName, char **exts);
+  GooString *findFontFile(GooString *fontName, const char **exts);
   GBool getEnableFreeType();
   GBool getAntialias();
   GBool getVectorAntialias();
@@ -274,7 +274,7 @@ public:
 private:
 
   void parseNameToUnicode(GooString *name);
-  GBool parseYesNo2(char *token, GBool *flag);
+  GBool parseYesNo2(const char *token, GBool *flag);
   UnicodeMap *getUnicodeMap2(GooString *encodingName);
 
   void scanEncodingDirs();
diff --git a/poppler/GlobalParamsWin.cc b/poppler/GlobalParamsWin.cc
index f989fb8..b316946 100644
--- a/poppler/GlobalParamsWin.cc
+++ b/poppler/GlobalParamsWin.cc
@@ -60,9 +60,9 @@ description for all fonts available in Windows. That's how MuPDF works.
 #define DEFAULT_SUBSTITUTE_FONT "Helvetica"
 
 static struct {
-    char *name;
-    char *t1FileName;
-    char *ttFileName;
+    const char *name;
+    const char *t1FileName;
+    const char *ttFileName;
 } displayFontTab[] = {
     {"Courier",               "n022003l.pfb", "cour.ttf"},
     {"Courier-Bold",          "n022004l.pfb", "courbd.ttf"},
diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc
index bfb1994..ba02b14 100644
--- a/poppler/JBIG2Stream.cc
+++ b/poppler/JBIG2Stream.cc
@@ -1266,7 +1266,7 @@ int JBIG2Stream::getPos() {
   return dataPtr - pageBitmap->getDataPtr();
 }
 
-GooString *JBIG2Stream::getPSFilter(int psLevel, char *indent) {
+GooString *JBIG2Stream::getPSFilter(int psLevel, const char *indent) {
   return NULL;
 }
 
diff --git a/poppler/JBIG2Stream.h b/poppler/JBIG2Stream.h
index 23d3d92..504ecea 100644
--- a/poppler/JBIG2Stream.h
+++ b/poppler/JBIG2Stream.h
@@ -53,7 +53,7 @@ public:
   virtual int getPos();
   virtual int getChar();
   virtual int lookChar();
-  virtual GooString *getPSFilter(int psLevel, char *indent);
+  virtual GooString *getPSFilter(int psLevel, const char *indent);
   virtual GBool isBinary(GBool last = gTrue);
 
 private:
diff --git a/poppler/JPEG2000Stream.cc b/poppler/JPEG2000Stream.cc
index b7a29bf..a96fc10 100644
--- a/poppler/JPEG2000Stream.cc
+++ b/poppler/JPEG2000Stream.cc
@@ -173,7 +173,7 @@ int JPXStream::lookChar() {
   return doLookChar();
 }
 
-GooString *JPXStream::getPSFilter(int psLevel, char *indent) {
+GooString *JPXStream::getPSFilter(int psLevel, const char *indent) {
   return NULL;
 }
 
diff --git a/poppler/JPEG2000Stream.h b/poppler/JPEG2000Stream.h
index bb4085a..5aed32d 100644
--- a/poppler/JPEG2000Stream.h
+++ b/poppler/JPEG2000Stream.h
@@ -32,7 +32,7 @@ public:
   virtual int getPos();
   virtual int getChar();
   virtual int lookChar();
-  virtual GooString *getPSFilter(int psLevel, char *indent);
+  virtual GooString *getPSFilter(int psLevel, const char *indent);
   virtual GBool isBinary(GBool last = gTrue);
   virtual void getImageParams(int *bitsPerComponent, StreamColorSpaceMode *csMode);
 
diff --git a/poppler/JPXStream.h b/poppler/JPXStream.h
index 2e0bda3..ffc3ab9 100644
--- a/poppler/JPXStream.h
+++ b/poppler/JPXStream.h
@@ -279,7 +279,7 @@ public:
   virtual void close();
   virtual int getChar();
   virtual int lookChar();
-  virtual GooString *getPSFilter(int psLevel, char *indent);
+  virtual GooString *getPSFilter(int psLevel, const char *indent);
   virtual GBool isBinary(GBool last = gTrue);
   virtual void getImageParams(int *bitsPerComponent,
 			      StreamColorSpaceMode *csMode);
diff --git a/poppler/NameToCharCode.cc b/poppler/NameToCharCode.cc
index efe1c4d..5448dc4 100644
--- a/poppler/NameToCharCode.cc
+++ b/poppler/NameToCharCode.cc
@@ -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;
diff --git a/poppler/NameToCharCode.h b/poppler/NameToCharCode.h
index bc57c37..5b1092b 100644
--- a/poppler/NameToCharCode.h
+++ b/poppler/NameToCharCode.h
@@ -25,12 +25,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;
diff --git a/poppler/NameToUnicodeTable.h b/poppler/NameToUnicodeTable.h
index 650f62e..c7fc878 100644
--- a/poppler/NameToUnicodeTable.h
+++ b/poppler/NameToUnicodeTable.h
@@ -26,7 +26,7 @@
 
 static struct {
   Unicode u;
-  char *name;
+  const char *name;
 } nameToUnicodeTab[] = {
   {0x0021, "!"},
   {0x0023, "#"},
diff --git a/poppler/Object.cc b/poppler/Object.cc
index 4f7da80..84b5583 100644
--- a/poppler/Object.cc
+++ b/poppler/Object.cc
@@ -38,7 +38,7 @@
 // Object
 //------------------------------------------------------------------------
 
-static char *objTypeNames[numObjTypes] = {
+static const char *objTypeNames[numObjTypes] = {
   "boolean",
   "integer",
   "real",
@@ -155,7 +155,7 @@ void Object::free() {
   type = objNone;
 }
 
-char *Object::getTypeName() {
+const char *Object::getTypeName() {
   return objTypeNames[type];
 }
 
diff --git a/poppler/Object.h b/poppler/Object.h
index 72ff667..95c7afd 100644
--- a/poppler/Object.h
+++ b/poppler/Object.h
@@ -126,7 +126,7 @@ public:
     { initObj(objReal); real = realA; return this; }
   Object *initString(GooString *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; }
@@ -179,11 +179,11 @@ public:
   GBool isUint() { return type == objUint; }
 
   // Special type checking.
-  GBool isName(char *nameA)
+  GBool isName(const char *nameA)
     { return type == objName && !strcmp(name, nameA); }
-  GBool isDict(char *dictType);
+  GBool isDict(const char *dictType);
   GBool isStream(char *dictType);
-  GBool isCmd(char *cmdA)
+  GBool isCmd(const char *cmdA)
     { return type == objCmd && !strcmp(cmd, cmdA); }
 
   // Accessors.
@@ -211,10 +211,10 @@ public:
   // Dict accessors.
   int dictGetLength();
   void dictAdd(char *key, Object *val);
-  void dictSet(char *key, Object *val);
-  GBool dictIs(char *dictType);
-  Object *dictLookup(char *key, Object *obj, std::set<int> *fetchOriginatorNums = NULL);
-  Object *dictLookupNF(char *key, Object *obj);
+  void dictSet(const char *key, Object *val);
+  GBool dictIs(const char *dictType);
+  Object *dictLookup(const char *key, Object *obj, std::set<int> *fetchOriginatorNums = NULL);
+  Object *dictLookupNF(const char *key, Object *obj);
   char *dictGetKey(int i);
   Object *dictGetVal(int i, Object *obj);
   Object *dictGetValNF(int i, Object *obj);
@@ -232,7 +232,7 @@ public:
   Dict *streamGetDict();
 
   // Output.
-  char *getTypeName();
+  const char *getTypeName();
   void print(FILE *f = stdout);
 
   // Memory testing.
@@ -291,19 +291,19 @@ inline int Object::dictGetLength()
 inline void Object::dictAdd(char *key, Object *val)
   { OBJECT_TYPE_CHECK(objDict); dict->add(key, val); }
 
-inline void Object::dictSet(char *key, Object *val)
+inline void Object::dictSet(const char *key, Object *val)
  	{ OBJECT_TYPE_CHECK(objDict); dict->set(key, val); }
 
-inline GBool Object::dictIs(char *dictType)
+inline GBool Object::dictIs(const char *dictType)
   { OBJECT_TYPE_CHECK(objDict); 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, std::set<int> *fetchOriginatorNums)
+inline Object *Object::dictLookup(const char *key, Object *obj, std::set<int> *fetchOriginatorNums)
   { OBJECT_TYPE_CHECK(objDict); return dict->lookup(key, obj, fetchOriginatorNums); }
 
-inline Object *Object::dictLookupNF(char *key, Object *obj)
+inline Object *Object::dictLookupNF(const char *key, Object *obj)
   { OBJECT_TYPE_CHECK(objDict); return dict->lookupNF(key, obj); }
 
 inline char *Object::dictGetKey(int i)
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index 01d2759..3092cea 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -1151,7 +1151,7 @@ void PDFDoc::writeTrailer(Guint uxrefOffset, int uxrefSize,
 
 void PDFDoc::writeTrailer(Guint uxrefOffset, int uxrefSize, OutStream* outStr, GBool incrUpdate)
 {
-  char *fileNameA;
+  const char *fileNameA;
   if (fileName)
     fileNameA = fileName->getCString();
   else
diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc
index 3e5cf08..9b0a634 100644
--- a/poppler/PSOutputDev.cc
+++ b/poppler/PSOutputDev.cc
@@ -98,7 +98,7 @@
 //      ^   ^----- s=psLevel*Sep, n=psLevel*
 //      +----- 1=psLevel1*, 2=psLevel2*, 3=psLevel3*
 
-static char *prolog[] = {
+static const char *prolog[] = {
   "/xpdf 75 dict def xpdf begin",
   "% PDF special state",
   "/pdfDictSize 15 def",
@@ -751,7 +751,7 @@ static char *prolog[] = {
   NULL
 };
 
-static char *cmapProlog[] = {
+static const char *cmapProlog[] = {
   "/CIDInit /ProcSet findresource begin",
   "10 dict begin",
   "  begincmap",
@@ -801,7 +801,7 @@ static char *cmapProlog[] = {
 //------------------------------------------------------------------------
 
 struct PSSubstFont {
-  char *psName;			// PostScript name
+  const char *psName;			// PostScript name
   double mWidth;		// width of 'm' character
 };
 
@@ -912,7 +912,7 @@ public:
     { return (bufIdx >= bufSize && !fillBuf()) ? EOF : buf[bufIdx++]; }
   virtual int lookChar()
     { return (bufIdx >= bufSize && !fillBuf()) ? EOF : buf[bufIdx]; }
-  virtual GooString *getPSFilter(int psLevel, char *indent) { return NULL; }
+  virtual GooString *getPSFilter(int psLevel, const char *indent) { return NULL; }
   virtual GBool isBinary(GBool last = gTrue) { return gTrue; }
   virtual GBool isEncoder() { return gTrue; }
 
@@ -990,7 +990,7 @@ 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);
 }
 
@@ -1392,8 +1392,8 @@ void PSOutputDev::writeHeader(int firstPage, int lastPage,
 
 void PSOutputDev::writeXpdfProcset() {
   GBool lev1, lev2, lev3, sep, nonSep;
-  char **p;
-  char *q;
+  const char **p;
+  const char *q;
 
   writePSFmt("%%BeginResource: procset xpdf {0:s} 0\n", "3.00");
   writePSFmt("%%Copyright: {0:s}\n", xpdfCopyright);
@@ -1661,7 +1661,7 @@ void PSOutputDev::setupFont(GfxFont *font, Dict *parentResDict) {
   char buf[16];
   GBool subst;
   UnicodeMap *uMap;
-  char *charName;
+  const char *charName;
   double xs, ys;
   int code;
   double w1, w2;
@@ -6823,7 +6823,7 @@ void PSOutputDev::writePSChar(char c) {
   }
 }
 
-void PSOutputDev::writePS(char *s) {
+void PSOutputDev::writePS(const char *s) {
   if (t3String) {
     t3String->append(s);
   } else {
@@ -6831,7 +6831,7 @@ void PSOutputDev::writePS(char *s) {
   }
 }
 
-void PSOutputDev::writePSBuf(char *s, int len) {
+void PSOutputDev::writePSBuf(const char *s, int len) {
   if (t3String) {
     for (int i = 0; i < len; i++) {
       t3String->append(s[i]);
@@ -6885,8 +6885,8 @@ void PSOutputDev::writePSString(GooString *s) {
   writePSChar(')');
 }
 
-void PSOutputDev::writePSName(char *s) {
-  char *p;
+void PSOutputDev::writePSName(const char *s) {
+  const char *p;
   char c;
 
   p = s;
diff --git a/poppler/PSOutputDev.h b/poppler/PSOutputDev.h
index a1e0a29..3de590d 100644
--- a/poppler/PSOutputDev.h
+++ b/poppler/PSOutputDev.h
@@ -72,7 +72,7 @@ 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:
@@ -362,11 +362,11 @@ private:
   void writeDocSetup(PDFDoc *doc, Catalog *catalog, int firstPage, int lastPage, GBool duplexA);
 
   void writePSChar(char c);
-  void writePS(char *s);
-  void writePSBuf(char *s, int len);
+  void writePS(const char *s);
+  void writePSBuf(const char *s, int len);
   void writePSFmt(const char *fmt, ...);
   void writePSString(GooString *s);
-  void writePSName(char *s);
+  void writePSName(const char *s);
   GooString *filterPSLabel(GooString *label, GBool *needParens=0);
   void writePSTextLine(GooString *s);
 
diff --git a/poppler/Page.cc b/poppler/Page.cc
index 6c0d8c2..96f4b51 100644
--- a/poppler/Page.cc
+++ b/poppler/Page.cc
@@ -196,7 +196,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;
   double t;
   Object obj1, obj2;
diff --git a/poppler/Page.h b/poppler/Page.h
index 1ab69f3..ced11c0 100644
--- a/poppler/Page.h
+++ b/poppler/Page.h
@@ -101,7 +101,7 @@ public:
 
 private:
 
-  GBool readBox(Dict *dict, char *key, PDFRectangle *box);
+  GBool readBox(Dict *dict, const char *key, PDFRectangle *box);
 
   PDFRectangle mediaBox;
   PDFRectangle cropBox;
diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc
index 96cb3c4..5bc7777 100644
--- a/poppler/SplashOutputDev.cc
+++ b/poppler/SplashOutputDev.cc
@@ -1815,7 +1815,7 @@ void SplashOutputDev::doUpdateFont(GfxState *state) {
       if (!(fontFile = fontEngine->loadType1Font(
 			   id,
 			   fontsrc,
-			   ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
+			   (const char **)((Gfx8BitFont *)gfxFont)->getEncoding()))) {
 	error(-1, "Couldn't create a font for '%s'",
 	      gfxFont->getName() ? gfxFont->getName()->getCString()
 	                         : "(unnamed)");
@@ -1826,7 +1826,7 @@ void SplashOutputDev::doUpdateFont(GfxState *state) {
       if (!(fontFile = fontEngine->loadType1CFont(
 			   id,
 			   fontsrc,
-			   ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
+			   (const char **)((Gfx8BitFont *)gfxFont)->getEncoding()))) {
 	error(-1, "Couldn't create a font for '%s'",
 	      gfxFont->getName() ? gfxFont->getName()->getCString()
 	                         : "(unnamed)");
@@ -1837,7 +1837,7 @@ void SplashOutputDev::doUpdateFont(GfxState *state) {
       if (!(fontFile = fontEngine->loadOpenTypeT1CFont(
 			   id,
 			   fontsrc,
-			   ((Gfx8BitFont *)gfxFont)->getEncoding()))) {
+			   (const char **)((Gfx8BitFont *)gfxFont)->getEncoding()))) {
 	error(-1, "Couldn't create a font for '%s'",
 	      gfxFont->getName() ? gfxFont->getName()->getCString()
 	                         : "(unnamed)");
diff --git a/poppler/Stream.cc b/poppler/Stream.cc
index ee53502..f6f41fc 100644
--- a/poppler/Stream.cc
+++ b/poppler/Stream.cc
@@ -131,7 +131,7 @@ char *Stream::getLine(char *buf, int size) {
   return buf;
 }
 
-GooString *Stream::getPSFilter(int psLevel, char *indent) {
+GooString *Stream::getPSFilter(int psLevel, const char *indent) {
   return new GooString();
 }
 
@@ -1100,7 +1100,7 @@ int ASCIIHexStream::lookChar() {
   return buf;
 }
 
-GooString *ASCIIHexStream::getPSFilter(int psLevel, char *indent) {
+GooString *ASCIIHexStream::getPSFilter(int psLevel, const char *indent) {
   GooString *s;
 
   if (psLevel < 2) {
@@ -1181,7 +1181,7 @@ int ASCII85Stream::lookChar() {
   return b[index];
 }
 
-GooString *ASCII85Stream::getPSFilter(int psLevel, char *indent) {
+GooString *ASCII85Stream::getPSFilter(int psLevel, const char *indent) {
   GooString *s;
 
   if (psLevel < 2) {
@@ -1364,7 +1364,7 @@ int LZWStream::getCode() {
   return code;
 }
 
-GooString *LZWStream::getPSFilter(int psLevel, char *indent) {
+GooString *LZWStream::getPSFilter(int psLevel, const char *indent) {
   GooString *s;
 
   if (psLevel < 2 || pred) {
@@ -1405,7 +1405,7 @@ void RunLengthStream::reset() {
   eof = gFalse;
 }
 
-GooString *RunLengthStream::getPSFilter(int psLevel, char *indent) {
+GooString *RunLengthStream::getPSFilter(int psLevel, const char *indent) {
   GooString *s;
 
   if (psLevel < 2) {
@@ -2067,7 +2067,7 @@ short CCITTFaxStream::lookBits(int n) {
   return (inputBuf >> (inputBits - n)) & (0xffff >> (16 - n));
 }
 
-GooString *CCITTFaxStream::getPSFilter(int psLevel, char *indent) {
+GooString *CCITTFaxStream::getPSFilter(int psLevel, const char *indent) {
   GooString *s;
   char s1[50];
 
@@ -3526,7 +3526,7 @@ int DCTStream::read16() {
   return (c1 << 8) + c2;
 }
 
-GooString *DCTStream::getPSFilter(int psLevel, char *indent) {
+GooString *DCTStream::getPSFilter(int psLevel, const char *indent) {
   GooString *s;
 
   if (psLevel < 2) {
@@ -4290,7 +4290,7 @@ int FlateStream::getRawChar() {
   return doGetRawChar();
 }
 
-GooString *FlateStream::getPSFilter(int psLevel, char *indent) {
+GooString *FlateStream::getPSFilter(int psLevel, const char *indent) {
   GooString *s;
 
   if (psLevel < 3 || pred) {
diff --git a/poppler/Stream.h b/poppler/Stream.h
index 4f2a08b..6ede153 100644
--- a/poppler/Stream.h
+++ b/poppler/Stream.h
@@ -188,7 +188,7 @@ public:
   virtual void setPos(Guint pos, int dir = 0) = 0;
 
   // Get PostScript command for the filter(s).
-  virtual GooString *getPSFilter(int psLevel, char *indent);
+  virtual GooString *getPSFilter(int psLevel, const char *indent);
 
   // Does this stream type potentially contain non-printable chars?
   virtual GBool isBinary(GBool last = gTrue) = 0;
@@ -626,7 +626,7 @@ public:
   virtual int getChar()
     { int c = lookChar(); buf = EOF; return c; }
   virtual int lookChar();
-  virtual GooString *getPSFilter(int psLevel, char *indent);
+  virtual GooString *getPSFilter(int psLevel, const char *indent);
   virtual GBool isBinary(GBool last = gTrue);
 
 private:
@@ -649,7 +649,7 @@ public:
   virtual int getChar()
     { int ch = lookChar(); ++index; return ch; }
   virtual int lookChar();
-  virtual GooString *getPSFilter(int psLevel, char *indent);
+  virtual GooString *getPSFilter(int psLevel, const char *indent);
   virtual GBool isBinary(GBool last = gTrue);
 
 private:
@@ -676,7 +676,7 @@ public:
   virtual int lookChar();
   virtual int getRawChar();
   virtual void getRawChars(int nChars, int *buffer);
-  virtual GooString *getPSFilter(int psLevel, char *indent);
+  virtual GooString *getPSFilter(int psLevel, const char *indent);
   virtual GBool isBinary(GBool last = gTrue);
 
 private:
@@ -732,7 +732,7 @@ public:
     { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
   virtual int lookChar()
     { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
-  virtual GooString *getPSFilter(int psLevel, char *indent);
+  virtual GooString *getPSFilter(int psLevel, const char *indent);
   virtual GBool isBinary(GBool last = gTrue);
 
 private:
@@ -763,7 +763,7 @@ public:
   virtual int getChar()
     { int c = lookChar(); buf = EOF; return c; }
   virtual int lookChar();
-  virtual GooString *getPSFilter(int psLevel, char *indent);
+  virtual GooString *getPSFilter(int psLevel, const char *indent);
   virtual GBool isBinary(GBool last = gTrue);
 
   virtual void unfilteredReset ();
@@ -839,7 +839,7 @@ public:
   virtual void close();
   virtual int getChar();
   virtual int lookChar();
-  virtual GooString *getPSFilter(int psLevel, char *indent);
+  virtual GooString *getPSFilter(int psLevel, const char *indent);
   virtual GBool isBinary(GBool last = gTrue);
   Stream *getRawStream() { return str; }
 
@@ -948,7 +948,7 @@ public:
   virtual int lookChar();
   virtual int getRawChar();
   virtual void getRawChars(int nChars, int *buffer);
-  virtual GooString *getPSFilter(int psLevel, char *indent);
+  virtual GooString *getPSFilter(int psLevel, const char *indent);
   virtual GBool isBinary(GBool last = gTrue);
   virtual void unfilteredReset ();
 
@@ -1026,7 +1026,7 @@ public:
   virtual void reset() {}
   virtual int getChar() { return EOF; }
   virtual int lookChar() { return EOF; }
-  virtual GooString *getPSFilter(int /*psLevel*/, char * /*indent*/)  { return NULL; }
+  virtual GooString *getPSFilter(int /*psLevel*/, const char * /*indent*/)  { return NULL; }
   virtual GBool isBinary(GBool /*last = gTrue*/) { return gFalse; }
 };
 
@@ -1043,7 +1043,7 @@ public:
   virtual void reset();
   virtual int getChar();
   virtual int lookChar();
-  virtual GooString *getPSFilter(int /*psLevel*/, char * /*indent*/) { return NULL; }
+  virtual GooString *getPSFilter(int /*psLevel*/, const char * /*indent*/) { return NULL; }
   virtual GBool isBinary(GBool /*last = gTrue*/);
   virtual GBool isEncoder() { return gTrue; }
 
@@ -1068,7 +1068,7 @@ public:
     { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
   virtual int lookChar()
     { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
-  virtual GooString *getPSFilter(int /*psLevel*/, char * /*indent*/) { return NULL; }
+  virtual GooString *getPSFilter(int /*psLevel*/, const char * /*indent*/) { return NULL; }
   virtual GBool isBinary(GBool /*last = gTrue*/) { return gFalse; }
   virtual GBool isEncoder() { return gTrue; }
 
@@ -1098,7 +1098,7 @@ public:
     { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
   virtual int lookChar()
     { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
-  virtual GooString *getPSFilter(int /*psLevel*/, char * /*indent*/) { return NULL; }
+  virtual GooString *getPSFilter(int /*psLevel*/, const char * /*indent*/) { return NULL; }
   virtual GBool isBinary(GBool /*last = gTrue*/) { return gFalse; }
   virtual GBool isEncoder() { return gTrue; }
 
@@ -1128,7 +1128,7 @@ public:
     { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
   virtual int lookChar()
     { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
-  virtual GooString *getPSFilter(int /*psLevel*/, char * /*indent*/) { return NULL; }
+  virtual GooString *getPSFilter(int /*psLevel*/, const char * /*indent*/) { return NULL; }
   virtual GBool isBinary(GBool /*last = gTrue*/) { return gTrue; }
   virtual GBool isEncoder() { return gTrue; }
 
@@ -1158,7 +1158,7 @@ public:
     { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
   virtual int lookChar()
     { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
-  virtual GooString *getPSFilter(int /*psLevel*/, char * /*indent*/) { return NULL; }
+  virtual GooString *getPSFilter(int /*psLevel*/, const char * /*indent*/) { return NULL; }
   virtual GBool isBinary(GBool /*last = gTrue*/) { return gFalse; }
   virtual GBool isEncoder() { return gTrue; }
 
diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc
index 3d7ba6d..213d97e 100644
--- a/poppler/TextOutputDev.cc
+++ b/poppler/TextOutputDev.cc
@@ -5147,7 +5147,7 @@ void ActualText::endMC(GfxState *state) {
 // TextOutputDev
 //------------------------------------------------------------------------
 
-static void TextOutputDev_outputToFile(void *stream, char *text, int len) {
+static void TextOutputDev_outputToFile(void *stream, const char *text, int len) {
   fwrite(text, 1, len, (FILE *)stream);
 }
 
diff --git a/poppler/TextOutputDev.h b/poppler/TextOutputDev.h
index 63f3670..6c0fa4f 100644
--- a/poppler/TextOutputDev.h
+++ b/poppler/TextOutputDev.h
@@ -59,7 +59,7 @@ class TextSelectionVisitor;
 
 //------------------------------------------------------------------------
 
-typedef void (*TextOutputFunc)(void *stream, char *text, int len);
+typedef void (*TextOutputFunc)(void *stream, const char *text, int len);
 
 enum SelectionStyle {
   selectionStyleGlyph,
diff --git a/poppler/UnicodeMap.cc b/poppler/UnicodeMap.cc
index fda0758..fc86cea 100644
--- a/poppler/UnicodeMap.cc
+++ b/poppler/UnicodeMap.cc
@@ -136,7 +136,7 @@ UnicodeMap::UnicodeMap(GooString *encodingNameA) {
 #endif
 }
 
-UnicodeMap::UnicodeMap(char *encodingNameA, GBool unicodeOutA,
+UnicodeMap::UnicodeMap(const char *encodingNameA, GBool unicodeOutA,
 		       UnicodeMapRange *rangesA, int lenA) {
   encodingName = new GooString(encodingNameA);
   unicodeOut = unicodeOutA;
@@ -151,7 +151,7 @@ UnicodeMap::UnicodeMap(char *encodingNameA, GBool unicodeOutA,
 #endif
 }
 
-UnicodeMap::UnicodeMap(char *encodingNameA, GBool unicodeOutA,
+UnicodeMap::UnicodeMap(const char *encodingNameA, GBool unicodeOutA,
 		       UnicodeMapFunc funcA) {
   encodingName = new GooString(encodingNameA);
   unicodeOut = unicodeOutA;
diff --git a/poppler/UnicodeMap.h b/poppler/UnicodeMap.h
index 6f03163..ba7df2c 100644
--- a/poppler/UnicodeMap.h
+++ b/poppler/UnicodeMap.h
@@ -52,12 +52,12 @@ public:
   static UnicodeMap *parse(GooString *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();
diff --git a/poppler/UnicodeTypeTable.cc b/poppler/UnicodeTypeTable.cc
index f18930f..6146eb7 100644
--- a/poppler/UnicodeTypeTable.cc
+++ b/poppler/UnicodeTypeTable.cc
@@ -28,8 +28,8 @@
 #include "goo/gmem.h"
 
 struct UnicodeMapTableEntry {
-  char *vector;
-  char type;
+  const char *vector;
+  const char type;
 };
 
 struct UnicodeCaseTableVector {
diff --git a/qt4/src/poppler-private.cc b/qt4/src/poppler-private.cc
index c47fbe8..af1f4e4 100644
--- a/qt4/src/poppler-private.cc
+++ b/qt4/src/poppler-private.cc
@@ -53,7 +53,7 @@ namespace Debug {
         Debug::debugClosure = closure;
     }
 
-    void qt4ErrorFunction(int pos, char *msg, va_list args)
+    void qt4ErrorFunction(int pos, const char *msg, va_list args)
     {
         QString emsg;
         char buffer[1024]; // should be big enough
diff --git a/qt4/src/poppler-ps-converter.cc b/qt4/src/poppler-ps-converter.cc
index 4472b0f..a1b26d2 100644
--- a/qt4/src/poppler-ps-converter.cc
+++ b/qt4/src/poppler-ps-converter.cc
@@ -25,7 +25,7 @@
 
 #include "PSOutputDev.h"
 
-static void outputToQIODevice(void *stream, char *data, int len)
+static void outputToQIODevice(void *stream, const char *data, int len)
 {
 	static_cast<QIODevice*>(stream)->write(data, len);
 }
diff --git a/splash/SplashFTFontEngine.cc b/splash/SplashFTFontEngine.cc
index 144f8f4..ffed747 100644
--- a/splash/SplashFTFontEngine.cc
+++ b/splash/SplashFTFontEngine.cc
@@ -50,7 +50,7 @@ extern "C" int unlink(char *filename);
 //------------------------------------------------------------------------
 
 #if 0
-static void fileWrite(void *stream, char *data, int len) {
+static void fileWrite(void *stream, const char *data, int len) {
   fwrite(data, 1, len, (FILE *)stream);
 }
 #endif
@@ -90,19 +90,19 @@ SplashFTFontEngine::~SplashFTFontEngine() {
 
 SplashFontFile *SplashFTFontEngine::loadType1Font(SplashFontFileID *idA,
 						  SplashFontSrc *src,
-						  char **enc) {
+						  const char **enc) {
   return SplashFTFontFile::loadType1Font(this, idA, src, enc);
 }
 
 SplashFontFile *SplashFTFontEngine::loadType1CFont(SplashFontFileID *idA,
 						   SplashFontSrc *src,
-						   char **enc) {
+						   const char **enc) {
   return SplashFTFontFile::loadType1Font(this, idA, src, enc);
 }
 
 SplashFontFile *SplashFTFontEngine::loadOpenTypeT1CFont(SplashFontFileID *idA,
 							SplashFontSrc *src,
-							char **enc) {
+							const char **enc) {
   return SplashFTFontFile::loadType1Font(this, idA, src, enc);
 }
 
diff --git a/splash/SplashFTFontEngine.h b/splash/SplashFTFontEngine.h
index 42207fb..da85409 100644
--- a/splash/SplashFTFontEngine.h
+++ b/splash/SplashFTFontEngine.h
@@ -50,9 +50,9 @@ public:
   ~SplashFTFontEngine();
 
   // Load fonts.
-  SplashFontFile *loadType1Font(SplashFontFileID *idA, SplashFontSrc *src,  char **enc);
-  SplashFontFile *loadType1CFont(SplashFontFileID *idA, SplashFontSrc *src,  char **enc);
-  SplashFontFile *loadOpenTypeT1CFont(SplashFontFileID *idA, SplashFontSrc *src,  char **enc);
+  SplashFontFile *loadType1Font(SplashFontFileID *idA, SplashFontSrc *src,  const char **enc);
+  SplashFontFile *loadType1CFont(SplashFontFileID *idA, SplashFontSrc *src,  const char **enc);
+  SplashFontFile *loadOpenTypeT1CFont(SplashFontFileID *idA, SplashFontSrc *src,  const char **enc);
   SplashFontFile *loadCIDFont(SplashFontFileID *idA, SplashFontSrc *src);
   SplashFontFile *loadOpenTypeCFFFont(SplashFontFileID *idA, SplashFontSrc *src);
   SplashFontFile *loadTrueTypeFont(SplashFontFileID *idA, SplashFontSrc *src,
diff --git a/splash/SplashFTFontFile.cc b/splash/SplashFTFontFile.cc
index 160481e..8575560 100644
--- a/splash/SplashFTFontFile.cc
+++ b/splash/SplashFTFontFile.cc
@@ -39,10 +39,10 @@
 SplashFontFile *SplashFTFontFile::loadType1Font(SplashFTFontEngine *engineA,
 						SplashFontFileID *idA,
 						SplashFontSrc *src,
-						char **encA) {
+						const char **encA) {
   FT_Face faceA;
   Gushort *codeToGIDA;
-  char *name;
+  const char *name;
   int i;
 
   if (src->isFile) {
@@ -56,7 +56,7 @@ SplashFontFile *SplashFTFontFile::loadType1Font(SplashFTFontEngine *engineA,
   for (i = 0; i < 256; ++i) {
     codeToGIDA[i] = 0;
     if ((name = encA[i])) {
-      codeToGIDA[i] = (Gushort)FT_Get_Name_Index(faceA, name);
+      codeToGIDA[i] = (Gushort)FT_Get_Name_Index(faceA, (char *)name);
     }
   }
 
diff --git a/splash/SplashFTFontFile.h b/splash/SplashFTFontFile.h
index 079fb1c..28ee0e5 100644
--- a/splash/SplashFTFontFile.h
+++ b/splash/SplashFTFontFile.h
@@ -43,7 +43,7 @@ public:
 
   static SplashFontFile *loadType1Font(SplashFTFontEngine *engineA,
 				       SplashFontFileID *idA,
-				       SplashFontSrc *src, char **encA);
+				       SplashFontSrc *src, const char **encA);
   static SplashFontFile *loadCIDFont(SplashFTFontEngine *engineA,
 					 SplashFontFileID *idA,
 					 SplashFontSrc *src,
diff --git a/splash/SplashFontEngine.cc b/splash/SplashFontEngine.cc
index 5fe8aeb..3ce0d30 100644
--- a/splash/SplashFontEngine.cc
+++ b/splash/SplashFontEngine.cc
@@ -133,7 +133,7 @@ SplashFontFile *SplashFontEngine::getFontFile(SplashFontFileID *id) {
 
 SplashFontFile *SplashFontEngine::loadType1Font(SplashFontFileID *idA,
 						SplashFontSrc *src,
-						char **enc) {
+						const char **enc) {
   SplashFontFile *fontFile;
 
   fontFile = NULL;
@@ -162,7 +162,7 @@ SplashFontFile *SplashFontEngine::loadType1Font(SplashFontFileID *idA,
 
 SplashFontFile *SplashFontEngine::loadType1CFont(SplashFontFileID *idA,
 						 SplashFontSrc *src,
-						 char **enc) {
+						 const char **enc) {
   SplashFontFile *fontFile;
 
   fontFile = NULL;
@@ -191,7 +191,7 @@ SplashFontFile *SplashFontEngine::loadType1CFont(SplashFontFileID *idA,
 
 SplashFontFile *SplashFontEngine::loadOpenTypeT1CFont(SplashFontFileID *idA,
 						      SplashFontSrc *src,
-						      char **enc) {
+						      const char **enc) {
   SplashFontFile *fontFile;
 
   fontFile = NULL;
diff --git a/splash/SplashFontEngine.h b/splash/SplashFontEngine.h
index 38efa48..7f84bd0 100644
--- a/splash/SplashFontEngine.h
+++ b/splash/SplashFontEngine.h
@@ -70,9 +70,9 @@ public:
   SplashFontFile *getFontFile(SplashFontFileID *id);
 
   // Load fonts - these create new SplashFontFile objects.
-  SplashFontFile *loadType1Font(SplashFontFileID *idA, SplashFontSrc *src, char **enc);
-  SplashFontFile *loadType1CFont(SplashFontFileID *idA, SplashFontSrc *src, char **enc);
-  SplashFontFile *loadOpenTypeT1CFont(SplashFontFileID *idA, SplashFontSrc *src, char **enc);
+  SplashFontFile *loadType1Font(SplashFontFileID *idA, SplashFontSrc *src, const char **enc);
+  SplashFontFile *loadType1CFont(SplashFontFileID *idA, SplashFontSrc *src, const char **enc);
+  SplashFontFile *loadOpenTypeT1CFont(SplashFontFileID *idA, SplashFontSrc *src, const char **enc);
   SplashFontFile *loadCIDFont(SplashFontFileID *idA, SplashFontSrc *src);
   SplashFontFile *loadOpenTypeCFFFont(SplashFontFileID *idA, SplashFontSrc *src);
   SplashFontFile *loadTrueTypeFont(SplashFontFileID *idA, SplashFontSrc *src,
diff --git a/splash/SplashT1FontEngine.cc b/splash/SplashT1FontEngine.cc
index a09a883..fb4b38d 100644
--- a/splash/SplashT1FontEngine.cc
+++ b/splash/SplashT1FontEngine.cc
@@ -51,7 +51,7 @@ int SplashT1FontEngine::t1libInitCount = 0;
 
 //------------------------------------------------------------------------
 
-static void fileWrite(void *stream, char *data, int len) {
+static void fileWrite(void *stream, const char *data, int len) {
   fwrite(data, 1, len, (FILE *)stream);
 }
 
@@ -98,13 +98,13 @@ SplashT1FontEngine::~SplashT1FontEngine() {
 
 SplashFontFile *SplashT1FontEngine::loadType1Font(SplashFontFileID *idA,
 						  SplashFontSrc *src,
-						  char **enc) {
+						  const char **enc) {
   return SplashT1FontFile::loadType1Font(this, idA, src, enc);
 }
 
 SplashFontFile *SplashT1FontEngine::loadType1CFont(SplashFontFileID *idA,
 						   SplashFontSrc *src,
-						   char **enc) {
+						   const char **enc) {
   FoFiType1C *ff;
   GooString *tmpFileName;
   FILE *tmpFile;
diff --git a/splash/SplashT1FontEngine.h b/splash/SplashT1FontEngine.h
index ffc285b..268a014 100644
--- a/splash/SplashT1FontEngine.h
+++ b/splash/SplashT1FontEngine.h
@@ -31,8 +31,8 @@ public:
   ~SplashT1FontEngine();
 
   // Load fonts.
-  SplashFontFile *loadType1Font(SplashFontFileID *idA, SplashFontSrc *src, char **enc);
-  SplashFontFile *loadType1CFont(SplashFontFileID *idA, SplashFontSrc *src, char **enc);
+  SplashFontFile *loadType1Font(SplashFontFileID *idA, SplashFontSrc *src, const char **enc);
+  SplashFontFile *loadType1CFont(SplashFontFileID *idA, SplashFontSrc *src, const char **enc);
 
 private:
 
diff --git a/splash/SplashT1FontFile.cc b/splash/SplashT1FontFile.cc
index 3f46ba6..1832a91 100644
--- a/splash/SplashT1FontFile.cc
+++ b/splash/SplashT1FontFile.cc
@@ -43,9 +43,9 @@
 SplashFontFile *SplashT1FontFile::loadType1Font(SplashT1FontEngine *engineA,
 						SplashFontFileID *idA,
 						SplashFontSrc *src,
-						char **encA) {
+						const char **encA) {
   int t1libIDA;
-  char **encTmp;
+  const char **encTmp;
   char *encStrTmp;
   int encStrSize;
   char *encPtr;
@@ -82,7 +82,7 @@ SplashFontFile *SplashT1FontFile::loadType1Font(SplashT1FontEngine *engineA,
       encStrSize += strlen(encA[i]) + 1;
     }
   }
-  encTmp = (char **)gmallocn(257, sizeof(char *));
+  encTmp = (const char **)gmallocn(257, sizeof(char *));
   encStrTmp = (char *)gmallocn(encStrSize, sizeof(char));
   encPtr = encStrTmp;
   for (i = 0; i < 256; ++i) {
@@ -95,7 +95,7 @@ SplashFontFile *SplashT1FontFile::loadType1Font(SplashT1FontEngine *engineA,
     }
   }
   encTmp[256] = "custom";
-  T1_ReencodeFont(t1libIDA, encTmp);
+  T1_ReencodeFont(t1libIDA, (char **)encTmp);
 
   ff = new SplashT1FontFile(engineA, idA, src,
 			      t1libIDA, encTmp, encStrTmp);
@@ -107,7 +107,7 @@ SplashFontFile *SplashT1FontFile::loadType1Font(SplashT1FontEngine *engineA,
 SplashT1FontFile::SplashT1FontFile(SplashT1FontEngine *engineA,
 				   SplashFontFileID *idA,
 				   SplashFontSrc *srcA,
-				   int t1libIDA, char **encA, char *encStrA):
+				   int t1libIDA, const char **encA, char *encStrA):
   SplashFontFile(idA, srcA)
 {
   engine = engineA;
diff --git a/splash/SplashT1FontFile.h b/splash/SplashT1FontFile.h
index 24c958b..c094b6d 100644
--- a/splash/SplashT1FontFile.h
+++ b/splash/SplashT1FontFile.h
@@ -41,7 +41,7 @@ public:
   static SplashFontFile *loadType1Font(SplashT1FontEngine *engineA,
 				       SplashFontFileID *idA,
 				       SplashFontSrc *src,
-				       char **encA);
+				       const char **encA);
 
   virtual ~SplashT1FontFile();
 
@@ -55,11 +55,11 @@ private:
   SplashT1FontFile(SplashT1FontEngine *engineA,
 		   SplashFontFileID *idA,
 		   SplashFontSrc *src,
-		   int t1libIDA, char **encA, char *encStrA);
+		   int t1libIDA, const char **encA, char *encStrA);
 
   SplashT1FontEngine *engine;
   int t1libID;			// t1lib font ID
-  char **enc;
+  const char **enc;
   char *encStr;
 
   friend class SplashT1Font;
diff --git a/test/pdf-operators.c b/test/pdf-operators.c
index 3e838a2..a174df1 100644
--- a/test/pdf-operators.c
+++ b/test/pdf-operators.c
@@ -1,7 +1,7 @@
 typedef struct
 {
-  char *op;
-  char *description;
+  const char *op;
+  const char *description;
 } OperatorMapping;
 
 OperatorMapping op_mapping[] = {
diff --git a/test/perf-test.cc b/test/perf-test.cc
index 6d6961e..94bddcd 100644
--- a/test/perf-test.cc
+++ b/test/perf-test.cc
@@ -742,7 +742,7 @@ void OutputDebugString(const char *txt)
 #define _vsnprintf vsnprintf
 #endif
 
-void my_error(int pos, char *msg, va_list args) {
+void my_error(int pos, const char *msg, va_list args) {
 #if 0
     char        buf[4096], *p = buf;
 
@@ -796,7 +796,7 @@ void my_error(int pos, char *msg, va_list args) {
 #endif
 }
 
-void LogInfo(char *fmt, ...)
+void LogInfo(const char *fmt, ...)
 {
     va_list args;
     char        buf[4096], *p = buf;
diff --git a/utils/HtmlFonts.cc b/utils/HtmlFonts.cc
index c9b558e..7205a1d 100644
--- a/utils/HtmlFonts.cc
+++ b/utils/HtmlFonts.cc
@@ -36,8 +36,8 @@
 #include <stdio.h>
 
  struct Fonts{
-    char *Fontname;
-    char *name;
+    const char *Fontname;
+    const char *name;
   };
 
 const int font_num=13;
diff --git a/utils/HtmlOutputDev.cc b/utils/HtmlOutputDev.cc
index 615cf5f..a3a99f5 100644
--- a/utils/HtmlOutputDev.cc
+++ b/utils/HtmlOutputDev.cc
@@ -742,7 +742,7 @@ void HtmlPage::dumpAsXML(FILE* f,int page){
 
 int HtmlPage::dumpComplexHeaders(FILE * const file, FILE *& pageFile, int page) {
   GooString* tmp;
-  char* htmlEncoding;
+  const char* htmlEncoding;
 
   if( !noframes )
   {
@@ -928,7 +928,7 @@ void HtmlPage::setDocName(char *fname){
 // HtmlMetaVar
 //------------------------------------------------------------------------
 
-HtmlMetaVar::HtmlMetaVar(char *_name, char *_content)
+HtmlMetaVar::HtmlMetaVar(const char *_name, const char *_content)
 {
     name = new GooString(_name);
     content = new GooString(_content);
@@ -954,13 +954,13 @@ GooString* HtmlMetaVar::toString()
 // HtmlOutputDev
 //------------------------------------------------------------------------
 
-static char* HtmlEncodings[][2] = {
+static const char* HtmlEncodings[][2] = {
     {"Latin1", "ISO-8859-1"},
     {NULL, NULL}
 };
 
 
-char* HtmlOutputDev::mapEncodingToHtml(GooString* encoding)
+const char* HtmlOutputDev::mapEncodingToHtml(GooString* encoding)
 {
     char* enc = encoding->getCString();
     for(int i = 0; HtmlEncodings[i][0] != NULL; i++)
@@ -975,7 +975,7 @@ char* HtmlOutputDev::mapEncodingToHtml(GooString* encoding)
 
 void HtmlOutputDev::doFrame(int firstPage){
   GooString* fName=new GooString(Docname);
-  char* htmlEncoding;
+  const char* htmlEncoding;
   fName->append(".html");
 
   if (!(fContentsFrame = fopen(fName->getCString(), "w"))){
@@ -1014,7 +1014,7 @@ HtmlOutputDev::HtmlOutputDev(char *fileName, char *title,
 	char *extension,
 	GBool rawOrder, int firstPage, GBool outline) 
 {
-  char *htmlEncoding;
+  const char *htmlEncoding;
   
   fContentsFrame = NULL;
   docTitle = new GooString(title);
diff --git a/utils/HtmlOutputDev.h b/utils/HtmlOutputDev.h
index 474e3af..2d40c9e 100644
--- a/utils/HtmlOutputDev.h
+++ b/utils/HtmlOutputDev.h
@@ -196,7 +196,7 @@ private:
 //------------------------------------------------------------------------
 class HtmlMetaVar {
 public:
-    HtmlMetaVar(char *_name, char *_content);
+    HtmlMetaVar(const char *_name, const char *_content);
     ~HtmlMetaVar();    
     
     GooString* toString();	
@@ -303,7 +303,7 @@ public:
 private:
   // convert encoding into a HTML standard, or encoding->getCString if not
   // recognized
-  static char* mapEncodingToHtml(GooString* encoding);
+  static const char* mapEncodingToHtml(GooString* encoding);
   void doProcessLink(AnnotLink *link);
   GooString* getLinkDest(AnnotLink *link,Catalog *catalog);
   void dumpMetaVars(FILE *);
diff --git a/utils/parseargs.cc b/utils/parseargs.cc
index c5f3007..5d6769e 100644
--- a/utils/parseargs.cc
+++ b/utils/parseargs.cc
@@ -57,9 +57,9 @@ GBool parseArgs(const ArgDesc *args, int *argc, char *argv[]) {
   return ok;
 }
 
-void printUsage(char *program, char *otherArgs, const ArgDesc *args) {
+void printUsage(const char *program, const char *otherArgs, const ArgDesc *args) {
   const ArgDesc *arg;
-  char *typ;
+  const char *typ;
   int w, w1;
 
   w = 0;
diff --git a/utils/parseargs.h b/utils/parseargs.h
index 410dcc4..8a58e6c 100644
--- a/utils/parseargs.h
+++ b/utils/parseargs.h
@@ -53,11 +53,11 @@ typedef enum {
  * Argument descriptor.
  */
 typedef struct {
-  char *arg;			/* the command line switch */
+  const char *arg;		/* the command line switch */
   ArgKind kind;			/* kind of arg */
   void *val;			/* place to store value */
   int size;			/* for argString: size of string */
-  char *usage;			/* usage string */
+  const char *usage;		/* usage string */
 } ArgDesc;
 
 /*
@@ -70,7 +70,7 @@ extern GBool parseArgs(const ArgDesc *args, int *argc, char *argv[]);
 /*
  * Print usage message, based on arg descriptor list.
  */
-extern void printUsage(char *program, char *otherArgs, const ArgDesc *args);
+extern void printUsage(const char *program, const char *otherArgs, const ArgDesc *args);
 
 /*
  * Check if a string is a valid integer or floating point number.
diff --git a/utils/pdffonts.cc b/utils/pdffonts.cc
index f2e49e5..dc2ee8e 100644
--- a/utils/pdffonts.cc
+++ b/utils/pdffonts.cc
@@ -38,7 +38,7 @@
 #include "PDFDocFactory.h"
 #include "FontInfo.h"
 
-static char *fontTypeNames[] = {
+static const char *fontTypeNames[] = {
   "unknown",
   "Type 1",
   "Type 1C",
diff --git a/utils/pdfinfo.cc b/utils/pdfinfo.cc
index c9b4c58..314d874 100644
--- a/utils/pdfinfo.cc
+++ b/utils/pdfinfo.cc
@@ -50,10 +50,10 @@
 #include "Error.h"
 #include "DateInfo.h"
 
-static void printInfoString(Dict *infoDict, char *key, char *text,
+static void printInfoString(Dict *infoDict, const char *key, const char *text,
 			    UnicodeMap *uMap);
-static void printInfoDate(Dict *infoDict, char *key, char *text);
-static void printBox(char *text, PDFRectangle *box);
+static void printInfoDate(Dict *infoDict, const char *key, const char *text);
+static void printBox(const char *text, PDFRectangle *box);
 
 static int firstPage = 1;
 static int lastPage = 0;
@@ -342,7 +342,7 @@ int main(int argc, char *argv[]) {
   return exitCode;
 }
 
-static void printInfoString(Dict *infoDict, char *key, char *text,
+static void printInfoString(Dict *infoDict, const char *key, const char *text,
 			    UnicodeMap *uMap) {
   Object obj;
   GooString *s1;
@@ -379,7 +379,7 @@ static void printInfoString(Dict *infoDict, char *key, char *text,
   obj.free();
 }
 
-static void printInfoDate(Dict *infoDict, char *key, char *text) {
+static void printInfoDate(Dict *infoDict, const char *key, const char *text) {
   Object obj;
   char *s;
   int year, mon, day, hour, min, sec, tz_hour, tz_minute;
@@ -416,7 +416,7 @@ static void printInfoDate(Dict *infoDict, char *key, char *text) {
   obj.free();
 }
 
-static void printBox(char *text, PDFRectangle *box) {
+static void printBox(const char *text, PDFRectangle *box) {
   printf("%s%8.2f %8.2f %8.2f %8.2f\n",
 	 text, box->x1, box->y1, box->x2, box->y2);
 }
diff --git a/utils/pdftocairo.cc b/utils/pdftocairo.cc
index f86b10f..4928657 100644
--- a/utils/pdftocairo.cc
+++ b/utils/pdftocairo.cc
@@ -680,7 +680,7 @@ static GooString *getOutputFileName(GooString *fileName, GooString *outputName)
   return name;
 }
 
-static void checkInvalidPrintOption(GBool option, char *option_name)
+static void checkInvalidPrintOption(GBool option, const char *option_name)
 {
   if (option) {
     fprintf(stderr, "Error: %s may only be used with the -png or -jpeg output options.\n", option_name);
@@ -688,7 +688,7 @@ static void checkInvalidPrintOption(GBool option, char *option_name)
   }
 }
 
-static void checkInvalidImageOption(GBool option, char *option_name)
+static void checkInvalidImageOption(GBool option, const char *option_name)
 {
   if (option) {
     fprintf(stderr, "Error: %s may only be used with the -ps, -eps, -pdf, or -svg output options.\n", option_name);
diff --git a/utils/pdftohtml.cc b/utils/pdftohtml.cc
index fa00ae1..9c9024b 100644
--- a/utils/pdftohtml.cc
+++ b/utils/pdftohtml.cc
@@ -88,8 +88,8 @@ static char userPassword[33] = "";
 static char gsDevice[33] = "none";
 static GBool printVersion = gFalse;
 
-static GooString* getInfoString(Dict *infoDict, char *key);
-static GooString* getInfoDate(Dict *infoDict, char *key);
+static GooString* getInfoString(Dict *infoDict, const char *key);
+static GooString* getInfoDate(Dict *infoDict, const char *key);
 
 static char textEncName[128] = "";
 
@@ -185,7 +185,7 @@ int main(int argc, char *argv[]) {
   char *p;
   GooString *ownerPW, *userPW;
   Object info;
-  char * extsList[] = {"png", "jpeg", "bmp", "pcx", "tiff", "pbm", NULL};
+  const char * extsList[] = {"png", "jpeg", "bmp", "pcx", "tiff", "pbm", NULL};
 
   // parse args
   ok = parseArgs(argDesc, &argc, argv);
@@ -511,7 +511,7 @@ int main(int argc, char *argv[]) {
   return 0;
 }
 
-static GooString* getInfoString(Dict *infoDict, char *key) {
+static GooString* getInfoString(Dict *infoDict, const char *key) {
   Object obj;
   // Raw value as read from PDF (may be in pdfDocEncoding or UCS2)
   GooString *rawString;
@@ -555,7 +555,7 @@ static GooString* getInfoString(Dict *infoDict, char *key) {
   return encodedString;
 }
 
-static GooString* getInfoDate(Dict *infoDict, char *key) {
+static GooString* getInfoDate(Dict *infoDict, const char *key) {
   Object obj;
   char *s;
   int year, mon, day, hour, min, sec, tz_hour, tz_minute;
diff --git a/utils/pdftotext.cc b/utils/pdftotext.cc
index ac9ae10..48b5c5a 100644
--- a/utils/pdftotext.cc
+++ b/utils/pdftotext.cc
@@ -55,9 +55,9 @@
 #include "Error.h"
 #include <string>
 
-static void printInfoString(FILE *f, Dict *infoDict, char *key,
-			    char *text1, char *text2, UnicodeMap *uMap);
-static void printInfoDate(FILE *f, Dict *infoDict, char *key, char *fmt);
+static void printInfoString(FILE *f, Dict *infoDict, const char *key,
+			    const char *text1, const char *text2, UnicodeMap *uMap);
+static void printInfoDate(FILE *f, Dict *infoDict, const char *key, const char *fmt);
 
 static int firstPage = 1;
 static int lastPage = 0;
@@ -428,8 +428,8 @@ int main(int argc, char *argv[]) {
   return exitCode;
 }
 
-static void printInfoString(FILE *f, Dict *infoDict, char *key,
-			    char *text1, char *text2, UnicodeMap *uMap) {
+static void printInfoString(FILE *f, Dict *infoDict, const char *key,
+			    const char *text1, const char *text2, UnicodeMap *uMap) {
   Object obj;
   GooString *s1;
   GBool isUnicode;
@@ -465,7 +465,7 @@ static void printInfoString(FILE *f, Dict *infoDict, char *key,
   obj.free();
 }
 
-static void printInfoDate(FILE *f, Dict *infoDict, char *key, char *fmt) {
+static void printInfoDate(FILE *f, Dict *infoDict, const char *key, const char *fmt) {
   Object obj;
   char *s;
 


More information about the poppler mailing list