|
@@ -12,17 +12,21 @@
|
|
|
* macro or constant.
|
|
* macro or constant.
|
|
|
*
|
|
*
|
|
|
* Example:
|
|
* Example:
|
|
|
|
|
+ * // Outputs "Initialized 32 values"
|
|
|
* #include <ccan/array_size/array_size.h>
|
|
* #include <ccan/array_size/array_size.h>
|
|
|
* #include <stdlib.h>
|
|
* #include <stdlib.h>
|
|
|
|
|
+ * #include <stdio.h>
|
|
|
*
|
|
*
|
|
|
* // We currently use 32 random values.
|
|
* // We currently use 32 random values.
|
|
|
* static unsigned int vals[32];
|
|
* static unsigned int vals[32];
|
|
|
*
|
|
*
|
|
|
- * static void init_values(void)
|
|
|
|
|
|
|
+ * int main(void)
|
|
|
* {
|
|
* {
|
|
|
* unsigned int i;
|
|
* unsigned int i;
|
|
|
* for (i = 0; i < ARRAY_SIZE(vals); i++)
|
|
* for (i = 0; i < ARRAY_SIZE(vals); i++)
|
|
|
* vals[i] = random();
|
|
* 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)
|