forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit75f4922
committed
Static assertions cleanup
Because we added StaticAssertStmt() first before StaticAssertDecl(),some uses as well as the instructions in c.h are now a bit backwardsfrom the "native" way static assertions are meant to be used in C.This updates the guidance and moves some static assertions to betterplaces.Specifically, since the addition of StaticAssertDecl(), we can putstatic assertions at the file level. This moves a number of staticassertions out of function bodies, where they might have been stuckout of necessity, to perhaps better places at the file level or inheader files.Also, when the static assertion appears in a position where adeclaration is allowed, then using StaticAssertDecl() is more nativethan StaticAssertStmt().Reviewed-by: John Naylor <john.naylor@enterprisedb.com>Discussion:https://www.postgresql.org/message-id/flat/941a04e7-dd6f-c0e4-8cdf-a33b3338cbda%40enterprisedb.com1 parent2613dec commit75f4922
File tree
29 files changed
+99
-104
lines changed- src
- backend
- access
- heap
- nbtree
- transam
- backup
- catalog
- executor
- libpq
- port
- storage
- lmgr
- page
- utils
- adt
- cache
- mmgr
- common
- include
- access
- catalog
- common
- storage
29 files changed
+99
-104
lines changedLines changed: 1 addition & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5783 | 5783 |
| |
5784 | 5784 |
| |
5785 | 5785 |
| |
5786 |
| - | |
5787 |
| - | |
5788 |
| - | |
5789 |
| - | |
5790 | 5786 |
| |
5791 | 5787 |
| |
5792 | 5788 |
| |
| |||
7921 | 7917 |
| |
7922 | 7918 |
| |
7923 | 7919 |
| |
7924 |
| - | |
| 7920 | + | |
7925 | 7921 |
| |
7926 | 7922 |
| |
7927 | 7923 |
| |
|
Lines changed: 0 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2486 | 2486 |
| |
2487 | 2487 |
| |
2488 | 2488 |
| |
2489 |
| - | |
2490 |
| - | |
2491 |
| - | |
2492 |
| - | |
2493 |
| - | |
2494 |
| - | |
2495 |
| - | |
2496 | 2489 |
| |
2497 | 2490 |
| |
2498 | 2491 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
275 | 275 |
| |
276 | 276 |
| |
277 | 277 |
| |
278 |
| - | |
| 278 | + | |
279 | 279 |
| |
280 | 280 |
| |
281 | 281 |
| |
|
Lines changed: 0 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3883 | 3883 |
| |
3884 | 3884 |
| |
3885 | 3885 |
| |
3886 |
| - | |
3887 |
| - | |
3888 |
| - | |
3889 |
| - | |
3890 |
| - | |
3891 |
| - | |
3892 |
| - | |
3893 |
| - | |
3894 |
| - | |
3895 | 3886 |
| |
3896 | 3887 |
| |
3897 | 3888 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
370 | 370 |
| |
371 | 371 |
| |
372 | 372 |
| |
373 |
| - | |
| 373 | + | |
374 | 374 |
| |
375 | 375 |
| |
376 | 376 |
| |
| |||
1745 | 1745 |
| |
1746 | 1746 |
| |
1747 | 1747 |
| |
1748 |
| - | |
| 1748 | + | |
1749 | 1749 |
| |
1750 | 1750 |
| |
1751 | 1751 |
| |
|
Lines changed: 6 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
191 | 191 |
| |
192 | 192 |
| |
193 | 193 |
| |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
194 | 200 |
| |
195 | 201 |
| |
196 | 202 |
| |
| |||
2550 | 2556 |
| |
2551 | 2557 |
| |
2552 | 2558 |
| |
2553 |
| - | |
2554 |
| - | |
2555 |
| - | |
2556 |
| - | |
2557 |
| - | |
2558 |
| - | |
2559 | 2559 |
| |
2560 | 2560 |
| |
2561 | 2561 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
496 | 496 |
| |
497 | 497 |
| |
498 | 498 |
| |
499 |
| - | |
| 499 | + | |
500 | 500 |
| |
501 | 501 |
| |
502 | 502 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1443 | 1443 |
| |
1444 | 1444 |
| |
1445 | 1445 |
| |
1446 |
| - | |
| 1446 | + | |
1447 | 1447 |
| |
1448 | 1448 |
| |
1449 | 1449 |
| |
|
Lines changed: 6 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
127 | 127 |
| |
128 | 128 |
| |
129 | 129 |
| |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
130 | 136 |
| |
131 | 137 |
| |
132 | 138 |
| |
| |||
3117 | 3123 |
| |
3118 | 3124 |
| |
3119 | 3125 |
| |
3120 |
| - | |
3121 |
| - | |
3122 |
| - | |
3123 |
| - | |
3124 |
| - | |
3125 |
| - | |
3126 | 3126 |
| |
3127 | 3127 |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
54 | 54 |
| |
55 | 55 |
| |
56 | 56 |
| |
57 |
| - | |
| 57 | + | |
58 | 58 |
| |
59 | 59 |
| |
60 | 60 |
| |
| |||
105 | 105 |
| |
106 | 106 |
| |
107 | 107 |
| |
108 |
| - | |
| 108 | + | |
109 | 109 |
| |
110 | 110 |
| |
111 | 111 |
| |
| |||
181 | 181 |
| |
182 | 182 |
| |
183 | 183 |
| |
184 |
| - | |
| 184 | + | |
185 | 185 |
| |
186 | 186 |
| |
187 | 187 |
| |
|
Lines changed: 3 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
108 | 108 |
| |
109 | 109 |
| |
110 | 110 |
| |
| 111 | + | |
| 112 | + | |
| 113 | + | |
111 | 114 |
| |
112 | 115 |
| |
113 | 116 |
| |
| |||
466 | 469 |
| |
467 | 470 |
| |
468 | 471 |
| |
469 |
| - | |
470 |
| - | |
471 |
| - | |
472 |
| - | |
473 |
| - | |
474 |
| - | |
475 | 472 |
| |
476 | 473 |
| |
477 | 474 |
| |
|
Lines changed: 6 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
20 | 26 |
| |
21 | 27 |
| |
22 | 28 |
| |
| |||
28 | 34 |
| |
29 | 35 |
| |
30 | 36 |
| |
31 |
| - | |
32 |
| - | |
33 |
| - | |
34 |
| - | |
35 |
| - | |
36 |
| - | |
37 |
| - | |
38 | 37 |
| |
39 | 38 |
| |
40 | 39 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4187 | 4187 |
| |
4188 | 4188 |
| |
4189 | 4189 |
| |
4190 |
| - | |
| 4190 | + | |
| 4191 | + | |
4191 | 4192 |
| |
4192 | 4193 |
| |
4193 | 4194 |
| |
|
Lines changed: 0 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
236 | 236 |
| |
237 | 237 |
| |
238 | 238 |
| |
239 |
| - | |
240 |
| - | |
241 | 239 |
| |
242 | 240 |
| |
243 | 241 |
| |
|
Lines changed: 8 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
77 | 85 |
| |
78 | 86 |
| |
79 | 87 |
| |
| |||
402 | 410 |
| |
403 | 411 |
| |
404 | 412 |
| |
405 |
| - | |
406 |
| - | |
407 |
| - | |
408 |
| - | |
409 |
| - | |
410 |
| - | |
411 |
| - | |
412 | 413 |
| |
413 | 414 |
| |
414 | 415 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1040 | 1040 |
| |
1041 | 1041 |
| |
1042 | 1042 |
| |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
1043 | 1046 |
| |
1044 | 1047 |
| |
1045 | 1048 |
| |
| |||
1068 | 1071 |
| |
1069 | 1072 |
| |
1070 | 1073 |
| |
1071 |
| - | |
1072 |
| - | |
1073 |
| - | |
1074 | 1074 |
| |
1075 | 1075 |
| |
1076 | 1076 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
306 | 306 |
| |
307 | 307 |
| |
308 | 308 |
| |
309 |
| - | |
| 309 | + | |
310 | 310 |
| |
311 | 311 |
| |
312 | 312 |
| |
| |||
358 | 358 |
| |
359 | 359 |
| |
360 | 360 |
| |
361 |
| - | |
| 361 | + | |
362 | 362 |
| |
363 | 363 |
| |
364 |
| - | |
| 364 | + | |
365 | 365 |
| |
366 | 366 |
| |
367 | 367 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
167 | 167 |
| |
168 | 168 |
| |
169 | 169 |
| |
170 |
| - | |
| 170 | + | |
171 | 171 |
| |
172 | 172 |
| |
173 | 173 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
151 | 151 |
| |
152 | 152 |
| |
153 | 153 |
| |
154 |
| - | |
| 154 | + | |
155 | 155 |
| |
156 | 156 |
| |
157 | 157 |
| |
|
Lines changed: 5 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
177 | 177 |
| |
178 | 178 |
| |
179 | 179 |
| |
180 |
| - | |
| 180 | + | |
181 | 181 |
| |
182 |
| - | |
| 182 | + | |
183 | 183 |
| |
184 |
| - | |
| 184 | + | |
185 | 185 |
| |
186 |
| - | |
| 186 | + | |
187 | 187 |
| |
188 |
| - | |
| 188 | + | |
189 | 189 |
| |
190 | 190 |
| |
191 | 191 |
| |
|
Lines changed: 0 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
149 | 149 |
| |
150 | 150 |
| |
151 | 151 |
| |
152 |
| - | |
153 |
| - | |
154 |
| - | |
155 |
| - | |
156 |
| - | |
157 |
| - | |
158 |
| - | |
159 |
| - | |
160 | 152 |
| |
161 | 153 |
| |
162 | 154 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
451 | 451 |
| |
452 | 452 |
| |
453 | 453 |
| |
| 454 | + | |
| 455 | + | |
| 456 | + | |
454 | 457 |
| |
455 | 458 |
| |
456 | 459 |
| |
| |||
469 | 472 |
| |
470 | 473 |
| |
471 | 474 |
| |
472 |
| - | |
473 |
| - | |
474 |
| - | |
475 | 475 |
| |
476 | 476 |
| |
477 | 477 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
| 60 | + | |
| 61 | + | |
| 62 | + | |
60 | 63 |
| |
61 | 64 |
| |
62 | 65 |
| |
|
0 commit comments
Comments
(0)