[poppler] mingw-gcc fix for GlobalParamsWin.cc

mpsuzuki at hiroshima-u.ac.jp mpsuzuki at hiroshima-u.ac.jp
Thu Mar 22 22:56:44 PDT 2012


Hi,

Now I'm testing poppler on MinGW environment and
found that the patch by Thomas (dae29c6c201cd69cbf4f008de865cc19a36f29b3)
has a problem. MinGW gcc compiler rejects new function
findSubstituteName() as,

	In file included from /tmp/poppler-current/poppler/GlobalParams.cc:1324:
	/tmp/poppler-current/poppler/GlobalParamsWin.cc: In member function 'void SysFontList::scanWindowsFonts(GooString*)':
	/tmp/poppler-current/poppler/GlobalParamsWin.cc:242: warning: deprecated conversion from string constant to 'char*'
	/tmp/poppler-current/poppler/GlobalParamsWin.cc:244: warning: deprecated conversion from string constant to 'char*'
	/tmp/poppler-current/poppler/GlobalParamsWin.cc: In function 'char* findSubstituteName(GfxFont*, GooHash*, const char*)':
	/tmp/poppler-current/poppler/GlobalParamsWin.cc:470: error: invalid conversion from 'const char*' to 'char*'

Thus, I propose to change the type of findSubstituteName()
from char* to const char*, like this:

diff --git a/poppler/GlobalParamsWin.cc b/poppler/GlobalParamsWin.cc
index dd8768a..90f49ef 100644
--- a/poppler/GlobalParamsWin.cc
+++ b/poppler/GlobalParamsWin.cc
@@ -448,7 +448,7 @@ void GlobalParams::setupBaseFonts(char * dir)
     }
 }
 
-static char *findSubstituteName(GfxFont *font, GooHash *substFiles, const char *origName)
+static const char *findSubstituteName(GfxFont *font, GooHash *substFiles, const char *origName)
 {
     assert(origName);
     if (!origName) return NULL;


More information about the poppler mailing list