projects
/
mech_eap.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2e94624
)
Introduce ARRAY_SIZE() macro
author
Jouni Malinen
<j@w1.fi>
Sat, 26 Oct 2013 14:00:01 +0000
(17:00 +0300)
committer
Jouni Malinen
<j@w1.fi>
Sat, 26 Oct 2013 14:49:00 +0000
(17:49 +0300)
This can be used to clean up the common sizeof(a)/sizeof(a[0])
constructions to use a more readable version.
Signed-hostap: Jouni Malinen <j@w1.fi>
src/utils/common.h
patch
|
blob
|
history
diff --git
a/src/utils/common.h
b/src/utils/common.h
index
399ab79
..
ba08cf4
100644
(file)
--- a/
src/utils/common.h
+++ b/
src/utils/common.h
@@
-518,6
+518,8
@@
int freq_range_list_includes(const struct wpa_freq_range_list *list,
unsigned int freq);
char * freq_range_list_str(const struct wpa_freq_range_list *list);
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+
/*
* gcc 4.4 ends up generating strict-aliasing warnings about some very common