summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compilerplugins/clang/redundantcast.cxx13
-rw-r--r--include/tools/vcompat.hxx13
2 files changed, 19 insertions, 7 deletions
diff --git a/compilerplugins/clang/redundantcast.cxx b/compilerplugins/clang/redundantcast.cxx
index 20a04b2176c7..72391256b285 100644
--- a/compilerplugins/clang/redundantcast.cxx
+++ b/compilerplugins/clang/redundantcast.cxx
@@ -330,9 +330,18 @@ bool RedundantCast::VisitCStyleCastExpr(CStyleCastExpr const * expr) {
<< t1 << t2 << expr->getSourceRange();
return true;
}
- bool bBuiltinType = t1->isSpecificBuiltinType(BuiltinType::Bool) || t1->isSpecificBuiltinType(BuiltinType::Double)
+ bool bBuiltinType = t1->isSpecificBuiltinType(BuiltinType::Bool)
+ || t1->isSpecificBuiltinType(BuiltinType::Void)
|| t1->isSpecificBuiltinType(BuiltinType::Float)
- || t1->isSpecificBuiltinType(BuiltinType::Void);
+ || t1->isSpecificBuiltinType(BuiltinType::Double)
+ || t1->isSpecificBuiltinType(BuiltinType::UChar)
+ || t1->isSpecificBuiltinType(BuiltinType::Char_U)
+ || t1->isSpecificBuiltinType(BuiltinType::SChar)
+ || t1->isSpecificBuiltinType(BuiltinType::Char_S)
+ || t1->isSpecificBuiltinType(BuiltinType::Char16)
+ || t1->isSpecificBuiltinType(BuiltinType::Char32)
+ || t1->isSpecificBuiltinType(BuiltinType::WChar_U)
+ || t1->isSpecificBuiltinType(BuiltinType::WChar_S);
if ((bBuiltinType || loplugin::TypeCheck(t1).Typedef()) && t1 == t2)
{
// Ignore FD_ISSET expanding to "...(SOCKET)(fd)..." in some Microsoft
diff --git a/include/tools/vcompat.hxx b/include/tools/vcompat.hxx
index 71b64beef916..0adf6913ea86 100644
--- a/include/tools/vcompat.hxx
+++ b/include/tools/vcompat.hxx
@@ -21,11 +21,14 @@
#include <tools/toolsdllapi.h>
-#define COMPAT_FORMAT( char1, char2, char3, char4 ) \
- ((sal_uInt32)((((sal_uInt32)(char)(char1)))| \
- (((sal_uInt32)(char)(char2))<<8UL)| \
- (((sal_uInt32)(char)(char3))<<16UL)| \
- ((sal_uInt32)(char)(char4))<<24UL))
+inline sal_uInt32 COMPAT_FORMAT( char char1, char char2, char char3, char char4 )
+{
+ return
+ ((sal_uInt32)char1) |
+ (((sal_uInt32)char2) << 8) |
+ (((sal_uInt32)char3) << 16) |
+ (((sal_uInt32)char4) << 24);
+};
class SvStream;
enum class StreamMode;