Skip to content

Commit 8729c43

Browse files
committed
Rule 11.9: Format test file
1 parent 422f170 commit 8729c43

File tree

1 file changed

+9
-9
lines changed
  • c/misra/test/rules/RULE-11-9

1 file changed

+9
-9
lines changed

c/misra/test/rules/RULE-11-9/test.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ void *f1(void *p1, int p2) {
2020
if (p2 == 0) { // COMPLIANT
2121
return NULL;
2222
}
23-
p2 ? p1 : 0; // NON_COMPLIANT
24-
p2 ? 0 : p1; // NON_COMPLIANT
25-
p2 ? (void*) 0 : p1; // COMPLIANT
26-
p2 ? p1 : (void*) 0; // COMPLIANT
27-
p2 ? p2 : 0; // COMPLIANT - p2 is not a pointer type
28-
p2 ? 0 : p2; // COMPLIANT - p2 is not a pointer type
23+
p2 ? p1 : 0; // NON_COMPLIANT
24+
p2 ? 0 : p1; // NON_COMPLIANT
25+
p2 ? (void *)0 : p1; // COMPLIANT
26+
p2 ? p1 : (void *)0; // COMPLIANT
27+
p2 ? p2 : 0; // COMPLIANT - p2 is not a pointer type
28+
p2 ? 0 : p2; // COMPLIANT - p2 is not a pointer type
2929
int x;
3030
int *y;
31-
p2 ? (p1 = 0) : p1; // NON_COMPLIANT - p1 is a pointer type
32-
p2 ? (p2 = 0) : p1; // COMPLIANT - p2 is not a pointer type
33-
return 0; // COMPLIANT
31+
p2 ? (p1 = 0) : p1; // NON_COMPLIANT - p1 is a pointer type
32+
p2 ? (p2 = 0) : p1; // COMPLIANT - p2 is not a pointer type
33+
return 0; // COMPLIANT
3434
}

0 commit comments

Comments
 (0)