Browse Source

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: Rusty Russell <rusty@rustcorp.com.au>
Rusty Russell 9 years ago
parent
commit
a7b9ba000d
7 changed files with 9 additions and 8 deletions
  1. 1 1
      ccan/asort/_info
  2. 2 1
      ccan/cdump/_info
  3. 2 2
      ccan/htable/_info
  4. 1 1
      ccan/list/_info
  5. 1 1
      ccan/noerr/_info
  6. 1 1
      ccan/strmap/_info
  7. 1 1
      ccan/tal/link/_info

+ 1 - 1
ccan/asort/_info

@@ -31,7 +31,7 @@
  *	int main(int argc, char *argv[])
  *	int main(int argc, char *argv[])
  *	{
  *	{
  *		bool casefold = false;
  *		bool casefold = false;
- *		unsigned int i;
+ *		int i;
  *	
  *	
  *		if (argc < 2) {
  *		if (argc < 2) {
  *			fprintf(stderr, "Usage: %s [-i] <list>...\n"
  *			fprintf(stderr, "Usage: %s [-i] <list>...\n"

+ 2 - 1
ccan/cdump/_info

@@ -29,7 +29,8 @@
  * {
  * {
  * 	char *code, *problems;
  * 	char *code, *problems;
  * 	struct cdump_definitions *defs;
  * 	struct cdump_definitions *defs;
- * 	int i, j;
+ * 	int i;
+ *	size_t j;
  *
  *
  * 	// Read code from stdin.
  * 	// Read code from stdin.
  * 	code = grab_file(NULL, NULL);
  * 	code = grab_file(NULL, NULL);

+ 2 - 2
ccan/htable/_info

@@ -65,7 +65,7 @@
  *	int main(int argc, char *argv[])
  *	int main(int argc, char *argv[])
  *	{
  *	{
  *		struct htable ht;
  *		struct htable ht;
- *		unsigned int i;
+ *		int i;
  *		unsigned long val;
  *		unsigned long val;
  *
  *
  *		if (argc < 2)
  *		if (argc < 2)
@@ -74,7 +74,7 @@
  *
  *
  *		// Create and populate hash table.
  *		// Create and populate hash table.
  *		htable_init(&ht, rehash, NULL);
  *		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]);
  *			htable_add(&ht, hash_string(map[i].name), &map[i]);
  *
  *
  *		// Add any aliases to the hash table.
  *		// Add any aliases to the hash table.

+ 1 - 1
ccan/list/_info

@@ -31,7 +31,7 @@
  *	{
  *	{
  *		struct parent p;
  *		struct parent p;
  *		struct child *c;
  *		struct child *c;
- *		unsigned int i;
+ *		int i;
  *
  *
  *		if (argc < 2)
  *		if (argc < 2)
  *			errx(1, "Usage: %s parent children...", argv[0]);
  *			errx(1, "Usage: %s parent children...", argv[0]);

+ 1 - 1
ccan/noerr/_info

@@ -37,7 +37,7 @@
  *			return false;
  *			return false;
  *		}
  *		}
  *		// A short write means out of space.
  *		// A short write means out of space.
- *		if (ret < strlen(string)) {
+ *		if (ret < (int)strlen(string)) {
  *			unlink(file);
  *			unlink(file);
  *			errno = ENOSPC;
  *			errno = ENOSPC;
  *			return false;
  *			return false;

+ 1 - 1
ccan/strmap/_info

@@ -33,7 +33,7 @@
  * 	STRMAP(size_t) map;
  * 	STRMAP(size_t) map;
  *
  *
  * 	strmap_init(&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.
  *		// This only adds the first time for this arg.
  * 		strmap_add(&map, argv[i], i);
  * 		strmap_add(&map, argv[i], i);
  *
  *

+ 1 - 1
ccan/tal/link/_info

@@ -87,7 +87,7 @@
  *
  *
  *	int main(int argc, char *argv[])
  *	int main(int argc, char *argv[])
  *	{
  *	{
- *		unsigned int i;
+ *		int i;
  *		const char **values;
  *		const char **values;
  *
  *
  *		// Initialize cache.
  *		// Initialize cache.