- Replace 'switch(' with 'switch ('.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2359 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
zwelch 2009-06-23 22:36:56 +00:00
parent 50c086ffb9
commit 9af5e445b7
19 changed files with 96 additions and 96 deletions

View File

@ -806,7 +806,7 @@ static int cfi_erase(struct flash_bank_s *bank, int first, int last)
if (cfi_info->qry[0] != 'Q') if (cfi_info->qry[0] != 'Q')
return ERROR_FLASH_BANK_NOT_PROBED; return ERROR_FLASH_BANK_NOT_PROBED;
switch(cfi_info->pri_id) switch (cfi_info->pri_id)
{ {
case 1: case 1:
case 3: case 3:
@ -958,7 +958,7 @@ static int cfi_protect(struct flash_bank_s *bank, int set, int first, int last)
if (cfi_info->qry[0] != 'Q') if (cfi_info->qry[0] != 'Q')
return ERROR_FLASH_BANK_NOT_PROBED; return ERROR_FLASH_BANK_NOT_PROBED;
switch(cfi_info->pri_id) switch (cfi_info->pri_id)
{ {
case 1: case 1:
case 3: case 3:
@ -1601,7 +1601,7 @@ static int cfi_intel_write_words(struct flash_bank_s *bank, uint8_t *word, uint3
bank->base, address, cfi_info->max_buf_write_size); bank->base, address, cfi_info->max_buf_write_size);
return ERROR_FLASH_OPERATION_FAILED; return ERROR_FLASH_OPERATION_FAILED;
} }
switch(bank->chip_width) switch (bank->chip_width)
{ {
case 4 : bufferwsize = buffersize / 4; break; case 4 : bufferwsize = buffersize / 4; break;
case 2 : bufferwsize = buffersize / 2; break; case 2 : bufferwsize = buffersize / 2; break;
@ -1740,7 +1740,7 @@ static int cfi_spansion_write_words(struct flash_bank_s *bank, uint8_t *word, ui
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); 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; return ERROR_FLASH_OPERATION_FAILED;
} }
switch(bank->chip_width) switch (bank->chip_width)
{ {
case 4 : bufferwsize = buffersize / 4; break; case 4 : bufferwsize = buffersize / 4; break;
case 2 : bufferwsize = buffersize / 2; break; case 2 : bufferwsize = buffersize / 2; break;
@ -1817,7 +1817,7 @@ static int cfi_write_word(struct flash_bank_s *bank, uint8_t *word, uint32_t add
{ {
cfi_flash_bank_t *cfi_info = bank->driver_priv; cfi_flash_bank_t *cfi_info = bank->driver_priv;
switch(cfi_info->pri_id) switch (cfi_info->pri_id)
{ {
case 1: case 1:
case 3: case 3:
@ -1838,7 +1838,7 @@ static int cfi_write_words(struct flash_bank_s *bank, uint8_t *word, uint32_t wo
{ {
cfi_flash_bank_t *cfi_info = bank->driver_priv; cfi_flash_bank_t *cfi_info = bank->driver_priv;
switch(cfi_info->pri_id) switch (cfi_info->pri_id)
{ {
case 1: case 1:
case 3: case 3:
@ -1927,7 +1927,7 @@ int cfi_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint3
/* handle blocks of bus_size aligned bytes */ /* handle blocks of bus_size aligned bytes */
blk_count = count & ~(bank->bus_width - 1); /* round down, leave tail 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) */ /* try block writes (fails without working area) */
case 1: case 1:
@ -1958,7 +1958,7 @@ int cfi_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset, uint3
uint32_t buffermask = buffersize-1; uint32_t buffermask = buffersize-1;
uint32_t bufferwsize; uint32_t bufferwsize;
switch(bank->chip_width) switch (bank->chip_width)
{ {
case 4 : bufferwsize = buffersize / 4; break; case 4 : bufferwsize = buffersize / 4; break;
case 2 : bufferwsize = buffersize / 2; break; case 2 : bufferwsize = buffersize / 2; break;
@ -2293,7 +2293,7 @@ static int cfi_probe(struct flash_bank_s *bank)
/* We need to read the primary algorithm extended query table before calculating /* We need to read the primary algorithm extended query table before calculating
* the sector layout to be able to apply fixups * 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) */ /* Intel command set (standard and extended) */
case 0x0001: case 0x0001:
@ -2326,7 +2326,7 @@ static int cfi_probe(struct flash_bank_s *bank)
} /* end CFI case */ } /* end CFI case */
/* apply fixups depending on the primary command set */ /* apply fixups depending on the primary command set */
switch(cfi_info->pri_id) switch (cfi_info->pri_id)
{ {
/* Intel command set (standard and extended) */ /* Intel command set (standard and extended) */
case 0x0001: case 0x0001:
@ -2490,7 +2490,7 @@ static int cfi_protect_check(struct flash_bank_s *bank)
if (cfi_info->qry[0] != 'Q') if (cfi_info->qry[0] != 'Q')
return ERROR_FLASH_BANK_NOT_PROBED; return ERROR_FLASH_BANK_NOT_PROBED;
switch(cfi_info->pri_id) switch (cfi_info->pri_id)
{ {
case 1: case 1:
case 3: case 3:
@ -2567,7 +2567,7 @@ static int cfi_info(struct flash_bank_s *bank, char *buf, int buf_size)
buf += printed; buf += printed;
buf_size -= printed; buf_size -= printed;
switch(cfi_info->pri_id) switch (cfi_info->pri_id)
{ {
case 1: case 1:
case 3: case 3:

View File

@ -392,7 +392,7 @@ static void command(flash_bank_t *bank, uint8_t cmd, uint8_t *cmd_buf)
static uint32_t ecosflash_address(struct flash_bank_s *bank, uint32_t address) static uint32_t ecosflash_address(struct flash_bank_s *bank, uint32_t address)
{ {
uint32_t retval = 0; uint32_t retval = 0;
switch(bank->bus_width) switch (bank->bus_width)
{ {
case 4: case 4:
retval = address & 0xfffffffc; retval = address & 0xfffffffc;

View File

@ -751,7 +751,7 @@ static int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cm
if (count == 0) if (count == 0)
return ERROR_OK; return ERROR_OK;
switch(cmd[4]) switch (cmd[4])
{ {
case 'w': case 'w':
wordsize=4; wordsize=4;
@ -767,7 +767,7 @@ static int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cm
} }
chunk_count = MIN(count, (1024 / wordsize)); chunk_count = MIN(count, (1024 / wordsize));
switch(wordsize) switch (wordsize)
{ {
case 4: case 4:
for(i = 0; i < chunk_count; i++) for(i = 0; i < chunk_count; i++)

View File

@ -232,7 +232,7 @@ static int mg_dsk_wait(mg_io_type_wait wait, uint32_t time)
if (wait == mg_io_wait_bsy) if (wait == mg_io_wait_bsy)
return ERROR_OK; return ERROR_OK;
} else { } else {
switch(wait) switch (wait)
{ {
case mg_io_wait_not_bsy: case mg_io_wait_not_bsy:
return ERROR_OK; return ERROR_OK;

View File

@ -848,7 +848,7 @@ static int stm32x_info(struct flash_bank_s *bank, char *buf, int buf_size)
buf += printed; buf += printed;
buf_size -= printed; buf_size -= printed;
switch(device_id >> 16) switch (device_id >> 16)
{ {
case 0x0000: case 0x0000:
snprintf(buf, buf_size, "A"); snprintf(buf, buf_size, "A");
@ -877,7 +877,7 @@ static int stm32x_info(struct flash_bank_s *bank, char *buf, int buf_size)
buf += printed; buf += printed;
buf_size -= printed; buf_size -= printed;
switch(device_id >> 16) switch (device_id >> 16)
{ {
case 0x1000: case 0x1000:
snprintf(buf, buf_size, "A"); snprintf(buf, buf_size, "A");
@ -894,7 +894,7 @@ static int stm32x_info(struct flash_bank_s *bank, char *buf, int buf_size)
buf += printed; buf += printed;
buf_size -= printed; buf_size -= printed;
switch(device_id >> 16) switch (device_id >> 16)
{ {
case 0x1000: case 0x1000:
snprintf(buf, buf_size, "A"); snprintf(buf, buf_size, "A");
@ -915,7 +915,7 @@ static int stm32x_info(struct flash_bank_s *bank, char *buf, int buf_size)
buf += printed; buf += printed;
buf_size -= printed; buf_size -= printed;
switch(device_id >> 16) switch (device_id >> 16)
{ {
case 0x1000: case 0x1000:
snprintf(buf, buf_size, "A"); snprintf(buf, buf_size, "A");

View File

@ -246,7 +246,7 @@ static int JimStringMatch(const char *pattern, int patternLen,
const char *string, int stringLen, int nocase) const char *string, int stringLen, int nocase)
{ {
while (patternLen) { while (patternLen) {
switch(pattern[0]) { switch (pattern[0]) {
case '*': case '*':
while (pattern[1] == '*') { while (pattern[1] == '*') {
pattern++; pattern++;
@ -1189,7 +1189,7 @@ int JimParseScript(struct JimParserCtx *pc)
pc->eof = 1; pc->eof = 1;
return JIM_OK; return JIM_OK;
} }
switch(*(pc->p)) { switch (*(pc->p)) {
case '\\': case '\\':
if (*(pc->p+1) == '\n') if (*(pc->p+1) == '\n')
return JimParseSep(pc); return JimParseSep(pc);
@ -1427,7 +1427,7 @@ int JimParseStr(struct JimParserCtx *pc)
pc->tt = JIM_TT_ESC; pc->tt = JIM_TT_ESC;
return JIM_OK; return JIM_OK;
} }
switch(*pc->p) { switch (*pc->p) {
case '\\': case '\\':
if (pc->state == JIM_PS_DEF && if (pc->state == JIM_PS_DEF &&
*(pc->p+1) == '\n') { *(pc->p+1) == '\n') {
@ -1518,9 +1518,9 @@ static int JimEscape(char *dest, const char *s, int slen)
slen = strlen(s); slen = strlen(s);
for (i = 0; i < slen; i++) { for (i = 0; i < slen; i++) {
switch(s[i]) { switch (s[i]) {
case '\\': case '\\':
switch(s[i+1]) { switch (s[i+1]) {
case 'a': *p++ = 0x7; i++; break; case 'a': *p++ = 0x7; i++; break;
case 'b': *p++ = 0x8; i++; break; case 'b': *p++ = 0x8; i++; break;
case 'f': *p++ = 0xc; i++; break; case 'f': *p++ = 0xc; i++; break;
@ -1709,7 +1709,7 @@ int JimParseList(struct JimParserCtx *pc)
pc->eof = 1; pc->eof = 1;
return JIM_OK; return JIM_OK;
} }
switch(*pc->p) { switch (*pc->p) {
case ' ': case ' ':
case '\n': case '\n':
case '\t': case '\t':
@ -1757,7 +1757,7 @@ int JimParseListStr(struct JimParserCtx *pc)
pc->tt = JIM_TT_ESC; pc->tt = JIM_TT_ESC;
return JIM_OK; return JIM_OK;
} }
switch(*pc->p) { switch (*pc->p) {
case '\\': case '\\':
pc->p++; pc->len--; pc->p++; pc->len--;
break; break;
@ -2286,7 +2286,7 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
if ( fmtLen <= 0 ){ if ( fmtLen <= 0 ){
break; break;
} }
switch( *fmt ){ switch ( *fmt ){
/* terminals */ /* terminals */
case 'b': /* binary - not all printfs() do this */ case 'b': /* binary - not all printfs() do this */
case 's': /* string */ case 's': /* string */
@ -2436,7 +2436,7 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
/* here we do the work */ /* here we do the work */
/* actually - we make sprintf() do it for us */ /* actually - we make sprintf() do it for us */
switch(*fmt) { switch (*fmt) {
case 's': case 's':
*cp++ = 's'; *cp++ = 's';
*cp = 0; *cp = 0;
@ -5030,7 +5030,7 @@ static int ListElementQuotingType(const char *s, int len)
goto testbrace; goto testbrace;
} }
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
switch(s[i]) { switch (s[i]) {
case ' ': case ' ':
case '$': case '$':
case '"': case '"':
@ -5057,7 +5057,7 @@ testbrace:
s[len-1] == ']') return JIM_ELESTR_QUOTE; s[len-1] == ']') return JIM_ELESTR_QUOTE;
level = 0; level = 0;
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
switch(s[i]) { switch (s[i]) {
case '{': level++; break; case '{': level++; break;
case '}': level--; case '}': level--;
if (level < 0) return JIM_ELESTR_QUOTE; if (level < 0) return JIM_ELESTR_QUOTE;
@ -5073,7 +5073,7 @@ testbrace:
if (level == 0) { if (level == 0) {
if (!trySimple) return JIM_ELESTR_BRACE; if (!trySimple) return JIM_ELESTR_BRACE;
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
switch(s[i]) { switch (s[i]) {
case ' ': case ' ':
case '$': case '$':
case '"': case '"':
@ -5164,7 +5164,7 @@ void UpdateStringOfList(struct Jim_Obj *objPtr)
const char *strRep = Jim_GetString(ele[i], &len); const char *strRep = Jim_GetString(ele[i], &len);
char *q; char *q;
switch(quotingType[i]) { switch (quotingType[i]) {
case JIM_ELESTR_SIMPLE: case JIM_ELESTR_SIMPLE:
memcpy(p, strRep, len); memcpy(p, strRep, len);
p += len; p += len;
@ -5739,7 +5739,7 @@ void UpdateStringOfDict(struct Jim_Obj *objPtr)
const char *strRep = Jim_GetString(objv[i], &len); const char *strRep = Jim_GetString(objv[i], &len);
char *q; char *q;
switch(quotingType[i]) { switch (quotingType[i]) {
case JIM_ELESTR_SIMPLE: case JIM_ELESTR_SIMPLE:
memcpy(p, strRep, len); memcpy(p, strRep, len);
p += len; p += len;
@ -6291,7 +6291,7 @@ int JimParseExpression(struct JimParserCtx *pc)
pc->eof = 1; pc->eof = 1;
return JIM_OK; return JIM_OK;
} }
switch(*(pc->p)) { switch (*(pc->p)) {
case '(': case '(':
pc->tstart = pc->tend = pc->p; pc->tstart = pc->tend = pc->p;
pc->tline = pc->linenr; pc->tline = pc->linenr;
@ -6508,7 +6508,7 @@ static int ExprCheckCorrectness(ExprByteCode *expr)
* and make sure at the end of the program there is * and make sure at the end of the program there is
* a single result on the stack. */ * a single result on the stack. */
for (i = 0; i < expr->len; i++) { for (i = 0; i < expr->len; i++) {
switch(expr->opcode[i]) { switch (expr->opcode[i]) {
case JIM_EXPROP_NUMBER: case JIM_EXPROP_NUMBER:
case JIM_EXPROP_STRING: case JIM_EXPROP_STRING:
case JIM_EXPROP_SUBST: case JIM_EXPROP_SUBST:
@ -6624,7 +6624,7 @@ static void ExprMakeLazy(Jim_Interp *interp, ExprByteCode *expr)
leftindex = index-1; leftindex = index-1;
arity = 1; arity = 1;
while (arity) { while (arity) {
switch(expr->opcode[leftindex]) { switch (expr->opcode[leftindex]) {
case JIM_EXPROP_NUMBER: case JIM_EXPROP_NUMBER:
case JIM_EXPROP_COMMAND: case JIM_EXPROP_COMMAND:
case JIM_EXPROP_VARIABLE: case JIM_EXPROP_VARIABLE:
@ -6710,7 +6710,7 @@ int SetExprFromAny(Jim_Interp *interp, struct Jim_Obj *objPtr)
Jim_Free(token); Jim_Free(token);
break; break;
} }
switch(type) { switch (type) {
case JIM_TT_STR: case JIM_TT_STR:
ExprObjAddInstr(interp, expr, JIM_EXPROP_STRING, token, len); ExprObjAddInstr(interp, expr, JIM_EXPROP_STRING, token, len);
break; break;
@ -6949,7 +6949,7 @@ int Jim_EvalExpression(Jim_Interp *interp, Jim_Obj *exprObjPtr,
} }
Jim_DecrRefCount(interp, A); Jim_DecrRefCount(interp, A);
Jim_DecrRefCount(interp, B); Jim_DecrRefCount(interp, B);
switch(expr->opcode[i]) { switch (expr->opcode[i]) {
case JIM_EXPROP_ADD: wC = wA+wB; break; case JIM_EXPROP_ADD: wC = wA+wB; break;
case JIM_EXPROP_SUB: wC = wA-wB; break; case JIM_EXPROP_SUB: wC = wA-wB; break;
case JIM_EXPROP_MUL: wC = wA*wB; break; case JIM_EXPROP_MUL: wC = wA*wB; break;
@ -7040,7 +7040,7 @@ trydouble:
} }
Jim_DecrRefCount(interp, A); Jim_DecrRefCount(interp, A);
Jim_DecrRefCount(interp, B); Jim_DecrRefCount(interp, B);
switch(expr->opcode[i]) { switch (expr->opcode[i]) {
case JIM_EXPROP_ROTL: case JIM_EXPROP_ROTL:
case JIM_EXPROP_ROTR: case JIM_EXPROP_ROTR:
case JIM_EXPROP_LSHIFT: case JIM_EXPROP_LSHIFT:
@ -7097,7 +7097,7 @@ trydouble:
retry_as_string: retry_as_string:
sA = Jim_GetString(A, &Alen); sA = Jim_GetString(A, &Alen);
sB = Jim_GetString(B, &Blen); sB = Jim_GetString(B, &Blen);
switch(opcode) { switch (opcode) {
case JIM_EXPROP_STREQ: case JIM_EXPROP_STREQ:
if (Alen == Blen && memcmp(sA, sB, Alen) ==0) if (Alen == Blen && memcmp(sA, sB, Alen) ==0)
wC = 1; wC = 1;
@ -7134,7 +7134,7 @@ retry_as_string:
goto trydouble_unary; goto trydouble_unary;
} }
Jim_DecrRefCount(interp, A); Jim_DecrRefCount(interp, A);
switch(expr->opcode[i]) { switch (expr->opcode[i]) {
case JIM_EXPROP_NOT: wC = !wA; break; case JIM_EXPROP_NOT: wC = !wA; break;
case JIM_EXPROP_BITNOT: wC = ~wA; break; case JIM_EXPROP_BITNOT: wC = ~wA; break;
case JIM_EXPROP_LOGICAND_RIGHT: case JIM_EXPROP_LOGICAND_RIGHT:
@ -7155,7 +7155,7 @@ trydouble_unary:
goto err; goto err;
} }
Jim_DecrRefCount(interp, A); Jim_DecrRefCount(interp, A);
switch(expr->opcode[i]) { switch (expr->opcode[i]) {
case JIM_EXPROP_NOT: dC = !dA; break; case JIM_EXPROP_NOT: dC = !dA; break;
case JIM_EXPROP_LOGICAND_RIGHT: case JIM_EXPROP_LOGICAND_RIGHT:
case JIM_EXPROP_LOGICOR_RIGHT: dC = (dA != 0); break; case JIM_EXPROP_LOGICOR_RIGHT: dC = (dA != 0); break;
@ -8454,7 +8454,7 @@ int Jim_InterpolateTokens(Jim_Interp *interp, ScriptToken *token,
/* Compute every token forming the argument /* Compute every token forming the argument
* in the intv objects vector. */ * in the intv objects vector. */
for (i = 0; i < tokens; i++) { for (i = 0; i < tokens; i++) {
switch(token[i].type) { switch (token[i].type) {
case JIM_TT_ESC: case JIM_TT_ESC:
case JIM_TT_STR: case JIM_TT_STR:
intv[i] = token[i].objPtr; intv[i] = token[i].objPtr;
@ -8628,7 +8628,7 @@ int Jim_EvalObj(Jim_Interp *interp, Jim_Obj *scriptObjPtr)
if (tokens == 1) { if (tokens == 1) {
/* Fast path if the token does not /* Fast path if the token does not
* need interpolation */ * need interpolation */
switch(token[i].type) { switch (token[i].type) {
case JIM_TT_ESC: case JIM_TT_ESC:
case JIM_TT_STR: case JIM_TT_STR:
argv[j] = token[i].objPtr; argv[j] = token[i].objPtr;
@ -9020,7 +9020,7 @@ static int JimParseSubst(struct JimParserCtx *pc, int flags)
pc->eof = 1; pc->eof = 1;
return JIM_OK; return JIM_OK;
} }
switch(*pc->p) { switch (*pc->p) {
case '[': case '[':
retval = JimParseCmd(pc); retval = JimParseCmd(pc);
if (flags & JIM_SUBST_NOCMD) { if (flags & JIM_SUBST_NOCMD) {
@ -9170,7 +9170,7 @@ int Jim_SubstObj(Jim_Interp *interp, Jim_Obj *substObjPtr,
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
Jim_Obj *objPtr; Jim_Obj *objPtr;
switch(token[i].type) { switch (token[i].type) {
case JIM_TT_STR: case JIM_TT_STR:
case JIM_TT_ESC: case JIM_TT_ESC:
Jim_AppendObj(interp, resObjPtr, token[i].objPtr); Jim_AppendObj(interp, resObjPtr, token[i].objPtr);
@ -9773,7 +9773,7 @@ static int Jim_WhileCoreCommand(Jim_Interp *interp, int argc,
if ((expr = Jim_GetExpression(interp, argv[1])) == NULL) goto noopt; if ((expr = Jim_GetExpression(interp, argv[1])) == NULL) goto noopt;
if (expr->len <= 0 || expr->len > 3) goto noopt; if (expr->len <= 0 || expr->len > 3) goto noopt;
switch(expr->len) { switch (expr->len) {
case 1: case 1:
if (expr->opcode[0] != JIM_EXPROP_VARIABLE && if (expr->opcode[0] != JIM_EXPROP_VARIABLE &&
expr->opcode[0] != JIM_EXPROP_NUMBER) expr->opcode[0] != JIM_EXPROP_NUMBER)
@ -9789,7 +9789,7 @@ static int Jim_WhileCoreCommand(Jim_Interp *interp, int argc,
(expr->opcode[1] != JIM_EXPROP_NUMBER && (expr->opcode[1] != JIM_EXPROP_NUMBER &&
expr->opcode[1] != JIM_EXPROP_VARIABLE)) expr->opcode[1] != JIM_EXPROP_VARIABLE))
goto noopt; goto noopt;
switch(expr->opcode[2]) { switch (expr->opcode[2]) {
case JIM_EXPROP_LT: case JIM_EXPROP_LT:
case JIM_EXPROP_LTE: case JIM_EXPROP_LTE:
case JIM_EXPROP_GT: case JIM_EXPROP_GT:
@ -9834,7 +9834,7 @@ static int Jim_WhileCoreCommand(Jim_Interp *interp, int argc,
} }
if (!wideValue) break; if (!wideValue) break;
if ((retval = Jim_EvalObj(interp, argv[2])) != JIM_OK) { if ((retval = Jim_EvalObj(interp, argv[2])) != JIM_OK) {
switch(retval) { switch (retval) {
case JIM_BREAK: case JIM_BREAK:
if (varAObjPtr) if (varAObjPtr)
Jim_DecrRefCount(interp, varAObjPtr); Jim_DecrRefCount(interp, varAObjPtr);
@ -9885,7 +9885,7 @@ static int Jim_WhileCoreCommand(Jim_Interp *interp, int argc,
goto noopt; goto noopt;
} }
} }
switch(cmpType) { switch (cmpType) {
case JIM_EXPROP_LT: case JIM_EXPROP_LT:
cmpRes = wideValueA < wideValueB; break; cmpRes = wideValueA < wideValueB; break;
case JIM_EXPROP_LTE: case JIM_EXPROP_LTE:
@ -9901,7 +9901,7 @@ static int Jim_WhileCoreCommand(Jim_Interp *interp, int argc,
} }
if (!cmpRes) break; if (!cmpRes) break;
if ((retval = Jim_EvalObj(interp, argv[2])) != JIM_OK) { if ((retval = Jim_EvalObj(interp, argv[2])) != JIM_OK) {
switch(retval) { switch (retval) {
case JIM_BREAK: case JIM_BREAK:
Jim_DecrRefCount(interp, varAObjPtr); Jim_DecrRefCount(interp, varAObjPtr);
if (varBObjPtr) if (varBObjPtr)
@ -9941,7 +9941,7 @@ noopt:
return retval; return retval;
if (!boolean) break; if (!boolean) break;
if ((retval = Jim_EvalObj(interp, argv[2])) != JIM_OK) { if ((retval = Jim_EvalObj(interp, argv[2])) != JIM_OK) {
switch(retval) { switch (retval) {
case JIM_BREAK: case JIM_BREAK:
goto out; goto out;
break; break;
@ -10078,7 +10078,7 @@ static int Jim_ForCoreCommand(Jim_Interp *interp, int argc,
} }
/* Eval body */ /* Eval body */
if ((retval = Jim_EvalObj(interp, argv[4])) != JIM_OK) { if ((retval = Jim_EvalObj(interp, argv[4])) != JIM_OK) {
switch(retval) { switch (retval) {
case JIM_BREAK: case JIM_BREAK:
if (stopVarNamePtr) if (stopVarNamePtr)
Jim_DecrRefCount(interp, stopVarNamePtr); Jim_DecrRefCount(interp, stopVarNamePtr);
@ -10147,7 +10147,7 @@ testcond:
if (!boolean) break; if (!boolean) break;
/* Eval body */ /* Eval body */
if ((retval = Jim_EvalObj(interp, argv[4])) != JIM_OK) { if ((retval = Jim_EvalObj(interp, argv[4])) != JIM_OK) {
switch(retval) { switch (retval) {
case JIM_BREAK: case JIM_BREAK:
goto out; goto out;
break; break;
@ -10161,7 +10161,7 @@ testcond:
evalnext: evalnext:
/* Eval next */ /* Eval next */
if ((retval = Jim_EvalObj(interp, argv[3])) != JIM_OK) { if ((retval = Jim_EvalObj(interp, argv[3])) != JIM_OK) {
switch(retval) { switch (retval) {
case JIM_BREAK: case JIM_BREAK:
goto out; goto out;
break; break;
@ -10615,7 +10615,7 @@ static int Jim_LsortCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const arg
if (Jim_GetEnum(interp, argv[i], options, &option, "option", JIM_ERRMSG) if (Jim_GetEnum(interp, argv[i], options, &option, "option", JIM_ERRMSG)
!= JIM_OK) != JIM_OK)
return JIM_ERR; return JIM_ERR;
switch(option) { switch (option) {
case OPT_ASCII: lsortType = JIM_LSORT_ASCII; break; case OPT_ASCII: lsortType = JIM_LSORT_ASCII; break;
case OPT_NOCASE: lsortType = JIM_LSORT_NOCASE; break; case OPT_NOCASE: lsortType = JIM_LSORT_NOCASE; break;
case OPT_INCREASING: decreasing = 0; break; case OPT_INCREASING: decreasing = 0; break;
@ -10623,7 +10623,7 @@ static int Jim_LsortCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const arg
} }
} }
if (decreasing) { if (decreasing) {
switch(lsortType) { switch (lsortType) {
case JIM_LSORT_ASCII: lsortType = JIM_LSORT_ASCII_DECR; break; case JIM_LSORT_ASCII: lsortType = JIM_LSORT_ASCII_DECR; break;
case JIM_LSORT_NOCASE: lsortType = JIM_LSORT_NOCASE_DECR; break; case JIM_LSORT_NOCASE: lsortType = JIM_LSORT_NOCASE_DECR; break;
} }
@ -10800,7 +10800,7 @@ static int Jim_DebugCoreCommand(Jim_Interp *interp, int argc,
const char *type; const char *type;
Jim_ExprOperator *op; Jim_ExprOperator *op;
switch(expr->opcode[i]) { switch (expr->opcode[i]) {
case JIM_EXPROP_NUMBER: type = "number"; break; case JIM_EXPROP_NUMBER: type = "number"; break;
case JIM_EXPROP_COMMAND: type = "command"; break; case JIM_EXPROP_COMMAND: type = "command"; break;
case JIM_EXPROP_VARIABLE: type = "variable"; break; case JIM_EXPROP_VARIABLE: type = "variable"; break;

View File

@ -992,7 +992,7 @@ typedef struct jim_getopt {
* return e; * return e;
* } * }
* *
* switch( n->value ){ * switch ( n->value ){
* case ALIVE: * case ALIVE:
* printf("Option ALIVE specified\n"); * printf("Option ALIVE specified\n");
* break; * break;
@ -1112,7 +1112,7 @@ JIM_STATIC int JIM_API( Jim_GetOpt_Nvp)( Jim_GetOptInfo *goi, const Jim_Nvp *loo
* return e; * return e;
* } * }
* *
* switch( n->value ){ * switch ( n->value ){
* case OPT_SEX: * case OPT_SEX:
* // handle: --sex male|female|lots|needmore * // handle: --sex male|female|lots|needmore
* e = Jim_GetOpt_Nvp( &goi, &nvp_sex, &n ); * e = Jim_GetOpt_Nvp( &goi, &nvp_sex, &n );

View File

@ -77,7 +77,7 @@ int tap_move_ndx( tap_state_t astate )
int ndx; int ndx;
switch( astate ) switch ( astate )
{ {
case TAP_RESET: ndx = 0; break; case TAP_RESET: ndx = 0; break;
case TAP_DRSHIFT: ndx = 2; break; case TAP_DRSHIFT: ndx = 2; break;
@ -209,10 +209,10 @@ bool tap_is_state_stable(tap_state_t astate)
{ {
bool is_stable; 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. (not value dependent like an array), and can also check bounds.
*/ */
switch( astate ) switch ( astate )
{ {
case TAP_RESET: case TAP_RESET:
case TAP_IDLE: case TAP_IDLE:
@ -331,7 +331,7 @@ const char* tap_state_name(tap_state_t state)
{ {
const char* ret; const char* ret;
switch( state ) switch ( state )
{ {
case TAP_RESET: ret = "RESET"; break; case TAP_RESET: ret = "RESET"; break;
case TAP_IDLE: ret = "RUN/IDLE"; break; case TAP_IDLE: ret = "RUN/IDLE"; break;

View File

@ -363,7 +363,7 @@ dtc_load_from_buffer(
exit(1); exit(1);
} }
switch(header->type) { switch (header->type) {
case DTCLOAD_COMMENT: case DTCLOAD_COMMENT:
break; break;
@ -1243,7 +1243,7 @@ rlink_scan(
/* chunk_bits is a multiple of 8, so there are no rounding issues. */ /* chunk_bits is a multiple of 8, so there are no rounding issues. */
chunk_bytes = chunk_bits / 8; chunk_bytes = chunk_bits / 8;
switch(type) { switch (type) {
case SCAN_IN: case SCAN_IN:
x = DTC_CMD_SHIFT_TDO_BYTES(chunk_bytes); x = DTC_CMD_SHIFT_TDO_BYTES(chunk_bytes);
break; break;

View File

@ -374,7 +374,7 @@ static int jim_newtap_cmd( Jim_GetOptInfo *goi )
return e; return e;
} }
LOG_DEBUG("Processing option: %s", n->name ); LOG_DEBUG("Processing option: %s", n->name );
switch( n->value ){ switch ( n->value ){
case NTAP_OPT_ENABLED: case NTAP_OPT_ENABLED:
pTap->disabled_after_reset = false; pTap->disabled_after_reset = false;
break; break;
@ -414,7 +414,7 @@ static int jim_newtap_cmd( Jim_GetOptInfo *goi )
Jim_SetResult_sprintf( goi->interp, "option: %s bad parameter", n->name ); Jim_SetResult_sprintf( goi->interp, "option: %s bad parameter", n->name );
return e; return e;
} }
switch(n->value){ switch (n->value){
case NTAP_OPT_IRLEN: case NTAP_OPT_IRLEN:
if (w > (jim_wide) (8 * sizeof(pTap->ir_capture_value))) if (w > (jim_wide) (8 * sizeof(pTap->ir_capture_value)))
LOG_WARNING("huge IR length %d", (int) w); LOG_WARNING("huge IR length %d", (int) w);
@ -440,7 +440,7 @@ static int jim_newtap_cmd( Jim_GetOptInfo *goi )
reqbits &= (~(NTREQ_IRCAPTURE)); reqbits &= (~(NTREQ_IRCAPTURE));
break; break;
} }
} /* switch(n->value) */ } /* switch (n->value) */
} /* while ( goi->argc ) */ } /* while ( goi->argc ) */
/* default is enabled-after-reset */ /* default is enabled-after-reset */
@ -540,7 +540,7 @@ static int jim_jtag_command( Jim_Interp *interp, int argc, Jim_Obj *const *argv
return e; return e;
} }
Jim_SetEmptyResult( goi.interp ); Jim_SetEmptyResult( goi.interp );
switch( n->value ){ switch ( n->value ){
case JTAG_CMD_INTERFACE: case JTAG_CMD_INTERFACE:
/* return the name of the interface */ /* return the name of the interface */
/* TCL code might need to know the exact type... */ /* TCL code might need to know the exact type... */

View File

@ -362,7 +362,7 @@ static int vsllink_execute_queue(void)
case JTAG_STABLECLOCKS: case JTAG_STABLECLOCKS:
DEBUG_JTAG_IO("add %d clocks", cmd->cmd.stableclocks->num_cycles); DEBUG_JTAG_IO("add %d clocks", cmd->cmd.stableclocks->num_cycles);
switch(tap_get_state()) switch (tap_get_state())
{ {
case TAP_RESET: case TAP_RESET:
// tms should be '1' to stay in TAP_RESET mode // tms should be '1' to stay in TAP_RESET mode

View File

@ -188,7 +188,7 @@ int gdb_get_char(connection_t *connection, int* next_char)
#ifdef _WIN32 #ifdef _WIN32
errno = WSAGetLastError(); errno = WSAGetLastError();
switch(errno) switch (errno)
{ {
case WSAEWOULDBLOCK: case WSAEWOULDBLOCK:
usleep(1000); usleep(1000);
@ -204,7 +204,7 @@ int gdb_get_char(connection_t *connection, int* next_char)
exit(-1); exit(-1);
} }
#else #else
switch(errno) switch (errno)
{ {
case EAGAIN: case EAGAIN:
usleep(1000); usleep(1000);
@ -1964,7 +1964,7 @@ int gdb_v_packet(connection_t *connection, target_t *target, char *packet, int p
int gdb_detach(connection_t *connection, target_t *target) int gdb_detach(connection_t *connection, target_t *target)
{ {
switch( detach_mode ) switch ( detach_mode )
{ {
case GDB_DETACH_RESUME: case GDB_DETACH_RESUME:
target_handle_event( target, TARGET_EVENT_OLD_pre_resume ); target_handle_event( target, TARGET_EVENT_OLD_pre_resume );

View File

@ -273,7 +273,7 @@ static const char* tap_state_svf_name(tap_state_t state)
{ {
const char* ret; const char* ret;
switch( state ) switch ( state )
{ {
case TAP_RESET: ret = "RESET"; break; case TAP_RESET: ret = "RESET"; break;
case TAP_IDLE: ret = "IDLE"; break; case TAP_IDLE: ret = "IDLE"; break;
@ -507,7 +507,7 @@ static int svf_read_command_from_file(int fd)
while (!cmd_ok && (read(fd, &ch, 1) > 0) ) while (!cmd_ok && (read(fd, &ch, 1) > 0) )
{ {
switch(ch) switch (ch)
{ {
case '!': case '!':
slash = 0; slash = 0;
@ -578,7 +578,7 @@ static int svf_parse_cmd_string(char *str, int len, char **argus, int *num_of_ar
while (pos < len) while (pos < len)
{ {
switch(str[pos]) switch (str[pos])
{ {
case '\n': case '\n':
case '\r': case '\r':
@ -832,7 +832,7 @@ static int svf_run_command(struct command_context_s *cmd_ctx, char *cmd_str)
} }
command = svf_find_string_in_array(argus[0], (char **)svf_command_name, dimof(svf_command_name)); command = svf_find_string_in_array(argus[0], (char **)svf_command_name, dimof(svf_command_name));
switch(command) switch (command)
{ {
case ENDDR: case ENDDR:
case ENDIR: case ENDIR:

View File

@ -1332,7 +1332,7 @@ int evaluate_b_bl_blx_thumb(uint16_t opcode, uint32_t address, arm_instruction_t
target_address = address + 4 + (offset<<1); target_address = address + 4 + (offset<<1);
switch(opc) switch (opc)
{ {
/* unconditional branch */ /* unconditional branch */
case 0: case 0:
@ -1416,7 +1416,7 @@ int evaluate_shift_imm_thumb(uint16_t opcode, uint32_t address, arm_instruction_
uint8_t opc = (opcode >> 11) & 0x3; uint8_t opc = (opcode >> 11) & 0x3;
char *mnemonic = NULL; char *mnemonic = NULL;
switch(opc) switch (opc)
{ {
case 0: case 0:
instruction->type = ARM_MOV; instruction->type = ARM_MOV;
@ -1465,7 +1465,7 @@ int evaluate_data_proc_imm_thumb(uint16_t opcode, uint32_t address, arm_instruct
instruction->info.data_proc.variant = 0; /*immediate*/ instruction->info.data_proc.variant = 0; /*immediate*/
instruction->info.data_proc.shifter_operand.immediate.immediate = imm; instruction->info.data_proc.shifter_operand.immediate.immediate = imm;
switch(opc) switch (opc)
{ {
case 0: case 0:
instruction->type = ARM_MOV; instruction->type = ARM_MOV;
@ -1679,7 +1679,7 @@ int evaluate_load_store_reg_thumb(uint16_t opcode, uint32_t address, arm_instruc
uint8_t opc = (opcode >> 9) & 0x7; uint8_t opc = (opcode >> 9) & 0x7;
char *mnemonic = NULL; char *mnemonic = NULL;
switch(opc) switch (opc)
{ {
case 0: case 0:
instruction->type = ARM_STR; instruction->type = ARM_STR;

View File

@ -533,7 +533,7 @@ static int image_mot_buffer_complete(image_t *image)
} }
else if (record_type >= 1 && record_type <= 3) else if (record_type >= 1 && record_type <= 3)
{ {
switch( record_type ) switch ( record_type )
{ {
case 1: case 1:
/* S1 - 16 bit address data record */ /* S1 - 16 bit address data record */

View File

@ -765,7 +765,7 @@ int mips_m4k_read_memory(struct target_s *target, uint32_t address, uint32_t siz
for(i = 0; i < (count*size); i += size) for(i = 0; i < (count*size); i += size)
{ {
switch(size) switch (size)
{ {
case 4: case 4:
t32 = le_to_h_u32(&buffer[i]); t32 = le_to_h_u32(&buffer[i]);
@ -810,7 +810,7 @@ int mips_m4k_write_memory(struct target_s *target, uint32_t address, uint32_t si
for(i = 0; i < (count*size); i += size) for(i = 0; i < (count*size); i += size)
{ {
switch(size) switch (size)
{ {
case 4: case 4:
t32 = be_to_h_u32(&buffer[i]); t32 = be_to_h_u32(&buffer[i]);

View File

@ -2699,7 +2699,7 @@ static int handle_wp_command(struct command_context_s *cmd_ctx, char *cmd, char
return retval; return retval;
// fall through // fall through
case 3: case 3:
switch(args[2][0]) switch (args[2][0])
{ {
case 'r': case 'r':
type = WPT_READ; type = WPT_READ;
@ -3460,7 +3460,7 @@ static int target_configure( Jim_GetOptInfo *goi, target_t *target )
Jim_GetOpt_NvpUnknown( goi, nvp_config_opts, 0 ); Jim_GetOpt_NvpUnknown( goi, nvp_config_opts, 0 );
return e; return e;
} }
switch( n->value ){ switch ( n->value ){
case TCFG_TYPE: case TCFG_TYPE:
/* not setable */ /* not setable */
if ( goi->isconfigure ){ if ( goi->isconfigure ){
@ -3763,7 +3763,7 @@ static int tcl_target_func( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
/* Assume blank result */ /* Assume blank result */
Jim_SetEmptyResult( goi.interp ); Jim_SetEmptyResult( goi.interp );
switch( n->value ){ switch ( n->value ){
case TS_CMD_CONFIGURE: case TS_CMD_CONFIGURE:
if ( goi.argc < 2 ){ if ( goi.argc < 2 ){
Jim_WrongNumArgs( goi.interp, goi.argc, goi.argv, "missing: -option VALUE ..."); Jim_WrongNumArgs( goi.interp, goi.argc, goi.argv, "missing: -option VALUE ...");
@ -3815,7 +3815,7 @@ static int tcl_target_func( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
c = 1; c = 1;
} }
switch( n->value ){ switch ( n->value ){
case TS_CMD_MWW: case TS_CMD_MWW:
target_buffer_set_u32( target, target_buf, b ); target_buffer_set_u32( target, target_buf, b );
b = 4; b = 4;
@ -3866,7 +3866,7 @@ static int tcl_target_func( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
c = 1; c = 1;
} }
b = 1; /* shut up gcc */ b = 1; /* shut up gcc */
switch( n->value ){ switch ( n->value ){
case TS_CMD_MDW: case TS_CMD_MDW:
b = 4; b = 4;
break; break;
@ -3893,7 +3893,7 @@ static int tcl_target_func( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
} }
Jim_fprintf( interp, interp->cookie_stdout, "0x%08x ", (int)(a) ); Jim_fprintf( interp, interp->cookie_stdout, "0x%08x ", (int)(a) );
switch( b ){ switch ( b ){
case 4: case 4:
for( x = 0 ; (x < 16) && (x < y) ; x += 4 ){ for( x = 0 ; (x < 16) && (x < y) ; x += 4 ){
z = target_buffer_get_u32( target, &(target_buf[ x * 4 ]) ); z = target_buffer_get_u32( target, &(target_buf[ x * 4 ]) );
@ -4296,7 +4296,7 @@ static int jim_target( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
return r; return r;
} }
switch(x){ switch (x){
default: default:
Jim_Panic(goi.interp,"Why am I here?"); Jim_Panic(goi.interp,"Why am I here?");
return JIM_ERR; return JIM_ERR;

View File

@ -3610,7 +3610,7 @@ int xscale_handle_cp15(command_context_t *cmd_ctx, char *cmd, char **args, int a
{ {
reg_no = strtoul(args[0], NULL, 0); reg_no = strtoul(args[0], NULL, 0);
/*translate from xscale cp15 register no to openocd register*/ /*translate from xscale cp15 register no to openocd register*/
switch(reg_no) switch (reg_no)
{ {
case 0: case 0:
reg_no = XSCALE_MAINID; reg_no = XSCALE_MAINID;

View File

@ -133,7 +133,7 @@ static tap_state_t xsvf_to_tap( int xsvf_state )
{ {
tap_state_t ret; tap_state_t ret;
switch( xsvf_state ) switch ( xsvf_state )
{ {
case XSV_RESET: ret = TAP_RESET; break; case XSV_RESET: ret = TAP_RESET; break;
case XSV_IDLE: ret = TAP_IDLE; break; case XSV_IDLE: ret = TAP_IDLE; break;
@ -890,7 +890,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
break; break;
} }
switch( trst_mode ) switch ( trst_mode )
{ {
case XTRST_ON: case XTRST_ON:
jtag_add_reset(1, 0); jtag_add_reset(1, 0);