repo.or.cz
/
dragonfly.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
inet: Local group index is not assigned in jail.
[dragonfly.git]
/
test
/
cocci
/
NELEM.cocci
blob
86ed24bf879c1ff93a94d142ecd46d965924596f
1
//
2
// Find cases where NELEM() can be used.
3
//
4
// Applies to userland and kernel code.
5
//
6
7
@param@
8
@@
9
10
#include <sys/param.h>
11
12
@depends on param@
13
type E;
14
E[] T;
15
@@
16
17
- sizeof(T)/sizeof(E)
18
+ NELEM(T)
19
20
@depends on param@
21
type E;
22
E[] T;
23
@@
24
25
- sizeof(T)/sizeof(*T)
26
+ NELEM(T)
27
28
@depends on param@
29
type E;
30
E[] T;
31
@@
32
33
- sizeof(T)/sizeof(T[...])
34
+ NELEM(T)