summaryrefslogtreecommitdiff
path: root/cppu
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-04-29 11:08:37 +0200
committerStephan Bergmann <sbergman@redhat.com>2022-04-29 13:09:40 +0200
commit5b6bc8182bc1586facca5c3a019c9985e0d7b411 (patch)
treee6e9ec335ce052dc31976a2d48fdf2e5bb4ef251 /cppu
parent779c01a9e1eb3ed176d57e1e04073e25aca34a64 (diff)
Use the false warning suppression mechanism for loplugin:fakebool
Change-Id: I6572e500edc1be845c28389b0a4d3ca258dbbecb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133593 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'cppu')
-rw-r--r--cppu/qa/test_any.cxx20
-rw-r--r--cppu/source/uno/check.cxx5
2 files changed, 25 insertions, 0 deletions
diff --git a/cppu/qa/test_any.cxx b/cppu/qa/test_any.cxx
index 4cf9d181984f..757040314844 100644
--- a/cppu/qa/test_any.cxx
+++ b/cppu/qa/test_any.cxx
@@ -228,6 +228,7 @@ void Test::testVoid() {
CPPUNIT_ASSERT_MESSAGE("bool", b);
}
{
+ // [-loplugin:fakebool] false positive:
sal_Bool b = true;
CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b));
CPPUNIT_ASSERT_MESSAGE("sal_Bool", b);
@@ -336,6 +337,7 @@ void Test::testBoolean() {
CPPUNIT_ASSERT_MESSAGE("bool", !b);
}
{
+ // [-loplugin:fakebool] false positive:
sal_Bool b = true;
CPPUNIT_ASSERT_MESSAGE("sal_Bool", (a >>= b));
CPPUNIT_ASSERT_MESSAGE("sal_Bool", !b);
@@ -446,6 +448,7 @@ void Test::testByte() {
CPPUNIT_ASSERT_MESSAGE("bool", b);
}
{
+ // [-loplugin:fakebool] false positive:
sal_Bool b = true;
CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b));
CPPUNIT_ASSERT_MESSAGE("sal_Bool", b);
@@ -556,6 +559,7 @@ void Test::testShort() {
CPPUNIT_ASSERT_MESSAGE("bool", b);
}
{
+ // [-loplugin:fakebool] false positive:
sal_Bool b = true;
CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b));
CPPUNIT_ASSERT_MESSAGE("sal_Bool", b);
@@ -668,6 +672,7 @@ void Test::testUnsignedShort() {
CPPUNIT_ASSERT_MESSAGE("bool", b);
}
{
+ // [-loplugin:fakebool] false positive:
sal_Bool b = true;
CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b));
CPPUNIT_ASSERT_MESSAGE("sal_Bool", b);
@@ -778,6 +783,7 @@ void Test::testLong() {
CPPUNIT_ASSERT_MESSAGE("bool", b);
}
{
+ // [-loplugin:fakebool] false positive:
sal_Bool b = true;
CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b));
CPPUNIT_ASSERT_MESSAGE("sal_Bool", b);
@@ -888,6 +894,7 @@ void Test::testUnsignedLong() {
CPPUNIT_ASSERT_MESSAGE("bool", b);
}
{
+ // [-loplugin:fakebool] false positive:
sal_Bool b = true;
CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b));
CPPUNIT_ASSERT_MESSAGE("sal_Bool", b);
@@ -998,6 +1005,7 @@ void Test::testHyper() {
CPPUNIT_ASSERT_MESSAGE("bool", b);
}
{
+ // [-loplugin:fakebool] false positive:
sal_Bool b = true;
CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b));
CPPUNIT_ASSERT_MESSAGE("sal_Bool", b);
@@ -1108,6 +1116,7 @@ void Test::testUnsignedHyper() {
CPPUNIT_ASSERT_MESSAGE("bool", b);
}
{
+ // [-loplugin:fakebool] false positive:
sal_Bool b = true;
CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b));
CPPUNIT_ASSERT_MESSAGE("sal_Bool", b);
@@ -1218,6 +1227,7 @@ void Test::testFloat() {
CPPUNIT_ASSERT_MESSAGE("bool", b);
}
{
+ // [-loplugin:fakebool] false positive:
sal_Bool b = true;
CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b));
CPPUNIT_ASSERT_MESSAGE("sal_Bool", b);
@@ -1328,6 +1338,7 @@ void Test::testDouble() {
CPPUNIT_ASSERT_MESSAGE("bool", b);
}
{
+ // [-loplugin:fakebool] false positive:
sal_Bool b = true;
CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b));
CPPUNIT_ASSERT_MESSAGE("sal_Bool", b);
@@ -1439,6 +1450,7 @@ void Test::testChar() {
CPPUNIT_ASSERT_MESSAGE("bool", b);
}
{
+ // [-loplugin:fakebool] false positive:
sal_Bool b = true;
CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b));
CPPUNIT_ASSERT_MESSAGE("sal_Bool", b);
@@ -1549,6 +1561,7 @@ void Test::testString() {
CPPUNIT_ASSERT_MESSAGE("bool", b);
}
{
+ // [-loplugin:fakebool] false positive:
sal_Bool b = true;
CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b));
CPPUNIT_ASSERT_MESSAGE("sal_Bool", b);
@@ -1659,6 +1672,7 @@ void Test::testType() {
CPPUNIT_ASSERT_MESSAGE("bool", b);
}
{
+ // [-loplugin:fakebool] false positive:
sal_Bool b = true;
CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b));
CPPUNIT_ASSERT_MESSAGE("sal_Bool", b);
@@ -1770,6 +1784,7 @@ void Test::testSequence() {
CPPUNIT_ASSERT_MESSAGE("bool", b);
}
{
+ // [-loplugin:fakebool] false positive:
sal_Bool b = true;
CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b));
CPPUNIT_ASSERT_MESSAGE("sal_Bool", b);
@@ -1899,6 +1914,7 @@ void Test::testEnum() {
CPPUNIT_ASSERT_MESSAGE("bool", b);
}
{
+ // [-loplugin:fakebool] false positive:
sal_Bool b = true;
CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b));
CPPUNIT_ASSERT_MESSAGE("sal_Bool", b);
@@ -2014,6 +2030,7 @@ void Test::testStruct() {
CPPUNIT_ASSERT_MESSAGE("bool", b);
}
{
+ // [-loplugin:fakebool] false positive:
sal_Bool b = true;
CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b));
CPPUNIT_ASSERT_MESSAGE("sal_Bool", b);
@@ -2155,6 +2172,7 @@ void Test::testException() {
CPPUNIT_ASSERT_MESSAGE("bool", b);
}
{
+ // [-loplugin:fakebool] false positive:
sal_Bool b = true;
CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b));
CPPUNIT_ASSERT_MESSAGE("sal_Bool", b);
@@ -2290,6 +2308,7 @@ void Test::testInterface() {
CPPUNIT_ASSERT_MESSAGE("bool", b);
}
{
+ // [-loplugin:fakebool] false positive:
sal_Bool b = true;
CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b));
CPPUNIT_ASSERT_MESSAGE("sal_Bool", b);
@@ -2421,6 +2440,7 @@ void Test::testNull() {
CPPUNIT_ASSERT_MESSAGE("bool", b);
}
{
+ // [-loplugin:fakebool] false positive:
sal_Bool b = true;
CPPUNIT_ASSERT_MESSAGE("sal_Bool", !(a >>= b));
CPPUNIT_ASSERT_MESSAGE("sal_Bool", b);
diff --git a/cppu/source/uno/check.cxx b/cppu/source/uno/check.cxx
index 8e99ff0a35c3..2c289587c8a6 100644
--- a/cppu/source/uno/check.cxx
+++ b/cppu/source/uno/check.cxx
@@ -69,8 +69,11 @@ struct D
};
struct E
{
+ // [-loplugin:fakebool] false positive:
sal_Bool a;
+ // [-loplugin:fakebool] false positive:
sal_Bool b;
+ // [-loplugin:fakebool] false positive:
sal_Bool c;
sal_Int16 d;
sal_Int32 e;
@@ -142,8 +145,10 @@ enum Enum
# pragma pack(pop)
#endif
+// [-loplugin:fakebool] false positive:
static_assert( static_cast<sal_Bool>(true) == sal_True,
"must be binary compatible" );
+// [-loplugin:fakebool] false positive:
static_assert( static_cast<sal_Bool>(false) == sal_False,
"must be binary compatible" );
#if SAL_TYPES_ALIGNMENT8 == 2