diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-04-20 16:45:17 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-04-20 17:25:31 +0200 |
commit | a3858ed3a785507e7ed9c02cb1e145d2a4c4659b (patch) | |
tree | 9a39201f1fca556327aebde1400247a58adf104e /cppu/source/uno | |
parent | 12a4f93d1d412d58b1b13d814de589b10aa41e01 (diff) |
Use cast to bool to normalize sal_Bool values
Change-Id: I8a886f752d2a16ec4c10656bcd0b3631647971b2
Diffstat (limited to 'cppu/source/uno')
-rw-r--r-- | cppu/source/uno/assign.hxx | 2 | ||||
-rw-r--r-- | cppu/source/uno/copy.hxx | 4 | ||||
-rw-r--r-- | cppu/source/uno/eq.hxx | 8 |
3 files changed, 7 insertions, 7 deletions
diff --git a/cppu/source/uno/assign.hxx b/cppu/source/uno/assign.hxx index 5c6dc3202c9b..59257c44b09a 100644 --- a/cppu/source/uno/assign.hxx +++ b/cppu/source/uno/assign.hxx @@ -138,7 +138,7 @@ inline bool _assignData( switch (pSourceType->eTypeClass) { case typelib_TypeClass_BOOLEAN: - *static_cast<sal_Bool *>(pDest) = (*static_cast<sal_Bool *>(pSource) != sal_False); + *static_cast<sal_Bool *>(pDest) = bool(*static_cast<sal_Bool *>(pSource)); return true; default: return false; diff --git a/cppu/source/uno/copy.hxx b/cppu/source/uno/copy.hxx index f1ec222e4e2d..1e132c06ac87 100644 --- a/cppu/source/uno/copy.hxx +++ b/cppu/source/uno/copy.hxx @@ -116,7 +116,7 @@ inline void _copyConstructAnyFromData( break; case typelib_TypeClass_BOOLEAN: pDestAny->pData = &pDestAny->pReserved; - *static_cast<sal_Bool *>(pDestAny->pData) = (*static_cast<sal_Bool *>(pSource) != sal_False); + *static_cast<sal_Bool *>(pDestAny->pData) = bool(*static_cast<sal_Bool *>(pSource)); break; case typelib_TypeClass_BYTE: pDestAny->pData = &pDestAny->pReserved; @@ -524,7 +524,7 @@ inline void _copyConstructData( *static_cast<sal_Unicode *>(pDest) = *static_cast<sal_Unicode *>(pSource); break; case typelib_TypeClass_BOOLEAN: - *static_cast<sal_Bool *>(pDest) = (*static_cast<sal_Bool *>(pSource) != sal_False); + *static_cast<sal_Bool *>(pDest) = bool(*static_cast<sal_Bool *>(pSource)); break; case typelib_TypeClass_BYTE: *static_cast<sal_Int8 *>(pDest) = *static_cast<sal_Int8 *>(pSource); diff --git a/cppu/source/uno/eq.hxx b/cppu/source/uno/eq.hxx index 5a18e43dac19..008a204a104e 100644 --- a/cppu/source/uno/eq.hxx +++ b/cppu/source/uno/eq.hxx @@ -125,8 +125,8 @@ inline bool _equalSequence( { for ( sal_Int32 nPos = nElements; nPos--; ) { - if ((static_cast<sal_Bool *>(pDestElements)[nPos] != sal_False) != - (static_cast<sal_Bool *>(pSourceElements)[nPos] != sal_False)) + if (bool(static_cast<sal_Bool *>(pDestElements)[nPos]) != + bool(static_cast<sal_Bool *>(pSourceElements)[nPos])) { return false; } @@ -286,8 +286,8 @@ inline bool _equalData( && *static_cast<sal_Unicode *>(pDest) == *static_cast<sal_Unicode *>(pSource); case typelib_TypeClass_BOOLEAN: return eSourceTypeClass == typelib_TypeClass_BOOLEAN - && ((*static_cast<sal_Bool *>(pDest) != sal_False) - == (*static_cast<sal_Bool *>(pSource) != sal_False)); + && (bool(*static_cast<sal_Bool *>(pDest)) + == bool(*static_cast<sal_Bool *>(pSource))); case typelib_TypeClass_BYTE: switch (eSourceTypeClass) { |