Commit a7b9ba00 authored by Rusty Russell's avatar Rusty Russell

asort, cdump, htable, list, noerr, strmap, tal/link: fix sign warnings in examples.

Many are because argc is 'int' not 'unsigned', others just laziness.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 7307b7ef
......@@ -31,7 +31,7 @@
* int main(int argc, char *argv[])
* {
* bool casefold = false;
* unsigned int i;
* int i;
*
* if (argc < 2) {
* fprintf(stderr, "Usage: %s [-i] <list>...\n"
......
......@@ -29,7 +29,8 @@
* {
* char *code, *problems;
* struct cdump_definitions *defs;
* int i, j;
* int i;
* size_t j;
*
* // Read code from stdin.
* code = grab_file(NULL, NULL);
......
......@@ -65,7 +65,7 @@
* int main(int argc, char *argv[])
* {
* struct htable ht;
* unsigned int i;
* int i;
* unsigned long val;
*
* if (argc < 2)
......@@ -74,7 +74,7 @@
*
* // Create and populate hash table.
* htable_init(&ht, rehash, NULL);
* for (i = 0; i < sizeof(map)/sizeof(map[0]); i++)
* for (i = 0; i < (int)(sizeof(map)/sizeof(map[0])); i++)
* htable_add(&ht, hash_string(map[i].name), &map[i]);
*
* // Add any aliases to the hash table.
......
......@@ -31,7 +31,7 @@
* {
* struct parent p;
* struct child *c;
* unsigned int i;
* int i;
*
* if (argc < 2)
* errx(1, "Usage: %s parent children...", argv[0]);
......
......@@ -37,7 +37,7 @@
* return false;
* }
* // A short write means out of space.
* if (ret < strlen(string)) {
* if (ret < (int)strlen(string)) {
* unlink(file);
* errno = ENOSPC;
* return false;
......
......@@ -33,7 +33,7 @@
* 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);
*
......
......@@ -87,7 +87,7 @@
*
* int main(int argc, char *argv[])
* {
* unsigned int i;
* int i;
* const char **values;
*
* // Initialize cache.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment