Skip to content

Commit

Permalink
Fix warnings when building against Poppler 25.03.00
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Mar 9, 2025
1 parent 5674a68 commit 2e5e16f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions frmts/pdf/pdfdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class GDALPDFOutputDev : public SplashOutputDev
invert, interpolate, inlineImg);
else
{
str->reset();
VSIPDFFileStream::resetNoCheckReturnValue(str);
if (inlineImg)
{
skipBytes(str, width, height, 1, 1);
Expand Down Expand Up @@ -209,7 +209,7 @@ class GDALPDFOutputDev : public SplashOutputDev
interpolate, maskColors, inlineImg);
else
{
str->reset();
VSIPDFFileStream::resetNoCheckReturnValue(str);
if (inlineImg)
{
skipBytes(str, width, height, colorMap->getNumPixelComps(),
Expand Down
2 changes: 1 addition & 1 deletion frmts/pdf/pdfio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ void VSIPDFFileStream::reset()
/************************************************************************/

#if POPPLER_MAJOR_VERSION > 25 || \
(POPPLER_MAJOR_VERSION == 25 && POPPLER_MINOR_VERSION > 2)
(POPPLER_MAJOR_VERSION == 25 && POPPLER_MINOR_VERSION >= 3)
bool VSIPDFFileStream::unfilteredReset()
{
return reset();
Expand Down
12 changes: 11 additions & 1 deletion frmts/pdf/pdfio.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,18 @@ class VSIPDFFileStream final : public BaseStream
virtual void reset() override;
#endif

static void resetNoCheckReturnValue(Stream *str)
{
#if POPPLER_MAJOR_VERSION > 25 || \
(POPPLER_MAJOR_VERSION == 25 && POPPLER_MINOR_VERSION >= 2)
CPL_IGNORE_RET_VAL(str->reset());
#else
str->reset();
#endif
}

#if POPPLER_MAJOR_VERSION > 25 || \
(POPPLER_MAJOR_VERSION == 25 && POPPLER_MINOR_VERSION > 2)
(POPPLER_MAJOR_VERSION == 25 && POPPLER_MINOR_VERSION >= 3)
virtual bool unfilteredReset() override;
#else
virtual void unfilteredReset() override;
Expand Down

0 comments on commit 2e5e16f

Please sign in to comment.