Skip to content

Commit 17b1ef9

Browse files
committed
Inline isInappropriateType and fix .expected
1 parent 26c8f62 commit 17b1ef9

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

c/misra/src/rules/RULE-6-1/BitFieldsShallOnlyBeDeclaredWithAnAppropriateType.ql

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,8 @@ predicate isAppropriateTypedef(Type type) {
2828
isAppropriatePrimitive(type.(TypedefType).resolveTypedefs())
2929
}
3030

31-
predicate isInappropriateType(Type type) {
32-
not (isAppropriatePrimitive(type) or isAppropriateTypedef(type))
33-
}
34-
3531
from BitField bitField
3632
where
3733
not isExcluded(bitField, TypesPackage::bitFieldsShallOnlyBeDeclaredWithAnAppropriateTypeQuery()) and
38-
isInappropriateType(bitField.getType())
34+
not (isAppropriatePrimitive(bitField.getType()) or isAppropriateTypedef(bitField.getType()))
3935
select bitField, "Bit-field " + bitField + " is declared on type " + bitField + "."
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
| test.c:8:7:8:8 | b3 | Type int should not have a bit-field declaration at b3. |
2-
| test.c:11:15:11:16 | b5 | Type signed long should not have a bit-field declaration at b5. |
3-
| test.c:13:15:13:16 | b6 | Type signed char should not have a bit-field declaration at b6. |
4-
| test.c:14:14:14:15 | b7 | Type Color should not have a bit-field declaration at b7. |
1+
| test.c:8:7:8:8 | b3 | Bit-field b3 is declared on type b3. |
2+
| test.c:11:15:11:16 | b5 | Bit-field b5 is declared on type b5. |
3+
| test.c:13:15:13:16 | b6 | Bit-field b6 is declared on type b6. |
4+
| test.c:14:14:14:15 | b7 | Bit-field b7 is declared on type b7. |

0 commit comments

Comments
 (0)