src/{server,pld,svf,xsvf}: remove 'extern' keyword
[fw/openocd] / src / pld / virtex2.c
index 1f063a0ad925dc0b89c61d3ed84ca3965ff8bc27..28cae6cafec8f680c40b01e3cea95f150c7187c3 100644 (file)
@@ -90,7 +90,7 @@ static int virtex2_send_32(struct pld_device_s *pld_device,
 
 static __inline__ void virtexflip32(jtag_callback_data_t arg)
 {
-  uint8_t *in=(uint8_t *)arg;
+  uint8_t *in = (uint8_t *)arg;
        *((uint32_t *)in) = flip_u32(le_to_h_u32(in), 32);
 }
 
@@ -138,7 +138,7 @@ static int virtex2_read_stat(struct pld_device_s *pld_device, uint32_t *status)
 
        jtag_execute_queue();
 
-       LOG_DEBUG("status: 0x%8.8x", *status);
+       LOG_DEBUG("status: 0x%8.8" PRIx32 "", *status);
 
        return ERROR_OK;
 }
@@ -202,7 +202,9 @@ static int virtex2_handle_read_stat_command(struct command_context_s *cmd_ctx,
                return ERROR_OK;
        }
 
-       device = get_pld_device_by_num(strtoul(args[0], NULL, 0));
+       unsigned dev_id;
+       COMMAND_PARSE_NUMBER(uint, args[0], dev_id);
+       device = get_pld_device_by_num(dev_id);
        if (!device)
        {
                command_print(cmd_ctx, "pld device '#%s' is out of bounds", args[0]);
@@ -213,7 +215,7 @@ static int virtex2_handle_read_stat_command(struct command_context_s *cmd_ctx,
 
        virtex2_read_stat(device, &status);
 
-       command_print(cmd_ctx, "virtex2 status register: 0x%8.8x", status);
+       command_print(cmd_ctx, "virtex2 status register: 0x%8.8" PRIx32 "", status);
 
        return ERROR_OK;
 }
@@ -243,7 +245,7 @@ static int virtex2_pld_device_command(struct command_context_s *cmd_ctx,
 
        tap = jtag_tap_by_string(args[1]);
        if (tap == NULL) {
-               command_print( cmd_ctx, "Tap: %s does not exist", args[1] );
+               command_print(cmd_ctx, "Tap: %s does not exist", args[1]);
                return ERROR_OK;
        }