From d1c2eed1b6aaaa6f7416237ed148d23b10e47373 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 9 Dec 2020 19:51:39 +0100 Subject: [PATCH] Make the CI pass with new clang-tidy Disable bugprone-suspicious-include since it's triggered by the moc includes Disable bugprone-reserved-identifier since it's triggered by all our _OKULAR defines, and yes even if the spec says that underscore is reserved, are we going to be that unlucky that the library decides to start using _OKULAR ? not probably Add two TODOs for the future to make NormalizedRect/Point faster Silence a warning about a quick moving QString if we make it non const Silence a uchar vs char warning that is in decades old code so experience seems to suggest it's ok. --- .clang-tidy | 2 +- core/area.h | 6 ++++-- generators/dvi/dviFile.cpp | 2 +- generators/dvi/util.cpp | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index bda12524b..a2016be1c 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,5 +1,5 @@ --- -Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,performance-*,bugprone-*,readability-inconsistent-declaration-parameter-name,readability-string-compare,modernize-redundant-void-arg,modernize-use-bool-literals,modernize-make-unique,modernize-make-shared,modernize-use-override,modernize-use-equals-delete,modernize-use-emplace,modernize-loop-convert,modernize-use-nullptr,-bugprone-macro-parentheses,-bugprone-narrowing-conversions,-bugprone-branch-clone,-bugprone-incorrect-roundings' +Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,performance-*,bugprone-*,readability-inconsistent-declaration-parameter-name,readability-string-compare,modernize-redundant-void-arg,modernize-use-bool-literals,modernize-make-unique,modernize-make-shared,modernize-use-override,modernize-use-equals-delete,modernize-use-emplace,modernize-loop-convert,modernize-use-nullptr,-bugprone-macro-parentheses,-bugprone-narrowing-conversions,-bugprone-branch-clone,-bugprone-incorrect-roundings,-bugprone-suspicious-include,-bugprone-reserved-identifier' WarningsAsErrors: '*' HeaderFilterRegex: '.*/okular/.*' AnalyzeTemporaryDtors: false diff --git a/core/area.h b/core/area.h index abde072a7..704663551 100644 --- a/core/area.h +++ b/core/area.h @@ -141,7 +141,8 @@ public: NormalizedPoint &operator=(const NormalizedPoint &); NormalizedPoint(const NormalizedPoint &); - ~NormalizedPoint(); + // TODO next ABI break, move the = default to here + ~NormalizedPoint(); // NOLINT(performance-trivially-destructible) /** * Transforms the normalized point with the operations defined by @p matrix. @@ -237,7 +238,8 @@ public: */ NormalizedRect &operator=(const NormalizedRect &other); - ~NormalizedRect(); + // TODO next ABI break, move the = default to here + ~NormalizedRect(); // NOLINT(performance-trivially-destructible) /** * Build a normalized rect from a QRectF, which already has normalized coordinates. diff --git a/generators/dvi/dviFile.cpp b/generators/dvi/dviFile.cpp index 1e9b34e98..2faad3ac4 100644 --- a/generators/dvi/dviFile.cpp +++ b/generators/dvi/dviFile.cpp @@ -420,7 +420,7 @@ QString dvifile::convertPDFtoPS(const QString &PDFFilename, QString *converrorms convertedFiles[PDFFilename] = convertedFileName; tmpfile.setAutoRemove(false); - return convertedFileName; + return convertedFileName; //// NOLINT(performance-no-automatic-move) QString is cheap to copy and we prefer the const safety } bool dvifile::saveAs(const QString &filename) diff --git a/generators/dvi/util.cpp b/generators/dvi/util.cpp index e4195968e..62182e526 100644 --- a/generators/dvi/util.cpp +++ b/generators/dvi/util.cpp @@ -102,7 +102,7 @@ long snum(FILE *fp, int size) long x; #ifdef __STDC__ - x = (signed char)getc(fp); + x = (signed char)getc(fp); // NOLINT(bugprone-signed-char-misuse) This code is decades old, so prefer not to touch it #else x = (unsigned char)getc(fp); if (x & 0x80)