Kaydet (Commit) d19598b5 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Adapt ImplicitBoolConversion to 32-bit builds (where sal_Int32 is long)

Change-Id: I64480e6026e7e39fe89f90c7d269f6bb1d02968d
üst 08ab5747
...@@ -493,12 +493,23 @@ bool ImplicitBoolConversion::TraverseReturnStmt(ReturnStmt * stmt) { ...@@ -493,12 +493,23 @@ bool ImplicitBoolConversion::TraverseReturnStmt(ReturnStmt * stmt) {
} }
bool ImplicitBoolConversion::TraverseFunctionDecl(FunctionDecl * decl) { bool ImplicitBoolConversion::TraverseFunctionDecl(FunctionDecl * decl) {
bool ext = hasCLanguageLinkageType(decl) bool ext = false;
&& decl->isThisDeclarationADefinition() if (hasCLanguageLinkageType(decl) && decl->isThisDeclarationADefinition()) {
&& (compat::getReturnType(*decl)->isSpecificBuiltinType( QualType t { compat::getReturnType(*decl) };
BuiltinType::Int) if (t->isSpecificBuiltinType(BuiltinType::Int)
|| compat::getReturnType(*decl)->isSpecificBuiltinType( || t->isSpecificBuiltinType(BuiltinType::UInt))
BuiltinType::UInt)); {
ext = true;
} else {
TypedefType const * t2 = t->getAs<TypedefType>();
// cf. rtl_locale_equals (and sal_Int32 can be long):
if (t2 != nullptr
&& t2->getDecl()->getNameAsString() == "sal_Int32")
{
ext = true;
}
}
}
if (ext) { if (ext) {
assert(!externCIntFunctionDefinition); assert(!externCIntFunctionDefinition);
externCIntFunctionDefinition = true; externCIntFunctionDefinition = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment