Commit 26580308 authored by Albert Astals Cid's avatar Albert Astals Cid

xpdf303: char * -> const char *

parent c899d26e
...@@ -101,7 +101,7 @@ endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) ...@@ -101,7 +101,7 @@ endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
if(CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_COMPILER_IS_GNUCXX)
# set the default compile warnings # set the default compile warnings
set(DEFAULT_COMPILE_WARNINGS_NO) 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(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}") set(CMAKE_CXX_FLAGS "-Wnon-virtual-dtor -Woverloaded-virtual ${CMAKE_CXX_FLAGS}")
......
...@@ -568,7 +568,7 @@ if test "x$GCC" != xyes; then ...@@ -568,7 +568,7 @@ if test "x$GCC" != xyes; then
fi fi
case "$enable_compile_warnings" in case "$enable_compile_warnings" in
no) ;; 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 \ kde) CXXFLAGS="-Wnon-virtual-dtor -Wno-long-long -Wundef \
-D_XOPEN_SOURCE=600 -D_BSD_SOURCE -Wcast-align \ -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -Wcast-align \
-Wconversion -Wall -W -Wpointer-arith \ -Wconversion -Wall -W -Wpointer-arith \
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
using namespace poppler; 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; std::ostringstream oss;
if (pos >= 0) { if (pos >= 0) {
......
...@@ -37,7 +37,7 @@ namespace poppler ...@@ -37,7 +37,7 @@ namespace poppler
namespace detail 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); rectf pdfrectangle_to_rectf(const PDFRectangle &pdfrect);
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
//------------------------------------------------------------------------ //------------------------------------------------------------------------
typedef void (*FoFiOutputFunc)(void *stream, char *data, int len); typedef void (*FoFiOutputFunc)(void *stream, const char *data, int len);
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// FoFiBase // FoFiBase
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
// Type 1 and 1C font data // Type 1 and 1C font data
//------------------------------------------------------------------------ //------------------------------------------------------------------------
char *fofiType1StandardEncoding[256] = { const char *fofiType1StandardEncoding[256] = {
NULL, NULL,
NULL, NULL,
NULL, NULL,
...@@ -278,7 +278,7 @@ char *fofiType1StandardEncoding[256] = { ...@@ -278,7 +278,7 @@ char *fofiType1StandardEncoding[256] = {
NULL NULL
}; };
char *fofiType1ExpertEncoding[256] = { const char *fofiType1ExpertEncoding[256] = {
NULL, NULL,
NULL, NULL,
NULL, NULL,
...@@ -541,7 +541,7 @@ char *fofiType1ExpertEncoding[256] = { ...@@ -541,7 +541,7 @@ char *fofiType1ExpertEncoding[256] = {
// Type 1C font data // Type 1C font data
//------------------------------------------------------------------------ //------------------------------------------------------------------------
char *fofiType1CStdStrings[391] = { const char *fofiType1CStdStrings[391] = {
".notdef", ".notdef",
"space", "space",
"exclam", "exclam",
......
...@@ -19,14 +19,14 @@ ...@@ -19,14 +19,14 @@
// Type 1 and 1C font data // Type 1 and 1C font data
//------------------------------------------------------------------------ //------------------------------------------------------------------------
extern char *fofiType1StandardEncoding[256]; extern const char *fofiType1StandardEncoding[256];
extern char *fofiType1ExpertEncoding[256]; extern const char *fofiType1ExpertEncoding[256];
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// Type 1C font data // Type 1C font data
//------------------------------------------------------------------------ //------------------------------------------------------------------------
extern char *fofiType1CStdStrings[391]; extern const char *fofiType1CStdStrings[391];
extern Gushort fofiType1CISOAdobeCharset[229]; extern Gushort fofiType1CISOAdobeCharset[229];
extern Gushort fofiType1CExpertCharset[166]; extern Gushort fofiType1CExpertCharset[166];
extern Gushort fofiType1CExpertSubsetCharset[87]; extern Gushort fofiType1CExpertSubsetCharset[87];
......
...@@ -164,7 +164,7 @@ static int cmpTrueTypeTableTag(const void *p1, const void *p2) { ...@@ -164,7 +164,7 @@ static int cmpTrueTypeTableTag(const void *p1, const void *p2) {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
struct T42Table { struct T42Table {
char *tag; // 4-byte tag const char *tag; // 4-byte tag
GBool required; // required by the TrueType spec? GBool required; // required by the TrueType spec?
}; };
...@@ -194,7 +194,7 @@ static T42Table t42Tables[nT42Tables] = { ...@@ -194,7 +194,7 @@ static T42Table t42Tables[nT42Tables] = {
// Glyph names in some arbitrary standard order that Apple uses for // Glyph names in some arbitrary standard order that Apple uses for
// their TrueType fonts. // their TrueType fonts.
static char *macGlyphNames[258] = { static const char *macGlyphNames[258] = {
".notdef", "null", "CR", "space", ".notdef", "null", "CR", "space",
"exclam", "quotedbl", "numbersign", "dollar", "exclam", "quotedbl", "numbersign", "dollar",
"percent", "ampersand", "quotesingle", "parenleft", "percent", "ampersand", "quotesingle", "parenleft",
...@@ -530,7 +530,7 @@ void FoFiTrueType::convertToType42(char *psName, char **encoding, ...@@ -530,7 +530,7 @@ void FoFiTrueType::convertToType42(char *psName, char **encoding,
(*outputFunc)(outputStream, "FontName currentdict end definefont pop\n", 40); (*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, GBool ascii, FoFiOutputFunc outputFunc,
void *outputStream) { void *outputStream) {
FoFiType1C *ff; FoFiType1C *ff;
...@@ -1424,7 +1424,7 @@ void FoFiTrueType::writeTTF(FoFiOutputFunc outputFunc, ...@@ -1424,7 +1424,7 @@ void FoFiTrueType::writeTTF(FoFiOutputFunc outputFunc,
void FoFiTrueType::cvtEncoding(char **encoding, void FoFiTrueType::cvtEncoding(char **encoding,
FoFiOutputFunc outputFunc, FoFiOutputFunc outputFunc,
void *outputStream) { void *outputStream) {
char *name; const char *name;
GooString *buf; GooString *buf;
int i; int i;
...@@ -2085,7 +2085,7 @@ void FoFiTrueType::readPostTable() { ...@@ -2085,7 +2085,7 @@ void FoFiTrueType::readPostTable() {
} }
} }
int FoFiTrueType::seekTable(char *tag) { int FoFiTrueType::seekTable(const char *tag) {
Guint tagI; Guint tagI;
int i; int i;
......
...@@ -114,7 +114,7 @@ public: ...@@ -114,7 +114,7 @@ public:
// otherwise it will be left as binary data. If <psName> is // otherwise it will be left as binary data. If <psName> is
// non-NULL, it will be used as the PostScript font name. (Only // non-NULL, it will be used as the PostScript font name. (Only
// useful for OpenType CFF fonts.) // 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); FoFiOutputFunc outputFunc, void *outputStream);
// Convert to a Type 2 CIDFont, suitable for embedding in a // Convert to a Type 2 CIDFont, suitable for embedding in a
...@@ -176,7 +176,7 @@ private: ...@@ -176,7 +176,7 @@ private:
Guint computeTableChecksum(Guchar *data, int length); Guint computeTableChecksum(Guchar *data, int length);
void parse(); void parse();
void readPostTable(); void readPostTable();
int seekTable(char *tag); int seekTable(const char *tag);
Guint charToTag(const char *tagName); Guint charToTag(const char *tagName);
Guint doMapToVertGID(Guint orgGID); Guint doMapToVertGID(Guint orgGID);
Guint scanLookupList(Guint listIndex, Guint orgGID); Guint scanLookupList(Guint listIndex, Guint orgGID);
......
...@@ -90,7 +90,7 @@ char **FoFiType1::getEncoding() { ...@@ -90,7 +90,7 @@ char **FoFiType1::getEncoding() {
return encoding; return encoding;
} }
void FoFiType1::writeEncoded(char **newEncoding, void FoFiType1::writeEncoded(const char **newEncoding,
FoFiOutputFunc outputFunc, void *outputStream) { FoFiOutputFunc outputFunc, void *outputStream) {
char buf[512]; char buf[512];
char *line, *line2, *p; char *line, *line2, *p;
...@@ -213,7 +213,7 @@ void FoFiType1::parse() { ...@@ -213,7 +213,7 @@ void FoFiType1::parse() {
// get encoding // get encoding
} else if (!encoding && } else if (!encoding &&
!strncmp(line, "/Encoding StandardEncoding def", 30)) { !strncmp(line, "/Encoding StandardEncoding def", 30)) {
encoding = fofiType1StandardEncoding; encoding = (char **)fofiType1StandardEncoding;
} else if (!encoding && } else if (!encoding &&
!strncmp(line, "/Encoding 256 array", 19)) { !strncmp(line, "/Encoding 256 array", 19)) {
encoding = (char **)gmallocn(256, sizeof(char *)); encoding = (char **)gmallocn(256, sizeof(char *));
......
...@@ -39,7 +39,7 @@ public: ...@@ -39,7 +39,7 @@ public:
char **getEncoding(); char **getEncoding();
// Write a version of the Type 1 font file with a new encoding. // 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); FoFiOutputFunc outputFunc, void *outputStream);
private: private:
......
...@@ -144,7 +144,7 @@ Gushort *FoFiType1C::getCIDToGIDMap(int *nCIDs) { ...@@ -144,7 +144,7 @@ Gushort *FoFiType1C::getCIDToGIDMap(int *nCIDs) {
return map; return map;
} }
void FoFiType1C::convertToType1(char *psName, char **newEncoding, GBool ascii, void FoFiType1C::convertToType1(char *psName, const char **newEncoding, GBool ascii,
FoFiOutputFunc outputFunc, FoFiOutputFunc outputFunc,
void *outputStream) { void *outputStream) {
int psNameLen; int psNameLen;
...@@ -153,7 +153,7 @@ void FoFiType1C::convertToType1(char *psName, char **newEncoding, GBool ascii, ...@@ -153,7 +153,7 @@ void FoFiType1C::convertToType1(char *psName, char **newEncoding, GBool ascii,
Type1CIndexVal val; Type1CIndexVal val;
GooString *buf; GooString *buf;
char buf2[256]; char buf2[256];
char **enc; const char **enc;
GBool ok; GBool ok;
int i; int i;
...@@ -265,7 +265,7 @@ void FoFiType1C::convertToType1(char *psName, char **newEncoding, GBool ascii, ...@@ -265,7 +265,7 @@ void FoFiType1C::convertToType1(char *psName, char **newEncoding, GBool ascii,
(*outputFunc)(outputStream, "256 array\n", 10); (*outputFunc)(outputStream, "256 array\n", 10);
(*outputFunc)(outputStream, (*outputFunc)(outputStream,
"0 1 255 {1 index exch /.notdef put} for\n", 40); "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) { for (i = 0; i < 256; ++i) {
if (enc[i]) { if (enc[i]) {
buf = GooString::format("dup {0:d} /{1:s} put\n", i, enc[i]); buf = GooString::format("dup {0:d} /{1:s} put\n", i, enc[i]);
...@@ -1083,7 +1083,7 @@ void FoFiType1C::convertToType0(char *psName, ...@@ -1083,7 +1083,7 @@ void FoFiType1C::convertToType0(char *psName,
gfree(cidMap); gfree(cidMap);
} }
void FoFiType1C::eexecCvtGlyph(Type1CEexecBuf *eb, char *glyphName, void FoFiType1C::eexecCvtGlyph(Type1CEexecBuf *eb, const char *glyphName,
int offset, int nBytes, int offset, int nBytes,
Type1CIndex *subrIdx, Type1CIndex *subrIdx,
Type1CPrivateDict *pDict) { Type1CPrivateDict *pDict) {
...@@ -1809,7 +1809,7 @@ void FoFiType1C::cvtNum(double x, GBool isFP, GooString *charBuf) { ...@@ -1809,7 +1809,7 @@ void FoFiType1C::cvtNum(double x, GBool isFP, GooString *charBuf) {
charBuf->append((char *)buf, n); charBuf->append((char *)buf, n);
} }
void FoFiType1C::eexecWrite(Type1CEexecBuf *eb, char *s) { void FoFiType1C::eexecWrite(Type1CEexecBuf *eb, const char *s) {
Guchar *p; Guchar *p;
Guchar x; Guchar x;
...@@ -2278,10 +2278,10 @@ void FoFiType1C::buildEncoding() { ...@@ -2278,10 +2278,10 @@ void FoFiType1C::buildEncoding() {
int pos, c, sid, nLeft, nSups, i, j; int pos, c, sid, nLeft, nSups, i, j;
if (topDict.encodingOffset == 0) { if (topDict.encodingOffset == 0) {
encoding = fofiType1StandardEncoding; encoding = (char **)fofiType1StandardEncoding;
} else if (topDict.encodingOffset == 1) { } else if (topDict.encodingOffset == 1) {
encoding = fofiType1ExpertEncoding; encoding = (char **)fofiType1ExpertEncoding;
} else { } else {
encoding = (char **)gmallocn(256, sizeof(char *)); encoding = (char **)gmallocn(256, sizeof(char *));
......
...@@ -171,7 +171,7 @@ public: ...@@ -171,7 +171,7 @@ public:
// font. If <ascii> is true the eexec section will be hex-encoded, // 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, // otherwise it will be left as binary data. If <psName> is non-NULL,
// it will be used as the PostScript font name. // 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); FoFiOutputFunc outputFunc, void *outputStream);
// Convert to a Type 0 CIDFont, suitable for embedding in a // Convert to a Type 0 CIDFont, suitable for embedding in a
...@@ -189,7 +189,7 @@ public: ...@@ -189,7 +189,7 @@ public:
private: private:
FoFiType1C(char *fileA, int lenA, GBool freeFileDataA); FoFiType1C(char *fileA, int lenA, GBool freeFileDataA);
void eexecCvtGlyph(Type1CEexecBuf *eb, char *glyphName, void eexecCvtGlyph(Type1CEexecBuf *eb, const char *glyphName,
int offset, int nBytes, int offset, int nBytes,
Type1CIndex *subrIdx, Type1CIndex *subrIdx,
Type1CPrivateDict *pDict); Type1CPrivateDict *pDict);
...@@ -199,7 +199,7 @@ private: ...@@ -199,7 +199,7 @@ private:
void cvtGlyphWidth(GBool useOp, GooString *charBuf, void cvtGlyphWidth(GBool useOp, GooString *charBuf,
Type1CPrivateDict *pDict); Type1CPrivateDict *pDict);
void cvtNum(double x, GBool isFP, GooString *charBuf); 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); void eexecWriteCharstring(Type1CEexecBuf *eb, Guchar *s, int n);
GBool parse(); GBool parse();
void readTopDict(); void readTopDict();
......
...@@ -145,7 +145,7 @@ int GooHash::lookupInt(GooString *key) { ...@@ -145,7 +145,7 @@ int GooHash::lookupInt(GooString *key) {
return p->val.i; return p->val.i;
} }
void *GooHash::lookup(char *key) { void *GooHash::lookup(const char *key) {
GooHashBucket *p; GooHashBucket *p;
int h; int h;
...@@ -155,7 +155,7 @@ void *GooHash::lookup(char *key) { ...@@ -155,7 +155,7 @@ void *GooHash::lookup(char *key) {
return p->val.p; return p->val.p;
} }
int GooHash::lookupInt(char *key) { int GooHash::lookupInt(const char *key) {
GooHashBucket *p; GooHashBucket *p;
int h; int h;
...@@ -211,7 +211,7 @@ int GooHash::removeInt(GooString *key) { ...@@ -211,7 +211,7 @@ int GooHash::removeInt(GooString *key) {
return val; return val;
} }
void *GooHash::remove(char *key) { void *GooHash::remove(const char *key) {
GooHashBucket *p; GooHashBucket *p;
GooHashBucket **q; GooHashBucket **q;
void *val; void *val;
...@@ -234,7 +234,7 @@ void *GooHash::remove(char *key) { ...@@ -234,7 +234,7 @@ void *GooHash::remove(char *key) {
return val; return val;
} }
int GooHash::removeInt(char *key) { int GooHash::removeInt(const char *key) {
GooHashBucket *p; GooHashBucket *p;
GooHashBucket **q; GooHashBucket **q;
int val; int val;
...@@ -344,7 +344,7 @@ GooHashBucket *GooHash::find(GooString *key, int *h) { ...@@ -344,7 +344,7 @@ GooHashBucket *GooHash::find(GooString *key, int *h) {
return NULL; return NULL;
} }
GooHashBucket *GooHash::find(char *key, int *h) { GooHashBucket *GooHash::find(const char *key, int *h) {
GooHashBucket *p; GooHashBucket *p;
*h = hash(key); *h = hash(key);
...@@ -357,7 +357,7 @@ GooHashBucket *GooHash::find(char *key, int *h) { ...@@ -357,7 +357,7 @@ GooHashBucket *GooHash::find(char *key, int *h) {
} }
int GooHash::hash(GooString *key) { int GooHash::hash(GooString *key) {
char *p; const char *p;
unsigned int h; unsigned int h;
int i; int i;
...@@ -368,8 +368,8 @@ int GooHash::hash(GooString *key) { ...@@ -368,8 +368,8 @@ int GooHash::hash(GooString *key) {
return (int)(h % size); return (int)(h % size);
} }
int GooHash::hash(char *key) { int GooHash::hash(const char *key) {
char *p; const char *p;
unsigned int h; unsigned int h;
h = 0; h = 0;
......
...@@ -32,12 +32,12 @@ public: ...@@ -32,12 +32,12 @@ public:
void replace(GooString *key, int val); void replace(GooString *key, int val);
void *lookup(GooString *key); void *lookup(GooString *key);
int lookupInt(GooString *key); int lookupInt(GooString *key);
void *lookup(char *key); void *lookup(const char *key);
int lookupInt(char *key); int lookupInt(const char *key);
void *remove(GooString *key); void *remove(GooString *key);
int removeInt(GooString *key); int removeInt(GooString *key);
void *remove(char *key); void *remove(const char *key);
int removeInt(char *key); int removeInt(const char *key);
int getLength() { return len; } int getLength() { return len; }
void startIter(GooHashIter **iter); void startIter(GooHashIter **iter);
GBool getNext(GooHashIter **iter, GooString **key, void **val); GBool getNext(GooHashIter **iter, GooString **key, void **val);
...@@ -48,9 +48,9 @@ private: ...@@ -48,9 +48,9 @@ private:
void expand(); void expand();
GooHashBucket *find(GooString *key, int *h); 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(GooString *key);
int hash(char *key); int hash(const char *key);
GBool deleteKeys; // set if key strings should be deleted GBool deleteKeys; // set if key strings should be deleted
int size; // number of buckets int size; // number of buckets
......
...@@ -81,7 +81,7 @@ enum GooStringFormatType { ...@@ -81,7 +81,7 @@ enum GooStringFormatType {
fmtSpace fmtSpace
}; };
static char *formatStrings[] = { static const char *formatStrings[] = {
"d", "x", "o", "b", "ud", "ux", "uo", "ub", "d", "x", "o", "b", "ud", "ux", "uo", "ub",
"ld", "lx", "lo", "lb", "uld", "ulx", "ulo", "ulb", "ld", "lx", "lo", "lb", "uld", "ulx", "ulo", "ulb",
"f", "gs", "g", "f", "gs", "g",
...@@ -211,13 +211,13 @@ GooString::GooString(GooString *str1, GooString *str2) { ...@@ -211,13 +211,13 @@ GooString::GooString(GooString *str1, GooString *str2) {
GooString *GooString::fromInt(int x) { GooString *GooString::fromInt(int x) {
char buf[24]; // enough space for 64-bit ints plus a little extra char buf[24]; // enough space for 64-bit ints plus a little extra
char *p; const char *p;
int len; int len;
formatInt(x, buf, sizeof(buf), gFalse, 0, 10, &p, &len); formatInt(x, buf, sizeof(buf), gFalse, 0, 10, &p, &len);
return new GooString(p, len); return new GooString(p, len);
} }
GooString *GooString::format(char *fmt, ...) { GooString *GooString::format(const char *fmt, ...) {
va_list argList; va_list argList;
GooString *s; GooString *s;
...@@ -228,7 +228,7 @@ GooString *GooString::format(char *fmt, ...) { ...@@ -228,7 +228,7 @@ GooString *GooString::format(char *fmt, ...) {
return s; return s;
} }
GooString *GooString::formatv(char *fmt, va_list argList) { GooString *GooString::formatv(const char *fmt, va_list argList) {
GooString *s; GooString *s;
s = new GooString(); s = new GooString();
...@@ -263,7 +263,7 @@ GooString *GooString::append(const char *str, int lengthA) { ...@@ -263,7 +263,7 @@ GooString *GooString::append(const char *str, int lengthA) {
return this; return this;
} }
GooString *GooString::appendf(char *fmt, ...) { GooString *GooString::appendf(const char *fmt, ...) {
va_list argList; va_list argList;
va_start(argList, fmt); va_start(argList, fmt);
...@@ -272,7 +272,7 @@ GooString *GooString::appendf(char *fmt, ...) { ...@@ -272,7 +272,7 @@ GooString *GooString::appendf(char *fmt, ...) {
return this; return this;
} }
GooString *GooString::appendfv(char *fmt, va_list argList) { GooString *GooString::appendfv(const char *fmt, va_list argList) {
GooStringFormatArg *args; GooStringFormatArg *args;
int argsLen, argsSize; int argsLen, argsSize;
GooStringFormatArg arg; GooStringFormatArg arg;
...@@ -281,7 +281,7 @@ GooString *GooString::appendfv(char *fmt, va_list argList) { ...@@ -281,7 +281,7 @@ GooString *GooString::appendfv(char *fmt, va_list argList) {
GooStringFormatType ft; GooStringFormatType ft;
char buf[65]; char buf[65];
int len, i; int len, i;
char *p0, *p1, *str; const char *p0, *p1, *str;
argsLen = 0; argsLen = 0;
argsSize = 8; argsSize = 8;
...@@ -519,7 +519,7 @@ GooString *GooString::appendfv(char *fmt, va_list argList) { ...@@ -519,7 +519,7 @@ GooString *GooString::appendfv(char *fmt, va_list argList) {
void GooString::formatInt(long x, char *buf, int bufSize, void GooString::formatInt(long x, char *buf, int bufSize,
GBool zeroFill, int width, int base, GBool zeroFill, int width, int base,
char **p, int *len) { const char **p, int *len) {
static char vals[17] = "0123456789abcdef"; static char vals[17] = "0123456789abcdef";
GBool neg; GBool neg;
int start, i, j; int start, i, j;
...@@ -551,7 +551,7 @@ void GooString::formatInt(long x, char *buf, int bufSize, ...@@ -551,7 +551,7 @@ void GooString::formatInt(long x, char *buf, int bufSize,
void GooString::formatUInt(Gulong x, char *buf, int bufSize, void GooString::formatUInt(Gulong x, char *buf, int bufSize,
GBool zeroFill, int width, int base, GBool zeroFill, int width, int base,
char **p, int *len) { const char **p, int *len) {
static char vals[17] = "0123456789abcdef"; static char vals[17] = "0123456789abcdef";
int i, j; int i, j;
...@@ -574,7 +574,7 @@ void GooString::formatUInt(Gulong x, char *buf, int bufSize, ...@@ -574,7 +574,7 @@ void GooString::formatUInt(Gulong x, char *buf, int bufSize,
} }
void GooString::formatDouble(double x, char *buf, int bufSize, int prec, 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; GBool neg, started;
double x2; double x2;
int d, i, j; int d, i, j;
...@@ -613,7 +613,7 @@ void GooString::formatDouble(double x, char *buf, int bufSize, int prec, ...@@ -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, 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); double absX = fabs(x);
if (absX >= 0.1) { if (absX >= 0.1) {
......
...@@ -88,8 +88,8 @@ public: ...@@ -88,8 +88,8 @@ public:
// t -- GooString * // t -- GooString *
// w -- blank space; arg determines width // w -- blank space; arg determines width
// To get literal curly braces, use {{ or }}. // To get literal curly braces, use {{ or }}.