helper/fileio: Use size_t for file size.
[openocd.git] / src / flash / nor / tcl.c
index 709d0c1a708906d1d350ef5c8d7f58e7959e2f9a..8a30e1cd995a95eb43755b2f6a904d30de100ed7 100644 (file)
@@ -573,7 +573,7 @@ COMMAND_HANDLER(handle_flash_write_bank_command)
        if (fileio_open(&fileio, CMD_ARGV[1], FILEIO_READ, FILEIO_BINARY) != ERROR_OK)
                return ERROR_OK;
 
-       int filesize;
+       size_t filesize;
        retval = fileio_size(&fileio, &filesize);
        if (retval != ERROR_OK) {
                fileio_close(&fileio);
@@ -599,9 +599,9 @@ COMMAND_HANDLER(handle_flash_write_bank_command)
        buffer = NULL;
 
        if ((ERROR_OK == retval) && (duration_measure(&bench) == ERROR_OK)) {
-               command_print(CMD_CTX, "wrote %ld bytes from file %s to flash bank %u"
+               command_print(CMD_CTX, "wrote %zu bytes from file %s to flash bank %u"
                        " at offset 0x%8.8" PRIx32 " in %fs (%0.3f KiB/s)",
-                       (long)filesize, CMD_ARGV[1], p->bank_number, offset,
+                       filesize, CMD_ARGV[1], p->bank_number, offset,
                        duration_elapsed(&bench), duration_kbps(&bench, filesize));
        }
 
@@ -676,7 +676,7 @@ COMMAND_HANDLER(handle_flash_verify_bank_command)
        uint8_t *buffer_file, *buffer_flash;
        struct fileio fileio;
        size_t read_cnt;
-       int filesize;
+       size_t filesize;
        int differ;
 
        if (CMD_ARGC != 3)
@@ -719,7 +719,7 @@ COMMAND_HANDLER(handle_flash_verify_bank_command)
                return retval;
        }
 
-       if (read_cnt != (size_t) filesize) {
+       if (read_cnt != filesize) {
                LOG_ERROR("Short read");
                free(buffer_file);
                return ERROR_FAIL;

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)