projects
/
ccan
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
alignof, array_size, crc: provide comments to allow testing examples.
[ccan]
/
ccan
/
array_size
/
_info
diff --git
a/ccan/array_size/_info
b/ccan/array_size/_info
index 63b6b50e40f85bf7217c0dd39e29d0f9cb821905..af7ef1cfd291cd5179ad11ad5d8e26c55d512f30 100644
(file)
--- a/
ccan/array_size/_info
+++ b/
ccan/array_size/_info
@@
-12,17
+12,21
@@
* macro or constant.
*
* Example:
* macro or constant.
*
* Example:
+ * // Outputs "Initialized 32 values"
* #include <ccan/array_size/array_size.h>
* #include <stdlib.h>
* #include <ccan/array_size/array_size.h>
* #include <stdlib.h>
+ * #include <stdio.h>
*
* // We currently use 32 random values.
* static unsigned int vals[32];
*
*
* // We currently use 32 random values.
* static unsigned int vals[32];
*
- *
static void init_values
(void)
+ *
int main
(void)
* {
* unsigned int i;
* for (i = 0; i < ARRAY_SIZE(vals); i++)
* vals[i] = random();
* {
* unsigned int i;
* for (i = 0; i < ARRAY_SIZE(vals); i++)
* vals[i] = random();
+ * printf("Initialized %u values\n", i);
+ * return 0;
* }
*
* License: LGPL (2 or any later version)
* }
*
* License: LGPL (2 or any later version)