diff options
author | Zachary T Welch <zw@superlucidity.net> | 2009-11-10 00:02:18 -0800 |
---|---|---|
committer | Zachary T Welch <zw@superlucidity.net> | 2009-11-13 10:55:27 -0800 |
commit | d22270e0ed291d3b08fd03a25181b279ca5e0911 (patch) | |
tree | e9467fb7e4a05043d18eb747d0b4bfd89511abf1 /src/flash | |
parent | a585bdf7269ce5c861c83ee3294ba1f074e9c877 (diff) | |
download | openocd_libswd-d22270e0ed291d3b08fd03a25181b279ca5e0911.tar.gz openocd_libswd-d22270e0ed291d3b08fd03a25181b279ca5e0911.tar.bz2 openocd_libswd-d22270e0ed291d3b08fd03a25181b279ca5e0911.tar.xz openocd_libswd-d22270e0ed291d3b08fd03a25181b279ca5e0911.zip |
command_handler_t: make argc unsigned
The number of command arguments will always be 0 or more, so use
the right type in handlers. This has a cascading effect up through
the layers, but the new COMMAND_HANDLER macros prevented total chaos.
Diffstat (limited to 'src/flash')
-rw-r--r-- | src/flash/cfi.c | 5 | ||||
-rw-r--r-- | src/flash/nand.c | 6 |
2 files changed, 3 insertions, 8 deletions
diff --git a/src/flash/cfi.c b/src/flash/cfi.c index 08c43580..88f57df2 100644 --- a/src/flash/cfi.c +++ b/src/flash/cfi.c @@ -604,9 +604,6 @@ static int cfi_register_commands(struct command_context_s *cmd_ctx) FLASH_BANK_COMMAND_HANDLER(cfi_flash_bank_command) { cfi_flash_bank_t *cfi_info; - int i; - (void) cmd_ctx; - (void) cmd; if (argc < 6) { @@ -635,7 +632,7 @@ FLASH_BANK_COMMAND_HANDLER(cfi_flash_bank_command) cfi_info->jedec_probe = 0; cfi_info->not_cfi = 0; - for (i = 6; i < argc; i++) + for (unsigned i = 6; i < argc; i++) { if (strcmp(args[i], "x16_as_x8") == 0) { diff --git a/src/flash/nand.c b/src/flash/nand.c index 88d3e42c..26eb63ad 100644 --- a/src/flash/nand.c +++ b/src/flash/nand.c @@ -1315,8 +1315,7 @@ COMMAND_HANDLER(handle_nand_write_command) if (argc > 3) { - int i; - for (i = 3; i < argc; i++) + for (unsigned i = 3; i < argc; i++) { if (!strcmp(args[i], "oob_raw")) oob_format |= NAND_OOB_RAW; @@ -1485,8 +1484,7 @@ COMMAND_HANDLER(handle_nand_dump_command) if (argc > 4) { - int i; - for (i = 4; i < argc; i++) + for (unsigned i = 4; i < argc; i++) { if (!strcmp(args[i], "oob_raw")) oob_format |= NAND_OOB_RAW; |