Skip to content

Commit ea31308

Browse files
committed
Format test.c for DIR-4-6
1 parent 2889a5d commit ea31308

File tree

1 file changed

+27
-27
lines changed
  • c/misra/test/rules/DIR-4-6

1 file changed

+27
-27
lines changed

c/misra/test/rules/DIR-4-6/test.c

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
typedef signed char int8_t; // COMPLIANT: exception, typedefs are permitted
2-
typedef unsigned char uint8_t; // COMPLIANT: exception, typedefs are permitted
1+
typedef signed char int8_t; // COMPLIANT: exception, typedefs are permitted
2+
typedef unsigned char uint8_t; // COMPLIANT: exception, typedefs are permitted
33

44
typedef signed short int16_t; // COMPLIANT: exception, typedefs are permitted
55
typedef unsigned short uint16_t; // COMPLIANT: exception, typedefs are permitted
66

7-
typedef signed int int32_t; // COMPLIANT: exception, typedefs are permitted
8-
typedef unsigned int uint32_t; // COMPLIANT: exception, typedefs are permitted
7+
typedef signed int int32_t; // COMPLIANT: exception, typedefs are permitted
8+
typedef unsigned int uint32_t; // COMPLIANT: exception, typedefs are permitted
99

10-
typedef signed long int64_t; // COMPLIANT: exception, typedefs are permitted
11-
typedef unsigned long uint64_t; // COMPLIANT: exception, typedefs are permitted
10+
typedef signed long int64_t; // COMPLIANT: exception, typedefs are permitted
11+
typedef unsigned long uint64_t; // COMPLIANT: exception, typedefs are permitted
1212

1313
typedef signed long long
14-
int4_t; // NON_COMPLIANT: typedef does not have its indicated size
14+
int4_t; // NON_COMPLIANT: typedef does not have its indicated size
1515
typedef unsigned long long
1616
uint4_t; // NON_COMPLIANT: typedef does not have its indicated size
1717

@@ -28,38 +28,38 @@ typedef int
2828

2929
int // COMPLIANT: exception, main's return type can be plain int
3030
main(int argc, // COMPLIANT: exception, argc's type can be plain int
31-
char *argv[]) { // COMPLIANT: char is not a basic numeric type
31+
char *argv[]) { // COMPLIANT: char is not a basic numeric type
3232

33-
char c1 = 1; // COMPLIANT: char is not a basic numeric type
34-
signed char c2 = 1; // NON_COMPLIANT: use typedef int8_t
35-
unsigned char c3 = 1; // NON_COMPLIANT: use typedef uint8_t
36-
int8_t c4 = 1; // COMPLIANT: typedef used instead
33+
char c1 = 1; // COMPLIANT: char is not a basic numeric type
34+
signed char c2 = 1; // NON_COMPLIANT: use typedef int8_t
35+
unsigned char c3 = 1; // NON_COMPLIANT: use typedef uint8_t
36+
int8_t c4 = 1; // COMPLIANT: typedef used instead
3737

38-
short s1 = 1; // NON_COMPLIANT: short is a basic numeric type
39-
signed short s2 = 1; // NON_COMPLIANT: use typedef int16_t
40-
unsigned short s3 = 1; // NON_COMPLIANT: use typedef uint16_t
41-
int16_t s4 = 1; // COMPLIANT: typedef used instead
38+
short s1 = 1; // NON_COMPLIANT: short is a basic numeric type
39+
signed short s2 = 1; // NON_COMPLIANT: use typedef int16_t
40+
unsigned short s3 = 1; // NON_COMPLIANT: use typedef uint16_t
41+
int16_t s4 = 1; // COMPLIANT: typedef used instead
4242

43-
int i1 = 1; // NON_COMPLIANT: int is a basic numeric type
44-
signed int i2 = 1; // NON_COMPLIANT: use typedef int32_t
45-
unsigned int i3 = 1; // NON_COMPLIANT: use typedef uint32_t
46-
int32_t i4 = 1; // COMPLIANT: typedef used instead
43+
int i1 = 1; // NON_COMPLIANT: int is a basic numeric type
44+
signed int i2 = 1; // NON_COMPLIANT: use typedef int32_t
45+
unsigned int i3 = 1; // NON_COMPLIANT: use typedef uint32_t
46+
int32_t i4 = 1; // COMPLIANT: typedef used instead
4747

48-
long l1 = 1; // NON_COMPLIANT: int is a basic numeric type
49-
signed long l2 = 1; // NON_COMPLIANT: use typedef int64_t
50-
unsigned long l3 = 1; // NON_COMPLIANT: use typedef uint64_t
51-
int64_t l4 = 1; // COMPLIANT: typedef used instead
48+
long l1 = 1; // NON_COMPLIANT: int is a basic numeric type
49+
signed long l2 = 1; // NON_COMPLIANT: use typedef int64_t
50+
unsigned long l3 = 1; // NON_COMPLIANT: use typedef uint64_t
51+
int64_t l4 = 1; // COMPLIANT: typedef used instead
5252

5353
long long ll1 = 1; // NON_COMPLIANT: int is a basic numeric type
5454
signed long long ll2 = 1; // NON_COMPLIANT: use typedef int64_t
5555
unsigned long long ll3 = 1; // NON_COMPLIANT: use typedef uint64_t
5656
int64_t ll4 = 1; // COMPLIANT: typedef used instead
5757

5858
float f1 = 1; // NON_COMPLIANT: float is a basic numeric type, use a typedef
59-
float32_t f2 = 1; // COMPLIANT: typedef used instead
59+
float32_t f2 = 1; // COMPLIANT: typedef used instead
6060

61-
double d1 = 1; // NON_COMPLIANT: int is a basic numeric type
62-
float64_t d2 = 1; // COMPLIANT: typedef used instead
61+
double d1 = 1; // NON_COMPLIANT: int is a basic numeric type
62+
float64_t d2 = 1; // COMPLIANT: typedef used instead
6363

6464
long double ld1 = 1; // NON_COMPLIANT: int is a basic numeric type
6565
float128_t ld2 = 1; // COMPLIANT: typedef used instead

0 commit comments

Comments
 (0)