flash/nor: Use proper data types in driver API
[openocd.git] / src / server / gdb_server.c
index 6a9e261cd8aade3c155a4dd6a9ce40d5bee7f0c0..0e0b595c6982cccd1e20e9fe5e34a22709526715 100644 (file)
@@ -996,8 +996,7 @@ static int gdb_new_connection(struct connection *connection)
                 * This will cause an auto_probe to be invoked, which is either
                 * a no-op or it will fail when the target isn't ready(e.g. not halted).
                 */
-               int i;
-               for (i = 0; i < flash_get_bank_count(); i++) {
+               for (unsigned int i = 0; i < flash_get_bank_count(); i++) {
                        struct flash_bank *p;
                        p = get_flash_bank_by_num_noprobe(i);
                        if (p->target != target)
@@ -1831,8 +1830,7 @@ static int gdb_memory_map(struct connection *connection,
        int length;
        char *separator;
        target_addr_t ram_start = 0;
-       int i;
-       int target_flash_banks = 0;
+       unsigned int target_flash_banks = 0;
 
        /* skip command character */
        packet += 23;
@@ -1848,7 +1846,7 @@ static int gdb_memory_map(struct connection *connection,
         */
        banks = malloc(sizeof(struct flash_bank *)*flash_get_bank_count());
 
-       for (i = 0; i < flash_get_bank_count(); i++) {
+       for (unsigned int i = 0; i < flash_get_bank_count(); i++) {
                p = get_flash_bank_by_num_noprobe(i);
                if (p->target != target)
                        continue;
@@ -1864,8 +1862,7 @@ static int gdb_memory_map(struct connection *connection,
        qsort(banks, target_flash_banks, sizeof(struct flash_bank *),
                compare_bank);
 
-       for (i = 0; i < target_flash_banks; i++) {
-               int j;
+       for (unsigned int i = 0; i < target_flash_banks; i++) {
                unsigned sector_size = 0;
                unsigned group_len = 0;
 
@@ -1883,7 +1880,7 @@ static int gdb_memory_map(struct connection *connection,
                 * smaller ones at the end (maybe 32KB).  STR7 will have
                 * regions with 8KB, 32KB, and 64KB sectors; etc.
                 */
-               for (j = 0; j < p->num_sectors; j++) {
+               for (unsigned int j = 0; j < p->num_sectors; j++) {
 
                        /* Maybe start a new group of sectors. */
                        if (sector_size == 0) {
@@ -3117,7 +3114,7 @@ static int gdb_v_packet(struct connection *connection,
                target_call_event_callbacks(target,
                                TARGET_EVENT_GDB_FLASH_WRITE_START);
                result = flash_write(target, gdb_connection->vflash_image,
-                       &written, 0);
+                       &written, false);
                target_call_event_callbacks(target,
                        TARGET_EVENT_GDB_FLASH_WRITE_END);
                if (result != ERROR_OK) {

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)