diff options
author | Albert Astals Cid <aacid@kde.org> | 2011-08-30 14:49:23 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2011-08-30 14:49:23 +0200 |
commit | 2658030836f3a15dadadd7f1989dfaa858bf876f (patch) | |
tree | a7966b8c41de09572a38952d7eec15f62c1e11e6 /utils | |
parent | c899d26e0f7a61db99925179330c28df015a676b (diff) |
xpdf303: char * -> const char *
Diffstat (limited to 'utils')
-rw-r--r-- | utils/HtmlFonts.cc | 4 | ||||
-rw-r--r-- | utils/HtmlOutputDev.cc | 12 | ||||
-rw-r--r-- | utils/HtmlOutputDev.h | 4 | ||||
-rw-r--r-- | utils/parseargs.cc | 4 | ||||
-rw-r--r-- | utils/parseargs.h | 6 | ||||
-rw-r--r-- | utils/pdffonts.cc | 2 | ||||
-rw-r--r-- | utils/pdfinfo.cc | 12 | ||||
-rw-r--r-- | utils/pdftocairo.cc | 4 | ||||
-rw-r--r-- | utils/pdftohtml.cc | 10 | ||||
-rw-r--r-- | utils/pdftotext.cc | 12 |
10 files changed, 35 insertions, 35 deletions
diff --git a/utils/HtmlFonts.cc b/utils/HtmlFonts.cc index c9b558e9..7205a1d8 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 615cf5f7..a3a99f50 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 474e3af9..2d40c9e8 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 c5f3007e..5d6769ef 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 410dcc46..8a58e6c5 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 f2e49e51..dc2ee8e7 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 c9b4c58c..314d874f 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 f86b10f1..4928657f 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 fa00ae11..9c9024b0 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 ac9ae10c..48b5c5a8 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; |