|
8 | 8 | // => 'unmatched suppression' warnings are false negatives. |
9 | 9 | // |
10 | 10 |
|
11 | | -void test__SDL_mutexP__noreturn() { |
12 | | - int x = 1; |
13 | | - if (cond) { x=100; SDL_mutexP(arg1); } |
14 | | - // cppcheck-suppress shiftTooManyBits |
15 | | - x = 1 << x; |
| 11 | +void test__SDL_mutexP__noreturn() |
| 12 | +{ |
| 13 | + int x = 1; |
| 14 | + if (cond) { |
| 15 | + x=100; |
| 16 | + SDL_mutexP(arg1); |
| 17 | + } |
| 18 | + // cppcheck-suppress shiftTooManyBits |
| 19 | + x = 1 << x; |
16 | 20 | } |
17 | 21 |
|
18 | | -void test__SDL_mutexP__arg1__notbool() { |
19 | | - // cppcheck-suppress invalidFunctionArgBool |
20 | | - SDL_mutexP(!x); |
| 22 | +void test__SDL_mutexP__arg1__notbool() |
| 23 | +{ |
| 24 | + // cppcheck-suppress invalidFunctionArgBool |
| 25 | + SDL_mutexP(!x); |
21 | 26 | } |
22 | 27 |
|
23 | | -void test__SDL_mutexP__arg1__notnull() { |
24 | | - const char *p = NULL; |
25 | | - // cppcheck-suppress nullPointer |
26 | | - SDL_mutexP(p); |
| 28 | +void test__SDL_mutexP__arg1__notnull() |
| 29 | +{ |
| 30 | + // cppcheck-suppress nullPointer |
| 31 | + SDL_mutexP(NULL); |
27 | 32 | } |
28 | 33 |
|
29 | | -void test__SDL_mutexV__noreturn() { |
30 | | - int x = 1; |
31 | | - if (cond) { x=100; SDL_mutexV(arg1); } |
32 | | - // cppcheck-suppress shiftTooManyBits |
33 | | - x = 1 << x; |
| 34 | +void test__SDL_mutexV__noreturn() |
| 35 | +{ |
| 36 | + int x = 1; |
| 37 | + if (cond) { |
| 38 | + x=100; |
| 39 | + SDL_mutexV(arg1); |
| 40 | + } |
| 41 | + // cppcheck-suppress shiftTooManyBits |
| 42 | + x = 1 << x; |
34 | 43 | } |
35 | 44 |
|
36 | | -void test__SDL_mutexV__arg1__notbool() { |
37 | | - // cppcheck-suppress invalidFunctionArgBool |
38 | | - SDL_mutexV(!x); |
| 45 | +void test__SDL_mutexV__arg1__notbool() |
| 46 | +{ |
| 47 | + // cppcheck-suppress invalidFunctionArgBool |
| 48 | + SDL_mutexV(!x); |
39 | 49 | } |
40 | 50 |
|
41 | | -void test__SDL_mutexV__arg1__notnull() { |
42 | | - const char *p = NULL; |
43 | | - // cppcheck-suppress nullPointer |
44 | | - SDL_mutexV(p); |
| 51 | +void test__SDL_mutexV__arg1__notnull() |
| 52 | +{ |
| 53 | + // cppcheck-suppress nullPointer |
| 54 | + SDL_mutexV(NULL); |
45 | 55 | } |
46 | 56 |
|
47 | | -void test__SDL_RWsize__noreturn() { |
48 | | - int x = 1; |
49 | | - if (cond) { x=100; SDL_RWsize(arg1); } |
50 | | - // cppcheck-suppress shiftTooManyBits |
51 | | - x = 1 << x; |
| 57 | +void test__SDL_RWsize__noreturn() |
| 58 | +{ |
| 59 | + int x = 1; |
| 60 | + if (cond) { |
| 61 | + x=100; |
| 62 | + SDL_RWsize(arg1); |
| 63 | + } |
| 64 | + // cppcheck-suppress shiftTooManyBits |
| 65 | + x = 1 << x; |
52 | 66 | } |
53 | 67 |
|
54 | | -void test__SDL_RWsize__arg1__notbool() { |
55 | | - // cppcheck-suppress invalidFunctionArgBool |
56 | | - SDL_RWsize(!x); |
| 68 | +void test__SDL_RWsize__arg1__notbool() |
| 69 | +{ |
| 70 | + // cppcheck-suppress invalidFunctionArgBool |
| 71 | + SDL_RWsize(!x); |
57 | 72 | } |
58 | 73 |
|
59 | | -void test__SDL_RWsize__arg1__notnull() { |
60 | | - const char *p = NULL; |
61 | | - // cppcheck-suppress nullPointer |
62 | | - SDL_RWsize(p); |
| 74 | +void test__SDL_RWsize__arg1__notnull() |
| 75 | +{ |
| 76 | + // cppcheck-suppress nullPointer |
| 77 | + SDL_RWsize(NULL); |
63 | 78 | } |
64 | 79 |
|
65 | | -void test__SDL_RWread__noreturn() { |
66 | | - int x = 1; |
67 | | - if (cond) { x=100; SDL_RWread(arg1, arg2); } |
68 | | - // cppcheck-suppress shiftTooManyBits |
69 | | - x = 1 << x; |
| 80 | +void test__SDL_RWread__noreturn() |
| 81 | +{ |
| 82 | + int x = 1; |
| 83 | + if (cond) { |
| 84 | + x=100; |
| 85 | + SDL_RWread(arg1, arg2); |
| 86 | + } |
| 87 | + // cppcheck-suppress shiftTooManyBits |
| 88 | + x = 1 << x; |
70 | 89 | } |
71 | 90 |
|
72 | | -void test__SDL_RWread__arg1__notbool() { |
73 | | - // cppcheck-suppress invalidFunctionArgBool |
74 | | - SDL_RWread(!x, arg2); |
| 91 | +void test__SDL_RWread__arg1__notbool() |
| 92 | +{ |
| 93 | + // cppcheck-suppress invalidFunctionArgBool |
| 94 | + SDL_RWread(!x, arg2); |
75 | 95 | } |
76 | 96 |
|
77 | | -void test__SDL_RWread__arg1__notnull() { |
78 | | - const char *p = NULL; |
79 | | - // cppcheck-suppress nullPointer |
80 | | - SDL_RWread(p, arg2); |
| 97 | +void test__SDL_RWread__arg1__notnull() |
| 98 | +{ |
| 99 | + // cppcheck-suppress nullPointer |
| 100 | + SDL_RWread(NULL, arg2); |
81 | 101 | } |
82 | 102 |
|
83 | | -void test__SDL_RWread__arg2__notbool() { |
84 | | - // cppcheck-suppress invalidFunctionArgBool |
85 | | - SDL_RWread(arg1, !x); |
| 103 | +void test__SDL_RWread__arg2__notbool() |
| 104 | +{ |
| 105 | + // cppcheck-suppress invalidFunctionArgBool |
| 106 | + SDL_RWread(arg1, !x); |
86 | 107 | } |
87 | 108 |
|
88 | | -void test__SDL_RWread__arg2__notnull() { |
89 | | - const char *p = NULL; |
90 | | - // cppcheck-suppress nullPointer |
91 | | - SDL_RWread(arg1, p); |
| 109 | +void test__SDL_RWread__arg2__notnull() |
| 110 | +{ |
| 111 | + // cppcheck-suppress nullPointer |
| 112 | + SDL_RWread(arg1, NULL); |
92 | 113 | } |
93 | 114 |
|
94 | | -void test__IMG_isPNG__noreturn() { |
95 | | - int x = 1; |
96 | | - if (cond) { x=100; IMG_isPNG(arg1); } |
97 | | - // cppcheck-suppress shiftTooManyBits |
98 | | - x = 1 << x; |
| 115 | +void test__IMG_isPNG__noreturn() |
| 116 | +{ |
| 117 | + int x = 1; |
| 118 | + if (cond) { |
| 119 | + x=100; |
| 120 | + IMG_isPNG(arg1); |
| 121 | + } |
| 122 | + // cppcheck-suppress shiftTooManyBits |
| 123 | + x = 1 << x; |
99 | 124 | } |
100 | 125 |
|
101 | | -void test__IMG_isPNG__arg1__notbool() { |
102 | | - // cppcheck-suppress invalidFunctionArgBool |
103 | | - IMG_isPNG(!x); |
| 126 | +void test__IMG_isPNG__arg1__notbool() |
| 127 | +{ |
| 128 | + // cppcheck-suppress invalidFunctionArgBool |
| 129 | + IMG_isPNG(!x); |
104 | 130 | } |
105 | 131 |
|
106 | | -void test__IMG_isPNG__arg1__notnull() { |
107 | | - const char *p = NULL; |
108 | | - // cppcheck-suppress nullPointer |
109 | | - IMG_isPNG(p); |
| 132 | +void test__IMG_isPNG__arg1__notnull() |
| 133 | +{ |
| 134 | + // cppcheck-suppress nullPointer |
| 135 | + IMG_isPNG(NULL); |
110 | 136 | } |
111 | 137 |
|
112 | | -void test__IMG_isJPG__noreturn() { |
113 | | - int x = 1; |
114 | | - if (cond) { x=100; IMG_isJPG(arg1); } |
115 | | - // cppcheck-suppress shiftTooManyBits |
116 | | - x = 1 << x; |
| 138 | +void test__IMG_isJPG__noreturn() |
| 139 | +{ |
| 140 | + int x = 1; |
| 141 | + if (cond) { |
| 142 | + x=100; |
| 143 | + IMG_isJPG(arg1); |
| 144 | + } |
| 145 | + // cppcheck-suppress shiftTooManyBits |
| 146 | + x = 1 << x; |
117 | 147 | } |
118 | 148 |
|
119 | | -void test__IMG_isJPG__arg1__notbool() { |
120 | | - // cppcheck-suppress invalidFunctionArgBool |
121 | | - IMG_isJPG(!x); |
| 149 | +void test__IMG_isJPG__arg1__notbool() |
| 150 | +{ |
| 151 | + // cppcheck-suppress invalidFunctionArgBool |
| 152 | + IMG_isJPG(!x); |
122 | 153 | } |
123 | 154 |
|
124 | | -void test__IMG_isJPG__arg1__notnull() { |
125 | | - const char *p = NULL; |
126 | | - // cppcheck-suppress nullPointer |
127 | | - IMG_isJPG(p); |
| 155 | +void test__IMG_isJPG__arg1__notnull() |
| 156 | +{ |
| 157 | + // cppcheck-suppress nullPointer |
| 158 | + IMG_isJPG(NULL); |
128 | 159 | } |
129 | 160 |
|
0 commit comments