Commit 53d605e1 authored by zwelch's avatar zwelch
Browse files

- Fixes '!=' whitespace

- 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@2363 b42882b7-edfa-0310-969c-e2dbd0fdcd60
parent 5e98c714
......@@ -269,7 +269,7 @@ static int eCosBoard_erase(ecosflash_flash_bank_t *info, uint32_t address, uint3
int timeout = (len / 20480 + 1) * 1000; /*asume 20 KB/s*/
retval=loadDriver(info);
if (retval!=ERROR_OK)
if (retval != ERROR_OK)
return retval;
uint32_t flashErr;
......@@ -282,7 +282,7 @@ static int eCosBoard_erase(ecosflash_flash_bank_t *info, uint32_t address, uint3
&flashErr,
timeout
);
if (retval!=ERROR_OK)
if (retval != ERROR_OK)
return retval;
if (flashErr != 0x0)
......@@ -302,7 +302,7 @@ static int eCosBoard_flash(ecosflash_flash_bank_t *info, void *data, uint32_t ad
int timeout = (chunk / 20480 + 1) * 1000; /*asume 20 KB/s + 1 second*/
retval=loadDriver(info);
if (retval!=ERROR_OK)
if (retval != ERROR_OK)
return retval;
uint32_t buffer;
......@@ -314,7 +314,7 @@ static int eCosBoard_flash(ecosflash_flash_bank_t *info, void *data, uint32_t ad
0,
&buffer,
1000);
if (retval!=ERROR_OK)
if (retval != ERROR_OK)
return retval;
......
......@@ -90,7 +90,7 @@ static int flash_driver_write(struct flash_bank_s *bank, uint8_t *buffer, uint32
int retval;
retval=bank->driver->write(bank, buffer, offset, count);
if (retval!=ERROR_OK)
if (retval != ERROR_OK)
{
LOG_ERROR("error writing to flash at address 0x%08" PRIx32 " at offset 0x%8.8" PRIx32 " (%d)",
bank->base, offset, retval);
......@@ -104,7 +104,7 @@ static int flash_driver_erase(struct flash_bank_s *bank, int first, int last)
int retval;
retval=bank->driver->erase(bank, first, last);
if (retval!=ERROR_OK)
if (retval != ERROR_OK)
{
LOG_ERROR("failed erasing sectors %d to %d (%d)", first, last, retval);
}
......@@ -117,7 +117,7 @@ int flash_driver_protect(struct flash_bank_s *bank, int set, int first, int last
int retval;
retval=bank->driver->protect(bank, set, first, last);
if (retval!=ERROR_OK)
if (retval != ERROR_OK)
{
LOG_ERROR("failed setting protection for areas %d to %d (%d)", first, last, retval);
}
......@@ -801,11 +801,11 @@ static int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cm
return ERROR_FAIL;
}
err = flash_driver_write(bank, chunk, address - bank->base + wrote, cur_size);
if (err!=ERROR_OK)
if (err != ERROR_OK)
return err;
err = target_read_buffer(target, address + wrote, cur_size, readback);
if (err!=ERROR_OK)
if (err != ERROR_OK)
return err;
unsigned i;
......
......@@ -526,7 +526,7 @@ static int lpc2000_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t of
LOG_DEBUG("checksum: 0x%8.8" PRIx32, checksum);
uint32_t original_value=buf_get_u32(buffer + (5 * 4), 0, 32);
if (original_value!=checksum)
if (original_value != checksum)
{
LOG_WARNING("Verification will fail since checksum in image(0x%8.8" PRIx32 ") written to flash was different from calculated vector checksum(0x%8.8" PRIx32 ").",
original_value, checksum);
......
......@@ -53,7 +53,7 @@ void cmd_flash(uint32 cmd)
chksum=OCL_CHKS_INIT;
for (bi=0; bi<bi_end; bi++) chksum^=buffer[bi]=dcc_rd();
if (dcc_rd()!=chksum) {
if (dcc_rd() != chksum) {
dcc_wr(OCL_CHKS_FAIL);
return;
}
......
......@@ -175,7 +175,7 @@ int flash_erase_all(void)
{
int result;
if ((result=flash_erase_plane(0))!=FLASH_STAT_OK) return result;
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);
......
......@@ -388,7 +388,7 @@ static int pic32mx_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint3
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
};
if ((retval=target_write_buffer(target, pic32mx_info->write_algorithm->address, sizeof(pic32mx_flash_write_code), pic32mx_flash_write_code))!=ERROR_OK)
if ((retval=target_write_buffer(target, pic32mx_info->write_algorithm->address, sizeof(pic32mx_flash_write_code), pic32mx_flash_write_code)) != ERROR_OK)
return retval;
#endif
......@@ -409,7 +409,7 @@ static int pic32mx_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint3
{
uint32_t status;
if ((retval = target_write_buffer(target, source->address, buffer_size, buffer))!=ERROR_OK) {
if ((retval = target_write_buffer(target, source->address, buffer_size, buffer)) != ERROR_OK) {
LOG_ERROR("Failed to write row buffer (%d words) to RAM", (int)(buffer_size/4));
break;
}
......
......@@ -517,7 +517,7 @@ static int stm32x_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint32
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
};
if ((retval=target_write_buffer(target, stm32x_info->write_algorithm->address, sizeof(stm32x_flash_write_code), stm32x_flash_write_code))!=ERROR_OK)
if ((retval=target_write_buffer(target, stm32x_info->write_algorithm->address, sizeof(stm32x_flash_write_code), stm32x_flash_write_code)) != ERROR_OK)
return retval;
/* memory buffer */
......@@ -547,7 +547,7 @@ static int stm32x_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint32
{
uint32_t thisrun_count = (count > (buffer_size / 2)) ? (buffer_size / 2) : count;
if ((retval = target_write_buffer(target, source->address, thisrun_count * 2, buffer))!=ERROR_OK)
if ((retval = target_write_buffer(target, source->address, thisrun_count * 2, buffer)) != ERROR_OK)
break;
buf_set_u32(reg_params[0].value, 0, 32, source->address);
......
......@@ -198,11 +198,11 @@ static int str9x_protect_check(struct flash_bank_s *bank)
if (str9x_info->bank1)
{
adr = bank1start + 0x18;
if ((retval=target_write_u16(target, adr, 0x90))!=ERROR_OK)
if ((retval=target_write_u16(target, adr, 0x90)) != ERROR_OK)
{
return retval;
}
if ((retval=target_read_u16(target, adr, &hstatus))!=ERROR_OK)
if ((retval=target_read_u16(target, adr, &hstatus)) != ERROR_OK)
{
return retval;
}
......@@ -211,11 +211,11 @@ static int str9x_protect_check(struct flash_bank_s *bank)
else
{
adr = bank1start + 0x14;
if ((retval=target_write_u16(target, adr, 0x90))!=ERROR_OK)
if ((retval=target_write_u16(target, adr, 0x90)) != ERROR_OK)
{
return retval;
}
if ((retval=target_read_u32(target, adr, &status))!=ERROR_OK)
if ((retval=target_read_u32(target, adr, &status)) != ERROR_OK)
{
return retval;
}
......@@ -224,11 +224,11 @@ static int str9x_protect_check(struct flash_bank_s *bank)
else
{
adr = bank1start + 0x10;
if ((retval=target_write_u16(target, adr, 0x90))!=ERROR_OK)
if ((retval=target_write_u16(target, adr, 0x90)) != ERROR_OK)
{
return retval;
}
if ((retval=target_read_u16(target, adr, &hstatus))!=ERROR_OK)
if ((retval=target_read_u16(target, adr, &hstatus)) != ERROR_OK)
{
return retval;
}
......@@ -236,7 +236,7 @@ static int str9x_protect_check(struct flash_bank_s *bank)
}
/* read array command */
if ((retval=target_write_u16(target, adr, 0xFF))!=ERROR_OK)
if ((retval=target_write_u16(target, adr, 0xFF)) != ERROR_OK)
{
return retval;
}
......@@ -284,24 +284,24 @@ static int str9x_erase(struct flash_bank_s *bank, int first, int last)
adr = bank->base + bank->sectors[i].offset;
/* erase sectors */
if ((retval=target_write_u16(target, adr, erase_cmd))!=ERROR_OK)
if ((retval=target_write_u16(target, adr, erase_cmd)) != ERROR_OK)
{
return retval;
}
if ((retval=target_write_u16(target, adr, 0xD0))!=ERROR_OK)
if ((retval=target_write_u16(target, adr, 0xD0)) != ERROR_OK)
{
return retval;
}
/* get status */
if ((retval=target_write_u16(target, adr, 0x70))!=ERROR_OK)
if ((retval=target_write_u16(target, adr, 0x70)) != ERROR_OK)
{
return retval;
}
int timeout;
for (timeout=0; timeout<1000; timeout++) {
if ((retval=target_read_u8(target, adr, &status))!=ERROR_OK)
if ((retval=target_read_u8(target, adr, &status)) != ERROR_OK)
{
return retval;
}
......@@ -316,13 +316,13 @@ static int str9x_erase(struct flash_bank_s *bank, int first, int last)
}
/* clear status, also clear read array */
if ((retval=target_write_u16(target, adr, 0x50))!=ERROR_OK)
if ((retval=target_write_u16(target, adr, 0x50)) != ERROR_OK)
{
return retval;
}
/* read array command */
if ((retval=target_write_u16(target, adr, 0xFF))!=ERROR_OK)
if ((retval=target_write_u16(target, adr, 0xFF)) != ERROR_OK)
{
return retval;
}
......
......@@ -226,7 +226,7 @@ command_t* register_command(command_context_t *context, command_t *parent, char
const char *t2="";
const char *t3="";
/* maximum of two levels :-) */
if (c->parent!=NULL)
if (c->parent != NULL)
{
t1=c->parent->name;
t2="_";
......@@ -250,7 +250,7 @@ command_t* register_command(command_context_t *context, command_t *parent, char
Jim_Obj *cmd_list=Jim_NewListObj(interp, NULL, 0);
/* maximum of two levels :-) */
if (c->parent!=NULL)
if (c->parent != NULL)
{
Jim_ListAppendElement(interp, cmd_list, Jim_NewStringObj(interp, c->parent->name, -1));
}
......@@ -420,7 +420,7 @@ int run_command(command_context_t *context, command_t *c, char *words[], int num
const char *t2="";
const char *t3="";
/* maximum of two levels :-) */
if (c->parent!=NULL)
if (c->parent != NULL)
{
t1=c->parent->name;
t2=" ";
......@@ -473,7 +473,7 @@ int command_run_line(command_context_t *context, char *line)
Jim_DeleteAssocData(interp, "context");
}
if (retcode == JIM_ERR) {
if (retval!=ERROR_COMMAND_CLOSE_CONNECTION)
if (retval != ERROR_COMMAND_CLOSE_CONNECTION)
{
/* We do not print the connection closed error message */
Jim_PrintErrorMessage(interp);
......@@ -520,7 +520,7 @@ int command_run_linef(command_context_t *context, const char *format, ...)
va_list ap;
va_start(ap, format);
string = alloc_vprintf(format, ap);
if (string!=NULL)
if (string != NULL)
{
retval=command_run_line(context, string);
}
......@@ -809,7 +809,7 @@ int handle_sleep_command(struct command_context_s *cmd_ctx,
int handle_fast_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
if (argc!=1)
if (argc != 1)
return ERROR_COMMAND_SYNTAX_ERROR;
fast_and_dangerous = strcmp("enable", args[0])==0;
......
......@@ -116,7 +116,7 @@ int parse_config_file(struct command_context_s *cmd_ctx)
while (*cfg)
{
retval=command_run_line(cmd_ctx, *cfg);
if (retval!=ERROR_OK)
if (retval != ERROR_OK)
return retval;
cfg++;
}
......
......@@ -89,7 +89,7 @@ int loadFile(const char *fileName, void **data, size_t *len)
LOG_ERROR("Can't open %s\n", fileName);
return ERROR_FAIL;
}
if (fseek(pFile, 0, SEEK_END)!=0)
if (fseek(pFile, 0, SEEK_END) != 0)
{
LOG_ERROR("Can't open %s\n", fileName);
fclose(pFile);
......@@ -104,7 +104,7 @@ int loadFile(const char *fileName, void **data, size_t *len)
}
*len = fsize;
if (fseek(pFile, 0, SEEK_SET)!=0)
if (fseek(pFile, 0, SEEK_SET) != 0)
{
LOG_ERROR("Can't open %s\n", fileName);
fclose(pFile);
......@@ -225,11 +225,11 @@ int handle_append_command(struct command_context_s *cmd_ctx, char *cmd,
for (i = 1; i < argc; i++)
{
if (fwrite(args[i], 1, strlen(args[i]), config_file)!=strlen(args[i]))
if (fwrite(args[i], 1, strlen(args[i]), config_file) != strlen(args[i]))
break;
if (i != argc - 1)
{
if (fwrite(" ", 1, 1, config_file)!=1)
if (fwrite(" ", 1, 1, config_file) != 1)
break;
}
}
......@@ -274,7 +274,7 @@ int handle_cp_command(struct command_context_s *cmd_ctx, char *cmd, char **args,
chunk = maxChunk;
}
if ((retval==ERROR_OK)&&(fwrite(((char *)data)+pos, 1, chunk, f)!=chunk))
if ((retval==ERROR_OK)&&(fwrite(((char *)data)+pos, 1, chunk, f) != chunk))
retval = ERROR_INVALID_ARGUMENTS;
if (retval != ERROR_OK)
......@@ -613,7 +613,7 @@ static int zylinjtag_Jim_Command_mac(Jim_Interp *interp, int argc,
{
//if (ifr->ifr_addr.sa_family == AF_INET)
{
if (strcmp("eth0", ifr->ifr_name)!=0)
if (strcmp("eth0", ifr->ifr_name) != 0)
continue;
strncpy(ifreq.ifr_name, ifr->ifr_name, sizeof(ifreq.ifr_name));
if (ioctl(SockFD, SIOCGIFHWADDR, &ifreq) < 0)
......
......@@ -503,7 +503,7 @@ 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;
if ((b==0 && e != 0) || (e<0)) return 0;
for (i=0; i<e; i++) {res *= b;}
return res;
}
......@@ -6960,7 +6960,7 @@ int Jim_EvalExpression(Jim_Interp *interp, Jim_Obj *exprObjPtr,
case JIM_EXPROP_LSHIFT: wC = wA<<wB; break;
case JIM_EXPROP_RSHIFT: wC = wA>>wB; break;
case JIM_EXPROP_NUMEQ: wC = wA==wB; break;
case JIM_EXPROP_NUMNE: wC = wA!=wB; break;
case JIM_EXPROP_NUMNE: wC = wA != wB; break;
case JIM_EXPROP_BITAND: wC = wA&wB; break;
case JIM_EXPROP_BITXOR: wC = wA^wB; break;
case JIM_EXPROP_BITOR: wC = wA|wB; break;
......@@ -7063,7 +7063,7 @@ trydouble:
case JIM_EXPROP_LTE: dC = dA<=dB; break;
case JIM_EXPROP_GTE: dC = dA>=dB; break;
case JIM_EXPROP_NUMEQ: dC = dA==dB; break;
case JIM_EXPROP_NUMNE: dC = dA!=dB; break;
case JIM_EXPROP_NUMNE: dC = dA != dB; break;
case JIM_EXPROP_LOGICAND_LEFT:
if (dA == 0) {
i += (int)dB;
......
......@@ -89,7 +89,7 @@ static void log_puts(enum log_levels level, const char *file, int line, const ch
if (f != NULL)
file = f + 1;
if (strchr(string, '\n')!=NULL)
if (strchr(string, '\n') != NULL)
{
if (debug_level >= LOG_LVL_DEBUG)
{
......
......@@ -35,7 +35,7 @@
void *clear_malloc(size_t size)
{
void *t = malloc(size);
if (t!=NULL)
if (t != NULL)
{
memset(t, 0x00, size);
}
......@@ -45,7 +45,7 @@ void *clear_malloc(size_t size)
void *fill_malloc(size_t size)
{
void *t = malloc(size);
if (t!=NULL)
if (t != NULL)
{
/* We want to initialize memory to some known bad state. */
/* 0 and 0xff yields 0 and -1 as integers, which often */
......
......@@ -204,7 +204,7 @@ static void bitbang_scan(bool ir_scan, enum scan_type type, uint8_t *buffer, int
bitbang_interface->write(0, tms, tdi);
if (type!=SCAN_OUT)
if (type != SCAN_OUT)
val=bitbang_interface->read();
bitbang_interface->write(1, tms, tdi);
......
......@@ -72,7 +72,7 @@ void bitq_in_proc(void)
if (field->num_bits>bitq_in_bufsize * 8)
{
/* buffer previously allocated? */
if (bitq_in_buffer!=NULL)
if (bitq_in_buffer != NULL)
{
/* free it */
free(bitq_in_buffer);
......@@ -241,7 +241,7 @@ void bitq_scan_field(scan_field_t* field, int pause)
out_ptr = field->out_value;
for (bit_cnt = field->num_bits; bit_cnt>1; bit_cnt--)
{
bitq_io(0, ( (*out_ptr) & out_mask )!=0, tdo_req);
bitq_io(0, ( (*out_ptr) & out_mask ) != 0, tdo_req);
if (out_mask==0x80)
{
out_mask = 0x01;
......@@ -251,7 +251,7 @@ void bitq_scan_field(scan_field_t* field, int pause)
out_mask <<= 1;
}
bitq_io(pause, ( (*out_ptr) & out_mask )!=0, tdo_req);
bitq_io(pause, ( (*out_ptr) & out_mask ) != 0, tdo_req);
}
if (pause)
......@@ -382,7 +382,7 @@ int bitq_execute_queue(void)
void bitq_cleanup(void)
{
if (bitq_in_buffer!=NULL)
if (bitq_in_buffer != NULL)
{
free(bitq_in_buffer);
bitq_in_buffer = NULL;
......
......@@ -302,7 +302,7 @@ static void jtag_prelude(tap_state_t state)
{
jtag_checks();
assert(state!=TAP_INVALID);
assert(state != TAP_INVALID);
cmd_queue_cur_state = state;
}
......@@ -676,7 +676,7 @@ tap_state_t jtag_set_end_state(tap_state_t state)
LOG_ERROR("BUG: TAP_DRSHIFT/IRSHIFT can't be end state. Calling code should use a larger scan field");
}
if (state!=TAP_INVALID)
if (state != TAP_INVALID)
cmd_queue_end_state = state;
return cmd_queue_end_state;
}
......@@ -1157,7 +1157,7 @@ static int jtag_init_inner(struct command_context_s *cmd_ctx)
}
jtag_add_tlr();
if ((retval=jtag_execute_queue())!=ERROR_OK)
if ((retval=jtag_execute_queue()) != ERROR_OK)
return retval;
/* examine chain first, as this could discover the real chain layout */
......
......@@ -493,10 +493,10 @@ int interface_jtag_execute_queue(void)
if (retval == ERROR_OK)
{
struct jtag_callback_entry *entry;
for (entry=jtag_callback_queue_head; entry!=NULL; entry=entry->next)
for (entry=jtag_callback_queue_head; entry != NULL; entry=entry->next)
{
retval=entry->callback(entry->data0, entry->data1, entry->data2, entry->data3);
if (retval!=ERROR_OK)
if (retval != ERROR_OK)
break;
}
}
......
......@@ -52,7 +52,7 @@
#if (BUILD_FT2232_FTD2XX==1 && BUILD_FT2232_LIBFTDI==1)
#error "BUILD_FT2232_FTD2XX && BUILD_FT2232_LIBFTDI are mutually exclusive"
#elif (BUILD_FT2232_FTD2XX!=1 && BUILD_FT2232_LIBFTDI!=1)
#elif (BUILD_FT2232_FTD2XX != 1 && BUILD_FT2232_LIBFTDI != 1)
#error "BUILD_FT2232_FTD2XX || BUILD_FT2232_LIBFTDI must be chosen"
#endif
......
......@@ -751,7 +751,7 @@ static void jlink_tap_append_scan(int length, uint8_t *buffer, scan_command_t *c
for (i = 0; i < length; i++)
{
int tms = (i < (length - 1)) ? 0 : 1;
int tdi = (buffer[i / 8] & (1 << (i % 8)))!=0;
int tdi = (buffer[i / 8] & (1 << (i % 8))) != 0;
jlink_tap_append_step(tms, tdi);
}
pending_scan_results_length++;
......
Markdown is supported
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