Skip to content

Commit 5c387db

Browse files
Fix 7-6 formatting
1 parent 508cb3d commit 5c387db

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

c/misra/src/rules/RULE-7-6/UseOfBannedSmallIntegerConstantMacro.ql

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

18-
1918
from MacroInvocation macroInvoke, IntegerConstantMacro macro
2019
where
2120
not isExcluded(macroInvoke, Types2Package::useOfBannedSmallIntegerConstantMacroQuery()) and
22-
macroInvoke.getMacro() = macro
23-
and macro.isSmall()
24-
select
25-
macroInvoke, "Usage of small integer constant macro " + macro.getName() + " is not allowed."
21+
macroInvoke.getMacro() = macro and
22+
macro.isSmall()
23+
select macroInvoke, "Usage of small integer constant macro " + macro.getName() + " is not allowed."

c/misra/test/rules/RULE-7-6/test.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#include "stdint.h"
22

3-
int8_t g1 = INT8_C(0x12); // NON-COMPLIANT
4-
uint8_t g2 = UINT8_C(0x12); // NON-COMPLIANT
5-
int16_t g3 = INT16_C(0x1234); // NON-COMPLIANT
3+
int8_t g1 = INT8_C(0x12); // NON-COMPLIANT
4+
uint8_t g2 = UINT8_C(0x12); // NON-COMPLIANT
5+
int16_t g3 = INT16_C(0x1234); // NON-COMPLIANT
66
uint16_t g4 = UINT16_C(0x1234); // NON-COMPLIANT
7-
int32_t g5 = INT32_C(0x1234); // COMPLIANT
7+
int32_t g5 = INT32_C(0x1234); // COMPLIANT
88
uint32_t g6 = UINT32_C(0x1234); // COMPLIANT
9-
int64_t g7 = INT64_C(0x1234); // COMPLIANT
9+
int64_t g7 = INT64_C(0x1234); // COMPLIANT
1010
uint64_t g8 = UINT64_C(0x1234); // COMPLIANT

0 commit comments

Comments
 (0)