From 6d1d58a1fc3dfd60e9cac89460b5a6e438d11efa Mon Sep 17 00:00:00 2001 From: zwelch Date: Tue, 23 Jun 2009 22:45:47 +0000 Subject: - Fixes '[<>]' whitespace - Replace ')\([<>]\)(' with ') \1 ('. - Replace ')\([<>]\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\([<>]\)(' with '\1 \2 ('. - Replace '\(\w\)\([<>]\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2375 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/target/arm11_dbgtap.c | 4 ++-- src/target/arm720t.c | 2 +- src/target/arm7_9_common.c | 16 ++++++++-------- src/target/arm920t.c | 2 +- src/target/arm926ejs.c | 2 +- src/target/arm_adi_v5.c | 2 +- src/target/arm_disassembler.c | 12 ++++++------ src/target/image.c | 10 +++++----- src/target/mips32_dmaacc.c | 12 ++++++------ src/target/target.c | 38 +++++++++++++++++++------------------- 10 files changed, 50 insertions(+), 50 deletions(-) (limited to 'src/target') diff --git a/src/target/arm11_dbgtap.c b/src/target/arm11_dbgtap.c index e69d5988..5b6188f5 100644 --- a/src/target/arm11_dbgtap.c +++ b/src/target/arm11_dbgtap.c @@ -75,9 +75,9 @@ int arm11_add_dr_scan_vc(int num_fields, scan_field_t *fields, tap_state_t state * \param arm11 Target state variable. * \param num_bits Length of the data field * \param out_data pointer to the data that will be sent out - * (data is read when it is added to the JTAG queue) + * (data is read when it is added to the JTAG queue) * \param in_data pointer to the memory that will receive data that was clocked in - * (data is written when the JTAG queue is executed) + * (data is written when the JTAG queue is executed) * \param field target data structure that will be initialized */ void arm11_setup_field(arm11_common_t * arm11, int num_bits, void * out_data, void * in_data, scan_field_t * field) diff --git a/src/target/arm720t.c b/src/target/arm720t.c index efca08dd..49bdb887 100644 --- a/src/target/arm720t.c +++ b/src/target/arm720t.c @@ -375,7 +375,7 @@ int arm720t_soft_reset_halt(struct target_s *target) long long then = timeval_ms(); int timeout; - while (!(timeout = ((timeval_ms()-then)>1000))) + while (!(timeout = ((timeval_ms()-then) > 1000))) { if (buf_get_u32(dbg_stat->value, EICE_DBG_STATUS_DBGACK, 1) == 0) { diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index 1b08d474..266b7bf4 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -702,7 +702,7 @@ int arm7_9_execute_sys_speed(struct target_s *target) long long then = timeval_ms(); int timeout; - while (!(timeout = ((timeval_ms()-then)>1000))) + while (!(timeout = ((timeval_ms()-then) > 1000))) { /* read debug status register */ embeddedice_read_reg(dbg_stat); @@ -862,11 +862,11 @@ int arm7_9_handle_target_request(void *priv) * what happens: * * - * - * - * - * - * + * + * + * + * + * *
StateAction
TARGET_RUNNING | TARGET_RESETEnters debug mode. If TARGET_RESET, pc may be checked
TARGET_UNKNOWNWarning is logged
TARGET_DEBUG_RUNNINGEnters debug mode
TARGET_HALTEDNothing
State Action
TARGET_RUNNING | TARGET_RESET Enters debug mode. If TARGET_RESET, pc may be checked
TARGET_UNKNOWN Warning is logged
TARGET_DEBUG_RUNNING Enters debug mode
TARGET_HALTED Nothing
* * If the target does not end up in the halted state, a warning is produced. If @@ -1152,7 +1152,7 @@ int arm7_9_soft_reset_halt(struct target_s *target) long long then = timeval_ms(); int timeout; - while (!(timeout = ((timeval_ms()-then)>1000))) + while (!(timeout = ((timeval_ms()-then) > 1000))) { if (buf_get_u32(dbg_stat->value, EICE_DBG_STATUS_DBGACK, 1) != 0) break; @@ -2582,7 +2582,7 @@ static int arm7_9_dcc_completion(struct target_s *target, uint32_t exit_point, i int little = target->endianness == TARGET_LITTLE_ENDIAN; int count = dcc_count; uint8_t *buffer = dcc_buffer; - if (count>2) + if (count > 2) { /* Handle first & last using standard embeddedice_write_reg and the middle ones w/the * core function repeated. */ diff --git a/src/target/arm920t.c b/src/target/arm920t.c index 10428a65..92cee83c 100644 --- a/src/target/arm920t.c +++ b/src/target/arm920t.c @@ -574,7 +574,7 @@ int arm920t_soft_reset_halt(struct target_s *target) long long then = timeval_ms(); int timeout; - while (!(timeout = ((timeval_ms()-then)>1000))) + while (!(timeout = ((timeval_ms()-then) > 1000))) { if (buf_get_u32(dbg_stat->value, EICE_DBG_STATUS_DBGACK, 1) == 0) { diff --git a/src/target/arm926ejs.c b/src/target/arm926ejs.c index 0d6f0172..04981abe 100644 --- a/src/target/arm926ejs.c +++ b/src/target/arm926ejs.c @@ -574,7 +574,7 @@ int arm926ejs_soft_reset_halt(struct target_s *target) long long then = timeval_ms(); int timeout; - while (!(timeout = ((timeval_ms()-then)>1000))) + while (!(timeout = ((timeval_ms()-then) > 1000))) { if (buf_get_u32(dbg_stat->value, EICE_DBG_STATUS_DBGACK, 1) == 0) { diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index a77daa70..13c66f02 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -1118,7 +1118,7 @@ int dap_info_command(struct command_context_s *cmd_ctx, swjdp_common_t *swjdp, i command_print(cmd_ctx, "\t\tEnd of ROM table"); } entry_offset += 4; - } while (romentry>0); + } while (romentry > 0); } else { diff --git a/src/target/arm_disassembler.c b/src/target/arm_disassembler.c index e460e468..d290b670 100644 --- a/src/target/arm_disassembler.c +++ b/src/target/arm_disassembler.c @@ -891,7 +891,7 @@ int evaluate_misc_instr(uint32_t opcode, uint32_t address, arm_instruction_t *in int x = (opcode & 0x20) >> 5; int y = (opcode & 0x40) >> 6; - /* SMLA */ + /* SMLA < x> */ if ((opcode & 0x00600000) == 0x00000000) { uint8_t Rd, Rm, Rs, Rn; @@ -906,7 +906,7 @@ int evaluate_misc_instr(uint32_t opcode, uint32_t address, arm_instruction_t *in Rd, Rm, Rs, Rn); } - /* SMLAL */ + /* SMLAL < x> */ if ((opcode & 0x00600000) == 0x00400000) { uint8_t RdLow, RdHi, Rm, Rs; @@ -921,7 +921,7 @@ int evaluate_misc_instr(uint32_t opcode, uint32_t address, arm_instruction_t *in RdLow, RdHi, Rm, Rs); } - /* SMLAW */ + /* SMLAW < y> */ if (((opcode & 0x00600000) == 0x00100000) && (x == 0)) { uint8_t Rd, Rm, Rs, Rn; @@ -936,7 +936,7 @@ int evaluate_misc_instr(uint32_t opcode, uint32_t address, arm_instruction_t *in Rd, Rm, Rs, Rn); } - /* SMUL */ + /* SMUL < x> */ if ((opcode & 0x00600000) == 0x00300000) { uint8_t Rd, Rm, Rs; @@ -950,7 +950,7 @@ int evaluate_misc_instr(uint32_t opcode, uint32_t address, arm_instruction_t *in Rd, Rm, Rs); } - /* SMULW */ + /* SMULW < y> */ if (((opcode & 0x00600000) == 0x00100000) && (x == 1)) { uint8_t Rd, Rm, Rs; @@ -1922,7 +1922,7 @@ int evaluate_load_store_multiple_thumb(uint16_t opcode, uint32_t address, arm_in if (reg_list & (1 << i)) reg_names_p += snprintf(reg_names_p, (reg_names + 40 - reg_names_p), "r%i, ", i); } - if (reg_names_p>reg_names) + if (reg_names_p > reg_names) reg_names_p[-2] = '\0'; else /* invalid op : no registers */ reg_names[0] = '\0'; diff --git a/src/target/image.c b/src/target/image.c index 40b320fa..0ffa5fd3 100644 --- a/src/target/image.c +++ b/src/target/image.c @@ -414,12 +414,12 @@ static int image_elf_read_headers(image_t *image) /* count useful segments (loadable), ignore BSS section */ image->num_sections = 0; - for (i = 0;isegment_count;i++) + for (i = 0;i < elf->segment_count;i++) if ((field32(elf, elf->segments[i].p_type) == PT_LOAD) && (field32(elf, elf->segments[i].p_filesz) != 0)) image->num_sections++; /* alloc and fill sections array with loadable segments */ image->sections = malloc(image->num_sections * sizeof(image_section_t)); - for (i = 0,j = 0;isegment_count;i++) + for (i = 0,j = 0;i < elf->segment_count;i++) { if ((field32(elf, elf->segments[i].p_type) == PT_LOAD) && (field32(elf, elf->segments[i].p_filesz) != 0)) { @@ -449,7 +449,7 @@ static int image_elf_read_section(image_t *image, int section, uint32_t offset, LOG_DEBUG("load segment %d at 0x%" PRIx32 " (sz = 0x%" PRIx32 ")",section,offset,size); /* read initialized data in current segment if any */ - if (offsetp_filesz)) + if (offset < field32(elf,segment->p_filesz)) { /* maximal size present in file for the current segment */ read_size = MIN(size, field32(elf,segment->p_filesz)-offset); @@ -1015,10 +1015,10 @@ int image_calculate_checksum(uint8_t* buffer, uint32_t nbytes, uint32_t* checksu crc32_table[i] = c; } - while (nbytes>0) + while (nbytes > 0) { int run = nbytes; - if (run>32768) + if (run > 32768) { run = 32768; } diff --git a/src/target/mips32_dmaacc.c b/src/target/mips32_dmaacc.c index 6c57e783..e67c4ce7 100644 --- a/src/target/mips32_dmaacc.c +++ b/src/target/mips32_dmaacc.c @@ -369,7 +369,7 @@ int mips32_dmaacc_read_mem32(mips_ejtag_t *ejtag_info, uint32_t addr, int count, int i; int retval; - for (i = 0; iname); } - if (cur-then>500) + if (cur-then > 500) { keep_alive(); } - if ((cur-then)>ms) + if ((cur-then) > ms) { LOG_ERROR("timed out while waiting for target %s", Jim_Nvp_value2name_simple(nvp_target_state,state)->name); @@ -2280,16 +2280,16 @@ static int handle_load_image_command(struct command_context_s *cmd_ctx, char *cm /* DANGER!!! beware of unsigned comparision here!!! */ if ((image.sections[i].base_address + buf_cnt >= min_address)&& - (image.sections[i].base_addressmax_address) + if (image.sections[i].base_address + buf_cnt > max_address) { length -= (image.sections[i].base_address + buf_cnt)-max_address; } @@ -2790,7 +2790,7 @@ static void writeData(FILE *f, const void *data, size_t len) static void writeLong(FILE *f, int l) { int i; - for (i = 0; i<4; i++) + for (i = 0; i < 4; i++) { char c = (l >> (i*8))&0xff; writeData(f, &c, 1); @@ -2822,13 +2822,13 @@ static void writeGmon(uint32_t *samples, uint32_t sampleNum, char *filename) /* figure out bucket size */ uint32_t min = samples[0]; uint32_t max = samples[0]; - for (i = 0; isamples[i]) + if (min > samples[i]) { min = samples[i]; } - if (max65535) + if (val > 65535) { val = 65535; } @@ -4389,7 +4389,7 @@ static void free_fastload(void) if (fastload != NULL) { int i; - for (i = 0; i= min_address)&& - (image.sections[i].base_addressmax_address) + if (image.sections[i].base_address + buf_cnt > max_address) { length -= (image.sections[i].base_address + buf_cnt)-max_address; } @@ -4514,7 +4514,7 @@ static int handle_fast_load_image_command(struct command_context_s *cmd_ctx, cha static int handle_fast_load_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { - if (argc>0) + if (argc > 0) return ERROR_COMMAND_SYNTAX_ERROR; if (fastload == NULL) { @@ -4525,7 +4525,7 @@ static int handle_fast_load_command(struct command_context_s *cmd_ctx, char *cmd int ms = timeval_ms(); int size = 0; int retval = ERROR_OK; - for (i = 0; i