Merge branch 'vendor/OPENSSL'
[dragonfly.git] / test / cocci / NELEM.cocci
CommitLineData
faddfd67
SW
1//
2// Find cases where NELEM() can be used.
3//
4// Applies to userland and kernel code.
5//
cfa4e38f 6
80cb1f6f
SW
7@param@
8@@
9
10#include <sys/param.h>
11
12@depends on param@
13type E;
14E[] T;
15@@
16
17- sizeof(T)/sizeof(E)
18+ NELEM(T)
19
20@depends on param@
21type E;
22E[] T;
23@@
24
25- sizeof(T)/sizeof(*T)
26+ NELEM(T)
27
28@depends on param@
29type E;
30E[] T;
31@@
32
33- sizeof(T)/sizeof(T[...])
34+ NELEM(T)