Many are because argc is 'int' not 'unsigned', others just laziness.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* int main(int argc, char *argv[])
* {
* bool casefold = false;
- * unsigned int i;
+ * int i;
*
* if (argc < 2) {
* fprintf(stderr, "Usage: %s [-i] <list>...\n"
* {
* char *code, *problems;
* struct cdump_definitions *defs;
- * int i, j;
+ * int i;
+ * size_t j;
*
* // Read code from stdin.
* code = grab_file(NULL, NULL);
* int main(int argc, char *argv[])
* {
* struct htable ht;
- * unsigned int i;
+ * int i;
* unsigned long val;
*
* if (argc < 2)
*
* // 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.
* {
* struct parent p;
* struct child *c;
- * unsigned int i;
+ * int i;
*
* if (argc < 2)
* errx(1, "Usage: %s parent children...", argv[0]);
* return false;
* }
* // A short write means out of space.
- * if (ret < strlen(string)) {
+ * if (ret < (int)strlen(string)) {
* unlink(file);
* errno = ENOSPC;
* return false;
* 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);
*
*
* int main(int argc, char *argv[])
* {
- * unsigned int i;
+ * int i;
* const char **values;
*
* // Initialize cache.