diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-05-02 12:27:51 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-05-02 12:27:51 +0000 |
commit | 55899550ec16f1a2fccf4420316345016882f7cd (patch) | |
tree | 0f6e7f82603cd328ecb98e46c0d044503105dfcb | |
parent | 139cecf1ea2f3106ee7a49b4d5ff05720a017848 (diff) |
pdfTeX: Add several cast to avoid 'deprecated conversion' warnings from g++-4.4
git-svn-id: svn://tug.org/texlive/trunk@22276 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/ChangeLog | 12 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/pdftoepdf.cc | 32 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/pdftosrc.cc | 8 |
3 files changed, 32 insertions, 20 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog index f252d59f929..525f323aea4 100644 --- a/Build/source/texk/web2c/pdftexdir/ChangeLog +++ b/Build/source/texk/web2c/pdftexdir/ChangeLog @@ -1,3 +1,15 @@ +2011-05-02 Peter Breitenlohner <peb@mppmu.mpg.de> + + Avoid "deprecated conversion from string constant to 'char*'" + warnings from g++-4.4. + Unfortunately both xpdf and poppler declare lots of function + parameters as 'char *' that should actually be 'const char *'. + Compiling just the parts required for TeX Live with g++-4.4 + yields >10000 such warnings for each of xpdf and poppler. + + * pdftoepdf.cc, pdftosrc.cc: Cast string constants to 'char *' + in order to avoid more such warnings when compiling pdfTeX. + 2011-04-29 Karl Berry <karl@tug.org> * all files: update copyright notices. diff --git a/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc b/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc index 711339d562e..a5e8d3f79a8 100644 --- a/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc +++ b/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc @@ -407,22 +407,22 @@ static void copyFont(char *tag, Object * fontRef) // Only handle included Type1 (and Type1C) fonts; anything else will be copied. // Type1C fonts are replaced by Type1 fonts, if REPLACE_TYPE1C is true. if (!fixedinclusioncopyfont && fontRef->fetch(xref, &fontdict)->isDict() - && fontdict->dictLookup("Subtype", &subtype)->isName() + && fontdict->dictLookup((char *)"Subtype", &subtype)->isName() && !strcmp(subtype->getName(), "Type1") - && fontdict->dictLookup("BaseFont", &basefont)->isName() - && fontdict->dictLookupNF("FontDescriptor", &fontdescRef)->isRef() + && fontdict->dictLookup((char *)"BaseFont", &basefont)->isName() + && fontdict->dictLookupNF((char *)"FontDescriptor", &fontdescRef)->isRef() && fontdescRef->fetch(xref, &fontdesc)->isDict() - && (fontdesc->dictLookup("FontFile", &fontfile)->isStream() + && (fontdesc->dictLookup((char *)"FontFile", &fontfile)->isStream() || (REPLACE_TYPE1C - && fontdesc->dictLookup("FontFile3", &fontfile)->isStream() - && fontfile->streamGetDict()->lookup("Subtype", + && fontdesc->dictLookup((char *)"FontFile3", &fontfile)->isStream() + && fontfile->streamGetDict()->lookup((char *)"Subtype", &ffsubtype)->isName() && !strcmp(ffsubtype->getName(), "Type1C"))) && (fontmap = lookup_fontmap(basefont->getName())) != NULL) { // copy the value of /StemV - fontdesc->dictLookup("StemV", &stemV); + fontdesc->dictLookup((char *)"StemV", &stemV); fd = epdf_create_fontdescriptor(fontmap, stemV->getInt()); - if (fontdesc->dictLookup("CharSet", &charset) && + if (fontdesc->dictLookup((char *)"CharSet", &charset) && charset->isString() && is_subsetable(fontmap)) epdf_mark_glyphs(fd, charset->getString()->getCString()); else @@ -835,7 +835,7 @@ void write_epdf(void) int rotate; double scale[6] = { 0, 0, 0, 0, 0, 0 }; bool writematrix = false; - static char *pageDictKeys[] = { + static const char *pageDictKeys[] = { "LastModified", "Metadata", "PieceInfo", @@ -921,13 +921,13 @@ void write_epdf(void) pdf_puts(stripzeros(s)); // Metadata validity check (as a stream it must be indirect) - pageDict->lookupNF("Metadata", &dictObj); + pageDict->lookupNF((char *)"Metadata", &dictObj); if (!dictObj->isNull() && !dictObj->isRef()) pdftex_warn("PDF inclusion: /Metadata must be indirect object"); // copy selected items in Page dictionary except Resources & Group for (i = 0; pageDictKeys[i] != NULL; i++) { - pageDict->lookupNF(pageDictKeys[i], &dictObj); + pageDict->lookupNF((char *)pageDictKeys[i], &dictObj); if (!dictObj->isNull()) { pdf_newline(); pdf_printf("/%s ", pageDictKeys[i]); @@ -936,7 +936,7 @@ void write_epdf(void) } // handle page group - pageDict->lookupNF("Group", &dictObj); + pageDict->lookupNF((char *)"Group", &dictObj); if (!dictObj->isNull()) { if (pdfpagegroupval == 0) { // another pdf with page group was included earlier on the same page; @@ -992,21 +992,21 @@ void write_epdf(void) // Variant B: copy stream without recompressing // - contents->streamGetDict()->lookup("F", &obj1); + contents->streamGetDict()->lookup((char *)"F", &obj1); if (!obj1->isNull()) { pdftex_fail("PDF inclusion: Unsupported external stream"); } - contents->streamGetDict()->lookup("Length", &obj1); + contents->streamGetDict()->lookup((char *)"Length", &obj1); assert(!obj1->isNull()); pdf_puts("/Length "); copyObject(&obj1); pdf_puts("\n"); - contents->streamGetDict()->lookup("Filter", &obj1); + contents->streamGetDict()->lookup((char *)"Filter", &obj1); if (!obj1->isNull()) { pdf_puts("/Filter "); copyObject(&obj1); pdf_puts("\n"); - contents->streamGetDict()->lookup("DecodeParms", &obj1); + contents->streamGetDict()->lookup((char *)"DecodeParms", &obj1); if (!obj1->isNull()) { pdf_puts("/DecodeParms "); copyObject(&obj1); diff --git a/Build/source/texk/web2c/pdftexdir/pdftosrc.cc b/Build/source/texk/web2c/pdftexdir/pdftosrc.cc index 1793187334a..a6debc4acc5 100644 --- a/Build/source/texk/web2c/pdftexdir/pdftosrc.cc +++ b/Build/source/texk/web2c/pdftexdir/pdftosrc.cc @@ -85,19 +85,19 @@ int main(int argc, char *argv[]) xref = doc->getXRef(); catalogDict.initNull(); xref->getCatalog(&catalogDict); - if (!catalogDict.isDict("Catalog")) { + if (!catalogDict.isDict((char *)"Catalog")) { fprintf(stderr, "No Catalog found\n"); exit(1); } srcStream.initNull(); if (objnum == 0) { - catalogDict.dictLookup("SourceObject", &srcStream); - if (!srcStream.isStream("SourceFile")) { + catalogDict.dictLookup((char *)"SourceObject", &srcStream); + if (!srcStream.isStream((char *)"SourceFile")) { fprintf(stderr, "No SourceObject found\n"); exit(1); } srcName.initNull(); - srcStream.getStream()->getDict()->lookup("SourceName", &srcName); + srcStream.getStream()->getDict()->lookup((char *)"SourceName", &srcName); if (!srcName.isString()) { fprintf(stderr, "No SourceName found\n"); exit(1); |