Avoid loplugin:constparam when param is cast to void
...which typically indicates that the param just has to be of the given type for some reason Change-Id: Ide30f514c5a849ae897c31c1744ece9df712a9fc
This commit is contained in:
@@ -187,8 +187,6 @@ bool ConstParams::VisitFunctionDecl(const FunctionDecl * functionDecl)
|
|||||||
|| name == "egiGraphicExport"
|
|| name == "egiGraphicExport"
|
||||||
|| name == "etiGraphicExport"
|
|| name == "etiGraphicExport"
|
||||||
|| name == "epsGraphicExport"
|
|| name == "epsGraphicExport"
|
||||||
|| name == "QueueCallbackFunction"
|
|
||||||
// apple_remote/source/HIDRemoteControlDevice.m
|
|
||||||
)
|
)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -419,8 +417,8 @@ bool ConstParams::checkIfCanBeConst(const Stmt* stmt, const ParmVarDecl* parmVar
|
|||||||
return false;
|
return false;
|
||||||
} else if (isa<CastExpr>(parent)) { // all other cast expression subtypes
|
} else if (isa<CastExpr>(parent)) { // all other cast expression subtypes
|
||||||
if (auto e = dyn_cast<ExplicitCastExpr>(parent)) {
|
if (auto e = dyn_cast<ExplicitCastExpr>(parent)) {
|
||||||
if (loplugin::TypeCheck(e->getTypeAsWritten()).Pointer().NonConst())
|
loplugin::TypeCheck tc(e->getTypeAsWritten());
|
||||||
{
|
if (tc.Pointer().NonConst() || tc.Void()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user