From a5f8b9e7ccc12dcbae460d5a59acb0f8d7186e71 Mon Sep 17 00:00:00 2001 From: mike Date: Sun, 15 Apr 2001 11:52:49 +0000 Subject: [PATCH] Get rid of compiler warnings. Fix a bug in CCITT stream filter constructor - nstr instead of str used in arg list... git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@1676 7a7537e8-13f0-0310-91df-b6672ffda945 --- berkeley/lpr.c | 8 +-- cups/ipp.c | 6 +- cups/ipp.h | 5 +- filter/image-bmp.c | 6 +- filter/imagetoraster.c | 8 ++- pdftops/FontFile.cxx | 17 ++--- pdftops/Gfx.cxx | 156 ++++++++++++++++++++++++++++++++++++++++ pdftops/GfxFont.cxx | 17 +++-- pdftops/GfxState.cxx | 2 + pdftops/Object.cxx | 2 + pdftops/OutputDev.cxx | 5 ++ pdftops/OutputDev.h | 70 +++++++++--------- pdftops/PSOutputDev.cxx | 19 +++++ pdftops/Stream.cxx | 30 +++++++- pdftops/Stream.h | 16 ++--- pdftops/gfile.cxx | 2 + 16 files changed, 295 insertions(+), 74 deletions(-) diff --git a/berkeley/lpr.c b/berkeley/lpr.c index 2b9edf7f3..f9f4c61ea 100644 --- a/berkeley/lpr.c +++ b/berkeley/lpr.c @@ -1,5 +1,5 @@ /* - * "$Id: lpr.c,v 1.20 2001/02/13 20:37:43 mike Exp $" + * "$Id: lpr.c,v 1.21 2001/04/15 11:52:42 mike Exp $" * * "lpr" command for the Common UNIX Printing System (CUPS). * @@ -82,9 +82,9 @@ main(int argc, /* I - Number of command-line arguments */ int deletefile; /* Delete file after print? */ char buffer[8192]; /* Copy buffer */ int temp; /* Temporary file descriptor */ -#ifdef HAVE_SIGACTION +#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET) struct sigaction action; /* Signal action */ -#endif /* HAVE_SIGACTION */ +#endif /* HAVE_SIGACTION && !HAVE_SIGSET */ deletefile = 0; @@ -421,5 +421,5 @@ sighandler(int s) /* I - Signal number */ /* - * End of "$Id: lpr.c,v 1.20 2001/02/13 20:37:43 mike Exp $". + * End of "$Id: lpr.c,v 1.21 2001/04/15 11:52:42 mike Exp $". */ diff --git a/cups/ipp.c b/cups/ipp.c index 20667a6a9..bb5fc9b56 100644 --- a/cups/ipp.c +++ b/cups/ipp.c @@ -1,5 +1,5 @@ /* - * "$Id: ipp.c,v 1.55 2001/03/30 19:21:30 mike Exp $" + * "$Id: ipp.c,v 1.56 2001/04/15 11:52:43 mike Exp $" * * Internet Printing Protocol support functions for the Common UNIX * Printing System (CUPS). @@ -678,7 +678,7 @@ ippFindAttribute(ipp_t *ipp, /* I - IPP request */ DEBUG_printf(("ippFindAttribute: attr = %p, name = \'%s\'\n", attr, attr->name)); - value_tag = attr->value_tag & ~IPP_TAG_COPY; + value_tag = (ipp_tag_t)(attr->value_tag & IPP_TAG_MASK); if (attr->name != NULL && strcasecmp(attr->name, name) == 0 && (value_tag == type || type == IPP_TAG_ZERO || @@ -1870,5 +1870,5 @@ ipp_read(http_t *http, /* I - Client connection */ /* - * End of "$Id: ipp.c,v 1.55 2001/03/30 19:21:30 mike Exp $". + * End of "$Id: ipp.c,v 1.56 2001/04/15 11:52:43 mike Exp $". */ diff --git a/cups/ipp.h b/cups/ipp.h index a8541329c..9299975e9 100644 --- a/cups/ipp.h +++ b/cups/ipp.h @@ -1,5 +1,5 @@ /* - * "$Id: ipp.h,v 1.36 2001/03/30 19:21:30 mike Exp $" + * "$Id: ipp.h,v 1.37 2001/04/15 11:52:43 mike Exp $" * * Internet Printing Protocol definitions for the Common UNIX Printing * System (CUPS). @@ -105,6 +105,7 @@ typedef enum /**** Format tags for attribute formats... ****/ IPP_TAG_LANGUAGE, IPP_TAG_MIMETYPE, IPP_TAG_MEMBERNAME, + IPP_TAG_MASK = 0x7fffffff, /* Mask for copied attribute values */ IPP_TAG_COPY = 0x80000000 /* Bitflag for copied attribute values */ } ipp_tag_t; @@ -425,5 +426,5 @@ extern void _ipp_free_attr(ipp_attribute_t *); #endif /* !_CUPS_IPP_H_ */ /* - * End of "$Id: ipp.h,v 1.36 2001/03/30 19:21:30 mike Exp $". + * End of "$Id: ipp.h,v 1.37 2001/04/15 11:52:43 mike Exp $". */ diff --git a/filter/image-bmp.c b/filter/image-bmp.c index a0fb4f66f..bdcd3812a 100644 --- a/filter/image-bmp.c +++ b/filter/image-bmp.c @@ -1,5 +1,5 @@ /* - * "$Id: image-bmp.c,v 1.4 2001/04/12 17:25:03 mike Exp $" + * "$Id: image-bmp.c,v 1.5 2001/04/15 11:52:43 mike Exp $" * * BMP image routines for the Common UNIX Printing System (CUPS). * @@ -90,6 +90,8 @@ ImageReadBMP(image_t *img, /* IO - Image */ ib_t colormap[256][4]; /* Colormap */ + (void)secondary; + /* * Get the header... */ @@ -504,5 +506,5 @@ read_long(FILE *fp) /* I - File to read from */ /* - * End of "$Id: image-bmp.c,v 1.4 2001/04/12 17:25:03 mike Exp $". + * End of "$Id: image-bmp.c,v 1.5 2001/04/15 11:52:43 mike Exp $". */ diff --git a/filter/imagetoraster.c b/filter/imagetoraster.c index 323c94dcf..89ca25b3e 100644 --- a/filter/imagetoraster.c +++ b/filter/imagetoraster.c @@ -1,5 +1,5 @@ /* - * "$Id: imagetoraster.c,v 1.56 2001/03/15 17:48:07 mike Exp $" + * "$Id: imagetoraster.c,v 1.57 2001/04/15 11:52:44 mike Exp $" * * Image file to raster filter for the Common UNIX Printing System (CUPS). * @@ -2197,6 +2197,8 @@ format_K(cups_page_header_t *header, /* I - Page header */ *dither; /* Pointer into dither array */ + (void)z; + switch (XPosition) { case -1 : @@ -3461,6 +3463,8 @@ format_W(cups_page_header_t *header, /* I - Page header */ *dither; /* Pointer into dither array */ + (void)z; + switch (XPosition) { case -1 : @@ -4389,5 +4393,5 @@ make_lut(ib_t *lut, /* I - Lookup table */ /* - * End of "$Id: imagetoraster.c,v 1.56 2001/03/15 17:48:07 mike Exp $". + * End of "$Id: imagetoraster.c,v 1.57 2001/04/15 11:52:44 mike Exp $". */ diff --git a/pdftops/FontFile.cxx b/pdftops/FontFile.cxx index 4b2c7ae01..77ba6bdd7 100644 --- a/pdftops/FontFile.cxx +++ b/pdftops/FontFile.cxx @@ -135,7 +135,7 @@ Type1CFontFile::Type1CFontFile(const char *file, int len) { char buf[256]; Guchar *topPtr, *idxStartPtr, *idxPtr0, *idxPtr1; Guchar *stringIdxPtr, *stringStartPtr; - int topOffSize, idxOffSize, stringOffSize; + int idxOffSize, stringOffSize; int nFonts, nStrings, nGlyphs; int nCodes, nRanges, nLeft, nSups; Gushort *glyphNames; @@ -148,13 +148,14 @@ Type1CFontFile::Type1CFontFile(const char *file, int len) { int key; int i, j, n; + (void)len; + name = NULL; encoding = NULL; freeEnc = gTrue; // read header topPtr = (Guchar *)file + (file[2] & 0xff); - topOffSize = file[3] & 0xff; // read name index (first font only) nFonts = getWord(topPtr, 2); @@ -454,7 +455,7 @@ void Type1CFontConverter::convert() { char buf[256], eBuf[256]; Guchar *topPtr, *idxStartPtr, *idxPtr0, *idxPtr1; Guchar *stringIdxPtr, *stringStartPtr; - int topOffSize, idxOffSize, stringOffSize; + int idxOffSize, stringOffSize; int nFonts, nStrings, nGlyphs; int nCodes, nRanges, nLeft, nSups; Gushort *glyphNames; @@ -469,7 +470,6 @@ void Type1CFontConverter::convert() { // read header topPtr = (Guchar *)file + (file[2] & 0xff); - topOffSize = file[3] & 0xff; // read name (first font only) nFonts = getWord(topPtr, 2); @@ -578,15 +578,8 @@ void Type1CFontConverter::convert() { topPtr = stringStartPtr + getWord(topPtr + nStrings * stringOffSize, stringOffSize); -#if 1 //~ - // get global subrs - int nGSubrs; - int gSubrOffSize; - - nGSubrs = getWord(topPtr, 2); - gSubrOffSize = topPtr[2]; + // skip global subrs topPtr += 3; -#endif // write header and font dictionary, up to encoding fprintf(out, "%%!FontType1-1.0: %s", fontName); diff --git a/pdftops/Gfx.cxx b/pdftops/Gfx.cxx index 8b68828b6..17b6c5826 100644 --- a/pdftops/Gfx.cxx +++ b/pdftops/Gfx.cxx @@ -499,11 +499,17 @@ void Gfx::lookupColorSpace(const char *name, Object *obj) { //------------------------------------------------------------------------ void Gfx::opSave(Object args[], int numArgs) { + (void)args; + (void)numArgs; + out->saveState(state); state = state->save(); } void Gfx::opRestore(Object args[], int numArgs) { + (void)args; + (void)numArgs; + state = state->restore(); out->restoreState(state); @@ -515,6 +521,8 @@ void Gfx::opRestore(Object args[], int numArgs) { } void Gfx::opConcat(Object args[], int numArgs) { + (void)numArgs; + state->concatCTM(args[0].getNum(), args[1].getNum(), args[2].getNum(), args[3].getNum(), args[4].getNum(), args[5].getNum()); @@ -531,6 +539,8 @@ void Gfx::opSetDash(Object args[], int numArgs) { double *dash; int i; + (void)numArgs; + a = args[0].getArray(); length = a->getLength(); if (length == 0) { @@ -547,34 +557,48 @@ void Gfx::opSetDash(Object args[], int numArgs) { } void Gfx::opSetFlat(Object args[], int numArgs) { + (void)numArgs; + state->setFlatness((int)args[0].getNum()); out->updateFlatness(state); } void Gfx::opSetLineJoin(Object args[], int numArgs) { + (void)numArgs; + state->setLineJoin(args[0].getInt()); out->updateLineJoin(state); } void Gfx::opSetLineCap(Object args[], int numArgs) { + (void)numArgs; + state->setLineCap(args[0].getInt()); out->updateLineCap(state); } void Gfx::opSetMiterLimit(Object args[], int numArgs) { + (void)numArgs; + state->setMiterLimit(args[0].getNum()); out->updateMiterLimit(state); } void Gfx::opSetLineWidth(Object args[], int numArgs) { + (void)numArgs; + state->setLineWidth(args[0].getNum()); out->updateLineWidth(state); } void Gfx::opSetExtGState(Object args[], int numArgs) { + (void)args; + (void)numArgs; } void Gfx::opSetRenderingIntent(Object args[], int numArgs) { + (void)args; + (void)numArgs; } //------------------------------------------------------------------------ @@ -582,18 +606,24 @@ void Gfx::opSetRenderingIntent(Object args[], int numArgs) { //------------------------------------------------------------------------ void Gfx::opSetFillGray(Object args[], int numArgs) { + (void)numArgs; + state->setFillColorSpace(new GfxColorSpace(colorGray)); state->setFillGray(args[0].getNum()); out->updateFillColor(state); } void Gfx::opSetStrokeGray(Object args[], int numArgs) { + (void)numArgs; + state->setStrokeColorSpace(new GfxColorSpace(colorGray)); state->setStrokeGray(args[0].getNum()); out->updateStrokeColor(state); } void Gfx::opSetFillCMYKColor(Object args[], int numArgs) { + (void)numArgs; + state->setFillColorSpace(new GfxColorSpace(colorCMYK)); state->setFillCMYK(args[0].getNum(), args[1].getNum(), args[2].getNum(), args[3].getNum()); @@ -601,6 +631,8 @@ void Gfx::opSetFillCMYKColor(Object args[], int numArgs) { } void Gfx::opSetStrokeCMYKColor(Object args[], int numArgs) { + (void)numArgs; + state->setStrokeColorSpace(new GfxColorSpace(colorCMYK)); state->setStrokeCMYK(args[0].getNum(), args[1].getNum(), args[2].getNum(), args[3].getNum()); @@ -608,12 +640,16 @@ void Gfx::opSetStrokeCMYKColor(Object args[], int numArgs) { } void Gfx::opSetFillRGBColor(Object args[], int numArgs) { + (void)numArgs; + state->setFillColorSpace(new GfxColorSpace(colorRGB)); state->setFillRGB(args[0].getNum(), args[1].getNum(), args[2].getNum()); out->updateFillColor(state); } void Gfx::opSetStrokeRGBColor(Object args[], int numArgs) { + (void)numArgs; + state->setStrokeColorSpace(new GfxColorSpace(colorRGB)); state->setStrokeRGB(args[0].getNum(), args[1].getNum(), args[2].getNum()); out->updateStrokeColor(state); @@ -624,6 +660,8 @@ void Gfx::opSetFillColorSpace(Object args[], int numArgs) { GfxColorSpace *colorSpace; double x[4]; + (void)numArgs; + lookupColorSpace(args[0].getName(), &obj); if (obj.isNull()) colorSpace = new GfxColorSpace(&args[0]); @@ -646,6 +684,8 @@ void Gfx::opSetStrokeColorSpace(Object args[], int numArgs) { GfxColorSpace *colorSpace; double x[4]; + (void)numArgs; + lookupColorSpace(args[0].getName(), &obj); if (obj.isNull()) colorSpace = new GfxColorSpace(&args[0]); @@ -720,10 +760,14 @@ void Gfx::opSetStrokeColorN(Object args[], int numArgs) { //------------------------------------------------------------------------ void Gfx::opMoveTo(Object args[], int numArgs) { + (void)numArgs; + state->moveTo(args[0].getNum(), args[1].getNum()); } void Gfx::opLineTo(Object args[], int numArgs) { + (void)numArgs; + if (!state->isCurPt()) { error(getPos(), "No current point in lineto"); return; @@ -734,6 +778,8 @@ void Gfx::opLineTo(Object args[], int numArgs) { void Gfx::opCurveTo(Object args[], int numArgs) { double x1, y1, x2, y2, x3, y3; + (void)numArgs; + if (!state->isCurPt()) { error(getPos(), "No current point in curveto"); return; @@ -750,6 +796,8 @@ void Gfx::opCurveTo(Object args[], int numArgs) { void Gfx::opCurveTo1(Object args[], int numArgs) { double x1, y1, x2, y2, x3, y3; + (void)numArgs; + if (!state->isCurPt()) { error(getPos(), "No current point in curveto1"); return; @@ -766,6 +814,8 @@ void Gfx::opCurveTo1(Object args[], int numArgs) { void Gfx::opCurveTo2(Object args[], int numArgs) { double x1, y1, x2, y2, x3, y3; + (void)numArgs; + if (!state->isCurPt()) { error(getPos(), "No current point in curveto2"); return; @@ -782,6 +832,8 @@ void Gfx::opCurveTo2(Object args[], int numArgs) { void Gfx::opRectangle(Object args[], int numArgs) { double x, y, w, h; + (void)numArgs; + x = args[0].getNum(); y = args[1].getNum(); w = args[2].getNum(); @@ -794,6 +846,9 @@ void Gfx::opRectangle(Object args[], int numArgs) { } void Gfx::opClosePath(Object args[], int numArgs) { + (void)args; + (void)numArgs; + if (!state->isPath()) { error(getPos(), "No current point in closepath"); return; @@ -806,10 +861,16 @@ void Gfx::opClosePath(Object args[], int numArgs) { //------------------------------------------------------------------------ void Gfx::opEndPath(Object args[], int numArgs) { + (void)args; + (void)numArgs; + doEndPath(); } void Gfx::opStroke(Object args[], int numArgs) { + (void)args; + (void)numArgs; + if (!state->isCurPt()) { //error(getPos(), "No path in stroke"); return; @@ -820,6 +881,9 @@ void Gfx::opStroke(Object args[], int numArgs) { } void Gfx::opCloseStroke(Object args[], int numArgs) { + (void)args; + (void)numArgs; + if (!state->isCurPt()) { //error(getPos(), "No path in closepath/stroke"); return; @@ -832,6 +896,9 @@ void Gfx::opCloseStroke(Object args[], int numArgs) { } void Gfx::opFill(Object args[], int numArgs) { + (void)args; + (void)numArgs; + if (!state->isCurPt()) { //error(getPos(), "No path in fill"); return; @@ -842,6 +909,9 @@ void Gfx::opFill(Object args[], int numArgs) { } void Gfx::opEOFill(Object args[], int numArgs) { + (void)args; + (void)numArgs; + if (!state->isCurPt()) { //error(getPos(), "No path in eofill"); return; @@ -852,6 +922,9 @@ void Gfx::opEOFill(Object args[], int numArgs) { } void Gfx::opFillStroke(Object args[], int numArgs) { + (void)args; + (void)numArgs; + if (!state->isCurPt()) { //error(getPos(), "No path in fill/stroke"); return; @@ -864,6 +937,9 @@ void Gfx::opFillStroke(Object args[], int numArgs) { } void Gfx::opCloseFillStroke(Object args[], int numArgs) { + (void)args; + (void)numArgs; + if (!state->isCurPt()) { //error(getPos(), "No path in closepath/fill/stroke"); return; @@ -877,6 +953,9 @@ void Gfx::opCloseFillStroke(Object args[], int numArgs) { } void Gfx::opEOFillStroke(Object args[], int numArgs) { + (void)args; + (void)numArgs; + if (!state->isCurPt()) { //error(getPos(), "No path in eofill/stroke"); return; @@ -889,6 +968,9 @@ void Gfx::opEOFillStroke(Object args[], int numArgs) { } void Gfx::opCloseEOFillStroke(Object args[], int numArgs) { + (void)args; + (void)numArgs; + if (!state->isCurPt()) { //error(getPos(), "No path in closepath/eofill/stroke"); return; @@ -902,6 +984,8 @@ void Gfx::opCloseEOFillStroke(Object args[], int numArgs) { } void Gfx::opShFill(Object args[], int numArgs) { + (void)args; + (void)numArgs; } void Gfx::doEndPath() { @@ -920,10 +1004,16 @@ void Gfx::doEndPath() { //------------------------------------------------------------------------ void Gfx::opClip(Object args[], int numArgs) { + (void)args; + (void)numArgs; + clip = clipNormal; } void Gfx::opEOClip(Object args[], int numArgs) { + (void)args; + (void)numArgs; + clip = clipEO; } @@ -932,6 +1022,9 @@ void Gfx::opEOClip(Object args[], int numArgs) { //------------------------------------------------------------------------ void Gfx::opBeginText(Object args[], int numArgs) { + (void)args; + (void)numArgs; + state->setTextMat(1, 0, 0, 1, 0, 0); state->textMoveTo(0, 0); out->updateTextMat(state); @@ -940,6 +1033,8 @@ void Gfx::opBeginText(Object args[], int numArgs) { } void Gfx::opEndText(Object args[], int numArgs) { + (void)args; + (void)numArgs; } //------------------------------------------------------------------------ @@ -947,6 +1042,9 @@ void Gfx::opEndText(Object args[], int numArgs) { //------------------------------------------------------------------------ void Gfx::opSetCharSpacing(Object args[], int numArgs) { + (void)args; + (void)numArgs; + state->setCharSpace(args[0].getNum()); out->updateCharSpace(state); } @@ -954,6 +1052,8 @@ void Gfx::opSetCharSpacing(Object args[], int numArgs) { void Gfx::opSetFont(Object args[], int numArgs) { GfxFont *font; + (void)numArgs; + if (!(font = lookupFont(args[0].getName()))) return; if (printCommands) { @@ -966,25 +1066,35 @@ void Gfx::opSetFont(Object args[], int numArgs) { } void Gfx::opSetTextLeading(Object args[], int numArgs) { + (void)numArgs; + state->setLeading(args[0].getNum()); } void Gfx::opSetTextRender(Object args[], int numArgs) { + (void)numArgs; + state->setRender(args[0].getInt()); out->updateRender(state); } void Gfx::opSetTextRise(Object args[], int numArgs) { + (void)numArgs; + state->setRise(args[0].getNum()); out->updateRise(state); } void Gfx::opSetWordSpacing(Object args[], int numArgs) { + (void)numArgs; + state->setWordSpace(args[0].getNum()); out->updateWordSpace(state); } void Gfx::opSetHorizScaling(Object args[], int numArgs) { + (void)numArgs; + state->setHorizScaling(args[0].getNum()); out->updateHorizScaling(state); } @@ -996,6 +1106,8 @@ void Gfx::opSetHorizScaling(Object args[], int numArgs) { void Gfx::opTextMove(Object args[], int numArgs) { double tx, ty; + (void)numArgs; + tx = state->getLineX() + args[0].getNum(); ty = state->getLineY() + args[1].getNum(); state->textMoveTo(tx, ty); @@ -1005,6 +1117,8 @@ void Gfx::opTextMove(Object args[], int numArgs) { void Gfx::opTextMoveSet(Object args[], int numArgs) { double tx, ty; + (void)numArgs; + tx = state->getLineX() + args[0].getNum(); ty = args[1].getNum(); state->setLeading(-ty); @@ -1014,6 +1128,8 @@ void Gfx::opTextMoveSet(Object args[], int numArgs) { } void Gfx::opSetTextMatrix(Object args[], int numArgs) { + (void)numArgs; + state->setTextMat(args[0].getNum(), args[1].getNum(), args[2].getNum(), args[3].getNum(), args[4].getNum(), args[5].getNum()); @@ -1026,6 +1142,9 @@ void Gfx::opSetTextMatrix(Object args[], int numArgs) { void Gfx::opTextNextLine(Object args[], int numArgs) { double tx, ty; + (void)args; + (void)numArgs; + tx = state->getLineX(); ty = state->getLineY() - state->getLeading(); state->textMoveTo(tx, ty); @@ -1037,6 +1156,8 @@ void Gfx::opTextNextLine(Object args[], int numArgs) { //------------------------------------------------------------------------ void Gfx::opShowText(Object args[], int numArgs) { + (void)numArgs; + if (!state->getFont()) { error(getPos(), "No font in show"); return; @@ -1047,6 +1168,8 @@ void Gfx::opShowText(Object args[], int numArgs) { void Gfx::opMoveShowText(Object args[], int numArgs) { double tx, ty; + (void)numArgs; + if (!state->getFont()) { error(getPos(), "No font in move/show"); return; @@ -1061,6 +1184,8 @@ void Gfx::opMoveShowText(Object args[], int numArgs) { void Gfx::opMoveSetShowText(Object args[], int numArgs) { double tx, ty; + (void)numArgs; + if (!state->getFont()) { error(getPos(), "No font in move/set/show"); return; @@ -1081,6 +1206,8 @@ void Gfx::opShowSpaceText(Object args[], int numArgs) { Object obj; int i; + (void)numArgs; + if (!state->getFont()) { error(getPos(), "No font in show/space"); return; @@ -1296,6 +1423,8 @@ void Gfx::opXObject(Object args[], int numArgs) { Object opiDict; #endif + (void)numArgs; + if (!lookupXObject(args[0].getName(), &obj1)) return; if (!obj1.isStream()) { @@ -1611,6 +1740,9 @@ void Gfx::opBeginImage(Object args[], int numArgs) { Stream *str; int c1, c2; + (void)args; + (void)numArgs; + // build dict/stream str = buildImageStream(); @@ -1665,10 +1797,16 @@ Stream *Gfx::buildImageStream() { } void Gfx::opImageData(Object args[], int numArgs) { + (void)args; + (void)numArgs; + error(getPos(), "Internal: got 'ID' operator"); } void Gfx::opEndImage(Object args[], int numArgs) { + (void)args; + (void)numArgs; + error(getPos(), "Internal: got 'EI' operator"); } @@ -1677,10 +1815,16 @@ void Gfx::opEndImage(Object args[], int numArgs) { //------------------------------------------------------------------------ void Gfx::opSetCharWidth(Object args[], int numArgs) { + (void)args; + (void)numArgs; + error(getPos(), "Encountered 'd0' operator in content stream"); } void Gfx::opSetCacheDevice(Object args[], int numArgs) { + (void)args; + (void)numArgs; + error(getPos(), "Encountered 'd1' operator in content stream"); } @@ -1689,10 +1833,16 @@ void Gfx::opSetCacheDevice(Object args[], int numArgs) { //------------------------------------------------------------------------ void Gfx::opBeginIgnoreUndef(Object args[], int numArgs) { + (void)args; + (void)numArgs; + ++ignoreUndef; } void Gfx::opEndIgnoreUndef(Object args[], int numArgs) { + (void)args; + (void)numArgs; + if (ignoreUndef > 0) --ignoreUndef; } @@ -1702,6 +1852,8 @@ void Gfx::opEndIgnoreUndef(Object args[], int numArgs) { //------------------------------------------------------------------------ void Gfx::opBeginMarkedContent(Object args[], int numArgs) { + (void)numArgs; + if (printCommands) { printf(" marked content: %s ", args[0].getName()); if (numArgs == 2) @@ -1711,9 +1863,13 @@ void Gfx::opBeginMarkedContent(Object args[], int numArgs) { } void Gfx::opEndMarkedContent(Object args[], int numArgs) { + (void)args; + (void)numArgs; } void Gfx::opMarkPoint(Object args[], int numArgs) { + (void)numArgs; + if (printCommands) { printf(" mark point: %s ", args[0].getName()); if (numArgs == 2) diff --git a/pdftops/GfxFont.cxx b/pdftops/GfxFont.cxx index 0a56d1b70..2a2251f8c 100644 --- a/pdftops/GfxFont.cxx +++ b/pdftops/GfxFont.cxx @@ -37,10 +37,12 @@ //------------------------------------------------------------------------ +#if defined(JAPANESE_SUPPORT) || defined(CHINESE_SUPPORT) extern "C" { static int cmpWidthExcep(const void *w1, const void *w2); static int cmpWidthExcepV(const void *w1, const void *w2); } +#endif /* JAPANESE_SUPPORT || CHINESE_SUPPORT */ //------------------------------------------------------------------------ @@ -650,8 +652,10 @@ void GfxFont::makeWidths(Dict *fontDict, FontEncoding *builtinEncoding, void GfxFont::getType0EncAndWidths(Dict *fontDict) { Object obj1, obj2, obj3, obj4, obj5, obj6, obj7, obj8; +#if defined(JAPANESE_SUPPORT) || defined(CHINESE_SUPPORT) int excepsSize; int i, j, k, n; +#endif /* JAPANESE_SUPPORT || CHINESE_SUPPORT */ widths16.exceps = NULL; widths16.excepsV = NULL; @@ -704,6 +708,8 @@ void GfxFont::getType0EncAndWidths(Dict *fontDict) { error(-1, "Unknown Type 0 character set"); goto err4; } + +#if defined(JAPANESE_SUPPORT) || defined(CHINESE_SUPPORT) obj5.free(); obj4.free(); obj3.free(); @@ -895,7 +901,7 @@ void GfxFont::getType0EncAndWidths(Dict *fontDict) { error(-1, "Bad encoding for Type 0 font"); goto err1; } -#if JAPANESE_SUPPORT +# if JAPANESE_SUPPORT if (enc16.charSet == font16AdobeJapan12) { for (i = 0; gfxJapan12Tab[i].name; ++i) { if (!strcmp(obj1.getName(), gfxJapan12Tab[i].name)) @@ -908,8 +914,8 @@ void GfxFont::getType0EncAndWidths(Dict *fontDict) { } enc16.enc = gfxJapan12Tab[i].enc; } -#endif -#if CHINESE_SUPPORT +# endif +# if CHINESE_SUPPORT if (enc16.charSet == font16AdobeGB12) { for (i = 0; gfxGB12Tab[i].name; ++i) { if (!strcmp(obj1.getName(), gfxGB12Tab[i].name)) @@ -922,10 +928,11 @@ void GfxFont::getType0EncAndWidths(Dict *fontDict) { } enc16.enc = gfxGB12Tab[i].enc; } -#endif +# endif obj1.free(); return; +#endif /* JAPANESE_SUPPORT || CHINESE_SUPPORT */ err4: obj5.free(); @@ -941,6 +948,7 @@ void GfxFont::getType0EncAndWidths(Dict *fontDict) { makeWidths(fontDict, NULL, NULL, 0); } +#if defined(JAPANESE_SUPPORT) || defined(CHINESE_SUPPORT) static int cmpWidthExcep(const void *w1, const void *w2) { return ((GfxFontWidthExcep *)w1)->first - ((GfxFontWidthExcep *)w2)->first; } @@ -948,6 +956,7 @@ static int cmpWidthExcep(const void *w1, const void *w2) { static int cmpWidthExcepV(const void *w1, const void *w2) { return ((GfxFontWidthExcepV *)w1)->first - ((GfxFontWidthExcepV *)w2)->first; } +#endif /* JAPANESE_SUPPORT || CHINESE_SUPPORT */ //------------------------------------------------------------------------ // GfxFontDict diff --git a/pdftops/GfxState.cxx b/pdftops/GfxState.cxx index 0d191eaa0..8371d27a5 100644 --- a/pdftops/GfxState.cxx +++ b/pdftops/GfxState.cxx @@ -79,6 +79,8 @@ void GfxColor::setLab(double L, double a, double bb, LabParams *params) { double X, Y, Z; double t1, t2; + (void)params; + // convert L*a*b* to CIE 1931 XYZ color space // (This ignores the white point parameter, because I don't // understand exactly how it should work.) diff --git a/pdftops/Object.cxx b/pdftops/Object.cxx index b488c3467..b3ebe40f0 100644 --- a/pdftops/Object.cxx +++ b/pdftops/Object.cxx @@ -216,5 +216,7 @@ void Object::memCheck(FILE *f) { fprintf(f, " %-20s: %6d\n", objTypeNames[i], numAlloc[i]); } } +#else + (void)f; #endif } diff --git a/pdftops/OutputDev.cxx b/pdftops/OutputDev.cxx index 16e0ad96d..b28b205a4 100644 --- a/pdftops/OutputDev.cxx +++ b/pdftops/OutputDev.cxx @@ -62,6 +62,9 @@ void OutputDev::drawImageMask(GfxState *state, Stream *str, GBool inlineImg) { int i, j; + (void)state; + (void)invert; + if (inlineImg) { str->reset(); j = height * ((width + 7) / 8); @@ -75,6 +78,8 @@ void OutputDev::drawImage(GfxState *state, Stream *str, int width, GBool inlineImg) { int i, j; + (void)state; + if (inlineImg) { str->reset(); j = height * ((width * colorMap->getNumPixelComps() * diff --git a/pdftops/OutputDev.h b/pdftops/OutputDev.h index 6d11ae8e5..575fc00c5 100644 --- a/pdftops/OutputDev.h +++ b/pdftops/OutputDev.h @@ -51,7 +51,7 @@ public: virtual void setDefaultCTM(double *ctm1); // Start a page. - virtual void startPage(int pageNum, GfxState *state) {} + virtual void startPage(int, GfxState *) {} // End a page. virtual void endPage() {} @@ -66,54 +66,52 @@ public: virtual void cvtUserToDev(double ux, double uy, int *dx, int *dy); //----- link borders - virtual void drawLink(Link *link, Catalog *catalog) {} + virtual void drawLink(Link *, Catalog *) {} //----- save/restore graphics state - virtual void saveState(GfxState *state) {} - virtual void restoreState(GfxState *state) {} + virtual void saveState(GfxState *) {} + virtual void restoreState(GfxState *) {} //----- update graphics state virtual void updateAll(GfxState *state); - virtual void updateCTM(GfxState *state, double m11, double m12, - double m21, double m22, double m31, double m32) {} - virtual void updateLineDash(GfxState *state) {} - virtual void updateFlatness(GfxState *state) {} - virtual void updateLineJoin(GfxState *state) {} - virtual void updateLineCap(GfxState *state) {} - virtual void updateMiterLimit(GfxState *state) {} - virtual void updateLineWidth(GfxState *state) {} - virtual void updateFillColor(GfxState *state) {} - virtual void updateStrokeColor(GfxState *state) {} + virtual void updateCTM(GfxState *, double, double, + double, double, double, double) {} + virtual void updateLineDash(GfxState *) {} + virtual void updateFlatness(GfxState *) {} + virtual void updateLineJoin(GfxState *) {} + virtual void updateLineCap(GfxState *) {} + virtual void updateMiterLimit(GfxState *) {} + virtual void updateLineWidth(GfxState *) {} + virtual void updateFillColor(GfxState *) {} + virtual void updateStrokeColor(GfxState *) {} //----- update text state - virtual void updateFont(GfxState *state) {} - virtual void updateTextMat(GfxState *state) {} - virtual void updateCharSpace(GfxState *state) {} - virtual void updateRender(GfxState *state) {} - virtual void updateRise(GfxState *state) {} - virtual void updateWordSpace(GfxState *state) {} - virtual void updateHorizScaling(GfxState *state) {} - virtual void updateTextPos(GfxState *state) {} - virtual void updateTextShift(GfxState *state, double shift) {} + virtual void updateFont(GfxState *) {} + virtual void updateTextMat(GfxState *) {} + virtual void updateCharSpace(GfxState *) {} + virtual void updateRender(GfxState *) {} + virtual void updateRise(GfxState *) {} + virtual void updateWordSpace(GfxState *) {} + virtual void updateHorizScaling(GfxState *) {} + virtual void updateTextPos(GfxState *) {} + virtual void updateTextShift(GfxState *, double) {} //----- path painting - virtual void stroke(GfxState *state) {} - virtual void fill(GfxState *state) {} - virtual void eoFill(GfxState *state) {} + virtual void stroke(GfxState *) {} + virtual void fill(GfxState *) {} + virtual void eoFill(GfxState *) {} //----- path clipping - virtual void clip(GfxState *state) {} - virtual void eoClip(GfxState *state) {} + virtual void clip(GfxState *) {} + virtual void eoClip(GfxState *) {} //----- text drawing - virtual void beginString(GfxState *state, GString *s) {} - virtual void endString(GfxState *state) {} - virtual void drawChar(GfxState *state, double x, double y, - double dx, double dy, Guchar c) {} - virtual void drawChar16(GfxState *state, double x, double y, - double dx, double dy, int c) {} - virtual void drawString(GfxState *state, GString *s) {} - virtual void drawString16(GfxState *state, GString *s) {} + virtual void beginString(GfxState *, GString *) {} + virtual void endString(GfxState *) {} + virtual void drawChar(GfxState *, double, double, double, double, Guchar) {} + virtual void drawChar16(GfxState *, double, double, double, double, int) {} + virtual void drawString(GfxState *, GString *) {} + virtual void drawString16(GfxState *, GString *) {} //----- image drawing virtual void drawImageMask(GfxState *state, Stream *str, diff --git a/pdftops/PSOutputDev.cxx b/pdftops/PSOutputDev.cxx index 9b8d03b89..482ef4ef7 100644 --- a/pdftops/PSOutputDev.cxx +++ b/pdftops/PSOutputDev.cxx @@ -919,15 +919,21 @@ void PSOutputDev::endPage() { } void PSOutputDev::saveState(GfxState *state) { + (void)state; + writePS("q\n"); } void PSOutputDev::restoreState(GfxState *state) { + (void)state; + writePS("Q\n"); } void PSOutputDev::updateCTM(GfxState *state, double m11, double m12, double m21, double m22, double m31, double m32) { + (void)state; + writePS("[%g %g %g %g %g %g] cm\n", m11, m12, m21, m22, m31, m32); } @@ -1032,6 +1038,8 @@ void PSOutputDev::updateTextPos(GfxState *state) { } void PSOutputDev::updateTextShift(GfxState *state, double shift) { + (void)state; + writePS("%g TJm\n", shift); } @@ -1126,9 +1134,13 @@ void PSOutputDev::drawString(GfxState *state, GString *s) { } void PSOutputDev::drawString16(GfxState *state, GString *s) { +#if defined(JAPANESE_SUPPORT) || defined(CHINESE_SUPPORT) int c1, c2; double w; int i; +#else + (void)s; +#endif /* JAPANESE_SUPPORT || CHINESE_SUPPORT */ // check for invisible text -- this is used by Acrobat Capture if ((state->getRender() & 3) == 3) @@ -1168,6 +1180,8 @@ void PSOutputDev::drawImageMask(GfxState *state, Stream *str, GBool inlineImg) { int len; + (void)state; + len = height * ((width + 7) / 8); if (psOutLevel1) doImageL1(NULL, invert, inlineImg, str, width, height, len); @@ -1180,6 +1194,8 @@ void PSOutputDev::drawImage(GfxState *state, Stream *str, int width, GBool inlineImg) { int len; + (void)state; + len = height * ((width * colorMap->getNumPixelComps() * colorMap->getBits() + 7) / 8); if (psOutLevel1) @@ -1196,6 +1212,9 @@ void PSOutputDev::doImageL1(GfxImageColorMap *colorMap, GfxColor color; int x, y, i; + (void)inlineImg; + (void)len; + // width, height, matrix, bits per component if (colorMap) { writePS("%d %d 8 [%d 0 0 %d 0 %d] pdfIm1\n", diff --git a/pdftops/Stream.cxx b/pdftops/Stream.cxx index 1137d05f6..d627f7a2d 100644 --- a/pdftops/Stream.cxx +++ b/pdftops/Stream.cxx @@ -86,6 +86,8 @@ char *Stream::getLine(char *buf, int size) { } GString *Stream::getPSFilter(const char *indent) { + (void)indent; + return new GString(); } @@ -295,6 +297,8 @@ FilterStream::~FilterStream() { } void FilterStream::setPos(int pos) { + (void)pos; + error(-1, "Internal: called setPos() on FilterStream"); } @@ -639,11 +643,17 @@ EmbedStream::~EmbedStream() { } Stream *EmbedStream::makeSubStream(int start, int length, Object *ndict) { + (void)start; + (void)length; + (void)ndict; + error(-1, "Internal: called makeSubStream() on EmbedStream"); return NULL; } void EmbedStream::setPos(int pos) { + (void)pos; + error(-1, "Internal: called setPos() on EmbedStream"); } @@ -653,6 +663,8 @@ int EmbedStream::getStart() { } void EmbedStream::moveStart(int start) { + (void)start; + error(-1, "Internal: called moveStart() on EmbedStream"); } @@ -738,6 +750,8 @@ GString *ASCIIHexStream::getPSFilter(const char *indent) { } GBool ASCIIHexStream::isBinary(GBool last) { + (void)last; + return str->isBinary(gFalse); } @@ -814,6 +828,8 @@ GString *ASCII85Stream::getPSFilter(const char *indent) { } GBool ASCII85Stream::isBinary(GBool last) { + (void)last; + return str->isBinary(gFalse); } @@ -1129,6 +1145,8 @@ GString *LZWStream::getPSFilter(const char *indent) { } GBool LZWStream::isBinary(GBool last) { + (void)last; + return str->isBinary(gTrue); } @@ -1161,6 +1179,8 @@ GString *RunLengthStream::getPSFilter(const char *indent) { } GBool RunLengthStream::isBinary(GBool last) { + (void)last; + return str->isBinary(gTrue); } @@ -1194,7 +1214,7 @@ GBool RunLengthStream::fillBuf() { // CCITTFaxStream //------------------------------------------------------------------------ -CCITTFaxStream::CCITTFaxStream(Stream *nstr, int nencoding, GBool nendOfLine, +CCITTFaxStream::CCITTFaxStream(Stream *str, int nencoding, GBool nendOfLine, GBool nbyteAlign, int ncolumns, int nrows, GBool nendOfBlock, GBool nblack): FilterStream(str) { @@ -1724,6 +1744,8 @@ GString *CCITTFaxStream::getPSFilter(const char *indent) { } GBool CCITTFaxStream::isBinary(GBool last) { + (void)last; + return str->isBinary(gTrue); } @@ -2691,6 +2713,8 @@ GString *DCTStream::getPSFilter(const char *indent) { } GBool DCTStream::isBinary(GBool last) { + (void)last; + return str->isBinary(gTrue); } @@ -2866,10 +2890,14 @@ int FlateStream::getRawChar() { } GString *FlateStream::getPSFilter(const char *indent) { + (void)indent; + return NULL; } GBool FlateStream::isBinary(GBool last) { + (void)last; + return str->isBinary(gTrue); } diff --git a/pdftops/Stream.h b/pdftops/Stream.h index 84135bcbc..f7a2a2608 100644 --- a/pdftops/Stream.h +++ b/pdftops/Stream.h @@ -623,8 +623,8 @@ public: virtual void reset() {} virtual int getChar() { return EOF; } virtual int lookChar() { return EOF; } - virtual GString *getPSFilter(const char *indent) { return NULL; } - virtual GBool isBinary(GBool last = gTrue) { return gFalse; } + virtual GString *getPSFilter(const char *indent) { (void)indent; return NULL; } + virtual GBool isBinary(GBool last = gTrue) { (void)last; return gFalse; } }; //------------------------------------------------------------------------ @@ -640,8 +640,8 @@ public: virtual void reset(); virtual int getChar(); virtual int lookChar(); - virtual GString *getPSFilter(const char *indent) { return NULL; } - virtual GBool isBinary(GBool last = gTrue) { return gFalse; } + virtual GString *getPSFilter(const char *indent) { (void)indent; return NULL; } + virtual GBool isBinary(GBool last = gTrue) { (void)last; return gFalse; } virtual GBool isEncoder() { return gTrue; } private: @@ -665,8 +665,8 @@ public: { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); } virtual int lookChar() { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); } - virtual GString *getPSFilter(const char *indent) { return NULL; } - virtual GBool isBinary(GBool last = gTrue) { return gFalse; } + virtual GString *getPSFilter(const char *indent) { (void)indent; return NULL; } + virtual GBool isBinary(GBool last = gTrue) { (void)last; return gFalse; } virtual GBool isEncoder() { return gTrue; } private: @@ -695,8 +695,8 @@ public: { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); } virtual int lookChar() { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); } - virtual GString *getPSFilter(const char *indent) { return NULL; } - virtual GBool isBinary(GBool last = gTrue) { return gFalse; } + virtual GString *getPSFilter(const char *indent) { (void)indent; return NULL; } + virtual GBool isBinary(GBool last = gTrue) { (void)last; return gFalse; } virtual GBool isEncoder() { return gTrue; } private: diff --git a/pdftops/gfile.cxx b/pdftops/gfile.cxx index 9697481cc..394f503ab 100644 --- a/pdftops/gfile.cxx +++ b/pdftops/gfile.cxx @@ -411,6 +411,8 @@ GBool openTempFile(GString **name, FILE **f, const char *mode, const char *ext) int fd; // File descriptor... + (void)ext; + // Use the CUPS temporary file function on all platforms... if ((fd = cupsTempFd(filename, sizeof(filename))) < 0) return (gFalse); -- 2.39.5