Commit 6d1d58a1 authored by zwelch's avatar zwelch
Browse files

- 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
parent fb1a9b2c
......@@ -550,7 +550,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank)
/* calculate bank size */
bank_size = sectors_num * pages_per_sector * page_size;
for (bnk = 0; bnk<banks_num; bnk++)
for (bnk = 0; bnk < banks_num; bnk++)
{
if (bnk > 0)
{
......@@ -575,7 +575,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank)
/* allocate sectors */
t_bank->sectors = malloc(sectors_num * sizeof(flash_sector_t));
for (sec = 0; sec<sectors_num; sec++)
for (sec = 0; sec < sectors_num; sec++)
{
t_bank->sectors[sec].offset = sec * pages_per_sector * page_size;
t_bank->sectors[sec].size = pages_per_sector * page_size;
......@@ -639,7 +639,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank)
at91sam7_set_flash_mode(bank, FMR_TIMING_FLASH);
fast_check = 1;
for (nSector = 0; nSector<bank->num_sectors; nSector++)
for (nSector = 0; nSector < bank->num_sectors; nSector++)
{
retval = target_blank_check_memory(target, bank->base + bank->sectors[nSector].offset,
bank->sectors[nSector].size, &blank);
......@@ -662,7 +662,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank)
LOG_USER("Running slow fallback erase check - add working memory");
buffer = malloc(bank->sectors[0].size);
for (nSector = 0; nSector<bank->num_sectors; nSector++)
for (nSector = 0; nSector < bank->num_sectors; nSector++)
{
bank->sectors[nSector].is_erased = 1;
retval = target_read_memory(target, bank->base + bank->sectors[nSector].offset, 4,
......@@ -670,7 +670,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank)
if (retval != ERROR_OK)
return retval;
for (nByte = 0; nByte<bank->sectors[nSector].size; nByte++)
for (nByte = 0; nByte < bank->sectors[nSector].size; nByte++)
{
if (buffer[nByte] != 0xFF)
{
......@@ -705,7 +705,7 @@ static int at91sam7_protect_check(struct flash_bank_s *bank)
at91sam7_info->lockbits = (status >> 16);
at91sam7_info->num_lockbits_on = 0;
for (lock_pos = 0; lock_pos<bank->num_sectors; lock_pos++)
for (lock_pos = 0; lock_pos < bank->num_sectors; lock_pos++)
{
if ( ((status >> (16 + lock_pos))&(0x0001)) == 1)
{
......@@ -723,7 +723,7 @@ static int at91sam7_protect_check(struct flash_bank_s *bank)
at91sam7_info->nvmbits = (status >> 8)&0xFF;
at91sam7_info->num_nvmbits_on = 0;
for (gpnvm_pos = 0; gpnvm_pos<at91sam7_info->num_nvmbits; gpnvm_pos++)
for (gpnvm_pos = 0; gpnvm_pos < at91sam7_info->num_nvmbits; gpnvm_pos++)
{
if ( ((status >> (8 + gpnvm_pos))&(0x01)) == 1)
{
......@@ -809,7 +809,7 @@ static int at91sam7_flash_bank_command(struct command_context_s *cmd_ctx, char *
/* calculate bank size */
bank_size = num_sectors * pages_per_sector * page_size;
for (bnk = 0; bnk<banks_num; bnk++)
for (bnk = 0; bnk < banks_num; bnk++)
{
if (bnk > 0)
{
......@@ -834,7 +834,7 @@ static int at91sam7_flash_bank_command(struct command_context_s *cmd_ctx, char *
/* allocate sectors */
t_bank->sectors = malloc(num_sectors * sizeof(flash_sector_t));
for (sec = 0; sec<num_sectors; sec++)
for (sec = 0; sec < num_sectors; sec++)
{
t_bank->sectors[sec].offset = sec * pages_per_sector * page_size;
t_bank->sectors[sec].size = pages_per_sector * page_size;
......@@ -902,7 +902,7 @@ static int at91sam7_erase(struct flash_bank_s *bank, int first, int last)
/* allocate and clean buffer */
nbytes = (last - first + 1) * bank->sectors[first].size;
buffer = malloc(nbytes * sizeof(uint8_t));
for (pos = 0; pos<nbytes; pos++)
for (pos = 0; pos < nbytes; pos++)
{
buffer[pos] = 0xFF;
}
......@@ -1016,9 +1016,9 @@ static int at91sam7_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t o
at91sam7_read_clock_info(bank);
at91sam7_set_flash_mode(bank, FMR_TIMING_FLASH);
for (pagen = first_page; pagen<last_page; pagen++)
for (pagen = first_page; pagen < last_page; pagen++)
{
if (bytes_remaining<dst_min_alignment)
if (bytes_remaining < dst_min_alignment)
count = bytes_remaining;
else
count = dst_min_alignment;
......
......@@ -212,7 +212,7 @@ static uint16_t cfi_query_u16(flash_bank_t *bank, int sector, uint32_t offset)
if (cfi_info->x16_as_x8)
{
uint8_t i;
for (i = 0;i<2;i++)
for (i = 0;i < 2;i++)
target_read_memory(target, flash_address(bank, sector, offset + i), bank->bus_width, 1,
&data[i*bank->bus_width] );
}
......@@ -234,7 +234,7 @@ static uint32_t cfi_query_u32(flash_bank_t *bank, int sector, uint32_t offset)
if (cfi_info->x16_as_x8)
{
uint8_t i;
for (i = 0;i<4;i++)
for (i = 0;i < 4;i++)
target_read_memory(target, flash_address(bank, sector, offset + i), bank->bus_width, 1,
&data[i*bank->bus_width] );
}
......
......@@ -319,10 +319,10 @@ static int eCosBoard_flash(ecosflash_flash_bank_t *info, void *data, uint32_t ad
uint32_t i;
for (i = 0; i<len; i += chunk)
for (i = 0; i < len; i += chunk)
{
int t = len-i;
if (t>chunk)
if (t > chunk)
{
t = chunk;
}
......
......@@ -791,7 +791,7 @@ static int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cm
duration_start_measure(&duration);
for (wrote = 0; wrote<(count*wordsize); wrote += cur_size)
for (wrote = 0; wrote < (count*wordsize); wrote += cur_size)
{
cur_size = MIN( (count*wordsize - wrote), sizeof(chunk) );
flash_bank_t *bank;
......@@ -809,7 +809,7 @@ static int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cm
return err;
unsigned i;
for (i = 0; i<cur_size; i++)
for (i = 0; i < cur_size; i++)
{
if (readback[i]!=chunk[i])
{
......
......@@ -76,7 +76,7 @@ struct flash_bank_s;
* that matches @c DRIVERNAME.
*
* The flash subsystem calls some of the other drivers routines a using
* corresponding static <code>flash_driver_<i>callback</i>()</code>
* corresponding static <code > flash_driver_ < i>callback</i > ()</code>
* routine in flash.c.
*/
typedef struct flash_driver_s
......
......@@ -200,7 +200,7 @@ static int ocl_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset
chksum = OCL_CHKS_INIT;
/* copy data to DCC buffer in proper byte order and properly aligned */
for (i = 0; i<runlen; i++)
for (i = 0; i < runlen; i++)
{
switch (byteofs++)
{
......@@ -332,7 +332,7 @@ static int ocl_probe(struct flash_bank_s *bank)
return ERROR_FLASH_BANK_INVALID;
}
sectsize = bank->size / bank->num_sectors;
for (i = 0; i<bank->num_sectors; i++)
for (i = 0; i < bank->num_sectors; i++)
{
bank->sectors[i].offset = i * sectsize;
bank->sectors[i].size = sectsize;
......
......@@ -45,13 +45,13 @@ void cmd_flash(uint32 cmd)
bi_start = ofs/4;
bi_end = (ofs + len + 3)/4;
if (bi_end>BUFSIZE) {
if (bi_end > BUFSIZE) {
dcc_wr(OCL_BUFF_OVER);
return;
}
chksum = OCL_CHKS_INIT;
for (bi = 0; bi<bi_end; bi++) chksum^=buffer[bi]=dcc_rd();
for (bi = 0; bi < bi_end; bi++) chksum^=buffer[bi]=dcc_rd();
if (dcc_rd() != chksum) {
dcc_wr(OCL_CHKS_FAIL);
......@@ -59,12 +59,12 @@ void cmd_flash(uint32 cmd)
}
/* fill in unused positions with unprogrammed values */
for (bi = 0; bi<bi_start; bi++) buffer[bi]=0xffffffff;
for (bi = 0; bi < bi_start; bi++) buffer[bi]=0xffffffff;
for (bi = bi_end; bi%flash_page_size; bi++) buffer[bi]=0xffffffff;
result = 0;
pagenum = adr/flash_page_size;
for (bi = 0; bi<bi_end; bi += flash_page_size/4) {
for (bi = 0; bi < bi_end; bi += flash_page_size/4) {
result = flash_page_program(buffer + bi, pagenum++);
if (result) break;
}
......
......@@ -146,7 +146,7 @@ int flash_erase_plane(int efc_ofs)
if ((inr(MC_FSR + efc_ofs)&MC_LOCKE)) return FLASH_STAT_LOCKE;
}
if ((page_num += flash_lock_pages)>flash_page_count) break;
if ((page_num += flash_lock_pages) > flash_page_count) break;
lockbits>>=1;
}
......@@ -178,7 +178,7 @@ int flash_erase_all(void)
if ((result = flash_erase_plane(0)) != FLASH_STAT_OK) return result;
/* the second flash controller, if any */
if (flash_page_count>1024) result = flash_erase_plane(0x10);
if (flash_page_count > 1024) result = flash_erase_plane(0x10);
return result;
}
......
......@@ -322,7 +322,7 @@ static int stellaris_info(struct flash_bank_s *bank, char *buf, int buf_size)
buf += printed;
buf_size -= printed;
if (stellaris_info->num_lockbits>0)
if (stellaris_info->num_lockbits > 0)
{
printed = snprintf(buf,
buf_size,
......
......@@ -300,7 +300,7 @@ static int str9x_erase(struct flash_bank_s *bank, int first, int last)
}
int timeout;
for (timeout = 0; timeout<1000; timeout++) {
for (timeout = 0; timeout < 1000; timeout++) {
if ((retval = target_read_u8(target, adr, &status)) != ERROR_OK)
{
return retval;
......@@ -575,7 +575,7 @@ static int str9x_write(struct flash_bank_s *bank,
target_write_u16(target, bank_adr, 0x70);
int timeout;
for (timeout = 0; timeout<1000; timeout++)
for (timeout = 0; timeout < 1000; timeout++)
{
target_read_u8(target, bank_adr, &status);
if ( status & 0x80 )
......@@ -624,7 +624,7 @@ static int str9x_write(struct flash_bank_s *bank,
target_write_u16(target, bank_adr, 0x70);
int timeout;
for (timeout = 0; timeout<1000; timeout++)
for (timeout = 0; timeout < 1000; timeout++)
{
target_read_u8(target, bank_adr, &status);
if ( status & 0x80 )
......
......@@ -42,7 +42,7 @@ static inline void buf_set_u32(uint8_t* buffer, unsigned int first, unsigned int
{
unsigned int i;
for (i = first; i<first + num; i++)
for (i = first; i < first + num; i++)
{
if (((value >> (i-first))&1) == 1)
buffer[i/8] |= 1 << (i%8);
......@@ -61,7 +61,7 @@ static inline uint32_t buf_get_u32(const uint8_t* buffer, unsigned int first, un
uint32_t result = 0;
unsigned int i;
for (i = first; i<first + num; i++)
for (i = first; i < first + num; i++)
{
if (((buffer[i/8]>>(i%8))&1) == 1)
result |= 1 << (i-first);
......
......@@ -492,7 +492,7 @@ int command_run_line(command_context_t *context, char *line)
int reslen;
result = Jim_GetString(Jim_GetResult(interp), &reslen);
if (reslen>0)
if (reslen > 0)
{
int i;
char buff[256 + 1];
......
......@@ -84,7 +84,7 @@ static inline int fileio_open_local(fileio_t *fileio)
result2 = fseek(fileio->file, 0, SEEK_SET);
if ((fileio->size<0)||(result<0)||(result2<0))
if ((fileio->size < 0)||(result < 0)||(result2 < 0))
{
fileio_close(fileio);
return ERROR_FILEIO_OPERATION_FAILED;
......
......@@ -503,8 +503,8 @@ int Jim_StringToDouble(const char *str, double *doublePtr)
static jim_wide JimPowWide(jim_wide b, jim_wide e)
{
jim_wide i, res = 1;
if ((b == 0 && e != 0) || (e<0)) return 0;
for (i = 0; i<e; i++) {res *= b;}
if ((b == 0 && e != 0) || (e < 0)) return 0;
for (i = 0; i < e; i++) {res *= b;}
return res;
}
......@@ -6953,8 +6953,8 @@ int Jim_EvalExpression(Jim_Interp *interp, Jim_Obj *exprObjPtr,
case JIM_EXPROP_ADD: wC = wA + wB; break;
case JIM_EXPROP_SUB: wC = wA-wB; break;
case JIM_EXPROP_MUL: wC = wA*wB; break;
case JIM_EXPROP_LT: wC = wA<wB; break;
case JIM_EXPROP_GT: wC = wA>wB; break;
case JIM_EXPROP_LT: wC = wA < wB; break;
case JIM_EXPROP_GT: wC = wA > wB; break;
case JIM_EXPROP_LTE: wC = wA <= wB; break;
case JIM_EXPROP_GTE: wC = wA >= wB; break;
case JIM_EXPROP_LSHIFT: wC = wA << wB; break;
......@@ -7058,8 +7058,8 @@ trydouble:
case JIM_EXPROP_ADD: dC = dA + dB; break;
case JIM_EXPROP_SUB: dC = dA-dB; break;
case JIM_EXPROP_MUL: dC = dA*dB; break;
case JIM_EXPROP_LT: dC = dA<dB; break;
case JIM_EXPROP_GT: dC = dA>dB; break;
case JIM_EXPROP_LT: dC = dA < dB; break;
case JIM_EXPROP_GT: dC = dA > dB; break;
case JIM_EXPROP_LTE: dC = dA <= dB; break;
case JIM_EXPROP_GTE: dC = dA >= dB; break;
case JIM_EXPROP_NUMEQ: dC = dA == dB; break;
......@@ -8197,7 +8197,7 @@ static char *JimFindBestPackage(Jim_Interp *interp, char **prefixes,
strncmp(fileName + fileNameLen-4, ".dll", 4) == 0 ||
strncmp(fileName + fileNameLen-3, ".so", 3) == 0))
{
char ver[6]; /* xx.yy<nulterm> */
char ver[6]; /* xx.yy < nulterm> */
char *p = strrchr(fileName, '.');
int verLen, fileVer;
......
......@@ -384,7 +384,7 @@ char *alloc_printf(const char *format, ...)
void keep_alive()
{
current_time = timeval_ms();
if (current_time-last_time>1000)
if (current_time-last_time > 1000)
{
extern int gdb_actual_connections;
......@@ -400,7 +400,7 @@ void keep_alive()
"trouble with GDB connections.",
current_time-last_time);
}
if (current_time-last_time>500)
if (current_time-last_time > 500)
{
/* this will keep the GDB connection alive */
LOG_USER_N("%s", "");
......@@ -429,10 +429,10 @@ void alive_sleep(int ms)
{
int i;
int napTime = 10;
for (i = 0; i<ms; i += napTime)
for (i = 0; i < ms; i += napTime)
{
int sleep_a_bit = ms-i;
if (sleep_a_bit>napTime)
if (sleep_a_bit > napTime)
{
sleep_a_bit = napTime;
}
......@@ -445,7 +445,7 @@ void busy_sleep(int ms)
{
long long then;
then = timeval_ms();
while ((timeval_ms()-then)<ms)
while ((timeval_ms()-then) < ms)
{
/* busy wait */
}
......
......@@ -28,10 +28,10 @@
/* MIN,MAX macros */
#ifndef MIN
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MIN(a,b) (((a) < (b))?(a):(b))
#endif
#ifndef MAX
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MAX(a,b) (((a) > (b))?(a):(b))
#endif
/* for systems that do not support ENOTSUP
......
......@@ -54,7 +54,7 @@ void bitq_in_proc(void)
if (bitq_in_state.cmd->type == JTAG_SCAN)
{
/* loop through the fields */
while (bitq_in_state.field_idx<bitq_in_state.cmd->cmd.scan->num_fields)
while (bitq_in_state.field_idx < bitq_in_state.cmd->cmd.scan->num_fields)
{
field = &bitq_in_state.cmd->cmd.scan->fields[bitq_in_state.field_idx];
if (field->in_value)
......@@ -69,7 +69,7 @@ void bitq_in_proc(void)
else
{
/* buffer reallocation needed? */
if (field->num_bits>bitq_in_bufsize * 8)
if (field->num_bits > bitq_in_bufsize * 8)
{
/* buffer previously allocated? */
if (bitq_in_buffer != NULL)
......@@ -79,7 +79,7 @@ void bitq_in_proc(void)
bitq_in_buffer = NULL;
}
/* double the buffer size until it fits */
while (field->num_bits>bitq_in_bufsize * 8)
while (field->num_bits > bitq_in_bufsize * 8)
bitq_in_bufsize *= 2;
}
/* if necessary, allocate buffer and check for malloc error */
......@@ -93,9 +93,9 @@ void bitq_in_proc(void)
}
/* field scanning */
while (bitq_in_state.bit_pos<field->num_bits)
while (bitq_in_state.bit_pos < field->num_bits)
{
if ( ( tdo = bitq_interface->in() )<0 )
if ( ( tdo = bitq_interface->in() ) < 0 )
{
#ifdef _DEBUG_JTAG_IO_
LOG_DEBUG("bitq in EOF");
......@@ -161,7 +161,7 @@ void bitq_state_move(tap_state_t new_state)
tms_scan = tap_get_tms_path(tap_get_state(), new_state);
int tms_count = tap_get_tms_path_len(tap_get_state(), tap_get_end_state());
for (i = 0; i<tms_count; i++)
for (i = 0; i < tms_count; i++)
{
bitq_io(tms_scan & 1, 0, 0);
tms_scan >>= 1;
......@@ -229,7 +229,7 @@ void bitq_scan_field(scan_field_t* field, int pause)
if (field->out_value == NULL)
{
/* just send zeros and request data from TDO */
for (bit_cnt = field->num_bits; bit_cnt>1; bit_cnt--)
for (bit_cnt = field->num_bits; bit_cnt > 1; bit_cnt--)
bitq_io(0, 0, tdo_req);
bitq_io(pause, 0, tdo_req);
......@@ -239,7 +239,7 @@ void bitq_scan_field(scan_field_t* field, int pause)
/* send data, and optionally request TDO */
out_mask = 0x01;
out_ptr = field->out_value;
for (bit_cnt = field->num_bits; bit_cnt>1; bit_cnt--)
for (bit_cnt = field->num_bits; bit_cnt > 1; bit_cnt--)
{
bitq_io(0, ( (*out_ptr) & out_mask ) != 0, tdo_req);
if (out_mask == 0x80)
......
......@@ -2794,7 +2794,7 @@ static int ft2232_handle_device_desc_command(struct command_context_s* cmd_ctx,
cp[-2] = 0;
ft2232_device_desc = strdup(buf);
} else {
// <space>A not defined
// <space > A not defined
// so create it
sprintf(buf, "%s A", ft2232_device_desc);
ft2232_device_desc_A = strdup(buf);
......
......@@ -500,7 +500,7 @@ static int gw16012_init_device(void)
LOG_DEBUG("opening %s...", buffer);
device_handle = open(buffer, O_WRONLY);
if (device_handle<0)
if (device_handle < 0)
{
LOG_ERROR("cannot open device. check it exists and that user read and write rights are set");
return ERROR_JTAG_INIT_FAILED;
......
......@@ -345,7 +345,7 @@ static int parport_init(void)
#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
i = ioctl(device_handle, PPCLAIM);
if (i<0)
if (i < 0)
{
LOG_ERROR("cannot claim device");
return ERROR_JTAG_INIT_FAILED;
......@@ -353,7 +353,7 @@ static int parport_init(void)
i = PARPORT_MODE_COMPAT;
i= ioctl(device_handle, PPSETMODE, & i);
if (i<0)
if (i < 0)
{
LOG_ERROR(" cannot set compatible mode to device");
return ERROR_JTAG_INIT_FAILED;
......@@ -361,7 +361,7 @@ static int parport_init(void)
i = IEEE1284_MODE_COMPAT;
i = ioctl(device_handle, PPNEGOT, & i);
if (i<0)
if (i < 0)
{
LOG_ERROR("cannot set compatible 1284 mode to device");
return ERROR_JTAG_INIT_FAILED;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment