Commit 53a4fbbb authored by Albert Astals Cid's avatar Albert Astals Cid

Enable modernize-use-override

not claiming copyright for this since it's a mechanical change
parent 3caf1a7a
......@@ -40,7 +40,7 @@ build_clang_libcpp:
script:
- git clone --branch ${CI_COMMIT_REF_NAME} --depth 1 ${TEST_DATA_URL} test-data || git clone --depth 1 ${UPSTREAM_TEST_DATA_URL} test-data
- mkdir -p build && cd build
- CC=clang CXX=clang++ cmake -G Ninja -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DTESTDATADIR=$PWD/../test-data -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-header-filter=.;-checks=-*,performance-*,,bugprone-*,readability-inconsistent-declaration-parameter-name,readability-string-compare,modernize-deprecated-headers,modernize-make-unique,modernize-make-shared,-bugprone-narrowing-conversions,-bugprone-macro-parentheses,-bugprone-suspicious-string-compare,-bugprone-incorrect-roundings,-bugprone-undefined-memory-manipulation;-warnings-as-errors=*" ..
- CC=clang CXX=clang++ cmake -G Ninja -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DTESTDATADIR=$PWD/../test-data -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-header-filter=.;-checks=-*,performance-*,,bugprone-*,readability-inconsistent-declaration-parameter-name,readability-string-compare,modernize-deprecated-headers,modernize-make-unique,modernize-make-shared,modernize-use-override,-bugprone-narrowing-conversions,-bugprone-macro-parentheses,-bugprone-suspicious-string-compare,-bugprone-incorrect-roundings,-bugprone-undefined-memory-manipulation;-warnings-as-errors=*" ..
- ninja
- ctest --output-on-failure
......
......@@ -72,7 +72,7 @@ class MemReader: public Reader {
public:
static MemReader *make(const char *bufA, int lenA);
~MemReader();
~MemReader() override;
int getByte(int pos) override;
bool getU16BE(int pos, int *val) override;
bool getU32BE(int pos, unsigned int *val) override;
......@@ -167,7 +167,7 @@ class FileReader: public Reader {
public:
static FileReader *make(const char *fileName);
~FileReader();
~FileReader() override;
int getByte(int pos) override;
bool getU16BE(int pos, int *val) override;
bool getU32BE(int pos, unsigned int *val) override;
......@@ -290,7 +290,7 @@ class StreamReader: public Reader {
public:
static StreamReader *make(int (*getCharA)(void *data), void *dataA);
~StreamReader();
~StreamReader() override;
int getByte(int pos) override;
bool getU16BE(int pos, int *val) override;
bool getU32BE(int pos, unsigned int *val) override;
......
......@@ -50,7 +50,7 @@ public:
// Create a FoFiTrueType object from a file on disk.
static FoFiTrueType *load(const char *fileName, int faceIndexA=0);
~FoFiTrueType();
~FoFiTrueType() override;
// Returns true if this an OpenType font containing CFF data, false
// if it's a TrueType font (or OpenType font with TrueType data).
......
......@@ -38,7 +38,7 @@ public:
// Create a FoFiType1 object from a file on disk.
static FoFiType1 *load(const char *fileName);
~FoFiType1();
~FoFiType1() override;
// Return the font name.
const char *getName();
......
......@@ -149,7 +149,7 @@ public:
// Create a FoFiType1C object from a file on disk.
static FoFiType1C *load(const char *fileName);
virtual ~FoFiType1C();
~FoFiType1C() override;
// Return the font name.
const char *getName() const;
......
......@@ -27,7 +27,7 @@
class PopplerCachedFileLoader: public CachedFileLoader {
public:
PopplerCachedFileLoader(GInputStream* inputStreamA, GCancellable *cancellableA, goffset lengthA = -1);
~PopplerCachedFileLoader();
~PopplerCachedFileLoader() override;
size_t init(GooString *url, CachedFile* cachedFile) override;
int load(const std::vector<ByteRange> &ranges, CachedFileWriter *writer) override;
......
......@@ -33,7 +33,7 @@ public:
PopplerInputStream(GInputStream *inputStream, GCancellable *cancellableA,
Goffset startA, bool limitedA, Goffset lengthA, Object &&dictA);
~PopplerInputStream();
~PopplerInputStream() override;
BaseStream *copy() override;
Stream *makeSubStream(Goffset start, bool limited,
Goffset lengthA, Object &&dictA) override;
......
......@@ -38,7 +38,7 @@ public:
JpegWriter(int quality, bool progressive, Format format = RGB);
JpegWriter(Format format = RGB);
~JpegWriter();
~JpegWriter() override;
void setQuality(int quality);
void setProgressive(bool progressive);
......
......@@ -34,7 +34,7 @@ public:
enum Format { RGB, MONOCHROME };
NetPBMWriter(Format formatA = RGB);
~NetPBMWriter() {};
~NetPBMWriter() override {};
bool init(FILE *f, int width, int height, int hDPI, int vDPI) override;
......
......@@ -37,7 +37,7 @@ public:
enum Format { RGB, RGBA, GRAY, MONOCHROME, RGB48 };
PNGWriter(Format format = RGB);
~PNGWriter();
~PNGWriter() override;
void setICCProfile(const char *name, unsigned char *data, int size);
void setSRGBProfile();
......
......@@ -36,7 +36,7 @@ public:
enum Format { RGB, RGBA_PREMULTIPLIED, GRAY, MONOCHROME, CMYK, RGB48 };
TiffWriter(Format format = RGB);
~TiffWriter();
~TiffWriter() override;
void setCompressionString(const char *compressionStringArg);
......
......@@ -784,7 +784,7 @@ class AnnotPopup: public Annot {
public:
AnnotPopup(PDFDoc *docA, PDFRectangle *rect);
AnnotPopup(PDFDoc *docA, Object &&dictObject, const Object *obj);
~AnnotPopup();
~AnnotPopup() override;
bool hasParent() const { return parentRef != Ref::INVALID(); }
void setParent(Annot *parentA);
......@@ -811,7 +811,7 @@ public:
AnnotMarkup(PDFDoc *docA, PDFRectangle *rect);
AnnotMarkup(PDFDoc *docA, Object &&dictObject, const Object *obj);
~AnnotMarkup();
~AnnotMarkup() override;
// getters
const GooString *getLabel() const { return label.get(); }
......@@ -872,7 +872,7 @@ public:
AnnotText(PDFDoc *docA, PDFRectangle *rect);
AnnotText(PDFDoc *docA, Object &&dictObject, const Object *obj);
~AnnotText();
~AnnotText() override;
void draw(Gfx *gfx, bool printing) override;
......@@ -905,7 +905,7 @@ class AnnotMovie: public Annot {
public:
AnnotMovie(PDFDoc *docA, PDFRectangle *rect, Movie *movieA);
AnnotMovie(PDFDoc *docA, Object &&dictObject, const Object *obj);
~AnnotMovie();
~AnnotMovie() override;
void draw(Gfx *gfx, bool printing) override;
......@@ -929,7 +929,7 @@ class AnnotScreen: public Annot {
AnnotScreen(PDFDoc *docA, PDFRectangle *rect);
AnnotScreen(PDFDoc *docA, Object &&dictObject, const Object *obj);
~AnnotScreen();
~AnnotScreen() override;
const GooString* getTitle() const { return title.get(); }
......@@ -965,7 +965,7 @@ public:
AnnotLink(PDFDoc *docA, PDFRectangle *rect);
AnnotLink(PDFDoc *docA, Object &&dictObject, const Object *obj);
~AnnotLink();
~AnnotLink() override;
void draw(Gfx *gfx, bool printing) override;
......@@ -1008,7 +1008,7 @@ public:
AnnotFreeText(PDFDoc *docA, PDFRectangle *rect, const DefaultAppearance &da);
AnnotFreeText(PDFDoc *docA, Object &&dictObject, const Object *obj);
~AnnotFreeText();
~AnnotFreeText() override;
void draw(Gfx *gfx, bool printing) override;
Object getAppearanceResDict() override;
......@@ -1071,7 +1071,7 @@ public:
AnnotLine(PDFDoc *docA, PDFRectangle *rect);
AnnotLine(PDFDoc *docA, Object &&dictObject, const Object *obj);
~AnnotLine();
~AnnotLine() override;
void draw(Gfx *gfx, bool printing) override;
Object getAppearanceResDict() override;
......@@ -1138,7 +1138,7 @@ public:
AnnotTextMarkup(PDFDoc *docA, PDFRectangle *rect, AnnotSubtype subType);
AnnotTextMarkup(PDFDoc *docA, Object &&dictObject, const Object *obj);
~AnnotTextMarkup();
~AnnotTextMarkup() override;
void draw(Gfx *gfx, bool printing) override;
......@@ -1165,7 +1165,7 @@ public:
AnnotStamp(PDFDoc *docA, PDFRectangle *rect);
AnnotStamp(PDFDoc *docA, Object &&dictObject, const Object *obj);
~AnnotStamp();
~AnnotStamp() override;
void setIcon(GooString *new_icon);
......@@ -1188,7 +1188,7 @@ public:
AnnotGeometry(PDFDoc *docA, PDFRectangle *rect, AnnotSubtype subType);
AnnotGeometry(PDFDoc *docA, Object &&dictObject, const Object *obj);
~AnnotGeometry();
~AnnotGeometry() override;
void draw(Gfx *gfx, bool printing) override;
......@@ -1224,7 +1224,7 @@ public:
AnnotPolygon(PDFDoc *docA, PDFRectangle *rect, AnnotSubtype subType);
AnnotPolygon(PDFDoc *docA, Object &&dictObject, const Object *obj);
~AnnotPolygon();
~AnnotPolygon() override;
void draw(Gfx *gfx, bool printing) override;
void generatePolyLineAppearance(AnnotAppearanceBuilder* appearBuilder);
......@@ -1274,7 +1274,7 @@ public:
AnnotCaret(PDFDoc *docA, PDFRectangle *rect);
AnnotCaret(PDFDoc *docA, Object &&dictObject, const Object *obj);
~AnnotCaret();
~AnnotCaret() override;
void setSymbol(AnnotCaretSymbol new_symbol);
......@@ -1299,7 +1299,7 @@ public:
AnnotInk(PDFDoc *docA, PDFRectangle *rect);
AnnotInk(PDFDoc *docA, Object &&dictObject, const Object *obj);
~AnnotInk();
~AnnotInk() override;
void draw(Gfx *gfx, bool printing) override;
......@@ -1334,7 +1334,7 @@ public:
AnnotFileAttachment(PDFDoc *docA, PDFRectangle *rect, GooString *filename);
AnnotFileAttachment(PDFDoc *docA, Object &&dictObject, const Object *obj);
~AnnotFileAttachment();
~AnnotFileAttachment() override;
void draw(Gfx *gfx, bool printing) override;
......@@ -1362,7 +1362,7 @@ public:
AnnotSound(PDFDoc *docA, PDFRectangle *rect, Sound *soundA);
AnnotSound(PDFDoc *docA, Object &&dictObject, const Object *obj);
~AnnotSound();
~AnnotSound() override;
void draw(Gfx *gfx, bool printing) override;
......@@ -1397,7 +1397,7 @@ public:
AnnotWidget(PDFDoc *docA, Object &&dictObject, const Object *obj);
AnnotWidget(PDFDoc *docA, Object *dictObject, Object *obj, FormField *fieldA);
~AnnotWidget();
~AnnotWidget() override;
void draw(Gfx *gfx, bool printing) override;
......@@ -1478,7 +1478,7 @@ public:
Annot3D(PDFDoc *docA, PDFRectangle *rect);
Annot3D(PDFDoc *docA, Object &&dictObject, const Object *obj);
~Annot3D();
~Annot3D() override;
// getters
......@@ -1658,7 +1658,7 @@ public:
AnnotRichMedia(PDFDoc *docA, PDFRectangle *rect);
AnnotRichMedia(PDFDoc *docA, Object &&dictObject, const Object *obj);
~AnnotRichMedia();
~AnnotRichMedia() override;
Content* getContent() const;
......
......@@ -74,7 +74,7 @@ protected:
class CairoFreeTypeFont : public CairoFont {
public:
static CairoFreeTypeFont *create(GfxFont *gfxFont, XRef *xref, FT_Library lib, bool useCIDs);
~CairoFreeTypeFont();
~CairoFreeTypeFont() override;
private:
CairoFreeTypeFont(Ref ref, cairo_font_face_t *cairo_font_face,
......@@ -88,7 +88,7 @@ public:
static CairoType3Font *create(GfxFont *gfxFont, PDFDoc *doc,
CairoFontEngine *fontEngine,
bool printing, XRef *xref);
~CairoType3Font();
~CairoType3Font() override;
bool matches(Ref &other, bool printing) override;
......
......@@ -91,7 +91,7 @@ public:
CairoOutputDev();
// Destructor.
virtual ~CairoOutputDev();
~CairoOutputDev() override;
//----- get info about output device
......@@ -383,7 +383,7 @@ public:
CairoImageOutputDev();
// Destructor.
virtual ~CairoImageOutputDev();
~CairoImageOutputDev() override;
//----- get info about output device
......
......@@ -24,7 +24,7 @@ class CurlCachedFileLoader : public CachedFileLoader {
public:
CurlCachedFileLoader();
~CurlCachedFileLoader();
~CurlCachedFileLoader() override;
size_t init(GooString *url, CachedFile* cachedFile) override;
int load(const std::vector<ByteRange> &ranges, CachedFileWriter *writer) override;
......
......@@ -56,7 +56,7 @@ class DCTStream: public FilterStream {
public:
DCTStream(Stream *strA, int colorXformA, Dict *dict, int recursion);
~DCTStream();
~DCTStream() override;
StreamKind getKind() const override { return strDCT; }
void reset() override;
int getChar() override;
......
......@@ -100,7 +100,7 @@ public:
BaseCryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA,
int keyLength, Ref ref);
~BaseCryptStream();
~BaseCryptStream() override;
StreamKind getKind() const override { return strCrypt; }
void reset() override;
int getChar() override;
......@@ -134,7 +134,7 @@ public:
EncryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA,
int keyLength, Ref ref);
~EncryptStream();
~EncryptStream() override;
void reset() override;
int lookChar() override;
};
......@@ -144,7 +144,7 @@ public:
DecryptStream(Stream *strA, const unsigned char *fileKey, CryptAlgorithm algoA,
int keyLength, Ref ref);
~DecryptStream();
~DecryptStream() override;
void reset() override;
int lookChar() override;
};
......
......@@ -41,7 +41,7 @@ class FlateEncoder: public FilterStream {
public:
FlateEncoder(Stream *strA);
~FlateEncoder();
~FlateEncoder() override;
StreamKind getKind() const override { return strWeird; }
void reset() override;
int getChar() override
......
......@@ -166,7 +166,7 @@ protected:
class FormWidgetButton: public FormWidget {
public:
FormWidgetButton(PDFDoc *docA, Object *dictObj, unsigned num, Ref ref, FormField *p);
~FormWidgetButton ();
~FormWidgetButton () override;
FormButtonType getButtonType() const;
......@@ -223,7 +223,7 @@ protected:
class FormWidgetChoice: public FormWidget {
public:
FormWidgetChoice(PDFDoc *docA, Object *dictObj, unsigned num, Ref ref, FormField *p);
~FormWidgetChoice();
~FormWidgetChoice() override;
int getNumChoices() const;
//return the display name of the i-th choice (UTF16BE)
......@@ -386,7 +386,7 @@ public:
void print(int indent) override;
~FormFieldButton();
~FormFieldButton() override;
protected:
void updateState(const char *state);
......@@ -413,7 +413,7 @@ public:
const GooString* getAppearanceContent () const { return internalContent ? internalContent : content; }
void setContentCopy (const GooString* new_content);
void setAppearanceContentCopy (const GooString* new_content);
~FormFieldText();
~FormFieldText() override;
bool isMultiline () const { return multiline; }
bool isPassword () const { return password; }
......@@ -457,7 +457,7 @@ class FormFieldChoice: public FormField {
public:
FormFieldChoice(PDFDoc *docA, Object &&aobj, const Ref ref, FormField *parent, std::set<int> *usedParents);
~FormFieldChoice();
~FormFieldChoice() override;
int getNumChoices() const { return numChoices; }
const GooString* getChoice(int i) const { return choices ? choices[i].optionName : nullptr; }
......@@ -528,7 +528,7 @@ public:
// Use -1 for now as validationTime
SignatureInfo *validateSignature(bool doVerifyCert, bool forceRevalidation, time_t validationTime);
~FormFieldSignature();
~FormFieldSignature() override;
Object* getByteRange() { return &byte_range; }
const GooString* getSignature() const { return signature; }
......
......@@ -106,7 +106,7 @@ class IdentityFunction: public Function {
public:
IdentityFunction();
~IdentityFunction();
~IdentityFunction() override;
Function *copy() const override { return new IdentityFunction(); }
int getType() const override { return -1; }
void transform(const double *in, double *out) const override;
......@@ -123,7 +123,7 @@ class SampledFunction: public Function {
public:
SampledFunction(Object *funcObj, Dict *dict);
~SampledFunction();
~SampledFunction() override;
Function *copy() const override { return new SampledFunction(this); }
int getType() const override { return 0; }
void transform(const double *in, double *out) const override;
......@@ -167,7 +167,7 @@ class ExponentialFunction: public Function {
public:
ExponentialFunction(Object *funcObj, Dict *dict);
~ExponentialFunction();
~ExponentialFunction() override;
Function *copy() const override { return new ExponentialFunction(this); }
int getType() const override { return 2; }
void transform(const double *in, double *out) const override;
......@@ -196,7 +196,7 @@ class StitchingFunction: public Function {
public:
StitchingFunction(Object *funcObj, Dict *dict, std::set<int> *usedParents);
~StitchingFunction();
~StitchingFunction() override;
Function *copy() const override { return new StitchingFunction(this); }
int getType() const override { return 3; }
void transform(const double *in, double *out) const override;
......@@ -228,7 +228,7 @@ class PostScriptFunction: public Function {
public:
PostScriptFunction(Object *funcObj, Dict *dict);
~PostScriptFunction();
~PostScriptFunction() override;
Function *copy() const override { return new PostScriptFunction(this); }
int getType() const override { return 4; }
void transform(const double *in, double *out) const override;
......
......@@ -360,7 +360,7 @@ public:
Dict *getResources();
private:
~Gfx8BitFont();
~Gfx8BitFont() override;
const Base14FontMapEntry *base14; // for Base-14 fonts only; NULL otherwise
char *enc[256]; // char code --> char name
......@@ -411,7 +411,7 @@ public:
double getWidth(char* s, int len) const;
private:
~GfxCIDFont();
~GfxCIDFont() override;
int mapCodeToGID(FoFiTrueType *ff, int cmapi,
Unicode unicode, bool wmode);
......
......@@ -298,7 +298,7 @@ class GfxDeviceGrayColorSpace: public GfxColorSpace {
public:
GfxDeviceGrayColorSpace();
~GfxDeviceGrayColorSpace();
~GfxDeviceGrayColorSpace() override;
GfxColorSpace *copy() override;
GfxColorSpaceMode getMode() const override { return csDeviceGray; }
......@@ -332,7 +332,7 @@ class GfxCalGrayColorSpace: public GfxColorSpace {
public:
GfxCalGrayColorSpace();
~GfxCalGrayColorSpace();
~GfxCalGrayColorSpace() override;
GfxColorSpace *copy() override;
GfxColorSpaceMode getMode() const override { return csCalGray; }
......@@ -376,7 +376,7 @@ class GfxDeviceRGBColorSpace: public GfxColorSpace {
public:
GfxDeviceRGBColorSpace();
~GfxDeviceRGBColorSpace();
~GfxDeviceRGBColorSpace() override;
GfxColorSpace *copy() override;
GfxColorSpaceMode getMode() const override { return csDeviceRGB; }
......@@ -410,7 +410,7 @@ class GfxCalRGBColorSpace: public GfxColorSpace {
public:
GfxCalRGBColorSpace();
~GfxCalRGBColorSpace();
~GfxCalRGBColorSpace() override;
GfxColorSpace *copy() override;
GfxColorSpaceMode getMode() const override { return csCalRGB; }
......@@ -458,7 +458,7 @@ class GfxDeviceCMYKColorSpace: public GfxColorSpace {
public:
GfxDeviceCMYKColorSpace();
~GfxDeviceCMYKColorSpace();
~GfxDeviceCMYKColorSpace() override;
GfxColorSpace *copy() override;
GfxColorSpaceMode getMode() const override { return csDeviceCMYK; }
......@@ -489,7 +489,7 @@ class GfxLabColorSpace: public GfxColorSpace {
public:
GfxLabColorSpace();
~GfxLabColorSpace();
~GfxLabColorSpace() override;
GfxColorSpace *copy() override;
GfxColorSpaceMode getMode() const override { return csLab; }
......@@ -539,7 +539,7 @@ class GfxICCBasedColorSpace: public GfxColorSpace {
public:
GfxICCBasedColorSpace(int nCompsA, GfxColorSpace *altA);
~GfxICCBasedColorSpace();
~GfxICCBasedColorSpace() override;
GfxColorSpace *copy() override;
GfxColorSpaceMode getMode() const override { return csICCBased; }
......@@ -590,7 +590,7 @@ class GfxIndexedColorSpace: public GfxColorSpace {
public:
GfxIndexedColorSpace(GfxColorSpace *baseA, int indexHighA);
~GfxIndexedColorSpace();
~GfxIndexedColorSpace() override;
GfxColorSpace *copy() override;
GfxColorSpaceMode getMode() const override { return csIndexed; }
......@@ -643,7 +643,7 @@ public:
GfxSeparationColorSpace(GooString *nameA, GfxColorSpace *altA,
Function *funcA);
~GfxSeparationColorSpace();
~GfxSeparationColorSpace() override;
GfxColorSpace *copy() override;
GfxColorSpaceMode getMode() const override { return csSeparation; }
......@@ -688,7 +688,7 @@ public:
GfxDeviceNColorSpace(int nCompsA, std::vector<std::string> &&namesA,
GfxColorSpace *alt, Function *func, std::vector<GfxSeparationColorSpace*> *sepsCS);
~GfxDeviceNColorSpace();
~GfxDeviceNColorSpace() override;
GfxColorSpace *copy() override;
GfxColorSpaceMode getMode() const override { return csDeviceN; }
......@@ -734,7 +734,7 @@ class GfxPatternColorSpace: public GfxColorSpace {
public:
GfxPatternColorSpace(GfxColorSpace *underA);
~GfxPatternColorSpace();
~GfxPatternColorSpace() override;
GfxColorSpace *copy() override;
GfxColorSpaceMode getMode() const override { return csPattern; }
......@@ -793,7 +793,7 @@ class GfxTilingPattern: public GfxPattern {
public:
static GfxTilingPattern *parse(Object *patObj, int patternRefNum);
~GfxTilingPattern();
~GfxTilingPattern() override;
GfxPattern *copy() override;
......@@ -831,7 +831,7 @@ class GfxShadingPattern: public GfxPattern {
public:
static GfxShadingPattern *parse(GfxResources *res, Object *patObj, OutputDev *out, GfxState *state, int patternRefNum);
~GfxShadingPattern();
~GfxShadingPattern() override;
GfxPattern *copy() override;
......@@ -903,7 +903,7 @@ public:
Function **funcsA, int nFuncsA,
bool extend0A, bool extend1A);
GfxUnivariateShading(GfxUnivariateShading *shading);
~GfxUnivariateShading();
~GfxUnivariateShading() override;
double getDomain0() const { return t0; }
double getDomain1() const { return t1; }
......@@ -950,7 +950,7 @@ public:
const double *matrixA,
Function **funcsA, int nFuncsA);
GfxFunctionShading(GfxFunctionShading *shading);
~GfxFunctionShading();
~GfxFunctionShading() override;
static GfxFunctionShading *parse(GfxResources *res, Dict *dict, OutputDev *out, GfxState *state);
......@@ -984,7 +984,7 @@ public:
Function **funcsA, int nFuncsA,
bool extend0A, bool extend1A);
GfxAxialShading(GfxAxialShading *shading);
~GfxAxialShading();
~GfxAxialShading() override;