summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2022-05-12 22:38:40 +0200
committerAlbert Astals Cid <aacid@kde.org>2022-05-12 22:38:40 +0200
commite7f0fd89d937d28a77539fb9782a2b59eb51e5a8 (patch)
treea5e515ba08c891bc7822bb07413be3ab56991713
parentcf5034d83593dae25890d8cb58159491683629f6 (diff)
NetPBMWriter: Change destructor
Makes gcc 12.1 happier, i think it was a gcc bug anyway, but the new code is a bit "better" anyway, the warning i was getting is In file included from utils/ImageOutputDev.cc:44: In destructor ‘virtual NetPBMWriter::~NetPBMWriter()’, inlined from ‘virtual NetPBMWriter::~NetPBMWriter()’ at goo/NetPBMWriter.h:41:31, inlined from ‘void ImageOutputDev::writeImage(GfxState*, Object*, Stream*, int, int, GfxImageColorMap*, bool)’ at utils/ImageOutputDev.cc:636:16: goo/NetPBMWriter.h:41:31: warning: array subscript ‘NetPBMWriter[0]’ is partly outside array bounds of ‘ImgWriter [2]’ [-Warray-bounds] 41 | ~NetPBMWriter() override {}; | ^ utils/ImageOutputDev.cc: In member function ‘void ImageOutputDev::writeImage(GfxState*, Object*, Stream*, int, int, GfxImageColorMap*, bool)’: utils/ImageOutputDev.cc:620:57: note: object of size 16 allocated by ‘operator new’ 620 | writer = new PNGWriter(PNGWriter::MONOCHROME); | ^ utils/ImageOutputDev.cc:623:51: note: object of size 16 allocated by ‘operator new’ 623 | writer = new PNGWriter(PNGWriter::GRAY); | ^ utils/ImageOutputDev.cc:627:52: note: object of size 16 allocated by ‘operator new’ 627 | writer = new PNGWriter(PNGWriter::RGB48); | ^ utils/ImageOutputDev.cc:630:50: note: object of size 16 allocated by ‘operator new’ 630 | writer = new PNGWriter(PNGWriter::RGB); | ^
-rw-r--r--goo/NetPBMWriter.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/goo/NetPBMWriter.h b/goo/NetPBMWriter.h
index 3075d730..a942a574 100644
--- a/goo/NetPBMWriter.h
+++ b/goo/NetPBMWriter.h
@@ -38,7 +38,7 @@ public:
};
explicit NetPBMWriter(Format formatA = RGB);
- ~NetPBMWriter() override {};
+ ~NetPBMWriter() override = default;
bool init(FILE *f, int width, int height, double /*hDPI*/, double /*vDPI*/) override;