]> git.ozlabs.org Git - ccan/blobdiff - ccan/strmap/_info
base64: fix for unsigned chars (e.g. ARM).
[ccan] / ccan / strmap / _info
index 6d03b0caaa9c4c81ec30bba34e66e3dddf4d7dbb..eba8fe444ae78e1119e03644ab0f55d29d1d4d23 100644 (file)
@@ -1,5 +1,6 @@
-#include <string.h>
 #include "config.h"
+#include <stdio.h>
+#include <string.h>
 
 /**
  * strmap - an ordered map of strings to values
  *     license_depends_compat FAIL
  *
  * Example:
+ * #include <ccan/compiler/compiler.h>
  * #include <ccan/strmap/strmap.h>
  * #include <stdio.h>
  *
- * static bool dump(const char *member, size_t value, void *unused)
+ * static bool dump(const char *member, size_t value, void *unused UNNEEDED)
  * {
  *     printf("%s at %zu. ", member, value);
  *     // true means keep going with iteration.
  * int main(int argc, char *argv[])
  * {
  *     size_t i;
- *     struct { STRMAP_MEMBERS(size_t); } map;
+ *     STRMAP(size_t) map;
  *
  *     strmap_init(&map);
- *     for (i = 1; i < argc; i++)
+ *     for (i = 1; i < (size_t)argc; i++)
  *             // This only adds the first time for this arg.
  *             strmap_add(&map, argv[i], i);
  *
@@ -39,9 +41,9 @@
  *     printf("\n");
  *     return 0;
  * }
- * // Given 'foo' outputs 'foo at 1. '
- * // Given 'foo bar' outputs 'bar at 2. foo at 1. '
- * // Given 'foo foo bar zebra' outputs 'bar at 3. foo at 1. zebra at 4. '
+ * // Given "foo" outputs "foo at 1. \n"
+ * // Given "foo bar" outputs "bar at 2. foo at 1. \n"
+ * // Given "foo foo bar zebra" outputs "bar at 3. foo at 1. zebra at 4. \n"
  */
 int main(int argc, char *argv[])
 {