printf() warning fixes due to uint32_t change-over
authorduane <duane@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Fri, 19 Jun 2009 23:15:58 +0000 (23:15 +0000)
committerduane <duane@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Fri, 19 Jun 2009 23:15:58 +0000 (23:15 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@2293 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/jtag/arm-jtag-ew.c
src/jtag/core.c
src/jtag/ft2232.c
src/jtag/jlink.c
src/jtag/presto.c
src/jtag/tcl.c

index b951f61bfcaabe681eeb91a3814416919aaad2bd..150cabf1f07f972a864c49374acf79ad91df35e3 100644 (file)
@@ -472,14 +472,14 @@ static int armjtagew_get_status(void)
        if (result == 0)
        {
                unsigned int u_tg = buf_get_u32(usb_in_buffer, 0, 16);
-               LOG_INFO("U_tg = %d mV, U_aux = %d mV, U_tgpwr = %d mV, I_tgpwr = %d mA, D1 = %d, Target power %s %s\n", \
-                       buf_get_u32(usb_in_buffer + 0, 0, 16), \
-                       buf_get_u32(usb_in_buffer + 2, 0, 16), \
-                       buf_get_u32(usb_in_buffer + 4, 0, 16), \
-                       buf_get_u32(usb_in_buffer + 6, 0, 16), \
-                       usb_in_buffer[9], \
-                       usb_in_buffer[11] ? "OVERCURRENT" : "OK", \
-                       usb_in_buffer[10] ? "enabled" : "disabled");
+               LOG_INFO("U_tg = %d mV, U_aux = %d mV, U_tgpwr = %d mV, I_tgpwr = %d mA, D1 = %d, Target power %s %s\n", 
+                        (int)(buf_get_u32(usb_in_buffer + 0, 0, 16)),
+                        (int)(buf_get_u32(usb_in_buffer + 2, 0, 16)),
+                        (int)(buf_get_u32(usb_in_buffer + 4, 0, 16)),
+                        (int)(buf_get_u32(usb_in_buffer + 6, 0, 16)),
+                        usb_in_buffer[9], 
+                        usb_in_buffer[11] ? "OVERCURRENT" : "OK", 
+                        usb_in_buffer[10] ? "enabled" : "disabled");
 
                if (u_tg < 1500)
                {
index ed16bdbfe871065fcb9f4a390e480f896eb3d742..5bf7295ec78c33e60dec22407d286125db34a555 100644 (file)
@@ -862,10 +862,13 @@ static void jtag_examine_chain_display(enum log_levels level, const char *msg,
                const char *name, uint32_t idcode)
 {
        log_printf_lf(level, __FILE__, __LINE__, __FUNCTION__,
-                       "JTAG tap: %s %16.16s: 0x%08x "
-                       "(mfg: 0x%3.3x, part: 0x%4.4x, ver: 0x%1.1x)",
-               name, msg, idcode,
-               EXTRACT_MFG(idcode), EXTRACT_PART(idcode), EXTRACT_VER(idcode) );
+                                 "JTAG tap: %s %16.16s: 0x%08x "
+                                 "(mfg: 0x%3.3x, part: 0x%4.4x, ver: 0x%1.1x)",
+                                 name, msg, 
+                                 (unsigned int)idcode,
+                                 (unsigned int)EXTRACT_MFG(idcode), 
+                                 (unsigned int)EXTRACT_PART(idcode), 
+                                 (unsigned int)EXTRACT_VER(idcode) );
 }
 
 static bool jtag_idcode_is_final(uint32_t idcode)
@@ -889,7 +892,7 @@ static void jtag_examine_chain_end(uint8_t *idcodes, unsigned count, unsigned ma
                if (!triggered && jtag_idcode_is_final(idcode))
                        continue;
                LOG_WARNING("Unexpected idcode after end of chain: %d 0x%08x",
-                               count, idcode);
+                                       count, (unsigned int)idcode);
                triggered = true;
        }
 }
@@ -1100,7 +1103,7 @@ void jtag_tap_init(jtag_tap_t *tap)
        LOG_DEBUG("Created Tap: %s @ abs position %d, "
                        "irlen %d, capture: 0x%x mask: 0x%x", tap->dotted_name,
                                tap->abs_chain_position, tap->ir_length,
-                               tap->ir_capture_value, tap->ir_capture_mask);
+                         (unsigned int)(tap->ir_capture_value), (unsigned int)(tap->ir_capture_mask));
        jtag_tap_add(tap);
 }
 
index 70c2dd31df12eedd084b93a005d65a825704bf98..c38d7d47443b05a0941388fb5f586801245c2e42 100644 (file)
@@ -411,7 +411,9 @@ static int ft2232_read(uint8_t* buf, uint32_t size, uint32_t* bytes_read)
 
        if (*bytes_read < size)
        {
-               LOG_ERROR("couldn't read the requested number of bytes from FT2232 device (%i < %i)", *bytes_read, size);
+               LOG_ERROR("couldn't read the requested number of bytes from FT2232 device (%i < %i)", 
+                         (unsigned int)(*bytes_read), 
+                         (unsigned int)size);
                return ERROR_JTAG_DEVICE_ERROR;
        }
 
@@ -963,7 +965,8 @@ static int ft2232_large_scan(scan_command_t* cmd, enum scan_type type, uint8_t*
                LOG_ERROR("couldn't write MPSSE commands to FT2232");
                exit(-1);
        }
-       LOG_DEBUG("ft2232_buffer_size: %i, bytes_written: %i", ft2232_buffer_size, bytes_written);
+       LOG_DEBUG("ft2232_buffer_size: %i, bytes_written: %i", 
+                 ft2232_buffer_size, (int)bytes_written);
        ft2232_buffer_size = 0;
 
        /* add command for complete bytes */
@@ -1016,7 +1019,9 @@ static int ft2232_large_scan(scan_command_t* cmd, enum scan_type type, uint8_t*
                        LOG_ERROR("couldn't write MPSSE commands to FT2232");
                        exit(-1);
                }
-               LOG_DEBUG("ft2232_buffer_size: %i, bytes_written: %i", ft2232_buffer_size, bytes_written);
+               LOG_DEBUG("ft2232_buffer_size: %i, bytes_written: %i", 
+                         ft2232_buffer_size, 
+                         (int)bytes_written);
                ft2232_buffer_size = 0;
 
                if (type != SCAN_OUT)
@@ -1026,7 +1031,9 @@ static int ft2232_large_scan(scan_command_t* cmd, enum scan_type type, uint8_t*
                                LOG_ERROR("couldn't read from FT2232");
                                exit(-1);
                        }
-                       LOG_DEBUG("thisrun_read: %i, bytes_read: %i", thisrun_read, bytes_read);
+                       LOG_DEBUG("thisrun_read: %i, bytes_read: %i", 
+                                 thisrun_read, 
+                                 (int)bytes_read);
                        receive_pointer += bytes_read;
                }
        }
@@ -1122,7 +1129,9 @@ static int ft2232_large_scan(scan_command_t* cmd, enum scan_type type, uint8_t*
                LOG_ERROR("couldn't write MPSSE commands to FT2232");
                exit(-1);
        }
-       LOG_DEBUG("ft2232_buffer_size: %i, bytes_written: %i", ft2232_buffer_size, bytes_written);
+       LOG_DEBUG("ft2232_buffer_size: %i, bytes_written: %i", 
+                 ft2232_buffer_size, 
+                 (int)bytes_written);
        ft2232_buffer_size = 0;
 
        if (type != SCAN_OUT)
@@ -1132,7 +1141,9 @@ static int ft2232_large_scan(scan_command_t* cmd, enum scan_type type, uint8_t*
                        LOG_ERROR("couldn't read from FT2232");
                        exit(-1);
                }
-               LOG_DEBUG("thisrun_read: %i, bytes_read: %i", thisrun_read, bytes_read);
+               LOG_DEBUG("thisrun_read: %i, bytes_read: %i", 
+                         thisrun_read, 
+                         (int)bytes_read);
                receive_pointer += bytes_read;
        }
 
index 907207ce4dccacf4685c050f2110fcc6e692eda4..283260eeb7b584c74afa09c3ae5987e64498c2f2 100644 (file)
@@ -589,7 +589,7 @@ static int jlink_get_version_info(void)
        }
 
        jlink_caps = buf_get_u32(usb_in_buffer, 0, 32);
-       LOG_INFO("JLink caps 0x%x", jlink_caps);
+       LOG_INFO("JLink caps 0x%x", (unsigned)jlink_caps);
 
        if (jlink_caps & (1 << EMU_CAP_GET_HW_VERSION))
        {
@@ -608,7 +608,7 @@ static int jlink_get_version_info(void)
                if (major_revision >= 5)
                        jlink_hw_jtag_version = 3;
 
-               LOG_INFO("JLink hw version %i", jlink_hw_version);
+               LOG_INFO("JLink hw version %i", (int)jlink_hw_version);
        }
 
        if (jlink_caps & (1 << EMU_CAP_GET_MAX_BLOCK_SIZE))
@@ -624,7 +624,7 @@ static int jlink_get_version_info(void)
                }
 
                jlink_max_size = buf_get_u32(usb_in_buffer, 0, 32);
-               LOG_INFO("JLink max mem block %i", jlink_max_size);
+               LOG_INFO("JLink max mem block %i", (int)jlink_max_size);
        }
 
        return ERROR_OK;
index 385c93c019390b21eee0304cb5bd65b5cdb5367c..1331f2af84a881531f34d045a85cc5ec922b06ff 100644 (file)
@@ -150,7 +150,8 @@ static int presto_write(uint8_t *buf, uint32_t size)
 
        if (ftbytes != size)
        {
-               LOG_ERROR("couldn't write the requested number of bytes to PRESTO (%u < %u)", (uint32_t)ftbytes, size);
+               LOG_ERROR("couldn't write the requested number of bytes to PRESTO (%u < %u)", 
+                         (unsigned)ftbytes, (unsigned)size);
                return ERROR_JTAG_DEVICE_ERROR;
        }
 
@@ -192,7 +193,8 @@ static int presto_read(uint8_t* buf, uint32_t size)
        if (ftbytes != size)
        {
                /* this is just a warning, there might have been timeout when detecting PRESTO, which is not fatal */
-               LOG_WARNING("couldn't read the requested number of bytes from PRESTO (%u < %u)", (uint32_t)ftbytes, size);
+               LOG_WARNING("couldn't read the requested number of bytes from PRESTO (%u < %u)", 
+                           (unsigned)ftbytes, (unsigned)size);
                return ERROR_JTAG_DEVICE_ERROR;
        }
 
index 010b375f07f58985be3c184f3e46c4643a144a0b..44d652de85edea32014528f748ee6aae67d2c9a7 100644 (file)
@@ -872,16 +872,16 @@ static int handle_scan_chain_command(struct command_context_s *cmd_ctx, char *cm
                                          tap->abs_chain_position,
                                          tap->dotted_name,
                                          tap->enabled ? 'Y' : 'n',
-                                         tap->idcode,
-                                         (tap->expected_ids_cnt > 0 ? tap->expected_ids[0] : 0),
-                                         tap->ir_length,
-                                         expected,
-                                         expected_mask,
-                                         cur_instr);
+                                         (unsigned int)(tap->idcode),
+                                         (unsigned int)(tap->expected_ids_cnt > 0 ? tap->expected_ids[0] : 0),
+                                         (unsigned int)(tap->ir_length),
+                                         (unsigned int)(expected),
+                                         (unsigned int)(expected_mask),
+                                         (unsigned int)(cur_instr));
 
                for (ii = 1; ii < tap->expected_ids_cnt; ii++) {
                        command_print(cmd_ctx, "   |                    |         |            | 0x%08x |      |      |      |         ",
-                                                 tap->expected_ids[ii]);
+                                                 (unsigned int)(tap->expected_ids[ii]));
                }
 
                tap = tap->next_tap;
@@ -1503,3 +1503,9 @@ static int handle_tms_sequence_command(struct command_context_s *cmd_ctx, char *
        return ERROR_OK;
 }
 
+/*
+ * Local Variables: 
+ * c-basic-offset: 4
+ * tab-width: 4
+ * End:
+ */

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)