summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2015-08-27 07:28:06 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2015-08-27 07:28:06 +0000
commitf015f872b280d6456f89fc5a1bebf90250eaf338 (patch)
treeb86800ebf06c05a7211a4de92f60fe1e2e68c621 /Build
parenta4fe64f503a9bf54c31c80eddc34475ef9f249d5 (diff)
pdfTeX: Enable and avoid gcc/g++ warnings
git-svn-id: svn://tug.org/texlive/trunk@38216 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/Makefile.in4
-rw-r--r--Build/source/texk/web2c/pdftexdir/ChangeLog6
-rw-r--r--Build/source/texk/web2c/pdftexdir/am/libpdftex.am4
-rw-r--r--Build/source/texk/web2c/pdftexdir/am/pdftosrc.am2
-rw-r--r--Build/source/texk/web2c/pdftexdir/pdftoepdf.cc36
-rw-r--r--Build/source/texk/web2c/pdftexdir/pdftosrc.cc9
-rw-r--r--Build/source/texk/web2c/pdftexdir/tounicode.c4
7 files changed, 37 insertions, 28 deletions
diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in
index 93a0f81839e..abfa6a10611 100644
--- a/Build/source/texk/web2c/Makefile.in
+++ b/Build/source/texk/web2c/Makefile.in
@@ -3114,7 +3114,7 @@ euptex_ch_srcs = \
#
euptex_tests = euptexdir/euptriptest.test euptexdir/pdfprimitive.test
libpdftex_a_CPPFLAGS = $(REGEX_INCLUDES) $(pdftex_cppflags)
-libpdftex_a_CXXFLAGS = # $(WARNING_CXXFLAGS)
+libpdftex_a_CXXFLAGS = $(WARNING_CXXFLAGS)
libpdftex_a_SOURCES = pdftexdir/avl.c pdftexdir/avl.h \
pdftexdir/avlstuff.c pdftexdir/avlstuff.h pdftexdir/epdf.c \
pdftexdir/image.h pdftexdir/mapfile.c pdftexdir/pdftex.h \
@@ -3178,7 +3178,7 @@ ttf2afm_tests = pdftexdir/ttf2afm.test
# Force Automake to use CXXLD for linking
nodist_EXTRA_pdftosrc_SOURCES = dummy.cxx
pdftosrc_CPPFLAGS = $(pdftex_cppflags)
-pdftosrc_CXXFLAGS = # $(WARNING_CXXFLAGS)
+pdftosrc_CXXFLAGS = $(WARNING_CXXFLAGS)
pdftosrc_SOURCES = pdftexdir/pdftosrc.cc
pdftosrc_LDADD = $(pdftex_ldadd) $(LDADD)
pdftosrc_DEPENDENCIES = $(pdftex_dependencies)
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog
index 9e4439dec7b..0a1174b4c35 100644
--- a/Build/source/texk/web2c/pdftexdir/ChangeLog
+++ b/Build/source/texk/web2c/pdftexdir/ChangeLog
@@ -1,3 +1,9 @@
+2015-08-27 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * am/libpdftex.am, am/pdftosrc.am: Enable g++ warnings.
+ * pdftoepdf.cc, pdftosrc.cc: Avoid g++ warnings.
+ * tounicode.c: Avoid gcc warnings.
+
2015-07-28 Peter Breitenlohner <peb@mppmu.mpg.de>
* ptexmac.h: Avoid possible integer overflow.
diff --git a/Build/source/texk/web2c/pdftexdir/am/libpdftex.am b/Build/source/texk/web2c/pdftexdir/am/libpdftex.am
index c7c5042585f..f31df2abf3a 100644
--- a/Build/source/texk/web2c/pdftexdir/am/libpdftex.am
+++ b/Build/source/texk/web2c/pdftexdir/am/libpdftex.am
@@ -1,6 +1,6 @@
## texk/web2c/pdftexdir/am/libpdftex.am: Makefile fragment for libpdftex.
##
-## Copyright (C) 2009-2012 Peter Breitenlohner <tex-live@tug.org>
+## Copyright (C) 2009-2015 Peter Breitenlohner <tex-live@tug.org>
## You may freely use, modify and/or distribute this file.
## libpdftex
@@ -8,7 +8,7 @@
EXTRA_LIBRARIES += libpdftex.a
libpdftex_a_CPPFLAGS = $(REGEX_INCLUDES) $(pdftex_cppflags)
-libpdftex_a_CXXFLAGS = # $(WARNING_CXXFLAGS)
+libpdftex_a_CXXFLAGS = $(WARNING_CXXFLAGS)
libpdftex_a_SOURCES = \
pdftexdir/avl.c \
diff --git a/Build/source/texk/web2c/pdftexdir/am/pdftosrc.am b/Build/source/texk/web2c/pdftexdir/am/pdftosrc.am
index 2c232b8e7f6..1e70468d801 100644
--- a/Build/source/texk/web2c/pdftexdir/am/pdftosrc.am
+++ b/Build/source/texk/web2c/pdftexdir/am/pdftosrc.am
@@ -14,7 +14,7 @@ EXTRA_PROGRAMS += pdftosrc
nodist_EXTRA_pdftosrc_SOURCES = dummy.cxx
pdftosrc_CPPFLAGS = $(pdftex_cppflags)
-pdftosrc_CXXFLAGS = # $(WARNING_CXXFLAGS)
+pdftosrc_CXXFLAGS = $(WARNING_CXXFLAGS)
pdftosrc_SOURCES = pdftexdir/pdftosrc.cc
diff --git a/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc b/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc
index be54069d7bc..a8c4a0221a3 100644
--- a/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc
+++ b/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc
@@ -275,6 +275,7 @@ static int addInObj(InObjType type, Ref ref, fd_entry * fd, int e)
return n->num;
}
+#if 0 /* unusewd */
static int getNewObjectNumber(Ref ref)
{
InObj *p;
@@ -294,6 +295,7 @@ static int getNewObjectNumber(Ref ref)
return -60000;
#endif
}
+#endif
static void copyObject(Object *);
@@ -405,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((char *)"Subtype", &subtype)->isName()
+ && fontdict->dictLookup("Subtype", &subtype)->isName()
&& !strcmp(subtype->getName(), "Type1")
- && fontdict->dictLookup((char *)"BaseFont", &basefont)->isName()
- && fontdict->dictLookupNF((char *)"FontDescriptor", &fontdescRef)->isRef()
+ && fontdict->dictLookup("BaseFont", &basefont)->isName()
+ && fontdict->dictLookupNF("FontDescriptor", &fontdescRef)->isRef()
&& fontdescRef->fetch(xref, &fontdesc)->isDict()
- && (fontdesc->dictLookup((char *)"FontFile", &fontfile)->isStream()
+ && (fontdesc->dictLookup("FontFile", &fontfile)->isStream()
|| (REPLACE_TYPE1C
- && fontdesc->dictLookup((char *)"FontFile3", &fontfile)->isStream()
- && fontfile->streamGetDict()->lookup((char *)"Subtype",
+ && fontdesc->dictLookup("FontFile3", &fontfile)->isStream()
+ && fontfile->streamGetDict()->lookup("Subtype",
&ffsubtype)->isName()
&& !strcmp(ffsubtype->getName(), "Type1C")))
&& (fontmap = lookup_fontmap(basefont->getName())) != NULL) {
// copy the value of /StemV
- fontdesc->dictLookup((char *)"StemV", &stemV);
+ fontdesc->dictLookup("StemV", &stemV);
fd = epdf_create_fontdescriptor(fontmap, stemV->getInt());
- if (fontdesc->dictLookup((char *)"CharSet", &charset) &&
+ if (fontdesc->dictLookup("CharSet", &charset) &&
charset->isString() && is_subsetable(fontmap))
epdf_mark_glyphs(fd, charset->getString()->getCString());
else
@@ -924,13 +926,13 @@ void write_epdf(void)
pdf_puts(stripzeros(s));
// Metadata validity check (as a stream it must be indirect)
- pageDict->lookupNF((char *)"Metadata", &dictObj);
+ pageDict->lookupNF("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((char *)pageDictKeys[i], &dictObj);
+ pageDict->lookupNF(pageDictKeys[i], &dictObj);
if (!dictObj->isNull()) {
pdf_newline();
pdf_printf("/%s ", pageDictKeys[i]);
@@ -939,7 +941,7 @@ void write_epdf(void)
}
// handle page group
- pageDict->lookupNF((char *)"Group", &dictObj);
+ pageDict->lookupNF("Group", &dictObj);
if (!dictObj->isNull()) {
if (pdfpagegroupval == 0) {
// another pdf with page group was included earlier on the
@@ -954,12 +956,12 @@ void write_epdf(void)
copyObject(&dictObj);
} else {
// write Group dict as a separate object, since the Page dict also refers to it
- pageDict->lookup((char *) "Group", &dictObj);
+ pageDict->lookup("Group", &dictObj);
if (!dictObj->isDict())
pdftex_fail("PDF inclusion: /Group dict missing");
writeSepGroup = true;
initDictFromDict(groupDict, page->getGroup());
- pdf_printf("/Group %d 0 R\n", pdfpagegroupval);
+ pdf_printf("/Group %ld 0 R\n", (long)pdfpagegroupval);
}
}
@@ -1003,21 +1005,21 @@ void write_epdf(void)
// Variant B: copy stream without recompressing
//
- contents->streamGetDict()->lookup((char *)"F", &obj1);
+ contents->streamGetDict()->lookup("F", &obj1);
if (!obj1->isNull()) {
pdftex_fail("PDF inclusion: Unsupported external stream");
}
- contents->streamGetDict()->lookup((char *)"Length", &obj1);
+ contents->streamGetDict()->lookup("Length", &obj1);
assert(!obj1->isNull());
pdf_puts("/Length ");
copyObject(&obj1);
pdf_puts("\n");
- contents->streamGetDict()->lookup((char *)"Filter", &obj1);
+ contents->streamGetDict()->lookup("Filter", &obj1);
if (!obj1->isNull()) {
pdf_puts("/Filter ");
copyObject(&obj1);
pdf_puts("\n");
- contents->streamGetDict()->lookup((char *)"DecodeParms", &obj1);
+ contents->streamGetDict()->lookup("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 ef59b1fddb1..42b9e066f5d 100644
--- a/Build/source/texk/web2c/pdftexdir/pdftosrc.cc
+++ b/Build/source/texk/web2c/pdftexdir/pdftosrc.cc
@@ -88,19 +88,20 @@ int main(int argc, char *argv[])
xref = doc->getXRef();
catalogDict.initNull();
xref->getCatalog(&catalogDict);
- if (!catalogDict.isDict((char *)"Catalog")) {
+ if (!catalogDict.isDict("Catalog")) {
fprintf(stderr, "No Catalog found\n");
exit(1);
}
srcStream.initNull();
if (objnum == 0) {
- catalogDict.dictLookup((char *)"SourceObject", &srcStream);
- if (!srcStream.isStream((char *)"SourceFile")) {
+ catalogDict.dictLookup("SourceObject", &srcStream);
+ static char const_SourceFile[] = "SourceFile";
+ if (!srcStream.isStream(const_SourceFile)) {
fprintf(stderr, "No SourceObject found\n");
exit(1);
}
srcName.initNull();
- srcStream.getStream()->getDict()->lookup((char *)"SourceName", &srcName);
+ srcStream.getStream()->getDict()->lookup("SourceName", &srcName);
if (!srcName.isString()) {
fprintf(stderr, "No SourceName found\n");
exit(1);
diff --git a/Build/source/texk/web2c/pdftexdir/tounicode.c b/Build/source/texk/web2c/pdftexdir/tounicode.c
index a246366bf03..16ab10bdae2 100644
--- a/Build/source/texk/web2c/pdftexdir/tounicode.c
+++ b/Build/source/texk/web2c/pdftexdir/tounicode.c
@@ -273,8 +273,8 @@ static void set_glyph_unicode(const char *s, const char* tfmname,
}
/* lookup for glyph name in the main database */
- tmp.name = (char *)s; /* this is okay since we're not calling
- destroy_glyph_unicode_entry on this */
+ snprintf(buf2, SMALL_BUF_SIZE, "%s", s);
+ tmp.name = buf2;
tmp.code = UNI_UNDEF;
ptmp = (glyph_unicode_entry *) avl_find(glyph_unicode_tree, &tmp);
if (ptmp != NULL) {