From c3e7d33b54e27e5458c9394e1e4fcbcda7dec0a7 Mon Sep 17 00:00:00 2001 From: zwelch Date: Wed, 24 Jun 2009 09:37:23 +0000 Subject: [PATCH] - Replace 'for(' with 'for ('. git-svn-id: svn://svn.berlios.de/openocd/trunk@2389 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/flash/at91sam3.c | 20 ++++++++++---------- src/helper/membuf.c | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/flash/at91sam3.c b/src/flash/at91sam3.c index 9fe416e19..bb51ad4cf 100644 --- a/src/flash/at91sam3.c +++ b/src/flash/at91sam3.c @@ -745,7 +745,7 @@ FLASHD_ReadUniqueID ( struct sam3_bank_private *pPrivate ) return r; } - for( x = 0 ; x < 4 ; x++ ){ + for ( x = 0 ; x < 4 ; x++ ){ r = target_read_u32( pPrivate->pChip->target, pPrivate->pBank->base + (x * 4), &v ); @@ -1224,7 +1224,7 @@ sam3_explain_chipid_cidr( struct sam3_chip *pChip ) v = sam3_reg_fieldname( pChip, "ARCH", pChip->cfg.CHIPID_CIDR, 20, 8 ); cp = _unknown; - for( x = 0 ; archnames[x].name ; x++ ){ + for ( x = 0 ; archnames[x].name ; x++ ){ if ( v == archnames[x].value ){ cp = archnames[x].name; break; @@ -1569,7 +1569,7 @@ sam3_erase_check(struct flash_bank_s *bank) } LOG_INFO("sam3 - supports auto-erase, erase_check ignored"); - for( x = 0 ; x < bank->num_sectors ; x++ ){ + for ( x = 0 ; x < bank->num_sectors ; x++ ){ bank->sectors[x].is_erased = 1; } @@ -1606,7 +1606,7 @@ sam3_protect_check(struct flash_bank_s *bank) return r; } - for( x = 0 ; x < pPrivate->nsectors ; x++ ){ + for ( x = 0 ; x < pPrivate->nsectors ; x++ ){ bank->sectors[x].is_protected = (!!(v & (1 << x))); } LOG_DEBUG("Done"); @@ -1730,7 +1730,7 @@ sam3_GetDetails( struct sam3_bank_private *pPrivate ) // // save the "bank" pointers - for( x = 0 ; x < SAM3_MAX_FLASH_BANKS ; x++ ){ + for ( x = 0 ; x < SAM3_MAX_FLASH_BANKS ; x++ ){ saved_banks[ x ] = pChip->details.bank[x].pBank; } @@ -1740,7 +1740,7 @@ sam3_GetDetails( struct sam3_bank_private *pPrivate ) sizeof(pPrivate->pChip->details)); // now fix the ghosted pointers - for( x = 0 ; x < SAM3_MAX_FLASH_BANKS ; x++ ){ + for ( x = 0 ; x < SAM3_MAX_FLASH_BANKS ; x++ ){ pChip->details.bank[x].pChip = pChip; pChip->details.bank[x].pBank = saved_banks[x]; } @@ -1795,7 +1795,7 @@ _sam3_probe(struct flash_bank_s *bank, int noise) } // update the flash bank size - for( x = 0 ; x < SAM3_MAX_FLASH_BANKS ; x++ ){ + for ( x = 0 ; x < SAM3_MAX_FLASH_BANKS ; x++ ){ if ( bank->base == pPrivate->pChip->details.bank[0].base_address ){ bank->size = pPrivate->pChip->details.bank[0].size_bytes; break; @@ -1810,7 +1810,7 @@ _sam3_probe(struct flash_bank_s *bank, int noise) } bank->num_sectors = pPrivate->nsectors; - for( x = 0 ; ((int)(x)) < bank->num_sectors ; x++ ){ + for ( x = 0 ; ((int)(x)) < bank->num_sectors ; x++ ){ bank->sectors[x].size = pPrivate->sector_size; bank->sectors[x].offset = x * (pPrivate->sector_size); // mark as unknown @@ -2260,7 +2260,7 @@ sam3_handle_info_command( struct command_context_s *cmd_ctx, char *cmd, char ** // auto-probe other banks, 0 done above - for( x = 1 ; x < SAM3_MAX_FLASH_BANKS ; x++ ){ + for ( x = 1 ; x < SAM3_MAX_FLASH_BANKS ; x++ ){ // skip banks not present if ( !(pChip->details.bank[x].present) ){ continue; @@ -2358,7 +2358,7 @@ sam3_handle_gpnvm_command( struct command_context_s *cmd_ctx, char *cmd, char ** if ( 0 == strcmp( "show", argv[0] ) ){ if ( who == -1 ){ showall: - for( x = 0 ; x < pChip->details.n_gpnvms ; x++ ){ + for ( x = 0 ; x < pChip->details.n_gpnvms ; x++ ){ r = FLASHD_GetGPNVM( &(pChip->details.bank[0]), x, &v ); if ( r != ERROR_OK ){ break; diff --git a/src/helper/membuf.c b/src/helper/membuf.c index 29931f4e0..e9e71a98d 100644 --- a/src/helper/membuf.c +++ b/src/helper/membuf.c @@ -155,7 +155,7 @@ membuf_vsprintf( struct membuf *pBuf, const char *fmt, va_list ap ) grew = 0; - for(;;) { + for (;;) { sa = space_avail(pBuf); // do work