author | simon <simon> | 2002-11-08 15:20:59 (UTC) |
---|---|---|
committer | simon <simon> | 2002-11-08 15:20:59 (UTC) |
commit | d8ac5b68b504536136347547816992b1cf605cd4 (patch) (side-by-side diff) | |
tree | 7e90b9c23b78c7c67b5433bebd6a29e3e98e4bac | |
parent | 447735be20fad2642617e3ba4f7ef0b598f597db (diff) | |
download | opie-d8ac5b68b504536136347547816992b1cf605cd4.zip opie-d8ac5b68b504536136347547816992b1cf605cd4.tar.gz opie-d8ac5b68b504536136347547816992b1cf605cd4.tar.bz2 |
- a couple of fixes like this one:
- fprintf(f, "%g", real);
+ fprintf(f, "%g", static_cast<double>(real));
with 'real' being a fouble object. as fprintf is a c function with variable
arguments one cannot pass non-primitive objects through it and there is
no way for the compiler to figure out the right conversion operator, so
we give it a helping hand :)
-rw-r--r-- | noncore/unsupported/qpdf/xpdf/Gfx.cc | 2 | ||||
-rw-r--r-- | noncore/unsupported/qpdf/xpdf/Object.cc | 2 | ||||
-rw-r--r-- | noncore/unsupported/qpdf/xpdf/Page.cc | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/noncore/unsupported/qpdf/xpdf/Gfx.cc b/noncore/unsupported/qpdf/xpdf/Gfx.cc index 17d613e..f016c0e 100644 --- a/noncore/unsupported/qpdf/xpdf/Gfx.cc +++ b/noncore/unsupported/qpdf/xpdf/Gfx.cc @@ -1855,25 +1855,25 @@ void Gfx::opSetCharSpacing(Object args[], int numArgs) { } void Gfx::opSetFont(Object args[], int numArgs) { GfxFont *font; if (!(font = res->lookupFont(args[0].getName()))) { return; } if (printCommands) { printf(" font: tag=%s name='%s' %g\n", font->getTag()->getCString(), font->getName() ? font->getName()->getCString() : "???", - args[1].getNum()); + static_cast<double>(args[1].getNum())); fflush(stdout); } state->setFont(font, args[1].getNum()); fontChanged = gTrue; } void Gfx::opSetTextLeading(Object args[], int numArgs) { state->setLeading(args[0].getNum()); } void Gfx::opSetTextRender(Object args[], int numArgs) { state->setRender(args[0].getInt()); diff --git a/noncore/unsupported/qpdf/xpdf/Object.cc b/noncore/unsupported/qpdf/xpdf/Object.cc index 6d92c6a..77f1317 100644 --- a/noncore/unsupported/qpdf/xpdf/Object.cc +++ b/noncore/unsupported/qpdf/xpdf/Object.cc @@ -140,25 +140,25 @@ char *Object::getTypeName() { void Object::print(FILE *f) { Object obj; int i; switch (type) { case objBool: fprintf(f, "%s", booln ? "true" : "false"); break; case objInt: fprintf(f, "%d", intg); break; case objReal: - fprintf(f, "%g", real); + fprintf(f, "%g", static_cast<double>(real)); break; case objString: fprintf(f, "("); fwrite(string->getCString(), 1, string->getLength(), stdout); fprintf(f, ")"); break; case objName: fprintf(f, "/%s", name); break; case objNull: fprintf(f, "null"); break; diff --git a/noncore/unsupported/qpdf/xpdf/Page.cc b/noncore/unsupported/qpdf/xpdf/Page.cc index 9cc08c4..aead7da 100644 --- a/noncore/unsupported/qpdf/xpdf/Page.cc +++ b/noncore/unsupported/qpdf/xpdf/Page.cc @@ -221,28 +221,28 @@ void Page::display(OutputDev *out, fouble dpi, int rotate, PDFRectangle *box, *cropBox; Gfx *gfx; Object obj; Link *link; int i; Annots *annotList; box = getBox(); cropBox = getCropBox(); if (printCommands) { printf("***** MediaBox = ll:%g,%g ur:%g,%g\n", - box->x1, box->y1, box->x2, box->y2); + static_cast<double>(box->x1), static_cast<double>(box->y1), static_cast<double>(box->x2), static_cast<double>(box->y2)); if (isCropped()) { printf("***** CropBox = ll:%g,%g ur:%g,%g\n", - cropBox->x1, cropBox->y1, cropBox->x2, cropBox->y2); + static_cast<double>(cropBox->x1), static_cast<double>(cropBox->y1), static_cast<double>(cropBox->x2), static_cast<double>(cropBox->y2)); } printf("***** Rotate = %d\n", attrs->getRotate()); } rotate += getRotate(); if (rotate >= 360) { rotate -= 360; } else if (rotate < 0) { rotate += 360; } gfx = new Gfx(xref, out, num, attrs->getResourceDict(), dpi, box, isCropped(), cropBox, rotate, printCommands); |