diff --git a/goo/gmem.cc b/goo/gmem.cc index af3e19e..26e1868 100644 --- a/goo/gmem.cc +++ b/goo/gmem.cc @@ -330,7 +330,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 0c16b01..b85b40a 100644 --- a/goo/gmem.h +++ b/goo/gmem.h @@ -94,7 +94,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/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 0b1812c..3ed0247 100644 --- a/poppler/NameToUnicodeTable.h +++ b/poppler/NameToUnicodeTable.h @@ -8,7 +8,7 @@ static struct { Unicode u; - char *name; + const char *name; } nameToUnicodeTab[] = { {0x0021, "!"}, {0x0023, "#"},