- Replace 'for(' with 'for ('.
[openocd.git] / src / target / target.c
index 3505f9c251d40c396c66c3d3eae971679f8670e8..159464502e0b996094d8be26c949b4d3d2893ffc 100644 (file)
@@ -244,7 +244,7 @@ static int max_target_number(void)
 
        x = -1;
        t = all_targets;
-       while( t ){
+       while ( t ){
                if ( x < t->target_number ){
                        x = (t->target_number)+1;
                }
@@ -262,7 +262,7 @@ static int new_target_number(void)
        /* number is 0 based */
        x = -1;
        t = all_targets;
-       while(t){
+       while (t){
                if ( x < t->target_number ){
                        x = t->target_number;
                }
@@ -1728,7 +1728,7 @@ static int handle_reg_command(struct command_context_s *cmd_ctx, char *cmd, char
                reg_cache_t *cache = target->reg_cache;
 
                count = 0;
-               while(cache)
+               while (cache)
                {
                        int i;
                        for (i = 0; i < cache->num_regs; i++)
@@ -1759,7 +1759,7 @@ static int handle_reg_command(struct command_context_s *cmd_ctx, char *cmd, char
 
                reg_cache_t *cache = target->reg_cache;
                count = 0;
-               while(cache)
+               while (cache)
                {
                        int i;
                        for (i = 0; i < cache->num_regs; i++)
@@ -2699,7 +2699,7 @@ static int handle_wp_command(struct command_context_s *cmd_ctx, char *cmd, char
                        return retval;
                // fall through
        case 3:
-               switch(args[2][0])
+               switch (args[2][0])
                {
                case 'r':
                        type = WPT_READ;
@@ -3378,7 +3378,7 @@ void target_handle_event( target_t *target, enum target_event e )
        teap = target->event_action;
 
        done = 0;
-       while( teap ){
+       while ( teap ){
                if ( teap->event == e ){
                        done = 1;
                        LOG_DEBUG( "target: (%d) %s (%s) event: %d (%s) action: %s\n",
@@ -3437,7 +3437,7 @@ static int target_configure( Jim_GetOptInfo *goi, target_t *target )
        int e;
 
        /* parse config or cget options ... */
-       while( goi->argc > 0 ){
+       while ( goi->argc > 0 ){
                Jim_SetEmptyResult( goi->interp );
                /* Jim_GetOpt_Debug( goi ); */
 
@@ -3460,7 +3460,7 @@ static int target_configure( Jim_GetOptInfo *goi, target_t *target )
                        Jim_GetOpt_NvpUnknown( goi, nvp_config_opts, 0 );
                        return e;
                }
-               switch( n->value ){
+               switch ( n->value ){
                case TCFG_TYPE:
                        /* not setable */
                        if ( goi->isconfigure ){
@@ -3505,7 +3505,7 @@ static int target_configure( Jim_GetOptInfo *goi, target_t *target )
 
                                teap = target->event_action;
                                /* replace existing? */
-                               while( teap ){
+                               while ( teap ){
                                        if ( teap->event == (enum target_event)n->value ){
                                                break;
                                        }
@@ -3687,7 +3687,7 @@ static int target_configure( Jim_GetOptInfo *goi, target_t *target )
                        /* loop for more e*/
                        break;
                }
-       } /* while( goi->argc ) */
+       } /* while ( goi->argc ) */
 
 
                /* done - we return */
@@ -3763,7 +3763,7 @@ static int tcl_target_func( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
        /* 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 ...");
@@ -3815,7 +3815,7 @@ static int tcl_target_func( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
                        c = 1;
                }
 
-               switch( n->value ){
+               switch ( n->value ){
                case TS_CMD_MWW:
                        target_buffer_set_u32( target, target_buf, b );
                        b = 4;
@@ -3829,7 +3829,7 @@ static int tcl_target_func( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
                        b = 1;
                        break;
                }
-               for( x = 0 ; x < c ; x++ ){
+               for ( x = 0 ; x < c ; x++ ){
                        e = target_write_memory( target, a, b, 1, target_buf );
                        if ( e != ERROR_OK ){
                                Jim_SetResult_sprintf( interp, "Error writing @ 0x%08x: %d\n", (int)(a), e );
@@ -3866,7 +3866,7 @@ static int tcl_target_func( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
                        c = 1;
                }
                b = 1; /* shut up gcc */
-               switch( n->value ){
+               switch ( n->value ){
                case TS_CMD_MDW:
                        b =  4;
                        break;
@@ -3881,7 +3881,7 @@ static int tcl_target_func( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
                /* convert to "bytes" */
                c = c * b;
                /* count is now in 'BYTES' */
-               while( c > 0 ){
+               while ( c > 0 ){
                        y = c;
                        if ( y > 16 ){
                                y = 16;
@@ -3893,38 +3893,38 @@ static int tcl_target_func( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
                        }
 
                        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 ){
+                               for ( x = 0 ; (x < 16) && (x < y) ; x += 4 ){
                                        z = target_buffer_get_u32( target, &(target_buf[ x * 4 ]) );
                                        Jim_fprintf( interp, interp->cookie_stdout, "%08x ", (int)(z) );
                                }
-                               for( ; (x < 16) ; x += 4 ){
+                               for ( ; (x < 16) ; x += 4 ){
                                        Jim_fprintf( interp, interp->cookie_stdout, "         " );
                                }
                                break;
                        case 2:
-                               for( x = 0 ; (x < 16) && (x < y) ; x += 2 ){
+                               for ( x = 0 ; (x < 16) && (x < y) ; x += 2 ){
                                        z = target_buffer_get_u16( target, &(target_buf[ x * 2 ]) );
                                        Jim_fprintf( interp, interp->cookie_stdout, "%04x ", (int)(z) );
                                }
-                               for( ; (x < 16) ; x += 2 ){
+                               for ( ; (x < 16) ; x += 2 ){
                                        Jim_fprintf( interp, interp->cookie_stdout, "     " );
                                }
                                break;
                        case 1:
                        default:
-                               for( x = 0 ; (x < 16) && (x < y) ; x += 1 ){
+                               for ( x = 0 ; (x < 16) && (x < y) ; x += 1 ){
                                        z = target_buffer_get_u8( target, &(target_buf[ x * 4 ]) );
                                        Jim_fprintf( interp, interp->cookie_stdout, "%02x ", (int)(z) );
                                }
-                               for( ; (x < 16) ; x += 1 ){
+                               for ( ; (x < 16) ; x += 1 ){
                                        Jim_fprintf( interp, interp->cookie_stdout, "   " );
                                }
                                break;
                        }
                        /* ascii-ify the bytes */
-                       for( x = 0 ; x < y ; x++ ){
+                       for ( x = 0 ; x < y ; x++ ){
                                if ( (target_buf[x] >= 0x20) &&
                                        (target_buf[x] <= 0x7e) ){
                                        /* good */
@@ -3934,7 +3934,7 @@ static int tcl_target_func( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
                                }
                        }
                        /* space pad  */
-                       while( x < 16 ){
+                       while ( x < 16 ){
                                target_buf[x] = ' ';
                                x++;
                        }
@@ -4063,7 +4063,7 @@ static int tcl_target_func( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
                                                   target->cmd_name );
                        command_print( cmd_ctx, "%-25s | Body", "Event");
                        command_print( cmd_ctx, "------------------------- | ----------------------------------------");
-                       while( teap ){
+                       while ( teap ){
                                command_print( cmd_ctx,
                                                           "%-25s | %s",
                                                           Jim_Nvp_value2name_simple( nvp_target_event, teap->event )->name,
@@ -4132,7 +4132,7 @@ static int target_create( Jim_GetOptInfo *goi )
        e = Jim_GetOpt_String( goi, &cp2, NULL );
        cp = cp2;
        /* now does target type exist */
-       for( x = 0 ; target_types[x] ; x++ ){
+       for ( x = 0 ; target_types[x] ; x++ ){
                if ( 0 == strcmp( cp, target_types[x]->name ) ){
                        /* found */
                        break;
@@ -4140,7 +4140,7 @@ static int target_create( Jim_GetOptInfo *goi )
        }
        if ( target_types[x] == NULL ){
                Jim_SetResult_sprintf( goi->interp, "Unknown target type %s, try one of ", cp );
-               for( x = 0 ; target_types[x] ; x++ ){
+               for ( x = 0 ; target_types[x] ; x++ ){
                        if ( target_types[x+1] ){
                                Jim_AppendStrings( goi->interp,
                                                                   Jim_GetResult(goi->interp),
@@ -4236,7 +4236,7 @@ static int target_create( Jim_GetOptInfo *goi )
        {
                target_t **tpp;
                tpp = &(all_targets);
-               while( *tpp ){
+               while ( *tpp ){
                        tpp = &( (*tpp)->next );
                }
                *tpp = target;
@@ -4296,7 +4296,7 @@ static int jim_target( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
                return r;
        }
 
-       switch(x){
+       switch (x){
        default:
                Jim_Panic(goi.interp,"Why am I here?");
                return JIM_ERR;
@@ -4313,7 +4313,7 @@ static int jim_target( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
                        return JIM_ERR;
                }
                Jim_SetResult( goi.interp, Jim_NewListObj( goi.interp, NULL, 0 ) );
-               for( x = 0 ; target_types[x] ; x++ ){
+               for ( x = 0 ; target_types[x] ; x++ ){
                        Jim_ListAppendElement( goi.interp,
                                                                   Jim_GetResult(goi.interp),
                                                                   Jim_NewStringObj( goi.interp, target_types[x]->name, -1 ) );
@@ -4326,7 +4326,7 @@ static int jim_target( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
                }
                Jim_SetResult( goi.interp, Jim_NewListObj( goi.interp, NULL, 0 ) );
                target = all_targets;
-               while( target ){
+               while ( target ){
                        Jim_ListAppendElement( goi.interp,
                                                                   Jim_GetResult(goi.interp),
                                                                   Jim_NewStringObj( goi.interp, target->cmd_name, -1 ) );

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)