aboutsummaryrefslogtreecommitdiff
path: root/src/target/xscale.c
diff options
context:
space:
mode:
authorMarc Schink <dev@zapb.de>2020-11-03 16:11:48 +0100
committerAntonio Borneo <borneo.antonio@gmail.com>2020-11-07 20:52:00 +0000
commit73746d78b7bd582bab26cebdcf78299b8da99a62 (patch)
tree27cbee02d9f3699bbac688f7d0cca6a216266246 /src/target/xscale.c
parent6dbfdcd00f190b79f24a7c231137fb5eea52bc95 (diff)
downloadriscv-openocd-73746d78b7bd582bab26cebdcf78299b8da99a62.zip
riscv-openocd-73746d78b7bd582bab26cebdcf78299b8da99a62.tar.gz
riscv-openocd-73746d78b7bd582bab26cebdcf78299b8da99a62.tar.bz2
target/image: Use proper data types
While at it, fix some coding style issues. Change-Id: Id521394d89e0bf787a6f812701c2cc0fe7e4e63f Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/5919 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src/target/xscale.c')
-rw-r--r--src/target/xscale.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/target/xscale.c b/src/target/xscale.c
index 6d1d426..aaaed0e 100644
--- a/src/target/xscale.c
+++ b/src/target/xscale.c
@@ -2582,7 +2582,6 @@ static int xscale_read_instruction(struct target *target, uint32_t pc,
struct arm_instruction *instruction)
{
struct xscale_common *const xscale = target_to_xscale(target);
- int i;
int section = -1;
size_t size_read;
uint32_t opcode;
@@ -2592,7 +2591,7 @@ static int xscale_read_instruction(struct target *target, uint32_t pc,
return ERROR_TRACE_IMAGE_UNAVAILABLE;
/* search for the section the current instruction belongs to */
- for (i = 0; i < xscale->trace.image->num_sections; i++) {
+ for (unsigned int i = 0; i < xscale->trace.image->num_sections; i++) {
if ((xscale->trace.image->sections[i].base_address <= pc) &&
(xscale->trace.image->sections[i].base_address +
xscale->trace.image->sections[i].size > pc)) {
@@ -3428,15 +3427,15 @@ COMMAND_HANDLER(xscale_handle_trace_image_command)
}
xscale->trace.image = malloc(sizeof(struct image));
- xscale->trace.image->base_address_set = 0;
- xscale->trace.image->start_address_set = 0;
+ xscale->trace.image->base_address_set = false;
+ xscale->trace.image->start_address_set = false;
/* a base address isn't always necessary, default to 0x0 (i.e. don't relocate) */
if (CMD_ARGC >= 2) {
- xscale->trace.image->base_address_set = 1;
+ xscale->trace.image->base_address_set = true;
COMMAND_PARSE_NUMBER(llong, CMD_ARGV[1], xscale->trace.image->base_address);
} else
- xscale->trace.image->base_address_set = 0;
+ xscale->trace.image->base_address_set = false;
if (image_open(xscale->trace.image, CMD_ARGV[0],
(CMD_ARGC >= 3) ? CMD_ARGV[2] : NULL) != ERROR_OK) {