Enable a few more clang-tidy bugprone checks
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 42bdb89..635e9bf 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -40,7 +40,7 @@
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-too-small-loop-variable;-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-*,-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
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 56b9b93..9899c88 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -4345,7 +4345,7 @@
x = borderWidth;
break;
case quaddingCentered:
- x = borderWidth + (comb - charCount) / 2 * w;
+ x = borderWidth + (comb - charCount) / 2.0 * w;
break;
case quaddingRightJustified:
x = borderWidth + (comb - charCount) * w;
diff --git a/qt5/src/poppler-annotation-private.h b/qt5/src/poppler-annotation-private.h
index c63a86d..a39c213 100644
--- a/qt5/src/poppler-annotation-private.h
+++ b/qt5/src/poppler-annotation-private.h
@@ -32,7 +32,6 @@
class Annot;
class AnnotPath;
-class Link;
class Page;
class PDFRectangle;
diff --git a/qt5/src/poppler-link.h b/qt5/src/poppler-link.h
index 766124a..7f52e20 100644
--- a/qt5/src/poppler-link.h
+++ b/qt5/src/poppler-link.h
@@ -1,5 +1,5 @@
/* poppler-link.h: qt interface to poppler
- * Copyright (C) 2006, 2013, 2016, 2018, Albert Astals Cid <aacid@kde.org>
+ * Copyright (C) 2006, 2013, 2016, 2018, 2019, Albert Astals Cid <aacid@kde.org>
* Copyright (C) 2007-2008, 2010, Pino Toscano <pino@kde.org>
* Copyright (C) 2010, 2012, Guillermo Amaral <gamaral@kdab.com>
* Copyright (C) 2012, Tobias Koenig <tokoe@kdab.com>
@@ -34,8 +34,6 @@
struct Ref;
class MediaRendition;
-class MovieAnnotation;
-class ScreenAnnotation;
namespace Poppler {
@@ -53,6 +51,8 @@
class LinkOCGStatePrivate;
class LinkHidePrivate;
class MediaRendition;
+class MovieAnnotation;
+class ScreenAnnotation;
class SoundObject;
/**
diff --git a/qt5/tests/check_object.cpp b/qt5/tests/check_object.cpp
index f8531fb..c3ece94 100644
--- a/qt5/tests/check_object.cpp
+++ b/qt5/tests/check_object.cpp
@@ -21,8 +21,8 @@
}
void TestObject::benchMoveConstructor() {
- Object src;
QBENCHMARK {
+ Object src;
Object dst{std::move(src)};
}
}