Skip to content

Commit a065203

Browse files
committed
Rule 8.2.7: Simplify CodeQL
1 parent f9a6844 commit a065203

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

cpp/misra/src/rules/RULE-8-2-7/NoPointerToIntegralCast.ql

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515
import cpp
1616
import codingstandards.cpp.misra
1717

18-
from Cast cast, Type sourceType, Type targetType
18+
from Cast cast, Type sourceType, IntegralType targetType
1919
where
2020
not isExcluded(cast, Conversions2Package::noPointerToIntegralCastQuery()) and
2121
sourceType = cast.getExpr().getType().getUnspecifiedType() and
2222
targetType = cast.getType().getUnspecifiedType() and
23-
(sourceType instanceof PointerType or sourceType instanceof FunctionPointerType) and
24-
targetType instanceof IntegralType
25-
select cast, "Cast converts pointer type to integral type '" + targetType.toString() + "'."
23+
(sourceType instanceof PointerType or sourceType instanceof FunctionPointerType)
24+
select cast, "Cast converts pointer type to integral type '" + targetType + "'."

0 commit comments

Comments
 (0)