if (cfi_info->qry[0] != 'Q')
return ERROR_FLASH_BANK_NOT_PROBED;
- switch(cfi_info->pri_id)
+ switch (cfi_info->pri_id)
{
case 1:
case 3:
if (cfi_info->qry[0] != 'Q')
return ERROR_FLASH_BANK_NOT_PROBED;
- switch(cfi_info->pri_id)
+ switch (cfi_info->pri_id)
{
case 1:
case 3:
bank->base, address, cfi_info->max_buf_write_size);
return ERROR_FLASH_OPERATION_FAILED;
}
- switch(bank->chip_width)
+ switch (bank->chip_width)
{
case 4 : bufferwsize = buffersize / 4; break;
case 2 : bufferwsize = buffersize / 2; break;
LOG_ERROR("Write address at base 0x%" PRIx32 ", address %" PRIx32 " not aligned to 2^%d boundary", bank->base, address, cfi_info->max_buf_write_size);
return ERROR_FLASH_OPERATION_FAILED;
}
- switch(bank->chip_width)
+ switch (bank->chip_width)
{
case 4 : bufferwsize = buffersize / 4; break;
case 2 : bufferwsize = buffersize / 2; break;
{
cfi_flash_bank_t *cfi_info = bank->driver_priv;
- switch(cfi_info->pri_id)
+ switch (cfi_info->pri_id)
{
case 1:
case 3:
{
cfi_flash_bank_t *cfi_info = bank->driver_priv;
- switch(cfi_info->pri_id)
+ switch (cfi_info->pri_id)
{
case 1:
case 3:
/* handle blocks of bus_size aligned bytes */
blk_count = count & ~(bank->bus_width - 1); /* round down, leave tail bytes */
- switch(cfi_info->pri_id)
+ switch (cfi_info->pri_id)
{
/* try block writes (fails without working area) */
case 1:
uint32_t buffermask = buffersize-1;
uint32_t bufferwsize;
- switch(bank->chip_width)
+ switch (bank->chip_width)
{
case 4 : bufferwsize = buffersize / 4; break;
case 2 : bufferwsize = buffersize / 2; break;
/* We need to read the primary algorithm extended query table before calculating
* the sector layout to be able to apply fixups
*/
- switch(cfi_info->pri_id)
+ switch (cfi_info->pri_id)
{
/* Intel command set (standard and extended) */
case 0x0001:
} /* end CFI case */
/* apply fixups depending on the primary command set */
- switch(cfi_info->pri_id)
+ switch (cfi_info->pri_id)
{
/* Intel command set (standard and extended) */
case 0x0001:
if (cfi_info->qry[0] != 'Q')
return ERROR_FLASH_BANK_NOT_PROBED;
- switch(cfi_info->pri_id)
+ switch (cfi_info->pri_id)
{
case 1:
case 3:
buf += printed;
buf_size -= printed;
- switch(cfi_info->pri_id)
+ switch (cfi_info->pri_id)
{
case 1:
case 3:
static uint32_t ecosflash_address(struct flash_bank_s *bank, uint32_t address)
{
uint32_t retval = 0;
- switch(bank->bus_width)
+ switch (bank->bus_width)
{
case 4:
retval = address & 0xfffffffc;
if (count == 0)
return ERROR_OK;
- switch(cmd[4])
+ switch (cmd[4])
{
case 'w':
wordsize=4;
}
chunk_count = MIN(count, (1024 / wordsize));
- switch(wordsize)
+ switch (wordsize)
{
case 4:
for(i = 0; i < chunk_count; i++)
if (wait == mg_io_wait_bsy)
return ERROR_OK;
} else {
- switch(wait)
+ switch (wait)
{
case mg_io_wait_not_bsy:
return ERROR_OK;
buf += printed;
buf_size -= printed;
- switch(device_id >> 16)
+ switch (device_id >> 16)
{
case 0x0000:
snprintf(buf, buf_size, "A");
buf += printed;
buf_size -= printed;
- switch(device_id >> 16)
+ switch (device_id >> 16)
{
case 0x1000:
snprintf(buf, buf_size, "A");
buf += printed;
buf_size -= printed;
- switch(device_id >> 16)
+ switch (device_id >> 16)
{
case 0x1000:
snprintf(buf, buf_size, "A");
buf += printed;
buf_size -= printed;
- switch(device_id >> 16)
+ switch (device_id >> 16)
{
case 0x1000:
snprintf(buf, buf_size, "A");
const char *string, int stringLen, int nocase)
{
while (patternLen) {
- switch(pattern[0]) {
+ switch (pattern[0]) {
case '*':
while (pattern[1] == '*') {
pattern++;
pc->eof = 1;
return JIM_OK;
}
- switch(*(pc->p)) {
+ switch (*(pc->p)) {
case '\\':
if (*(pc->p+1) == '\n')
return JimParseSep(pc);
pc->tt = JIM_TT_ESC;
return JIM_OK;
}
- switch(*pc->p) {
+ switch (*pc->p) {
case '\\':
if (pc->state == JIM_PS_DEF &&
*(pc->p+1) == '\n') {
slen = strlen(s);
for (i = 0; i < slen; i++) {
- switch(s[i]) {
+ switch (s[i]) {
case '\\':
- switch(s[i+1]) {
+ switch (s[i+1]) {
case 'a': *p++ = 0x7; i++; break;
case 'b': *p++ = 0x8; i++; break;
case 'f': *p++ = 0xc; i++; break;
pc->eof = 1;
return JIM_OK;
}
- switch(*pc->p) {
+ switch (*pc->p) {
case ' ':
case '\n':
case '\t':
pc->tt = JIM_TT_ESC;
return JIM_OK;
}
- switch(*pc->p) {
+ switch (*pc->p) {
case '\\':
pc->p++; pc->len--;
break;
if ( fmtLen <= 0 ){
break;
}
- switch( *fmt ){
+ switch ( *fmt ){
/* terminals */
case 'b': /* binary - not all printfs() do this */
case 's': /* string */
/* here we do the work */
/* actually - we make sprintf() do it for us */
- switch(*fmt) {
+ switch (*fmt) {
case 's':
*cp++ = 's';
*cp = 0;
goto testbrace;
}
for (i = 0; i < len; i++) {
- switch(s[i]) {
+ switch (s[i]) {
case ' ':
case '$':
case '"':
s[len-1] == ']') return JIM_ELESTR_QUOTE;
level = 0;
for (i = 0; i < len; i++) {
- switch(s[i]) {
+ switch (s[i]) {
case '{': level++; break;
case '}': level--;
if (level < 0) return JIM_ELESTR_QUOTE;
if (level == 0) {
if (!trySimple) return JIM_ELESTR_BRACE;
for (i = 0; i < len; i++) {
- switch(s[i]) {
+ switch (s[i]) {
case ' ':
case '$':
case '"':
const char *strRep = Jim_GetString(ele[i], &len);
char *q;
- switch(quotingType[i]) {
+ switch (quotingType[i]) {
case JIM_ELESTR_SIMPLE:
memcpy(p, strRep, len);
p += len;
const char *strRep = Jim_GetString(objv[i], &len);
char *q;
- switch(quotingType[i]) {
+ switch (quotingType[i]) {
case JIM_ELESTR_SIMPLE:
memcpy(p, strRep, len);
p += len;
pc->eof = 1;
return JIM_OK;
}
- switch(*(pc->p)) {
+ switch (*(pc->p)) {
case '(':
pc->tstart = pc->tend = pc->p;
pc->tline = pc->linenr;
* and make sure at the end of the program there is
* a single result on the stack. */
for (i = 0; i < expr->len; i++) {
- switch(expr->opcode[i]) {
+ switch (expr->opcode[i]) {
case JIM_EXPROP_NUMBER:
case JIM_EXPROP_STRING:
case JIM_EXPROP_SUBST:
leftindex = index-1;
arity = 1;
while (arity) {
- switch(expr->opcode[leftindex]) {
+ switch (expr->opcode[leftindex]) {
case JIM_EXPROP_NUMBER:
case JIM_EXPROP_COMMAND:
case JIM_EXPROP_VARIABLE:
Jim_Free(token);
break;
}
- switch(type) {
+ switch (type) {
case JIM_TT_STR:
ExprObjAddInstr(interp, expr, JIM_EXPROP_STRING, token, len);
break;
}
Jim_DecrRefCount(interp, A);
Jim_DecrRefCount(interp, B);
- switch(expr->opcode[i]) {
+ switch (expr->opcode[i]) {
case JIM_EXPROP_ADD: wC = wA+wB; break;
case JIM_EXPROP_SUB: wC = wA-wB; break;
case JIM_EXPROP_MUL: wC = wA*wB; break;
}
Jim_DecrRefCount(interp, A);
Jim_DecrRefCount(interp, B);
- switch(expr->opcode[i]) {
+ switch (expr->opcode[i]) {
case JIM_EXPROP_ROTL:
case JIM_EXPROP_ROTR:
case JIM_EXPROP_LSHIFT:
retry_as_string:
sA = Jim_GetString(A, &Alen);
sB = Jim_GetString(B, &Blen);
- switch(opcode) {
+ switch (opcode) {
case JIM_EXPROP_STREQ:
if (Alen == Blen && memcmp(sA, sB, Alen) ==0)
wC = 1;
goto trydouble_unary;
}
Jim_DecrRefCount(interp, A);
- switch(expr->opcode[i]) {
+ switch (expr->opcode[i]) {
case JIM_EXPROP_NOT: wC = !wA; break;
case JIM_EXPROP_BITNOT: wC = ~wA; break;
case JIM_EXPROP_LOGICAND_RIGHT:
goto err;
}
Jim_DecrRefCount(interp, A);
- switch(expr->opcode[i]) {
+ switch (expr->opcode[i]) {
case JIM_EXPROP_NOT: dC = !dA; break;
case JIM_EXPROP_LOGICAND_RIGHT:
case JIM_EXPROP_LOGICOR_RIGHT: dC = (dA != 0); break;
/* Compute every token forming the argument
* in the intv objects vector. */
for (i = 0; i < tokens; i++) {
- switch(token[i].type) {
+ switch (token[i].type) {
case JIM_TT_ESC:
case JIM_TT_STR:
intv[i] = token[i].objPtr;
if (tokens == 1) {
/* Fast path if the token does not
* need interpolation */
- switch(token[i].type) {
+ switch (token[i].type) {
case JIM_TT_ESC:
case JIM_TT_STR:
argv[j] = token[i].objPtr;
pc->eof = 1;
return JIM_OK;
}
- switch(*pc->p) {
+ switch (*pc->p) {
case '[':
retval = JimParseCmd(pc);
if (flags & JIM_SUBST_NOCMD) {
for (i = 0; i < len; i++) {
Jim_Obj *objPtr;
- switch(token[i].type) {
+ switch (token[i].type) {
case JIM_TT_STR:
case JIM_TT_ESC:
Jim_AppendObj(interp, resObjPtr, token[i].objPtr);
if ((expr = Jim_GetExpression(interp, argv[1])) == NULL) goto noopt;
if (expr->len <= 0 || expr->len > 3) goto noopt;
- switch(expr->len) {
+ switch (expr->len) {
case 1:
if (expr->opcode[0] != JIM_EXPROP_VARIABLE &&
expr->opcode[0] != JIM_EXPROP_NUMBER)
(expr->opcode[1] != JIM_EXPROP_NUMBER &&
expr->opcode[1] != JIM_EXPROP_VARIABLE))
goto noopt;
- switch(expr->opcode[2]) {
+ switch (expr->opcode[2]) {
case JIM_EXPROP_LT:
case JIM_EXPROP_LTE:
case JIM_EXPROP_GT:
}
if (!wideValue) break;
if ((retval = Jim_EvalObj(interp, argv[2])) != JIM_OK) {
- switch(retval) {
+ switch (retval) {
case JIM_BREAK:
if (varAObjPtr)
Jim_DecrRefCount(interp, varAObjPtr);
goto noopt;
}
}
- switch(cmpType) {
+ switch (cmpType) {
case JIM_EXPROP_LT:
cmpRes = wideValueA < wideValueB; break;
case JIM_EXPROP_LTE:
}
if (!cmpRes) break;
if ((retval = Jim_EvalObj(interp, argv[2])) != JIM_OK) {
- switch(retval) {
+ switch (retval) {
case JIM_BREAK:
Jim_DecrRefCount(interp, varAObjPtr);
if (varBObjPtr)
return retval;
if (!boolean) break;
if ((retval = Jim_EvalObj(interp, argv[2])) != JIM_OK) {
- switch(retval) {
+ switch (retval) {
case JIM_BREAK:
goto out;
break;
}
/* Eval body */
if ((retval = Jim_EvalObj(interp, argv[4])) != JIM_OK) {
- switch(retval) {
+ switch (retval) {
case JIM_BREAK:
if (stopVarNamePtr)
Jim_DecrRefCount(interp, stopVarNamePtr);
if (!boolean) break;
/* Eval body */
if ((retval = Jim_EvalObj(interp, argv[4])) != JIM_OK) {
- switch(retval) {
+ switch (retval) {
case JIM_BREAK:
goto out;
break;
evalnext:
/* Eval next */
if ((retval = Jim_EvalObj(interp, argv[3])) != JIM_OK) {
- switch(retval) {
+ switch (retval) {
case JIM_BREAK:
goto out;
break;
if (Jim_GetEnum(interp, argv[i], options, &option, "option", JIM_ERRMSG)
!= JIM_OK)
return JIM_ERR;
- switch(option) {
+ switch (option) {
case OPT_ASCII: lsortType = JIM_LSORT_ASCII; break;
case OPT_NOCASE: lsortType = JIM_LSORT_NOCASE; break;
case OPT_INCREASING: decreasing = 0; break;
}
}
if (decreasing) {
- switch(lsortType) {
+ switch (lsortType) {
case JIM_LSORT_ASCII: lsortType = JIM_LSORT_ASCII_DECR; break;
case JIM_LSORT_NOCASE: lsortType = JIM_LSORT_NOCASE_DECR; break;
}
const char *type;
Jim_ExprOperator *op;
- switch(expr->opcode[i]) {
+ switch (expr->opcode[i]) {
case JIM_EXPROP_NUMBER: type = "number"; break;
case JIM_EXPROP_COMMAND: type = "command"; break;
case JIM_EXPROP_VARIABLE: type = "variable"; break;
* return e;
* }
*
- * switch( n->value ){
+ * switch ( n->value ){
* case ALIVE:
* printf("Option ALIVE specified\n");
* break;
* return e;
* }
*
- * switch( n->value ){
+ * switch ( n->value ){
* case OPT_SEX:
* // handle: --sex male|female|lots|needmore
* e = Jim_GetOpt_Nvp( &goi, &nvp_sex, &n );
int ndx;
- switch( astate )
+ switch ( astate )
{
case TAP_RESET: ndx = 0; break;
case TAP_DRSHIFT: ndx = 2; break;
{
bool is_stable;
- /* A switch() is used because it is symbol dependent
+ /* A switch () is used because it is symbol dependent
(not value dependent like an array), and can also check bounds.
*/
- switch( astate )
+ switch ( astate )
{
case TAP_RESET:
case TAP_IDLE:
{
const char* ret;
- switch( state )
+ switch ( state )
{
case TAP_RESET: ret = "RESET"; break;
case TAP_IDLE: ret = "RUN/IDLE"; break;
exit(1);
}
- switch(header->type) {
+ switch (header->type) {
case DTCLOAD_COMMENT:
break;
/* chunk_bits is a multiple of 8, so there are no rounding issues. */
chunk_bytes = chunk_bits / 8;
- switch(type) {
+ switch (type) {
case SCAN_IN:
x = DTC_CMD_SHIFT_TDO_BYTES(chunk_bytes);
break;
return e;
}
LOG_DEBUG("Processing option: %s", n->name );
- switch( n->value ){
+ switch ( n->value ){
case NTAP_OPT_ENABLED:
pTap->disabled_after_reset = false;
break;
Jim_SetResult_sprintf( goi->interp, "option: %s bad parameter", n->name );
return e;
}
- switch(n->value){
+ switch (n->value){
case NTAP_OPT_IRLEN:
if (w > (jim_wide) (8 * sizeof(pTap->ir_capture_value)))
LOG_WARNING("huge IR length %d", (int) w);
reqbits &= (~(NTREQ_IRCAPTURE));
break;
}
- } /* switch(n->value) */
+ } /* switch (n->value) */
} /* while ( goi->argc ) */
/* default is enabled-after-reset */
return e;
}
Jim_SetEmptyResult( goi.interp );
- switch( n->value ){
+ switch ( n->value ){
case JTAG_CMD_INTERFACE:
/* return the name of the interface */
/* TCL code might need to know the exact type... */
case JTAG_STABLECLOCKS:
DEBUG_JTAG_IO("add %d clocks", cmd->cmd.stableclocks->num_cycles);
- switch(tap_get_state())
+ switch (tap_get_state())
{
case TAP_RESET:
// tms should be '1' to stay in TAP_RESET mode
#ifdef _WIN32
errno = WSAGetLastError();
- switch(errno)
+ switch (errno)
{
case WSAEWOULDBLOCK:
usleep(1000);
exit(-1);
}
#else
- switch(errno)
+ switch (errno)
{
case EAGAIN:
usleep(1000);
int gdb_detach(connection_t *connection, target_t *target)
{
- switch( detach_mode )
+ switch ( detach_mode )
{
case GDB_DETACH_RESUME:
target_handle_event( target, TARGET_EVENT_OLD_pre_resume );
{
const char* ret;
- switch( state )
+ switch ( state )
{
case TAP_RESET: ret = "RESET"; break;
case TAP_IDLE: ret = "IDLE"; break;
while (!cmd_ok && (read(fd, &ch, 1) > 0) )
{
- switch(ch)
+ switch (ch)
{
case '!':
slash = 0;
while (pos < len)
{
- switch(str[pos])
+ switch (str[pos])
{
case '\n':
case '\r':
}
command = svf_find_string_in_array(argus[0], (char **)svf_command_name, dimof(svf_command_name));
- switch(command)
+ switch (command)
{
case ENDDR:
case ENDIR:
target_address = address + 4 + (offset<<1);
- switch(opc)
+ switch (opc)
{
/* unconditional branch */
case 0:
uint8_t opc = (opcode >> 11) & 0x3;
char *mnemonic = NULL;
- switch(opc)
+ switch (opc)
{
case 0:
instruction->type = ARM_MOV;
instruction->info.data_proc.variant = 0; /*immediate*/
instruction->info.data_proc.shifter_operand.immediate.immediate = imm;
- switch(opc)
+ switch (opc)
{
case 0:
instruction->type = ARM_MOV;
uint8_t opc = (opcode >> 9) & 0x7;
char *mnemonic = NULL;
- switch(opc)
+ switch (opc)
{
case 0:
instruction->type = ARM_STR;
}
else if (record_type >= 1 && record_type <= 3)
{
- switch( record_type )
+ switch ( record_type )
{
case 1:
/* S1 - 16 bit address data record */
for(i = 0; i < (count*size); i += size)
{
- switch(size)
+ switch (size)
{
case 4:
t32 = le_to_h_u32(&buffer[i]);
for(i = 0; i < (count*size); i += size)
{
- switch(size)
+ switch (size)
{
case 4:
t32 = be_to_h_u32(&buffer[i]);
return retval;
// fall through
case 3:
- switch(args[2][0])
+ switch (args[2][0])
{
case 'r':
type = WPT_READ;
Jim_GetOpt_NvpUnknown( goi, nvp_config_opts, 0 );
return e;
}
- switch( n->value ){
+ switch ( n->value ){
case TCFG_TYPE:
/* not setable */
if ( goi->isconfigure ){
/* Assume blank result */
Jim_SetEmptyResult( goi.interp );
- switch( n->value ){
+ switch ( n->value ){
case TS_CMD_CONFIGURE:
if ( goi.argc < 2 ){
Jim_WrongNumArgs( goi.interp, goi.argc, goi.argv, "missing: -option VALUE ...");
c = 1;
}
- switch( n->value ){
+ switch ( n->value ){
case TS_CMD_MWW:
target_buffer_set_u32( target, target_buf, b );
b = 4;
c = 1;
}
b = 1; /* shut up gcc */
- switch( n->value ){
+ switch ( n->value ){
case TS_CMD_MDW:
b = 4;
break;
}
Jim_fprintf( interp, interp->cookie_stdout, "0x%08x ", (int)(a) );
- switch( b ){
+ switch ( b ){
case 4:
for( x = 0 ; (x < 16) && (x < y) ; x += 4 ){
z = target_buffer_get_u32( target, &(target_buf[ x * 4 ]) );
return r;
}
- switch(x){
+ switch (x){
default:
Jim_Panic(goi.interp,"Why am I here?");
return JIM_ERR;
{
reg_no = strtoul(args[0], NULL, 0);
/*translate from xscale cp15 register no to openocd register*/
- switch(reg_no)
+ switch (reg_no)
{
case 0:
reg_no = XSCALE_MAINID;
{
tap_state_t ret;
- switch( xsvf_state )
+ switch ( xsvf_state )
{
case XSV_RESET: ret = TAP_RESET; break;
case XSV_IDLE: ret = TAP_IDLE; break;
break;
}
- switch( trst_mode )
+ switch ( trst_mode )
{
case XTRST_ON:
jtag_add_reset(1, 0);