]> git.gag.com Git - fw/openocd/commitdiff
Remove whitespace that occurs after '('.
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Tue, 23 Jun 2009 22:46:23 +0000 (22:46 +0000)
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Tue, 23 Jun 2009 22:46:23 +0000 (22:46 +0000)
- Replace '([ \t]*' with '('.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2376 b42882b7-edfa-0310-969c-e2dbd0fdcd60

69 files changed:
src/ecosboard.c
src/flash/at91sam7.c
src/flash/avrf.c
src/flash/cfi.c
src/flash/flash.c
src/flash/non_cfi.c
src/flash/ocl/at91sam7x/samflash.c
src/flash/pic32mx.c
src/flash/stm32x.c
src/flash/str9x.c
src/flash/str9xpec.c
src/helper/command.c
src/helper/fileio.c
src/helper/ioutil.c
src/helper/jim-eventloop.c
src/helper/jim.c
src/helper/jim.h
src/helper/log.h
src/helper/replacements.h
src/jtag/amt_jtagaccel.c
src/jtag/arm-jtag-ew.c
src/jtag/bitq.c
src/jtag/core.c
src/jtag/driver.c
src/jtag/dummy.c
src/jtag/ft2232.c
src/jtag/gw16012.c
src/jtag/interface.c
src/jtag/interface.h
src/jtag/parport.c
src/jtag/rlink/dtc_cmd.h
src/jtag/rlink/rlink.c
src/jtag/tcl.c
src/jtag/vsllink.c
src/jtag/zy1000/jtag_minidriver.h
src/openocd.c
src/pld/virtex2.c
src/server/gdb_server.c
src/server/httpd.c
src/server/server.c
src/svf/svf.c
src/target/arm11.c
src/target/arm720t.c
src/target/arm7_9_common.c
src/target/arm7tdmi.c
src/target/arm920t.c
src/target/arm926ejs.c
src/target/arm966e.c
src/target/arm9tdmi.c
src/target/arm_adi_v5.h
src/target/armv4_5.c
src/target/armv7m.c
src/target/armv7m.h
src/target/cortex_a8.c
src/target/cortex_m3.c
src/target/embeddedice.h
src/target/etb.c
src/target/image.c
src/target/mips32.c
src/target/mips32_pracc.c
src/target/mips32_pracc.h
src/target/mips_m4k.c
src/target/target.c
src/target/target.h
src/target/target_request.c
src/target/target_type.h
src/target/trace.c
src/target/xscale.c
src/xsvf/xsvf.c

index 62f7319db2465c8eb5bebe536f3b20fe7793e6b4..91780a98b9f310ac8fa2522823baf6c1d75fcb86 100644 (file)
@@ -93,7 +93,7 @@ struct tftpd_fileops fileops =
        (int (*)(const char *, int))open,
        close,
        (int (*)(int, const void *, int))write,
        (int (*)(const char *, int))open,
        close,
        (int (*)(int, const void *, int))write,
-       ( int (*)(int, void *, int))read
+       (int (*)(int, void *, int))read
 };
 
 #endif
 };
 
 #endif
@@ -253,7 +253,7 @@ void copyfile(char *name2, char *name1);
 void copydir(char *name, char *destdir);
 
 #if 0
 void copydir(char *name, char *destdir);
 
 #if 0
-MTAB_ENTRY( romfs_mte1,
+MTAB_ENTRY(romfs_mte1,
                "/rom",
                "romfs",
                "",
                "/rom",
                "romfs",
                "",
@@ -1130,7 +1130,7 @@ static int tftpfs_fo_lseek(struct CYG_FILE_TAG *fp, off_t *apos, int whence);
 // For simplicity we use _FILESYSTEM synchronization for all accesses since
 // we should never block in any filesystem operations.
 #if 1
 // For simplicity we use _FILESYSTEM synchronization for all accesses since
 // we should never block in any filesystem operations.
 #if 1
-FSTAB_ENTRY( tftpfs_fste, "tftpfs", 0,
+FSTAB_ENTRY(tftpfs_fste, "tftpfs", 0,
                CYG_SYNCMODE_NONE,
                tftpfs_mount,
                tftpfs_umount,
                CYG_SYNCMODE_NONE,
                tftpfs_mount,
                tftpfs_umount,
@@ -1151,7 +1151,7 @@ FSTAB_ENTRY( tftpfs_fste, "tftpfs", 0,
 // mtab entry.
 // This defines a single ROMFS loaded into ROM at the configured address
 //
 // mtab entry.
 // This defines a single ROMFS loaded into ROM at the configured address
 //
-// MTAB_ENTRY( rom_mte,        // structure name
+// MTAB_ENTRY(rom_mte, // structure name
 //             "/rom",         // mount point
 //             "romfs",        // FIlesystem type
 //             "",             // hardware device
 //             "/rom",         // mount point
 //             "romfs",        // FIlesystem type
 //             "",             // hardware device
@@ -1459,7 +1459,7 @@ static int logfs_fo_close(struct CYG_FILE_TAG *fp);
 // This defines the entry in the filesystem table.
 // For simplicity we use _FILESYSTEM synchronization for all accesses since
 // we should never block in any filesystem operations.
 // This defines the entry in the filesystem table.
 // For simplicity we use _FILESYSTEM synchronization for all accesses since
 // we should never block in any filesystem operations.
-FSTAB_ENTRY( logfs_fste, "logfs", 0,
+FSTAB_ENTRY(logfs_fste, "logfs", 0,
                CYG_SYNCMODE_FILE_FILESYSTEM | CYG_SYNCMODE_IO_FILESYSTEM,
                logfs_mount,
                logfs_umount,
                CYG_SYNCMODE_FILE_FILESYSTEM | CYG_SYNCMODE_IO_FILESYSTEM,
                logfs_mount,
                logfs_umount,
index bb2a28f5a33e17daf134d94b1bb17bc9f720fa01..6ac795b079ec30ec3593127a7d10bba006c90718 100644 (file)
@@ -187,7 +187,7 @@ static void at91sam7_read_clock_info(flash_bank_t *bank)
        }
 
        /* Prescaler adjust */
        }
 
        /* Prescaler adjust */
-       if ( (((mckr & PMC_MCKR_PRES) >> 2) == 7) || (tmp == 0) )
+       if ((((mckr & PMC_MCKR_PRES) >> 2) == 7) || (tmp == 0) )
        {
                at91sam7_info->mck_valid = 0;
                at91sam7_info->mck_freq = 0;
        {
                at91sam7_info->mck_valid = 0;
                at91sam7_info->mck_freq = 0;
@@ -707,7 +707,7 @@ static int at91sam7_protect_check(struct flash_bank_s *bank)
        at91sam7_info->num_lockbits_on = 0;
        for (lock_pos = 0; lock_pos < bank->num_sectors; lock_pos++)
        {
        at91sam7_info->num_lockbits_on = 0;
        for (lock_pos = 0; lock_pos < bank->num_sectors; lock_pos++)
        {
-               if ( ((status >> (16 + lock_pos))&(0x0001)) == 1)
+               if (((status >> (16 + lock_pos))&(0x0001)) == 1)
                {
                        at91sam7_info->num_lockbits_on++;
                        bank->sectors[lock_pos].is_protected = 1;
                {
                        at91sam7_info->num_lockbits_on++;
                        bank->sectors[lock_pos].is_protected = 1;
@@ -725,7 +725,7 @@ static int at91sam7_protect_check(struct flash_bank_s *bank)
        at91sam7_info->num_nvmbits_on = 0;
        for (gpnvm_pos = 0; gpnvm_pos < at91sam7_info->num_nvmbits; gpnvm_pos++)
        {
        at91sam7_info->num_nvmbits_on = 0;
        for (gpnvm_pos = 0; gpnvm_pos < at91sam7_info->num_nvmbits; gpnvm_pos++)
        {
-               if ( ((status >> (8 + gpnvm_pos))&(0x01)) == 1)
+               if (((status >> (8 + gpnvm_pos))&(0x01)) == 1)
                {
                        at91sam7_info->num_nvmbits_on++;
                }
                {
                        at91sam7_info->num_nvmbits_on++;
                }
@@ -907,7 +907,7 @@ static int at91sam7_erase(struct flash_bank_s *bank, int first, int last)
                        buffer[pos] = 0xFF;
                }
 
                        buffer[pos] = 0xFF;
                }
 
-               if ( at91sam7_write(bank, buffer, bank->sectors[first].offset, nbytes) != ERROR_OK)
+               if (at91sam7_write(bank, buffer, bank->sectors[first].offset, nbytes) != ERROR_OK)
                {
                        return ERROR_FLASH_OPERATION_FAILED;
                }
                {
                        return ERROR_FLASH_OPERATION_FAILED;
                }
index dd964e6bdb4a954244753817bed58f171adc0768..2f7901baadfed62d482a9ddbc3b4ca46dcbd149a 100644 (file)
@@ -323,7 +323,7 @@ static int avrf_probe(struct flash_bank_s *bank)
                return ERROR_FAIL;
        }
 
                return ERROR_FAIL;
        }
 
-       LOG_INFO( "device id = 0x%08" PRIx32 "", device_id );
+       LOG_INFO("device id = 0x%08" PRIx32 "", device_id );
        if (EXTRACT_MFG(device_id) != 0x1F)
        {
                LOG_ERROR("0x%" PRIx32 " is invalid Manufacturer for avr, 0x%X is expected", EXTRACT_MFG(device_id), 0x1F);
        if (EXTRACT_MFG(device_id) != 0x1F)
        {
                LOG_ERROR("0x%" PRIx32 " is invalid Manufacturer for avr, 0x%X is expected", EXTRACT_MFG(device_id), 0x1F);
@@ -402,7 +402,7 @@ static int avrf_info(struct flash_bank_s *bank, char *buf, int buf_size)
                return ERROR_FAIL;
        }
 
                return ERROR_FAIL;
        }
 
-       LOG_INFO( "device id = 0x%08" PRIx32 "", device_id );
+       LOG_INFO("device id = 0x%08" PRIx32 "", device_id );
        if (EXTRACT_MFG(device_id) != 0x1F)
        {
                LOG_ERROR("0x%" PRIx32 " is invalid Manufacturer for avr, 0x%X is expected", EXTRACT_MFG(device_id), 0x1F);
        if (EXTRACT_MFG(device_id) != 0x1F)
        {
                LOG_ERROR("0x%" PRIx32 " is invalid Manufacturer for avr, 0x%X is expected", EXTRACT_MFG(device_id), 0x1F);
index 7972bdbd464edb9c67e8999208e92975cef07968..2148995260e575a17d505d65ba5b4a7ffe997c36 100644 (file)
@@ -1154,7 +1154,7 @@ static int cfi_intel_write_block(struct flash_bank_s *bank, uint8_t *buffer, uin
        /* flash write code */
        if (!cfi_info->write_algorithm)
        {
        /* flash write code */
        if (!cfi_info->write_algorithm)
        {
-               if ( target_code_size > sizeof(target_code) )
+               if (target_code_size > sizeof(target_code) )
                {
                        LOG_WARNING("Internal error - target code buffer to small. Increase CFI_MAX_INTEL_CODESIZE and recompile.");
                        return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
                {
                        LOG_WARNING("Internal error - target code buffer to small. Increase CFI_MAX_INTEL_CODESIZE and recompile.");
                        return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
index 5ca26622beebd6a35367c942a68b1b069adde58b..3bf760e34b3f07afa6ce9fbacbafcc90693e1417 100644 (file)
@@ -793,7 +793,7 @@ static int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cm
 
        for (wrote = 0; wrote < (count*wordsize); wrote += cur_size)
        {
 
        for (wrote = 0; wrote < (count*wordsize); wrote += cur_size)
        {
-               cur_size = MIN( (count*wordsize - wrote), sizeof(chunk) );
+               cur_size = MIN((count*wordsize - wrote), sizeof(chunk) );
                flash_bank_t *bank;
                bank = get_flash_bank_by_addr(target, address);
                if (bank == NULL)
                flash_bank_t *bank;
                bank = get_flash_bank_by_addr(target, address);
                if (bank == NULL)
@@ -994,7 +994,7 @@ int flash_erase_address_range(target_t *target, uint32_t addr, uint32_t length)
                }
        }
 
                }
        }
 
-       if ( first == -1 || last == -1 )
+       if (first == -1 || last == -1 )
                return ERROR_OK;
 
        return flash_driver_erase(c, first, last);
                return ERROR_OK;
 
        return flash_driver_erase(c, first, last);
@@ -1127,7 +1127,7 @@ int flash_write(target_t *target, image_t *image, uint32_t *written, int erase)
                if (erase)
                {
                        /* calculate and erase sectors */
                if (erase)
                {
                        /* calculate and erase sectors */
-                       retval = flash_erase_address_range( target, run_address, run_size );
+                       retval = flash_erase_address_range(target, run_address, run_size );
                }
 
                if (retval == ERROR_OK)
                }
 
                if (retval == ERROR_OK)
index f3fd20f99a839ea1d8714668994899637aa9398f..86248ec8e614e7967da48cd300edf0bb046dbf98 100644 (file)
@@ -114,10 +114,10 @@ non_cfi_t non_cfi_flashes[] = {
                .num_erase_regions = 4,
                .erase_region_info =
                {
                .num_erase_regions = 4,
                .erase_region_info =
                {
-                       ERASE_REGION( 1, 16*KB),
-                       ERASE_REGION( 2,  8*KB),
-                       ERASE_REGION( 1, 32*KB),
-                       ERASE_REGION( 7, 64*KB)
+                       ERASE_REGION(1, 16*KB),
+                       ERASE_REGION(2,  8*KB),
+                       ERASE_REGION(1, 32*KB),
+                       ERASE_REGION(7, 64*KB)
                }
        },
        {
                }
        },
        {
@@ -131,10 +131,10 @@ non_cfi_t non_cfi_flashes[] = {
                .num_erase_regions = 4,
                .erase_region_info =
                {
                .num_erase_regions = 4,
                .erase_region_info =
                {
-                       ERASE_REGION( 7, 64*KB),
-                       ERASE_REGION( 1, 32*KB),
-                       ERASE_REGION( 2,  8*KB),
-                       ERASE_REGION( 1, 16*KB)
+                       ERASE_REGION(7, 64*KB),
+                       ERASE_REGION(1, 32*KB),
+                       ERASE_REGION(2,  8*KB),
+                       ERASE_REGION(1, 16*KB)
                }
        },
 
                }
        },
 
@@ -236,10 +236,10 @@ non_cfi_t non_cfi_flashes[] = {
                .num_erase_regions = 4,
                .erase_region_info =
                {
                .num_erase_regions = 4,
                .erase_region_info =
                {
-                       ERASE_REGION( 1, 16*KB),
-                       ERASE_REGION( 2,  8*KB),
-                       ERASE_REGION( 1, 32*KB),
-                       ERASE_REGION( 7, 64*KB)
+                       ERASE_REGION(1, 16*KB),
+                       ERASE_REGION(2,  8*KB),
+                       ERASE_REGION(1, 32*KB),
+                       ERASE_REGION(7, 64*KB)
                }
        },
        {
                }
        },
        {
@@ -253,10 +253,10 @@ non_cfi_t non_cfi_flashes[] = {
                .num_erase_regions = 4,
                .erase_region_info =
                {
                .num_erase_regions = 4,
                .erase_region_info =
                {
-                       ERASE_REGION( 7, 64*KB),
-                       ERASE_REGION( 1, 32*KB),
-                       ERASE_REGION( 2,  8*KB),
-                       ERASE_REGION( 1, 16*KB)
+                       ERASE_REGION(7, 64*KB),
+                       ERASE_REGION(1, 32*KB),
+                       ERASE_REGION(2,  8*KB),
+                       ERASE_REGION(1, 16*KB)
                }
        },
        {
                }
        },
        {
@@ -270,9 +270,9 @@ non_cfi_t non_cfi_flashes[] = {
                .num_erase_regions = 4,
                .erase_region_info =
                {
                .num_erase_regions = 4,
                .erase_region_info =
                {
-                       ERASE_REGION( 1, 16*KB),
-                       ERASE_REGION( 2,  8*KB),
-                       ERASE_REGION( 1, 32*KB),
+                       ERASE_REGION(1, 16*KB),
+                       ERASE_REGION(2,  8*KB),
+                       ERASE_REGION(1, 32*KB),
                        ERASE_REGION(15, 64*KB)
                }
        },
                        ERASE_REGION(15, 64*KB)
                }
        },
@@ -287,9 +287,9 @@ non_cfi_t non_cfi_flashes[] = {
                .num_erase_regions = 4,
                .erase_region_info =
                {
                .num_erase_regions = 4,
                .erase_region_info =
                {
-                       ERASE_REGION( 1, 16*KB),
-                       ERASE_REGION( 2,  8*KB),
-                       ERASE_REGION( 1, 32*KB),
+                       ERASE_REGION(1, 16*KB),
+                       ERASE_REGION(2,  8*KB),
+                       ERASE_REGION(1, 32*KB),
                        ERASE_REGION(15, 64*KB)
                }
        },
                        ERASE_REGION(15, 64*KB)
                }
        },
@@ -304,9 +304,9 @@ non_cfi_t non_cfi_flashes[] = {
                .num_erase_regions = 4,
                .erase_region_info =
                {
                .num_erase_regions = 4,
                .erase_region_info =
                {
-                       ERASE_REGION( 1, 16*KB),
-                       ERASE_REGION( 2, 8*KB),
-                       ERASE_REGION( 1, 32*KB),
+                       ERASE_REGION(1, 16*KB),
+                       ERASE_REGION(2, 8*KB),
+                       ERASE_REGION(1, 32*KB),
                        ERASE_REGION(15, 64*KB)
                }
        },
                        ERASE_REGION(15, 64*KB)
                }
        },
@@ -322,9 +322,9 @@ non_cfi_t non_cfi_flashes[] = {
                .num_erase_regions = 4,
                .erase_region_info =
                {
                .num_erase_regions = 4,
                .erase_region_info =
                {
-                       ERASE_REGION( 1, 16*KB),
-                       ERASE_REGION( 2, 8*KB),
-                       ERASE_REGION( 1, 32*KB),
+                       ERASE_REGION(1, 16*KB),
+                       ERASE_REGION(2, 8*KB),
+                       ERASE_REGION(1, 32*KB),
                        ERASE_REGION(31, 64*KB)
                }
        },
                        ERASE_REGION(31, 64*KB)
                }
        },
@@ -340,9 +340,9 @@ non_cfi_t non_cfi_flashes[] = {
                .erase_region_info =
                {
                        ERASE_REGION(31, 64*KB),
                .erase_region_info =
                {
                        ERASE_REGION(31, 64*KB),
-                       ERASE_REGION( 1, 32*KB),
-                       ERASE_REGION( 2, 8*KB),
-                       ERASE_REGION( 1, 16*KB)
+                       ERASE_REGION(1, 32*KB),
+                       ERASE_REGION(2, 8*KB),
+                       ERASE_REGION(1, 16*KB)
                }
        },
        {
                }
        },
        {
@@ -356,8 +356,8 @@ non_cfi_t non_cfi_flashes[] = {
                .num_erase_regions = 3,
                .erase_region_info =
                {
                .num_erase_regions = 3,
                .erase_region_info =
                {
-                       ERASE_REGION( 8,  8*KB),
-                       ERASE_REGION( 2, 32*KB),
+                       ERASE_REGION(8,  8*KB),
+                       ERASE_REGION(2, 32*KB),
                        ERASE_REGION(30, 64*KB)
                }
        },
                        ERASE_REGION(30, 64*KB)
                }
        },
@@ -373,8 +373,8 @@ non_cfi_t non_cfi_flashes[] = {
                .erase_region_info =
                {
                        ERASE_REGION(30, 64*KB),
                .erase_region_info =
                {
                        ERASE_REGION(30, 64*KB),
-                       ERASE_REGION( 2, 32*KB),
-                       ERASE_REGION( 8,  8*KB)
+                       ERASE_REGION(2, 32*KB),
+                       ERASE_REGION(8,  8*KB)
                }
        },
        {
                }
        },
        {
@@ -388,9 +388,9 @@ non_cfi_t non_cfi_flashes[] = {
                .num_erase_regions = 4,
                .erase_region_info =
                {
                .num_erase_regions = 4,
                .erase_region_info =
                {
-                       ERASE_REGION( 1, 16*KB),
-                       ERASE_REGION( 2, 8*KB),
-                       ERASE_REGION( 1, 32*KB),
+                       ERASE_REGION(1, 16*KB),
+                       ERASE_REGION(2, 8*KB),
+                       ERASE_REGION(1, 32*KB),
                        ERASE_REGION(15, 64*KB)
                }
        },
                        ERASE_REGION(15, 64*KB)
                }
        },
index bcb6dd09979949d3a0e415ef4ce352925fa4fb70..1dcc9f9d11be892bcb7bfa35397a4873edfe3ecb 100644 (file)
@@ -189,7 +189,7 @@ int flash_verify(uint32 adr, unsigned int len, uint8 *src)
        unsigned char *flash_ptr;
 
        flash_ptr = (uint8 *)FLASH_AREA_ADDR + adr;
        unsigned char *flash_ptr;
 
        flash_ptr = (uint8 *)FLASH_AREA_ADDR + adr;
-       for ( ;len; len--) {
+       for (;len; len--) {
                if (*(flash_ptr++)!=*(src++)) return FLASH_STAT_VERIFE;
        }
        return FLASH_STAT_OK;
                if (*(flash_ptr++)!=*(src++)) return FLASH_STAT_VERIFE;
        }
        return FLASH_STAT_OK;
index dab58a4bad8208479ca1b303fcbae65878cb8d01..29077c6da250f3bb9c23399c8668fc0aca8b94f4 100644 (file)
@@ -229,9 +229,9 @@ static int pic32mx_erase(struct flash_bank_s *bank, int first, int last)
        {
                LOG_DEBUG("Erasing entire program flash");
                status = pic32mx_nvm_exec(bank, NVMCON_OP_PFM_ERASE, 50);
        {
                LOG_DEBUG("Erasing entire program flash");
                status = pic32mx_nvm_exec(bank, NVMCON_OP_PFM_ERASE, 50);
-               if ( status & NVMCON_NVMERR )
+               if (status & NVMCON_NVMERR )
                        return ERROR_FLASH_OPERATION_FAILED;
                        return ERROR_FLASH_OPERATION_FAILED;
-               if ( status & NVMCON_LVDERR )
+               if (status & NVMCON_LVDERR )
                        return ERROR_FLASH_OPERATION_FAILED;
                return ERROR_OK;
        }
                        return ERROR_FLASH_OPERATION_FAILED;
                return ERROR_OK;
        }
@@ -245,9 +245,9 @@ static int pic32mx_erase(struct flash_bank_s *bank, int first, int last)
 
                status = pic32mx_nvm_exec(bank, NVMCON_OP_PAGE_ERASE, 10);
 
 
                status = pic32mx_nvm_exec(bank, NVMCON_OP_PAGE_ERASE, 10);
 
-               if ( status & NVMCON_NVMERR )
+               if (status & NVMCON_NVMERR )
                        return ERROR_FLASH_OPERATION_FAILED;
                        return ERROR_FLASH_OPERATION_FAILED;
-               if ( status & NVMCON_LVDERR )
+               if (status & NVMCON_LVDERR )
                        return ERROR_FLASH_OPERATION_FAILED;
                bank->sectors[i].is_erased = 1;
        }
                        return ERROR_FLASH_OPERATION_FAILED;
                bank->sectors[i].is_erased = 1;
        }
@@ -313,7 +313,7 @@ static int pic32mx_protect(struct flash_bank_s *bank, int set, int first, int la
                        reg = (i / pic32mx_info->ppage_size) / 8;
                        bit = (i / pic32mx_info->ppage_size) - (reg * 8);
 
                        reg = (i / pic32mx_info->ppage_size) / 8;
                        bit = (i / pic32mx_info->ppage_size) - (reg * 8);
 
-                       if ( set )
+                       if (set )
                                prot_reg[reg] &= ~(1 << bit);
                        else
                                prot_reg[reg] |= (1 << bit);
                                prot_reg[reg] &= ~(1 << bit);
                        else
                                prot_reg[reg] |= (1 << bit);
@@ -327,7 +327,7 @@ static int pic32mx_protect(struct flash_bank_s *bank, int set, int first, int la
                        reg = (i / pic32mx_info->ppage_size) / 8;
                        bit = (i / pic32mx_info->ppage_size) - (reg * 8);
 
                        reg = (i / pic32mx_info->ppage_size) / 8;
                        bit = (i / pic32mx_info->ppage_size) - (reg * 8);
 
-                       if ( set )
+                       if (set )
                                prot_reg[reg] &= ~(1 << bit);
                        else
                                prot_reg[reg] |= (1 << bit);
                                prot_reg[reg] &= ~(1 << bit);
                        else
                                prot_reg[reg] |= (1 << bit);
@@ -434,12 +434,12 @@ static int pic32mx_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint3
                }
 #endif
                status = pic32mx_write_row(bank, address, source->address);
                }
 #endif
                status = pic32mx_write_row(bank, address, source->address);
-               if ( status & NVMCON_NVMERR ) {
+               if (status & NVMCON_NVMERR ) {
                        LOG_ERROR("Flash write error NVMERR (status = 0x%08" PRIx32 ")", status);
                        retval = ERROR_FLASH_OPERATION_FAILED;
                        break;
                }
                        LOG_ERROR("Flash write error NVMERR (status = 0x%08" PRIx32 ")", status);
                        retval = ERROR_FLASH_OPERATION_FAILED;
                        break;
                }
-               if ( status & NVMCON_LVDERR ) {
+               if (status & NVMCON_LVDERR ) {
                        LOG_ERROR("Flash write error LVDERR (status = 0x%08" PRIx32 ")", status);
                        retval = ERROR_FLASH_OPERATION_FAILED;
                        break;
                        LOG_ERROR("Flash write error LVDERR (status = 0x%08" PRIx32 ")", status);
                        retval = ERROR_FLASH_OPERATION_FAILED;
                        break;
@@ -458,12 +458,12 @@ static int pic32mx_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint3
                memcpy(&value, buffer, sizeof(uint32_t));
 
                uint32_t status = pic32mx_write_word(bank, address, value);
                memcpy(&value, buffer, sizeof(uint32_t));
 
                uint32_t status = pic32mx_write_word(bank, address, value);
-               if ( status & NVMCON_NVMERR ) {
+               if (status & NVMCON_NVMERR ) {
                        LOG_ERROR("Flash write error NVMERR (status = 0x%08" PRIx32 ")", status);
                        retval = ERROR_FLASH_OPERATION_FAILED;
                        break;
                }
                        LOG_ERROR("Flash write error NVMERR (status = 0x%08" PRIx32 ")", status);
                        retval = ERROR_FLASH_OPERATION_FAILED;
                        break;
                }
-               if ( status & NVMCON_LVDERR ) {
+               if (status & NVMCON_LVDERR ) {
                        LOG_ERROR("Flash write error LVDERR (status = 0x%08" PRIx32 ")", status);
                        retval = ERROR_FLASH_OPERATION_FAILED;
                        break;
                        LOG_ERROR("Flash write error LVDERR (status = 0x%08" PRIx32 ")", status);
                        retval = ERROR_FLASH_OPERATION_FAILED;
                        break;
@@ -564,9 +564,9 @@ static int pic32mx_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t of
                memcpy(&value, buffer + bytes_written, sizeof(uint32_t));
 
                status = pic32mx_write_word(bank, address, value);
                memcpy(&value, buffer + bytes_written, sizeof(uint32_t));
 
                status = pic32mx_write_word(bank, address, value);
-               if ( status & NVMCON_NVMERR )
+               if (status & NVMCON_NVMERR )
                        return ERROR_FLASH_OPERATION_FAILED;
                        return ERROR_FLASH_OPERATION_FAILED;
-               if ( status & NVMCON_LVDERR )
+               if (status & NVMCON_LVDERR )
                        return ERROR_FLASH_OPERATION_FAILED;
 
                bytes_written += 4;
                        return ERROR_FLASH_OPERATION_FAILED;
 
                bytes_written += 4;
@@ -580,9 +580,9 @@ static int pic32mx_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t of
                memcpy(&value, buffer + bytes_written, bytes_remaining);
 
                status = pic32mx_write_word(bank, address, value);
                memcpy(&value, buffer + bytes_written, bytes_remaining);
 
                status = pic32mx_write_word(bank, address, value);
-               if ( status & NVMCON_NVMERR )
+               if (status & NVMCON_NVMERR )
                        return ERROR_FLASH_OPERATION_FAILED;
                        return ERROR_FLASH_OPERATION_FAILED;
-               if ( status & NVMCON_LVDERR )
+               if (status & NVMCON_LVDERR )
                        return ERROR_FLASH_OPERATION_FAILED;
        }
 
                        return ERROR_FLASH_OPERATION_FAILED;
        }
 
@@ -603,14 +603,14 @@ static int pic32mx_probe(struct flash_bank_s *bank)
        pic32mx_info->probed = 0;
 
        device_id = ejtag_info->idcode;
        pic32mx_info->probed = 0;
 
        device_id = ejtag_info->idcode;
-       LOG_INFO( "device id = 0x%08" PRIx32 " (manuf 0x%03x dev 0x%02x, ver 0x%03x)", 
+       LOG_INFO("device id = 0x%08" PRIx32 " (manuf 0x%03x dev 0x%02x, ver 0x%03x)", 
                          device_id,
                          (unsigned)((device_id >> 1)&0x7ff), 
                          (unsigned)((device_id >> 12)&0xff), 
                          (unsigned)((device_id >> 20)&0xfff) );
 
        if (((device_id >> 1)&0x7ff) != PIC32MX_MANUF_ID) {
                          device_id,
                          (unsigned)((device_id >> 1)&0x7ff), 
                          (unsigned)((device_id >> 12)&0xff), 
                          (unsigned)((device_id >> 20)&0xfff) );
 
        if (((device_id >> 1)&0x7ff) != PIC32MX_MANUF_ID) {
-               LOG_WARNING( "Cannot identify target as a PIC32MX family." );
+               LOG_WARNING("Cannot identify target as a PIC32MX family." );
                return ERROR_FLASH_OPERATION_FAILED;
        }
 
                return ERROR_FLASH_OPERATION_FAILED;
        }
 
@@ -626,7 +626,7 @@ static int pic32mx_probe(struct flash_bank_s *bank)
                                break;
                        }
                if (pic32mx_devs[i].name == NULL) {
                                break;
                        }
                if (pic32mx_devs[i].name == NULL) {
-                       LOG_WARNING( "Cannot identify target as a PIC32MX family." );
+                       LOG_WARNING("Cannot identify target as a PIC32MX family." );
                        return ERROR_FLASH_OPERATION_FAILED;
                }
        }
                        return ERROR_FLASH_OPERATION_FAILED;
                }
        }
@@ -646,7 +646,7 @@ static int pic32mx_probe(struct flash_bank_s *bank)
        }
 #endif
 
        }
 #endif
 
-       LOG_INFO( "flash size = %dkbytes", num_pages );
+       LOG_INFO("flash size = %dkbytes", num_pages );
 
        /* calculate numbers of pages */
        num_pages /= (page_size / 1024);
 
        /* calculate numbers of pages */
        num_pages /= (page_size / 1024);
@@ -847,13 +847,13 @@ static int pic32mx_chip_erase(struct flash_bank_s *bank)
 
        target_write_u32(target, PIC32MX_FLASH_CR, FLASH_LOCK);
 
 
        target_write_u32(target, PIC32MX_FLASH_CR, FLASH_LOCK);
 
-       if ( status & FLASH_WRPRTERR )
+       if (status & FLASH_WRPRTERR )
        {
                LOG_ERROR("pic32mx device protected");
                return ERROR_OK;
        }
 
        {
                LOG_ERROR("pic32mx device protected");
                return ERROR_OK;
        }
 
-       if ( status & FLASH_PGERR )
+       if (status & FLASH_PGERR )
        {
                LOG_ERROR("pic32mx device programming failed");
                return ERROR_OK;
        {
                LOG_ERROR("pic32mx device programming failed");
                return ERROR_OK;
@@ -931,9 +931,9 @@ static int pic32mx_handle_pgm_word_command(struct command_context_s *cmd_ctx, ch
 
        res = ERROR_OK;
        status = pic32mx_write_word(bank, address, value);
 
        res = ERROR_OK;
        status = pic32mx_write_word(bank, address, value);
-       if ( status & NVMCON_NVMERR )
+       if (status & NVMCON_NVMERR )
                res = ERROR_FLASH_OPERATION_FAILED;
                res = ERROR_FLASH_OPERATION_FAILED;
-       if ( status & NVMCON_LVDERR )
+       if (status & NVMCON_LVDERR )
                res = ERROR_FLASH_OPERATION_FAILED;
 
        if (res == ERROR_OK)
                res = ERROR_FLASH_OPERATION_FAILED;
 
        if (res == ERROR_OK)
index aab8b9a9392017a95a64509458f87ed27145853f..2f8ca3be69e1fabc09174aae303fb732b1ba374f 100644 (file)
@@ -182,9 +182,9 @@ static int stm32x_erase_options(struct flash_bank_s *bank)
 
        status = stm32x_wait_status_busy(bank, 10);
 
 
        status = stm32x_wait_status_busy(bank, 10);
 
-       if ( status & FLASH_WRPRTERR )
+       if (status & FLASH_WRPRTERR )
                return ERROR_FLASH_OPERATION_FAILED;
                return ERROR_FLASH_OPERATION_FAILED;
-       if ( status & FLASH_PGERR )
+       if (status & FLASH_PGERR )
                return ERROR_FLASH_OPERATION_FAILED;
 
        /* clear readout protection and complementary option bytes
                return ERROR_FLASH_OPERATION_FAILED;
 
        /* clear readout protection and complementary option bytes
@@ -218,9 +218,9 @@ static int stm32x_write_options(struct flash_bank_s *bank)
 
        status = stm32x_wait_status_busy(bank, 10);
 
 
        status = stm32x_wait_status_busy(bank, 10);
 
-       if ( status & FLASH_WRPRTERR )
+       if (status & FLASH_WRPRTERR )
                return ERROR_FLASH_OPERATION_FAILED;
                return ERROR_FLASH_OPERATION_FAILED;
-       if ( status & FLASH_PGERR )
+       if (status & FLASH_PGERR )
                return ERROR_FLASH_OPERATION_FAILED;
 
        /* write protection byte 1 */
                return ERROR_FLASH_OPERATION_FAILED;
 
        /* write protection byte 1 */
@@ -228,9 +228,9 @@ static int stm32x_write_options(struct flash_bank_s *bank)
 
        status = stm32x_wait_status_busy(bank, 10);
 
 
        status = stm32x_wait_status_busy(bank, 10);
 
-       if ( status & FLASH_WRPRTERR )
+       if (status & FLASH_WRPRTERR )
                return ERROR_FLASH_OPERATION_FAILED;
                return ERROR_FLASH_OPERATION_FAILED;
-       if ( status & FLASH_PGERR )
+       if (status & FLASH_PGERR )
                return ERROR_FLASH_OPERATION_FAILED;
 
        /* write protection byte 2 */
                return ERROR_FLASH_OPERATION_FAILED;
 
        /* write protection byte 2 */
@@ -238,9 +238,9 @@ static int stm32x_write_options(struct flash_bank_s *bank)
 
        status = stm32x_wait_status_busy(bank, 10);
 
 
        status = stm32x_wait_status_busy(bank, 10);
 
-       if ( status & FLASH_WRPRTERR )
+       if (status & FLASH_WRPRTERR )
                return ERROR_FLASH_OPERATION_FAILED;
                return ERROR_FLASH_OPERATION_FAILED;
-       if ( status & FLASH_PGERR )
+       if (status & FLASH_PGERR )
                return ERROR_FLASH_OPERATION_FAILED;
 
        /* write protection byte 3 */
                return ERROR_FLASH_OPERATION_FAILED;
 
        /* write protection byte 3 */
@@ -248,9 +248,9 @@ static int stm32x_write_options(struct flash_bank_s *bank)
 
        status = stm32x_wait_status_busy(bank, 10);
 
 
        status = stm32x_wait_status_busy(bank, 10);
 
-       if ( status & FLASH_WRPRTERR )
+       if (status & FLASH_WRPRTERR )
                return ERROR_FLASH_OPERATION_FAILED;
                return ERROR_FLASH_OPERATION_FAILED;
-       if ( status & FLASH_PGERR )
+       if (status & FLASH_PGERR )
                return ERROR_FLASH_OPERATION_FAILED;
 
        /* write protection byte 4 */
                return ERROR_FLASH_OPERATION_FAILED;
 
        /* write protection byte 4 */
@@ -258,9 +258,9 @@ static int stm32x_write_options(struct flash_bank_s *bank)
 
        status = stm32x_wait_status_busy(bank, 10);
 
 
        status = stm32x_wait_status_busy(bank, 10);
 
-       if ( status & FLASH_WRPRTERR )
+       if (status & FLASH_WRPRTERR )
                return ERROR_FLASH_OPERATION_FAILED;
                return ERROR_FLASH_OPERATION_FAILED;
-       if ( status & FLASH_PGERR )
+       if (status & FLASH_PGERR )
                return ERROR_FLASH_OPERATION_FAILED;
 
        /* write readout protection bit */
                return ERROR_FLASH_OPERATION_FAILED;
 
        /* write readout protection bit */
@@ -268,9 +268,9 @@ static int stm32x_write_options(struct flash_bank_s *bank)
 
        status = stm32x_wait_status_busy(bank, 10);
 
 
        status = stm32x_wait_status_busy(bank, 10);
 
-       if ( status & FLASH_WRPRTERR )
+       if (status & FLASH_WRPRTERR )
                return ERROR_FLASH_OPERATION_FAILED;
                return ERROR_FLASH_OPERATION_FAILED;
-       if ( status & FLASH_PGERR )
+       if (status & FLASH_PGERR )
                return ERROR_FLASH_OPERATION_FAILED;
 
        target_write_u32(target, STM32_FLASH_CR, FLASH_LOCK);
                return ERROR_FLASH_OPERATION_FAILED;
 
        target_write_u32(target, STM32_FLASH_CR, FLASH_LOCK);
@@ -338,7 +338,7 @@ static int stm32x_protect_check(struct flash_bank_s *bank)
                {
                        set = 1;
 
                {
                        set = 1;
 
-                       if ( protection & (1 << i))
+                       if (protection & (1 << i))
                                set = 0;
 
                        for (s = 0; s < stm32x_info->ppage_size; s++)
                                set = 0;
 
                        for (s = 0; s < stm32x_info->ppage_size; s++)
@@ -378,9 +378,9 @@ static int stm32x_erase(struct flash_bank_s *bank, int first, int last)
 
                status = stm32x_wait_status_busy(bank, 10);
 
 
                status = stm32x_wait_status_busy(bank, 10);
 
-               if ( status & FLASH_WRPRTERR )
+               if (status & FLASH_WRPRTERR )
                        return ERROR_FLASH_OPERATION_FAILED;
                        return ERROR_FLASH_OPERATION_FAILED;
-               if ( status & FLASH_PGERR )
+               if (status & FLASH_PGERR )
                        return ERROR_FLASH_OPERATION_FAILED;
                bank->sectors[i].is_erased = 1;
        }
                        return ERROR_FLASH_OPERATION_FAILED;
                bank->sectors[i].is_erased = 1;
        }
@@ -445,7 +445,7 @@ static int stm32x_protect(struct flash_bank_s *bank, int set, int first, int las
                        reg = (i / stm32x_info->ppage_size) / 8;
                        bit = (i / stm32x_info->ppage_size) - (reg * 8);
 
                        reg = (i / stm32x_info->ppage_size) / 8;
                        bit = (i / stm32x_info->ppage_size) - (reg * 8);
 
-                       if ( set )
+                       if (set )
                                prot_reg[reg] &= ~(1 << bit);
                        else
                                prot_reg[reg] |= (1 << bit);
                                prot_reg[reg] &= ~(1 << bit);
                        else
                                prot_reg[reg] |= (1 << bit);
@@ -459,7 +459,7 @@ static int stm32x_protect(struct flash_bank_s *bank, int set, int first, int las
                        reg = (i / stm32x_info->ppage_size) / 8;
                        bit = (i / stm32x_info->ppage_size) - (reg * 8);
 
                        reg = (i / stm32x_info->ppage_size) / 8;
                        bit = (i / stm32x_info->ppage_size) - (reg * 8);
 
-                       if ( set )
+                       if (set )
                                prot_reg[reg] &= ~(1 << bit);
                        else
                                prot_reg[reg] |= (1 << bit);
                                prot_reg[reg] &= ~(1 << bit);
                        else
                                prot_reg[reg] |= (1 << bit);
@@ -658,12 +658,12 @@ static int stm32x_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t off
 
                status = stm32x_wait_status_busy(bank, 5);
 
 
                status = stm32x_wait_status_busy(bank, 5);
 
-               if ( status & FLASH_WRPRTERR )
+               if (status & FLASH_WRPRTERR )
                {
                        LOG_ERROR("flash memory not erased before writing");
                        return ERROR_FLASH_OPERATION_FAILED;
                }
                {
                        LOG_ERROR("flash memory not erased before writing");
                        return ERROR_FLASH_OPERATION_FAILED;
                }
-               if ( status & FLASH_PGERR )
+               if (status & FLASH_PGERR )
                {
                        LOG_ERROR("flash memory write protected");
                        return ERROR_FLASH_OPERATION_FAILED;
                {
                        LOG_ERROR("flash memory write protected");
                        return ERROR_FLASH_OPERATION_FAILED;
@@ -684,12 +684,12 @@ static int stm32x_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t off
 
                status = stm32x_wait_status_busy(bank, 5);
 
 
                status = stm32x_wait_status_busy(bank, 5);
 
-               if ( status & FLASH_WRPRTERR )
+               if (status & FLASH_WRPRTERR )
                {
                        LOG_ERROR("flash memory not erased before writing");
                        return ERROR_FLASH_OPERATION_FAILED;
                }
                {
                        LOG_ERROR("flash memory not erased before writing");
                        return ERROR_FLASH_OPERATION_FAILED;
                }
-               if ( status & FLASH_PGERR )
+               if (status & FLASH_PGERR )
                {
                        LOG_ERROR("flash memory write protected");
                        return ERROR_FLASH_OPERATION_FAILED;
                {
                        LOG_ERROR("flash memory write protected");
                        return ERROR_FLASH_OPERATION_FAILED;
@@ -720,7 +720,7 @@ static int stm32x_probe(struct flash_bank_s *bank)
 
        /* read stm32 device id register */
        target_read_u32(target, 0xE0042000, &device_id);
 
        /* read stm32 device id register */
        target_read_u32(target, 0xE0042000, &device_id);
-       LOG_INFO( "device id = 0x%08" PRIx32 "", device_id );
+       LOG_INFO("device id = 0x%08" PRIx32 "", device_id );
 
        /* get flash size from target */
        if (target_read_u16(target, 0x1FFFF7E0, &num_pages) != ERROR_OK)
 
        /* get flash size from target */
        if (target_read_u16(target, 0x1FFFF7E0, &num_pages) != ERROR_OK)
@@ -740,7 +740,7 @@ static int stm32x_probe(struct flash_bank_s *bank)
                if (num_pages == 0xffff)
                {
                        /* number of sectors incorrect on revA */
                if (num_pages == 0xffff)
                {
                        /* number of sectors incorrect on revA */
-                       LOG_WARNING( "STM32 flash size failed, probe inaccurate - assuming 128k flash" );
+                       LOG_WARNING("STM32 flash size failed, probe inaccurate - assuming 128k flash" );
                        num_pages = 128;
                }
        }
                        num_pages = 128;
                }
        }
@@ -755,7 +755,7 @@ static int stm32x_probe(struct flash_bank_s *bank)
                if (num_pages == 0xffff)
                {
                        /* number of sectors incorrect on revA */
                if (num_pages == 0xffff)
                {
                        /* number of sectors incorrect on revA */
-                       LOG_WARNING( "STM32 flash size failed, probe inaccurate - assuming 32k flash" );
+                       LOG_WARNING("STM32 flash size failed, probe inaccurate - assuming 32k flash" );
                        num_pages = 32;
                }
        }
                        num_pages = 32;
                }
        }
@@ -770,7 +770,7 @@ static int stm32x_probe(struct flash_bank_s *bank)
                if (num_pages == 0xffff)
                {
                        /* number of sectors incorrect on revZ */
                if (num_pages == 0xffff)
                {
                        /* number of sectors incorrect on revZ */
-                       LOG_WARNING( "STM32 flash size failed, probe inaccurate - assuming 512k flash" );
+                       LOG_WARNING("STM32 flash size failed, probe inaccurate - assuming 512k flash" );
                        num_pages = 512;
                }
        }
                        num_pages = 512;
                }
        }
@@ -785,17 +785,17 @@ static int stm32x_probe(struct flash_bank_s *bank)
                if (num_pages == 0xffff)
                {
                        /* number of sectors incorrect on revZ */
                if (num_pages == 0xffff)
                {
                        /* number of sectors incorrect on revZ */
-                       LOG_WARNING( "STM32 flash size failed, probe inaccurate - assuming 256k flash" );
+                       LOG_WARNING("STM32 flash size failed, probe inaccurate - assuming 256k flash" );
                        num_pages = 256;
                }
        }
        else
        {
                        num_pages = 256;
                }
        }
        else
        {
-               LOG_WARNING( "Cannot identify target as a STM32 family." );
+               LOG_WARNING("Cannot identify target as a STM32 family." );
                return ERROR_FLASH_OPERATION_FAILED;
        }
 
                return ERROR_FLASH_OPERATION_FAILED;
        }
 
-       LOG_INFO( "flash size = %dkbytes", num_pages );
+       LOG_INFO("flash size = %dkbytes", num_pages );
 
        /* calculate numbers of pages */
        num_pages /= (page_size / 1024);
 
        /* calculate numbers of pages */
        num_pages /= (page_size / 1024);
@@ -1188,13 +1188,13 @@ static int stm32x_mass_erase(struct flash_bank_s *bank)
 
        target_write_u32(target, STM32_FLASH_CR, FLASH_LOCK);
 
 
        target_write_u32(target, STM32_FLASH_CR, FLASH_LOCK);
 
-       if ( status & FLASH_WRPRTERR )
+       if (status & FLASH_WRPRTERR )
        {
                LOG_ERROR("stm32x device protected");
                return ERROR_OK;
        }
 
        {
                LOG_ERROR("stm32x device protected");
                return ERROR_OK;
        }
 
-       if ( status & FLASH_PGERR )
+       if (status & FLASH_PGERR )
        {
                LOG_ERROR("stm32x device programming failed");
                return ERROR_OK;
        {
                LOG_ERROR("stm32x device programming failed");
                return ERROR_OK;
index 1911b59a556da6a29e9de83fc29b0d5d82683c8f..6808a068e38673d286473b56d6ef64735fb01f8b 100644 (file)
@@ -305,7 +305,7 @@ static int str9x_erase(struct flash_bank_s *bank, int first, int last)
                        {
                                return retval;
                        }
                        {
                                return retval;
                        }
-                       if ( status & 0x80 )
+                       if (status & 0x80 )
                                break;
                        alive_sleep(1);
                }
                                break;
                        alive_sleep(1);
                }
@@ -327,7 +327,7 @@ static int str9x_erase(struct flash_bank_s *bank, int first, int last)
                        return retval;
                }
 
                        return retval;
                }
 
-               if ( status & 0x22 )
+               if (status & 0x22 )
                {
                        LOG_ERROR("error erasing flash bank, status: 0x%x", status);
                        return ERROR_FLASH_OPERATION_FAILED;
                {
                        LOG_ERROR("error erasing flash bank, status: 0x%x", status);
                        return ERROR_FLASH_OPERATION_FAILED;
@@ -365,7 +365,7 @@ static int str9x_protect(struct flash_bank_s *bank,
                adr = bank->base + bank->sectors[i].offset;
 
                target_write_u16(target, adr, 0x60);
                adr = bank->base + bank->sectors[i].offset;
 
                target_write_u16(target, adr, 0x60);
-               if ( set )
+               if (set )
                        target_write_u16(target, adr, 0x01);
                else
                        target_write_u16(target, adr, 0xD0);
                        target_write_u16(target, adr, 0x01);
                else
                        target_write_u16(target, adr, 0xD0);
@@ -578,7 +578,7 @@ static int str9x_write(struct flash_bank_s *bank,
                for (timeout = 0; timeout < 1000; timeout++)
                {
                        target_read_u8(target, bank_adr, &status);
                for (timeout = 0; timeout < 1000; timeout++)
                {
                        target_read_u8(target, bank_adr, &status);
-                       if ( status & 0x80 )
+                       if (status & 0x80 )
                                break;
                        alive_sleep(1);
                }
                                break;
                        alive_sleep(1);
                }
@@ -627,7 +627,7 @@ static int str9x_write(struct flash_bank_s *bank,
                for (timeout = 0; timeout < 1000; timeout++)
                {
                        target_read_u8(target, bank_adr, &status);
                for (timeout = 0; timeout < 1000; timeout++)
                {
                        target_read_u8(target, bank_adr, &status);
-                       if ( status & 0x80 )
+                       if (status & 0x80 )
                                break;
                        alive_sleep(1);
                }
                                break;
                        alive_sleep(1);
                }
index 14dfebca36c547e2b16ba0ac03df247e765a4a6f..e679d42d5461cf0f8cd42009028b603d973c936a 100644 (file)
@@ -101,7 +101,7 @@ static int str9xpec_register_commands(struct command_context_s *cmd_ctx)
 
 int str9xpec_set_instr(jtag_tap_t *tap, uint32_t new_instr, tap_state_t end_state)
 {
 
 int str9xpec_set_instr(jtag_tap_t *tap, uint32_t new_instr, tap_state_t end_state)
 {
-       if ( tap == NULL ){
+       if (tap == NULL ){
                return ERROR_TARGET_INVALID;
        }
 
                return ERROR_TARGET_INVALID;
        }
 
@@ -325,7 +325,7 @@ static int str9xpec_flash_bank_command(struct command_context_s *cmd_ctx, char *
        arm7_9 = armv4_5->arch_info;
        jtag_info = &arm7_9->jtag_info;
 
        arm7_9 = armv4_5->arch_info;
        jtag_info = &arm7_9->jtag_info;
 
-       str9xpec_info->tap = jtag_tap_by_position( jtag_info->tap->abs_chain_position - 1);
+       str9xpec_info->tap = jtag_tap_by_position(jtag_info->tap->abs_chain_position - 1);
        str9xpec_info->isc_enable = 0;
 
        str9xpec_build_block_list(bank);
        str9xpec_info->isc_enable = 0;
 
        str9xpec_build_block_list(bank);
@@ -349,7 +349,7 @@ static int str9xpec_blank_check(struct flash_bank_s *bank, int first, int last)
        tap = str9xpec_info->tap;
 
        if (!str9xpec_info->isc_enable) {
        tap = str9xpec_info->tap;
 
        if (!str9xpec_info->isc_enable) {
-               str9xpec_isc_enable( bank );
+               str9xpec_isc_enable(bank );
        }
 
        if (!str9xpec_info->isc_enable) {
        }
 
        if (!str9xpec_info->isc_enable) {
@@ -438,7 +438,7 @@ static int str9xpec_erase_area(struct flash_bank_s *bank, int first, int last)
        tap = str9xpec_info->tap;
 
        if (!str9xpec_info->isc_enable) {
        tap = str9xpec_info->tap;
 
        if (!str9xpec_info->isc_enable) {
-               str9xpec_isc_enable( bank );
+               str9xpec_isc_enable(bank );
        }
 
        if (!str9xpec_info->isc_enable) {
        }
 
        if (!str9xpec_info->isc_enable) {
@@ -518,7 +518,7 @@ static int str9xpec_lock_device(struct flash_bank_s *bank)
        tap = str9xpec_info->tap;
 
        if (!str9xpec_info->isc_enable) {
        tap = str9xpec_info->tap;
 
        if (!str9xpec_info->isc_enable) {
-               str9xpec_isc_enable( bank );
+               str9xpec_isc_enable(bank );
        }
 
        if (!str9xpec_info->isc_enable) {
        }
 
        if (!str9xpec_info->isc_enable) {
@@ -575,7 +575,7 @@ static int str9xpec_protect(struct flash_bank_s *bank, int set, int first, int l
        /* last bank: 0xFF signals a full device protect */
        if (last == 0xFF)
        {
        /* last bank: 0xFF signals a full device protect */
        if (last == 0xFF)
        {
-               if ( set )
+               if (set )
                {
                        status = str9xpec_lock_device(bank);
                }
                {
                        status = str9xpec_lock_device(bank);
                }
@@ -589,7 +589,7 @@ static int str9xpec_protect(struct flash_bank_s *bank, int set, int first, int l
        {
                for (i = first; i <= last; i++)
                {
        {
                for (i = first; i <= last; i++)
                {
-                       if ( set )
+                       if (set )
                                buf_set_u32(str9xpec_info->options, str9xpec_info->sector_bits[i], 1, 1);
                        else
                                buf_set_u32(str9xpec_info->options, str9xpec_info->sector_bits[i], 1, 0);
                                buf_set_u32(str9xpec_info->options, str9xpec_info->sector_bits[i], 1, 1);
                        else
                                buf_set_u32(str9xpec_info->options, str9xpec_info->sector_bits[i], 1, 0);
@@ -919,13 +919,13 @@ static int str9xpec_write_options(struct flash_bank_s *bank)
        tap = str9xpec_info->tap;
 
        /* erase config options first */
        tap = str9xpec_info->tap;
 
        /* erase config options first */
-       status = str9xpec_erase_area( bank, 0xFE, 0xFE );
+       status = str9xpec_erase_area(bank, 0xFE, 0xFE );
 
        if ((status & ISC_STATUS_ERROR) != STR9XPEC_ISC_SUCCESS)
                return status;
 
        if (!str9xpec_info->isc_enable) {
 
        if ((status & ISC_STATUS_ERROR) != STR9XPEC_ISC_SUCCESS)
                return status;
 
        if (!str9xpec_info->isc_enable) {
-               str9xpec_isc_enable( bank );
+               str9xpec_isc_enable(bank );
        }
 
        if (!str9xpec_info->isc_enable) {
        }
 
        if (!str9xpec_info->isc_enable) {
index c259c648f0079db8e114cc5c7ddb07189e6191f8..63c64b86e9334c5187a11040395d708ac21d9be8 100644 (file)
@@ -348,8 +348,8 @@ int unregister_command(command_context_t *context, char *name)
 
 void command_output_text(command_context_t *context, const char *data)
 {
 
 void command_output_text(command_context_t *context, const char *data)
 {
-       if ( context && context->output_handler && data  ){
-               context->output_handler( context, data );
+       if (context && context->output_handler && data  ){
+               context->output_handler(context, data );
        }
 }
 
        }
 }
 
@@ -704,7 +704,7 @@ command_context_t* command_init()
        Jim_RegisterCoreCommands(interp);
 #endif
 
        Jim_RegisterCoreCommands(interp);
 #endif
 
-#if defined( _MSC_VER )
+#if defined(_MSC_VER )
        /* WinXX - is generic, the forward
         * looking problem is this:
         *
        /* WinXX - is generic, the forward
         * looking problem is this:
         *
@@ -713,18 +713,18 @@ command_context_t* command_init()
         * "winxx" is generic.
         */
        HostOs = "winxx";
         * "winxx" is generic.
         */
        HostOs = "winxx";
-#elif defined( __LINUX__)
+#elif defined(__LINUX__)
        HostOs = "linux";
        HostOs = "linux";
-#elif defined( __DARWIN__ )
+#elif defined(__DARWIN__ )
        HostOs = "darwin";
        HostOs = "darwin";
-#elif defined( __CYGWIN__ )
+#elif defined(__CYGWIN__ )
        HostOs = "cygwin";
        HostOs = "cygwin";
-#elif defined( __MINGW32__ )
+#elif defined(__MINGW32__ )
        HostOs = "mingw32";
 #else
        HostOs = "other";
 #endif
        HostOs = "mingw32";
 #else
        HostOs = "other";
 #endif
-       Jim_SetGlobalVariableStr( interp, "ocd_HOSTOS", Jim_NewStringObj( interp, HostOs , strlen(HostOs)) );
+       Jim_SetGlobalVariableStr(interp, "ocd_HOSTOS", Jim_NewStringObj(interp, HostOs , strlen(HostOs)) );
 
        Jim_CreateCommand(interp, "ocd_find", jim_find, NULL, NULL);
        Jim_CreateCommand(interp, "echo", jim_echo, NULL, NULL);
 
        Jim_CreateCommand(interp, "ocd_find", jim_find, NULL, NULL);
        Jim_CreateCommand(interp, "echo", jim_echo, NULL, NULL);
index 484d87df649e52c5c444c71e24318bc9735dafda..58d2c3a02206424e83e2f12406f723ee6b834f02 100644 (file)
@@ -182,7 +182,7 @@ int fileio_read_u32(fileio_t *fileio, uint32_t *data)
 
 static inline int fileio_local_fgets(fileio_t *fileio, uint32_t size, char *buffer)
 {
 
 static inline int fileio_local_fgets(fileio_t *fileio, uint32_t size, char *buffer)
 {
-       if ( fgets(buffer, size, fileio->file) == NULL)
+       if (fgets(buffer, size, fileio->file) == NULL)
                return ERROR_FILEIO_OPERATION_FAILED;
        
        return ERROR_OK;
                return ERROR_FILEIO_OPERATION_FAILED;
        
        return ERROR_OK;
index 2a74ab3126d7df692cf6f0553065724dcb01e20e..2bde024e68fc05cdd0ea29e4a92226d4c8b4f025 100644 (file)
@@ -325,34 +325,34 @@ void copyfile(char *name2, char *name1)
 
        fd1 = open(name1, O_WRONLY | O_CREAT, 0664);
        if (fd1 < 0)
 
        fd1 = open(name1, O_WRONLY | O_CREAT, 0664);
        if (fd1 < 0)
-               SHOW_RESULT( open, fd1 );
+               SHOW_RESULT(open, fd1 );
 
        fd2 = open(name2, O_RDONLY);
        if (fd2 < 0)
 
        fd2 = open(name2, O_RDONLY);
        if (fd2 < 0)
-               SHOW_RESULT( open, fd2 );
+               SHOW_RESULT(open, fd2 );
 
        for (;;)
        {
                done = read(fd2, buf, IOSIZE );
                if (done < 0)
                {
 
        for (;;)
        {
                done = read(fd2, buf, IOSIZE );
                if (done < 0)
                {
-                       SHOW_RESULT( read, done );
+                       SHOW_RESULT(read, done );
                        break;
                }
 
                        break;
                }
 
-        if ( done == 0 ) break;
+        if (done == 0 ) break;
 
                wrote = write(fd1, buf, done);
 
                wrote = write(fd1, buf, done);
-        if ( wrote != done ) SHOW_RESULT( write, wrote );
+        if (wrote != done ) SHOW_RESULT(write, wrote );
 
 
-        if ( wrote != done ) break;
+        if (wrote != done ) break;
        }
 
        err = close(fd1);
        }
 
        err = close(fd1);
-    if ( err < 0 ) SHOW_RESULT( close, err );
+    if (err < 0 ) SHOW_RESULT(close, err );
 
        err = close(fd2);
 
        err = close(fd2);
-    if ( err < 0 ) SHOW_RESULT( close, err );
+    if (err < 0 ) SHOW_RESULT(close, err );
 
 }
 
 
 }
 
@@ -372,7 +372,7 @@ void copydir(char *name, char *destdir)
        }
 
        dirp = opendir(name);
        }
 
        dirp = opendir(name);
-    if ( dirp == NULL ) SHOW_RESULT( opendir, -1 );
+    if (dirp == NULL ) SHOW_RESULT(opendir, -1 );
 
        for (;;)
        {
 
        for (;;)
        {
@@ -421,7 +421,7 @@ void copydir(char *name, char *destdir)
        }
 
        err = closedir(dirp);
        }
 
        err = closedir(dirp);
-    if ( err < 0 ) SHOW_RESULT( stat, err );
+    if (err < 0 ) SHOW_RESULT(stat, err );
 }
 
 
 }
 
 
index 5c6283bb5d890009fca2049057fbce6e80952e8b..18cb307da2d0e043ce49670b70ccb7704e7a30e8 100644 (file)
@@ -298,7 +298,7 @@ int Jim_ProcessEvents(Jim_Interp *interp, int flags)
             JimGetTime(&now_sec, &now_ms);
             tvp = &tv;
            dt   = 1000 * (shortest->when_sec - now_sec);
             JimGetTime(&now_sec, &now_ms);
             tvp = &tv;
            dt   = 1000 * (shortest->when_sec - now_sec);
-           dt  += ( shortest->when_ms  - now_ms);
+           dt  += (shortest->when_ms  - now_ms);
             if (dt < 0) {
                dt = 1;
            }
             if (dt < 0) {
                dt = 1;
            }
@@ -498,7 +498,7 @@ static int JimELAfterCommand(Jim_Interp *interp, int argc,
        int tlen ;
        jim_wide remain = 0;
        const char *tok = Jim_GetString(argv[2], &tlen);
        int tlen ;
        jim_wide remain = 0;
        const char *tok = Jim_GetString(argv[2], &tlen);
-       if ( sscanf(tok,"after#%lld",&id) == 1) {
+       if (sscanf(tok,"after#%lld",&id) == 1) {
                remain =  Jim_DeleteTimeHandler(interp, id);
                if (remain > -2)  {
                        Jim_SetResult(interp, Jim_NewIntObj(interp, remain));
                remain =  Jim_DeleteTimeHandler(interp, id);
                if (remain > -2)  {
                        Jim_SetResult(interp, Jim_NewIntObj(interp, remain));
index 2bdf15a669e6386dd45f2a42ca041a5261b67bcf..a1a3675c498a6541fe235d3cf610b6b3c13abec5 100644 (file)
@@ -117,25 +117,25 @@ static Jim_HashTableType *getJimVariablesHashTableType(void);
  * ---------------------------------------------------------------------------*/
 
 static char *
  * ---------------------------------------------------------------------------*/
 
 static char *
-jim_vasprintf( const char *fmt, va_list ap )
+jim_vasprintf(const char *fmt, va_list ap )
 {
 #ifndef HAVE_VASPRINTF
        /* yucky way */
 static char buf[2048];
 {
 #ifndef HAVE_VASPRINTF
        /* yucky way */
 static char buf[2048];
-       vsnprintf( buf, sizeof(buf), fmt, ap );
+       vsnprintf(buf, sizeof(buf), fmt, ap );
        /* garentee termination */
        buf[sizeof(buf)-1] = 0;
 #else
        char *buf;
        int result;
        /* garentee termination */
        buf[sizeof(buf)-1] = 0;
 #else
        char *buf;
        int result;
-       result = vasprintf( &buf, fmt, ap );
+       result = vasprintf(&buf, fmt, ap );
        if (result < 0) exit(-1);
 #endif
        return buf;
 }
 
 static void
        if (result < 0) exit(-1);
 #endif
        return buf;
 }
 
 static void
-jim_vasprintf_done( void *buf )
+jim_vasprintf_done(void *buf )
 {
 #ifndef HAVE_VASPRINTF
        (void)(buf);
 {
 #ifndef HAVE_VASPRINTF
        (void)(buf);
@@ -438,7 +438,7 @@ int Jim_StringToIndex(const char *str, int *intPtr)
     char *endptr;
 
     *intPtr = strtol(str, &endptr, 10);
     char *endptr;
 
     *intPtr = strtol(str, &endptr, 10);
-    if ( (str[0] == '\0') || (str == endptr) )
+    if ((str[0] == '\0') || (str == endptr) )
         return JIM_ERR;
     if (endptr[0] != '\0') {
         while (*endptr) {
         return JIM_ERR;
     if (endptr[0] != '\0') {
         while (*endptr) {
@@ -544,10 +544,10 @@ void Jim_Panic(Jim_Interp *interp, const char *fmt, ...)
 #endif
        
        /* This may actually crash... we do it last */
 #endif
        
        /* This may actually crash... we do it last */
-       if ( interp && interp->cookie_stderr ){
-               Jim_fprintf(  interp, interp->cookie_stderr, JIM_NL "JIM INTERPRETER PANIC: ");
-               Jim_vfprintf( interp, interp->cookie_stderr, fmt, ap );
-               Jim_fprintf(  interp, interp->cookie_stderr, JIM_NL JIM_NL );
+       if (interp && interp->cookie_stderr ){
+               Jim_fprintf(interp, interp->cookie_stderr, JIM_NL "JIM INTERPRETER PANIC: ");
+               Jim_vfprintf(interp, interp->cookie_stderr, fmt, ap );
+               Jim_fprintf(interp, interp->cookie_stderr, JIM_NL JIM_NL );
        }
     abort();
 }
        }
     abort();
 }
@@ -2055,17 +2055,17 @@ void Jim_AppendString(Jim_Interp *interp, Jim_Obj *objPtr, const char *str,
     StringAppendString(objPtr, str, len);
 }
 
     StringAppendString(objPtr, str, len);
 }
 
-void Jim_AppendString_sprintf( Jim_Interp *interp, Jim_Obj *objPtr, const char *fmt, ... )
+void Jim_AppendString_sprintf(Jim_Interp *interp, Jim_Obj *objPtr, const char *fmt, ... )
 {
        char *buf;
        va_list ap;
 
 {
        char *buf;
        va_list ap;
 
-       va_start( ap, fmt );
-       buf = jim_vasprintf( fmt, ap );
+       va_start(ap, fmt );
+       buf = jim_vasprintf(fmt, ap );
        va_end(ap);
 
        va_end(ap);
 
-       if ( buf ){
-               Jim_AppendString( interp, objPtr, buf, -1 );
+       if (buf ){
+               Jim_AppendString(interp, objPtr, buf, -1 );
                jim_vasprintf_done(buf);
        }
 }
                jim_vasprintf_done(buf);
        }
 }
@@ -2283,10 +2283,10 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
                haveprec = 0;
                prec = -1; /* not found yet */
     next_fmt:
                haveprec = 0;
                prec = -1; /* not found yet */
     next_fmt:
-               if ( fmtLen <= 0 ){
+               if (fmtLen <= 0 ){
                        break;
                }
                        break;
                }
-               switch ( *fmt ){
+               switch (*fmt ){
                        /* terminals */
         case 'b': /* binary - not all printfs() do this */
                case 's': /* string */
                        /* terminals */
         case 'b': /* binary - not all printfs() do this */
                case 's': /* string */
@@ -2341,11 +2341,11 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
                case '8':
                case '9':
                        accum = 0;
                case '8':
                case '9':
                        accum = 0;
-                       while ( isdigit(*fmt) && (fmtLen > 0) ){
+                       while (isdigit(*fmt) && (fmtLen > 0) ){
                                accum = (accum * 10) + (*fmt - '0');
                                fmt++;  fmtLen--;
                        }
                                accum = (accum * 10) + (*fmt - '0');
                                fmt++;  fmtLen--;
                        }
-                       if ( inprec ){
+                       if (inprec ){
                                haveprec = 1;
                                prec = accum;
                        } else {
                                haveprec = 1;
                                prec = accum;
                        } else {
@@ -2356,24 +2356,24 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
                        /* suck up the next item as an integer */
                        fmt++;  fmtLen--;
                        objc--;
                        /* suck up the next item as an integer */
                        fmt++;  fmtLen--;
                        objc--;
-                       if ( objc <= 0 ){
+                       if (objc <= 0 ){
                                goto not_enough_args;
                        }
                                goto not_enough_args;
                        }
-                       if ( Jim_GetWide(interp,objv[0],&wideValue )== JIM_ERR ){
+                       if (Jim_GetWide(interp,objv[0],&wideValue )== JIM_ERR ){
                                Jim_FreeNewObj(interp, resObjPtr );
                                return NULL;
                        }
                                Jim_FreeNewObj(interp, resObjPtr );
                                return NULL;
                        }
-                       if ( inprec ){
+                       if (inprec ){
                                haveprec = 1;
                                prec = wideValue;
                                haveprec = 1;
                                prec = wideValue;
-                               if ( prec < 0 ){
+                               if (prec < 0 ){
                                        /* man 3 printf says */
                                        /* if prec is negative, it is zero */
                                        prec = 0;
                                }
                        } else {
                        width = wideValue;
                                        /* man 3 printf says */
                                        /* if prec is negative, it is zero */
                                        prec = 0;
                                }
                        } else {
                        width = wideValue;
-                       if ( width < 0 ){
+                       if (width < 0 ){
                                ljust = 1;
                                width = -width;
                        }
                                ljust = 1;
                                width = -width;
                        }
@@ -2402,33 +2402,33 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
                 */
                cp = fmt_str;
                *cp++ = '%';
                 */
                cp = fmt_str;
                *cp++ = '%';
-               if ( altfm ){
+               if (altfm ){
                        *cp++ = '#';
                }
                        *cp++ = '#';
                }
-               if ( forceplus ){
+               if (forceplus ){
                        *cp++ = '+';
                        *cp++ = '+';
-               } else if ( spad ){
+               } else if (spad ){
                        /* PLUS overrides */
                        *cp++ = ' ';
                }
                        /* PLUS overrides */
                        *cp++ = ' ';
                }
-               if ( ljust ){
+               if (ljust ){
                        *cp++ = '-';
                }
                        *cp++ = '-';
                }
-               if ( zpad  ){
+               if (zpad  ){
                        *cp++ = '0';
                }
                        *cp++ = '0';
                }
-               if ( width > 0 ){
-                       sprintf( cp, "%d", width );
+               if (width > 0 ){
+                       sprintf(cp, "%d", width );
                        /* skip ahead */
                        cp = strchr(cp,0);
                }
                /* did we find a period? */
                        /* skip ahead */
                        cp = strchr(cp,0);
                }
                /* did we find a period? */
-               if ( inprec ){
+               if (inprec ){
                        /* then add it */
                        *cp++ = '.';
                        /* did something occur after the period? */
                        /* then add it */
                        *cp++ = '.';
                        /* did something occur after the period? */
-                       if ( haveprec ){
-                               sprintf( cp, "%d", prec );
+                       if (haveprec ){
+                               sprintf(cp, "%d", prec );
                        }
                        cp = strchr(cp,0);
                }
                        }
                        cp = strchr(cp,0);
                }
@@ -2441,7 +2441,7 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
                        *cp++ = 's';
                        *cp   = 0;
                        /* BUG: we do not handled embeded NULLs */
                        *cp++ = 's';
                        *cp   = 0;
                        /* BUG: we do not handled embeded NULLs */
-                       snprintf( sprintf_buf, JIM_MAX_FMT, fmt_str, Jim_GetString( objv[0], NULL ));
+                       snprintf(sprintf_buf, JIM_MAX_FMT, fmt_str, Jim_GetString(objv[0], NULL ));
             break;
         case 'c':
                        *cp++ = 'c';
             break;
         case 'c':
                        *cp++ = 'c';
@@ -2451,7 +2451,7 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
                 return NULL;
             }
             c = (char) wideValue;
                 return NULL;
             }
             c = (char) wideValue;
-                       snprintf( sprintf_buf, JIM_MAX_FMT, fmt_str, c );
+                       snprintf(sprintf_buf, JIM_MAX_FMT, fmt_str, c );
             break;
                case 'f':
                case 'F':
             break;
                case 'f':
                case 'F':
@@ -2461,11 +2461,11 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
                case 'E':
                        *cp++ = *fmt;
                        *cp   = 0;
                case 'E':
                        *cp++ = *fmt;
                        *cp   = 0;
-                       if ( Jim_GetDouble( interp, objv[0], &doubleValue ) == JIM_ERR ){
-                               Jim_FreeNewObj( interp, resObjPtr );
+                       if (Jim_GetDouble(interp, objv[0], &doubleValue ) == JIM_ERR ){
+                               Jim_FreeNewObj(interp, resObjPtr );
                                return NULL;
                        }
                                return NULL;
                        }
-                       snprintf( sprintf_buf, JIM_MAX_FMT, fmt_str, doubleValue );
+                       snprintf(sprintf_buf, JIM_MAX_FMT, fmt_str, doubleValue );
                        break;
         case 'b':
         case 'd':
                        break;
         case 'b':
         case 'd':
@@ -2475,7 +2475,7 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
                case 'x':
                case 'X':
                        /* jim widevaluse are 64bit */
                case 'x':
                case 'X':
                        /* jim widevaluse are 64bit */
-                       if ( sizeof(jim_wide) == sizeof(long long) ){
+                       if (sizeof(jim_wide) == sizeof(long long) ){
                                *cp++ = 'l'; 
                                *cp++ = 'l';
                        } else {
                                *cp++ = 'l'; 
                                *cp++ = 'l';
                        } else {
@@ -2509,7 +2509,7 @@ static Jim_Obj *Jim_FormatString_Inner(Jim_Interp *interp, Jim_Obj *fmtObjPtr,
 #endif
                
                sprintf_buf[ JIM_MAX_FMT - 1] = 0;
 #endif
                
                sprintf_buf[ JIM_MAX_FMT - 1] = 0;
-               Jim_AppendString( interp, resObjPtr, sprintf_buf, strlen(sprintf_buf) );
+               Jim_AppendString(interp, resObjPtr, sprintf_buf, strlen(sprintf_buf) );
                /* next obj */
                objv++;
         fmt++;
                /* next obj */
                objv++;
         fmt++;
@@ -2626,13 +2626,13 @@ int Jim_GetNvp(Jim_Interp *interp,
        Jim_Nvp *n;
        int e;
 
        Jim_Nvp *n;
        int e;
 
-       e = Jim_Nvp_name2value_obj( interp, nvp_table, objPtr, &n );
-       if ( e == JIM_ERR ){
+       e = Jim_Nvp_name2value_obj(interp, nvp_table, objPtr, &n );
+       if (e == JIM_ERR ){
                return e;
        }
 
        /* Success? found? */
                return e;
        }
 
        /* Success? found? */
-       if ( n->name ){
+       if (n->name ){
                /* remove const */
                *result = (Jim_Nvp *)n;
                return JIM_OK;
                /* remove const */
                *result = (Jim_Nvp *)n;
                return JIM_OK;
@@ -4424,11 +4424,11 @@ Jim_Interp *Jim_CreateInterp(void)
     i->cookie_stdin = stdin;
     i->cookie_stdout = stdout;
     i->cookie_stderr = stderr;
     i->cookie_stdin = stdin;
     i->cookie_stdout = stdout;
     i->cookie_stderr = stderr;
-       i->cb_fwrite   = ((size_t (*)( const void *, size_t, size_t, void *))(fwrite));
-       i->cb_fread    = ((size_t (*)(       void *, size_t, size_t, void *))(fread));
-       i->cb_vfprintf = ((int    (*)( void *, const char *fmt, va_list ))(vfprintf));
-       i->cb_fflush   = ((int    (*)( void *))(fflush));
-       i->cb_fgets    = ((char * (*)( char *, int, void *))(fgets));
+       i->cb_fwrite   = ((size_t (*)(const void *, size_t, size_t, void *))(fwrite));
+       i->cb_fread    = ((size_t (*)(void *, size_t, size_t, void *))(fread));
+       i->cb_vfprintf = ((int    (*)(void *, const char *fmt, va_list ))(vfprintf));
+       i->cb_fflush   = ((int    (*)(void *))(fflush));
+       i->cb_fgets    = ((char * (*)(char *, int, void *))(fgets));
 
     /* Note that we can create objects only after the
      * interpreter liveList and freeList pointers are
 
     /* Note that we can create objects only after the
      * interpreter liveList and freeList pointers are
@@ -4498,23 +4498,23 @@ void Jim_FreeInterp(Jim_Interp *i)
     if (i->liveList != NULL) {
         Jim_Obj *objPtr = i->liveList;
     
     if (i->liveList != NULL) {
         Jim_Obj *objPtr = i->liveList;
     
-        Jim_fprintf( i, i->cookie_stdout,JIM_NL "-------------------------------------" JIM_NL);
-        Jim_fprintf( i, i->cookie_stdout,"Objects still in the free list:" JIM_NL);
+        Jim_fprintf(i, i->cookie_stdout,JIM_NL "-------------------------------------" JIM_NL);
+        Jim_fprintf(i, i->cookie_stdout,"Objects still in the free list:" JIM_NL);
         while (objPtr) {
             const char *type = objPtr->typePtr ?
                 objPtr->typePtr->name : "";
         while (objPtr) {
             const char *type = objPtr->typePtr ?
                 objPtr->typePtr->name : "";
-            Jim_fprintf( i, i->cookie_stdout,"%p \"%-10s\": '%.20s' (refCount: %d)" JIM_NL,
+            Jim_fprintf(i, i->cookie_stdout,"%p \"%-10s\": '%.20s' (refCount: %d)" JIM_NL,
                     objPtr, type,
                     objPtr->bytes ? objPtr->bytes
                     : "(null)", objPtr->refCount);
             if (objPtr->typePtr == &sourceObjType) {
                     objPtr, type,
                     objPtr->bytes ? objPtr->bytes
                     : "(null)", objPtr->refCount);
             if (objPtr->typePtr == &sourceObjType) {
-                Jim_fprintf( i, i->cookie_stdout, "FILE %s LINE %d" JIM_NL,
+                Jim_fprintf(i, i->cookie_stdout, "FILE %s LINE %d" JIM_NL,
                 objPtr->internalRep.sourceValue.fileName,
                 objPtr->internalRep.sourceValue.lineNumber);
             }
             objPtr = objPtr->nextObjPtr;
         }
                 objPtr->internalRep.sourceValue.fileName,
                 objPtr->internalRep.sourceValue.lineNumber);
             }
             objPtr = objPtr->nextObjPtr;
         }
-        Jim_fprintf( i, i->cookie_stdout, "-------------------------------------" JIM_NL JIM_NL);
+        Jim_fprintf(i, i->cookie_stdout, "-------------------------------------" JIM_NL JIM_NL);
         Jim_Panic(i,"Live list non empty freeing the interpreter! Leak?");
     }
     /* Free all the freed objects. */
         Jim_Panic(i,"Live list non empty freeing the interpreter! Leak?");
     }
     /* Free all the freed objects. */
@@ -6352,7 +6352,7 @@ int JimParseExprNumber(struct JimParserCtx *pc)
     if (*pc->p == '-') {
         pc->p++; pc->len--;
     }
     if (*pc->p == '-') {
         pc->p++; pc->len--;
     }
-    while (  isdigit((int)*pc->p) 
+    while (isdigit((int)*pc->p) 
           || (allowhex && isxdigit((int)*pc->p) )
           || (allowdot && *pc->p == '.') 
           || (pc->p-pc->tstart == 1 && *pc->tstart == '0' &&
           || (allowhex && isxdigit((int)*pc->p) )
           || (allowdot && *pc->p == '.') 
           || (pc->p-pc->tstart == 1 && *pc->tstart == '0' &&
@@ -8684,7 +8684,7 @@ int Jim_EvalObj(Jim_Interp *interp, Jim_Obj *scriptObjPtr)
             Jim_Obj **eargv = NULL;
 
             for (j = 0; j < argc; j++) {
             Jim_Obj **eargv = NULL;
 
             for (j = 0; j < argc; j++) {
-                Jim_ExpandArgument( interp, &eargv, &eargc,
+                Jim_ExpandArgument(interp, &eargv, &eargc,
                         ecs[j] < 0, argv[j]);
             }
             if (argv != sargv)
                         ecs[j] < 0, argv[j]);
             }
             if (argv != sargv)
@@ -8894,8 +8894,8 @@ int Jim_Eval_Named(Jim_Interp *interp, const char *script, const char *filename,
     Jim_IncrRefCount(scriptObjPtr);
 
 
     Jim_IncrRefCount(scriptObjPtr);
 
 
-       if ( filename ){
-               JimSetSourceInfo( interp, scriptObjPtr, filename, lineno );
+       if (filename ){
+               JimSetSourceInfo(interp, scriptObjPtr, filename, lineno );
        }
 
     retval = Jim_EvalObj(interp, scriptObjPtr);
        }
 
     retval = Jim_EvalObj(interp, scriptObjPtr);
@@ -8905,7 +8905,7 @@ int Jim_Eval_Named(Jim_Interp *interp, const char *script, const char *filename,
 
 int Jim_Eval(Jim_Interp *interp, const char *script)
 {
 
 int Jim_Eval(Jim_Interp *interp, const char *script)
 {
-       return Jim_Eval_Named( interp, script, NULL, 0 );
+       return Jim_Eval_Named(interp, script, NULL, 0 );
 }
 
 
 }
 
 
@@ -8942,7 +8942,7 @@ int Jim_EvalObjBackground(Jim_Interp *interp, Jim_Obj *scriptObjPtr)
         Jim_IncrRefCount(objv[1]);
         if (Jim_EvalObjVector(interp, 2, objv) != JIM_OK) {
             /* Report the error to stderr. */
         Jim_IncrRefCount(objv[1]);
         if (Jim_EvalObjVector(interp, 2, objv) != JIM_OK) {
             /* Report the error to stderr. */
-            Jim_fprintf( interp, interp->cookie_stderr, "Background error:" JIM_NL);
+            Jim_fprintf(interp, interp->cookie_stderr, "Background error:" JIM_NL);
             Jim_PrintErrorMessage(interp);
         }
         Jim_DecrRefCount(interp, objv[0]);
             Jim_PrintErrorMessage(interp);
         }
         Jim_DecrRefCount(interp, objv[0]);
@@ -8963,7 +8963,7 @@ int Jim_EvalFile(Jim_Interp *interp, const char *filename)
        const int cwd_len = 2048;
                char *cwd = malloc(cwd_len);
         Jim_SetResult(interp, Jim_NewEmptyStringObj(interp));
        const int cwd_len = 2048;
                char *cwd = malloc(cwd_len);
         Jim_SetResult(interp, Jim_NewEmptyStringObj(interp));
-       if (!getcwd( cwd, cwd_len )) strcpy(cwd, "unknown");
+       if (!getcwd(cwd, cwd_len )) strcpy(cwd, "unknown");
         Jim_AppendStrings(interp, Jim_GetResult(interp),
        "Error loading script \"", filename, "\"",
            " cwd: ", cwd,
         Jim_AppendStrings(interp, Jim_GetResult(interp),
        "Error loading script \"", filename, "\"",
            " cwd: ", cwd,
@@ -9523,7 +9523,7 @@ static int Jim_PutsCoreCommand(Jim_Interp *interp, int argc,
     }
     str = Jim_GetString(argv[1], &len);
     Jim_fwrite(interp, str, 1, len, interp->cookie_stdout);
     }
     str = Jim_GetString(argv[1], &len);
     Jim_fwrite(interp, str, 1, len, interp->cookie_stdout);
-    if (!nonewline) Jim_fprintf( interp, interp->cookie_stdout, JIM_NL);
+    if (!nonewline) Jim_fprintf(interp, interp->cookie_stdout, JIM_NL);
     return JIM_OK;
 }
 
     return JIM_OK;
 }
 
@@ -12320,16 +12320,16 @@ void Jim_PrintErrorMessage(Jim_Interp *interp)
                 JIM_NONE);
         line = Jim_GetString(objPtr, NULL);
         if (*proc) {
                 JIM_NONE);
         line = Jim_GetString(objPtr, NULL);
         if (*proc) {
-            Jim_fprintf( interp, interp->cookie_stderr,
+            Jim_fprintf(interp, interp->cookie_stderr,
                     "in procedure '%s' ", proc);
         }
         if (*file) {
                     "in procedure '%s' ", proc);
         }
         if (*file) {
-            Jim_fprintf( interp, interp->cookie_stderr,
+            Jim_fprintf(interp, interp->cookie_stderr,
                     "called at file \"%s\", line %s",
                     file, line);
         }
         if (*file || *proc) {
                     "called at file \"%s\", line %s",
                     file, line);
         }
         if (*file || *proc) {
-            Jim_fprintf( interp, interp->cookie_stderr, JIM_NL);
+            Jim_fprintf(interp, interp->cookie_stderr, JIM_NL);
         }
     }
 }
         }
     }
 }
@@ -12357,8 +12357,8 @@ int Jim_InteractivePrompt(Jim_Interp *interp)
             else
                 Jim_fprintf(interp,interp->cookie_stdout, "[%d] . ", retcode);
         } else
             else
                 Jim_fprintf(interp,interp->cookie_stdout, "[%d] . ", retcode);
         } else
-            Jim_fprintf( interp, interp->cookie_stdout, ". ");
-        Jim_fflush( interp, interp->cookie_stdout);
+            Jim_fprintf(interp, interp->cookie_stdout, ". ");
+        Jim_fflush(interp, interp->cookie_stdout);
         scriptObjPtr = Jim_NewStringObj(interp, "", 0);
         Jim_IncrRefCount(scriptObjPtr);
         while (1) {
         scriptObjPtr = Jim_NewStringObj(interp, "", 0);
         Jim_IncrRefCount(scriptObjPtr);
         while (1) {
@@ -12366,7 +12366,7 @@ int Jim_InteractivePrompt(Jim_Interp *interp)
             char state;
             int len;
 
             char state;
             int len;
 
-            if ( Jim_fgets(interp, buf, 1024, interp->cookie_stdin) == NULL) {
+            if (Jim_fgets(interp, buf, 1024, interp->cookie_stdin) == NULL) {
                 Jim_DecrRefCount(interp, scriptObjPtr);
                 goto out;
             }
                 Jim_DecrRefCount(interp, scriptObjPtr);
                 goto out;
             }
@@ -12374,8 +12374,8 @@ int Jim_InteractivePrompt(Jim_Interp *interp)
             str = Jim_GetString(scriptObjPtr, &len);
             if (Jim_ScriptIsComplete(str, len, &state))
                 break;
             str = Jim_GetString(scriptObjPtr, &len);
             if (Jim_ScriptIsComplete(str, len, &state))
                 break;
-            Jim_fprintf( interp, interp->cookie_stdout, "%c> ", state);
-            Jim_fflush( interp, interp->cookie_stdout);
+            Jim_fprintf(interp, interp->cookie_stdout, "%c> ", state);
+            Jim_fflush(interp, interp->cookie_stdout);
         }
         retcode = Jim_EvalObj(interp, scriptObjPtr);
         Jim_DecrRefCount(interp, scriptObjPtr);
         }
         retcode = Jim_EvalObj(interp, scriptObjPtr);
         Jim_DecrRefCount(interp, scriptObjPtr);
@@ -12386,8 +12386,8 @@ int Jim_InteractivePrompt(Jim_Interp *interp)
             exit(Jim_GetExitCode(interp));
         } else {
             if (reslen) {
             exit(Jim_GetExitCode(interp));
         } else {
             if (reslen) {
-                               Jim_fwrite( interp, result, 1, reslen, interp->cookie_stdout);
-                               Jim_fprintf( interp,interp->cookie_stdout, JIM_NL);
+                               Jim_fwrite(interp, result, 1, reslen, interp->cookie_stdout);
+                               Jim_fprintf(interp,interp->cookie_stdout, JIM_NL);
             }
         }
     }
             }
         }
     }
@@ -12399,66 +12399,66 @@ out:
  * Jim's idea of STDIO..
  * ---------------------------------------------------------------------------*/
 
  * Jim's idea of STDIO..
  * ---------------------------------------------------------------------------*/
 
-int Jim_fprintf( Jim_Interp *interp, void *cookie, const char *fmt, ... )
+int Jim_fprintf(Jim_Interp *interp, void *cookie, const char *fmt, ... )
 {
        int r;
 
        va_list ap;
        va_start(ap,fmt);
 {
        int r;
 
        va_list ap;
        va_start(ap,fmt);
-       r = Jim_vfprintf( interp, cookie, fmt,ap );
+       r = Jim_vfprintf(interp, cookie, fmt,ap );
        va_end(ap);
        return r;
 }
 
        va_end(ap);
        return r;
 }
 
-int Jim_vfprintf( Jim_Interp *interp, void *cookie, const char *fmt, va_list ap )
+int Jim_vfprintf(Jim_Interp *interp, void *cookie, const char *fmt, va_list ap )
 {
 {
-       if ( (interp == NULL) || (interp->cb_vfprintf == NULL) ){
+       if ((interp == NULL) || (interp->cb_vfprintf == NULL) ){
                errno = ENOTSUP;
                return -1;
        }
                errno = ENOTSUP;
                return -1;
        }
-       return (*(interp->cb_vfprintf))( cookie, fmt, ap );
+       return (*(interp->cb_vfprintf))(cookie, fmt, ap );
 }
 
 }
 
-size_t Jim_fwrite( Jim_Interp *interp, const void *ptr, size_t size, size_t n, void *cookie )
+size_t Jim_fwrite(Jim_Interp *interp, const void *ptr, size_t size, size_t n, void *cookie )
 {
 {
-       if ( (interp == NULL) || (interp->cb_fwrite == NULL) ){
+       if ((interp == NULL) || (interp->cb_fwrite == NULL) ){
                errno = ENOTSUP;
                return 0;
        }
                errno = ENOTSUP;
                return 0;
        }
-       return (*(interp->cb_fwrite))( ptr, size, n, cookie);
+       return (*(interp->cb_fwrite))(ptr, size, n, cookie);
 }
 
 }
 
-size_t Jim_fread( Jim_Interp *interp, void *ptr, size_t size, size_t n, void *cookie )
+size_t Jim_fread(Jim_Interp *interp, void *ptr, size_t size, size_t n, void *cookie )
 {
 {
-       if ( (interp == NULL) || (interp->cb_fread == NULL) ){
+       if ((interp == NULL) || (interp->cb_fread == NULL) ){
                errno = ENOTSUP;
                return 0;
        }
                errno = ENOTSUP;
                return 0;
        }
-       return (*(interp->cb_fread))( ptr, size, n, cookie);
+       return (*(interp->cb_fread))(ptr, size, n, cookie);
 }
 
 }
 
-int Jim_fflush( Jim_Interp *interp, void *cookie )
+int Jim_fflush(Jim_Interp *interp, void *cookie )
 {
 {
-       if ( (interp == NULL) || (interp->cb_fflush == NULL) ){
+       if ((interp == NULL) || (interp->cb_fflush == NULL) ){
                /* pretend all is well */
                return 0;
        }
                /* pretend all is well */
                return 0;
        }
-       return (*(interp->cb_fflush))( cookie );
+       return (*(interp->cb_fflush))(cookie );
 }
 
 }
 
-char* Jim_fgets( Jim_Interp *interp, char *s, int size, void *cookie )
+char* Jim_fgets(Jim_Interp *interp, char *s, int size, void *cookie )
 {
 {
-       if ( (interp == NULL) || (interp->cb_fgets == NULL) ){
+       if ((interp == NULL) || (interp->cb_fgets == NULL) ){
                errno = ENOTSUP;
                return NULL;
        }
                errno = ENOTSUP;
                return NULL;
        }
-       return (*(interp->cb_fgets))( s, size, cookie );
+       return (*(interp->cb_fgets))(s, size, cookie );
 }
 Jim_Nvp *
 }
 Jim_Nvp *
-Jim_Nvp_name2value_simple( const Jim_Nvp *p, const char *name )
+Jim_Nvp_name2value_simple(const Jim_Nvp *p, const char *name )
 {
 {
-       while ( p->name ){
-               if ( 0 == strcmp( name, p->name ) ){
+       while (p->name ){
+               if (0 == strcmp(name, p->name ) ){
                        break;
                }
                p++;
                        break;
                }
                p++;
@@ -12467,10 +12467,10 @@ Jim_Nvp_name2value_simple( const Jim_Nvp *p, const char *name )
 }
 
 Jim_Nvp *
 }
 
 Jim_Nvp *
-Jim_Nvp_name2value_nocase_simple( const Jim_Nvp *p, const char *name )
+Jim_Nvp_name2value_nocase_simple(const Jim_Nvp *p, const char *name )
 {
 {
-       while ( p->name ){
-               if ( 0 == strcasecmp( name, p->name ) ){
+       while (p->name ){
+               if (0 == strcasecmp(name, p->name ) ){
                        break;
                }
                p++;
                        break;
                }
                p++;
@@ -12479,32 +12479,32 @@ Jim_Nvp_name2value_nocase_simple( const Jim_Nvp *p, const char *name )
 }
 
 int
 }
 
 int
-Jim_Nvp_name2value_obj( Jim_Interp *interp, 
+Jim_Nvp_name2value_obj(Jim_Interp *interp, 
                                                const Jim_Nvp *p, 
                                                Jim_Obj *o, 
                                                Jim_Nvp **result )
 {
                                                const Jim_Nvp *p, 
                                                Jim_Obj *o, 
                                                Jim_Nvp **result )
 {
-       return Jim_Nvp_name2value( interp, p, Jim_GetString( o, NULL ), result );
+       return Jim_Nvp_name2value(interp, p, Jim_GetString(o, NULL ), result );
 }
        
 
 int 
 }
        
 
 int 
-Jim_Nvp_name2value( Jim_Interp *interp, 
+Jim_Nvp_name2value(Jim_Interp *interp, 
                                        const Jim_Nvp *_p, 
                                        const char *name, 
                                        Jim_Nvp **result)
 {
        const Jim_Nvp *p;
 
                                        const Jim_Nvp *_p, 
                                        const char *name, 
                                        Jim_Nvp **result)
 {
        const Jim_Nvp *p;
 
-       p = Jim_Nvp_name2value_simple( _p, name );
+       p = Jim_Nvp_name2value_simple(_p, name );
 
        /* result */
 
        /* result */
-       if ( result ){
+       if (result ){
                *result = (Jim_Nvp *)(p);
        }
        
        /* found? */
                *result = (Jim_Nvp *)(p);
        }
        
        /* found? */
-       if ( p->name ){
+       if (p->name ){
                return JIM_OK;
        } else {
                return JIM_ERR;
                return JIM_OK;
        } else {
                return JIM_ERR;
@@ -12512,23 +12512,23 @@ Jim_Nvp_name2value( Jim_Interp *interp,
 }
 
 int
 }
 
 int
-Jim_Nvp_name2value_obj_nocase( Jim_Interp *interp, const Jim_Nvp *p, Jim_Obj *o, Jim_Nvp **puthere )
+Jim_Nvp_name2value_obj_nocase(Jim_Interp *interp, const Jim_Nvp *p, Jim_Obj *o, Jim_Nvp **puthere )
 {
 {
-       return Jim_Nvp_name2value_nocase( interp, p, Jim_GetString( o, NULL ), puthere );
+       return Jim_Nvp_name2value_nocase(interp, p, Jim_GetString(o, NULL ), puthere );
 }
 
 int
 }
 
 int
-Jim_Nvp_name2value_nocase( Jim_Interp *interp, const Jim_Nvp *_p, const char *name, Jim_Nvp **puthere )
+Jim_Nvp_name2value_nocase(Jim_Interp *interp, const Jim_Nvp *_p, const char *name, Jim_Nvp **puthere )
 {
        const Jim_Nvp *p;
 
 {
        const Jim_Nvp *p;
 
-       p = Jim_Nvp_name2value_nocase_simple( _p, name );
+       p = Jim_Nvp_name2value_nocase_simple(_p, name );
 
 
-       if ( puthere ){
+       if (puthere ){
                *puthere = (Jim_Nvp *)(p);
        }
        /* found */
                *puthere = (Jim_Nvp *)(p);
        }
        /* found */
-       if ( p->name ){
+       if (p->name ){
                return JIM_OK;
        } else {
                return JIM_ERR;
                return JIM_OK;
        } else {
                return JIM_ERR;
@@ -12537,24 +12537,24 @@ Jim_Nvp_name2value_nocase( Jim_Interp *interp, const Jim_Nvp *_p, const char *na
 
 
 int 
 
 
 int 
-Jim_Nvp_value2name_obj( Jim_Interp *interp, const Jim_Nvp *p, Jim_Obj *o, Jim_Nvp **result )
+Jim_Nvp_value2name_obj(Jim_Interp *interp, const Jim_Nvp *p, Jim_Obj *o, Jim_Nvp **result )
 {
        int e;;
        jim_wide w;
 
 {
        int e;;
        jim_wide w;
 
-       e = Jim_GetWide( interp, o, &w );
-       if ( e != JIM_OK ){
+       e = Jim_GetWide(interp, o, &w );
+       if (e != JIM_OK ){
                return e;
        }
 
                return e;
        }
 
-       return Jim_Nvp_value2name( interp, p, w, result );
+       return Jim_Nvp_value2name(interp, p, w, result );
 }
 
 Jim_Nvp *
 }
 
 Jim_Nvp *
-Jim_Nvp_value2name_simple( const Jim_Nvp *p, int value )
+Jim_Nvp_value2name_simple(const Jim_Nvp *p, int value )
 {
 {
-       while ( p->name ){
-               if ( value == p->value ){
+       while (p->name ){
+               if (value == p->value ){
                        break;
                }
                p++;
                        break;
                }
                p++;
@@ -12564,17 +12564,17 @@ Jim_Nvp_value2name_simple( const Jim_Nvp *p, int value )
 
 
 int 
 
 
 int 
-Jim_Nvp_value2name( Jim_Interp *interp, const Jim_Nvp *_p, int value, Jim_Nvp **result )
+Jim_Nvp_value2name(Jim_Interp *interp, const Jim_Nvp *_p, int value, Jim_Nvp **result )
 {
        const Jim_Nvp *p;
 
 {
        const Jim_Nvp *p;
 
-       p = Jim_Nvp_value2name_simple( _p, value );
+       p = Jim_Nvp_value2name_simple(_p, value );
 
 
-       if ( result ){
+       if (result ){
                *result = (Jim_Nvp *)(p);
        }
 
                *result = (Jim_Nvp *)(p);
        }
 
-       if ( p->name ){
+       if (p->name ){
                return JIM_OK;
        } else {
                return JIM_ERR;
                return JIM_OK;
        } else {
                return JIM_ERR;
@@ -12583,9 +12583,9 @@ Jim_Nvp_value2name( Jim_Interp *interp, const Jim_Nvp *_p, int value, Jim_Nvp **
 
 
 int
 
 
 int
-Jim_GetOpt_Setup( Jim_GetOptInfo *p, Jim_Interp *interp, int argc, Jim_Obj * const *  argv)
+Jim_GetOpt_Setup(Jim_GetOptInfo *p, Jim_Interp *interp, int argc, Jim_Obj * const *  argv)
 {
 {
-       memset( p, 0, sizeof(*p) );
+       memset(p, 0, sizeof(*p) );
        p->interp = interp;
        p->argc   = argc;
        p->argv   = argv;
        p->interp = interp;
        p->argc   = argc;
        p->argv   = argv;
@@ -12594,37 +12594,37 @@ Jim_GetOpt_Setup( Jim_GetOptInfo *p, Jim_Interp *interp, int argc, Jim_Obj * con
 }
 
 void
 }
 
 void
-Jim_GetOpt_Debug( Jim_GetOptInfo *p )
+Jim_GetOpt_Debug(Jim_GetOptInfo *p )
 {
        int x;
 
 {
        int x;
 
-       Jim_fprintf( p->interp, p->interp->cookie_stderr, "---args---\n");
-       for ( x = 0 ; x < p->argc ; x++ ){
-               Jim_fprintf( p->interp, p->interp->cookie_stderr, 
+       Jim_fprintf(p->interp, p->interp->cookie_stderr, "---args---\n");
+       for (x = 0 ; x < p->argc ; x++ ){
+               Jim_fprintf(p->interp, p->interp->cookie_stderr, 
                                         "%2d) %s\n", 
                                         x, 
                                         "%2d) %s\n", 
                                         x, 
-                                        Jim_GetString( p->argv[x], NULL ) );
+                                        Jim_GetString(p->argv[x], NULL ) );
        }
        }
-       Jim_fprintf( p->interp, p->interp->cookie_stderr, "-------\n");
+       Jim_fprintf(p->interp, p->interp->cookie_stderr, "-------\n");
 }
 
 
 int
 }
 
 
 int
-Jim_GetOpt_Obj( Jim_GetOptInfo *goi, Jim_Obj **puthere )
+Jim_GetOpt_Obj(Jim_GetOptInfo *goi, Jim_Obj **puthere )
 {
        Jim_Obj *o;
        
        o = NULL; // failure 
 {
        Jim_Obj *o;
        
        o = NULL; // failure 
-       if ( goi->argc ){
+       if (goi->argc ){
                // success 
                o = goi->argv[0];
                goi->argc -= 1;
                goi->argv += 1;
        }
                // success 
                o = goi->argv[0];
                goi->argc -= 1;
                goi->argv += 1;
        }
-       if ( puthere ){
+       if (puthere ){
                *puthere = o;
        }
                *puthere = o;
        }
-       if ( o != NULL ){
+       if (o != NULL ){
                return JIM_OK;
        } else {
                return JIM_ERR;
                return JIM_OK;
        } else {
                return JIM_ERR;
@@ -12632,17 +12632,17 @@ Jim_GetOpt_Obj( Jim_GetOptInfo *goi, Jim_Obj **puthere )
 }
 
 int
 }
 
 int
-Jim_GetOpt_String( Jim_GetOptInfo *goi, char **puthere, int *len )
+Jim_GetOpt_String(Jim_GetOptInfo *goi, char **puthere, int *len )
 {
        int r;
        Jim_Obj *o;
        const char *cp;
 
 
 {
        int r;
        Jim_Obj *o;
        const char *cp;
 
 
-       r = Jim_GetOpt_Obj( goi, &o );
-       if ( r == JIM_OK ){
-               cp = Jim_GetString( o, len );
-               if ( puthere ){
+       r = Jim_GetOpt_Obj(goi, &o );
+       if (r == JIM_OK ){
+               cp = Jim_GetString(o, len );
+               if (puthere ){
                        /* remove const */
                        *puthere = (char *)(cp);
                }
                        /* remove const */
                        *puthere = (char *)(cp);
                }
@@ -12651,47 +12651,47 @@ Jim_GetOpt_String( Jim_GetOptInfo *goi, char **puthere, int *len )
 }
 
 int
 }
 
 int
-Jim_GetOpt_Double( Jim_GetOptInfo *goi, double *puthere )
+Jim_GetOpt_Double(Jim_GetOptInfo *goi, double *puthere )
 {
        int r;
        Jim_Obj *o;
        double _safe;
        
 {
        int r;
        Jim_Obj *o;
        double _safe;
        
-       if ( puthere == NULL ){
+       if (puthere == NULL ){
                puthere = &_safe;
        }
 
                puthere = &_safe;
        }
 
-       r = Jim_GetOpt_Obj( goi, &o );
-       if ( r == JIM_OK ){
-               r = Jim_GetDouble( goi->interp, o, puthere );
-               if ( r != JIM_OK ){
-                       Jim_SetResult_sprintf( goi->interp,
+       r = Jim_GetOpt_Obj(goi, &o );
+       if (r == JIM_OK ){
+               r = Jim_GetDouble(goi->interp, o, puthere );
+               if (r != JIM_OK ){
+                       Jim_SetResult_sprintf(goi->interp,
                                                                   "not a number: %s", 
                                                                   "not a number: %s", 
-                                                                  Jim_GetString( o, NULL ) );
+                                                                  Jim_GetString(o, NULL ) );
                }
        }
        return r;
 }
 
 int
                }
        }
        return r;
 }
 
 int
-Jim_GetOpt_Wide( Jim_GetOptInfo *goi, jim_wide *puthere )
+Jim_GetOpt_Wide(Jim_GetOptInfo *goi, jim_wide *puthere )
 {
        int r;
        Jim_Obj *o;
        jim_wide _safe;
 
 {
        int r;
        Jim_Obj *o;
        jim_wide _safe;
 
-       if ( puthere == NULL ){
+       if (puthere == NULL ){
                puthere = &_safe;
        }
 
                puthere = &_safe;
        }
 
-       r = Jim_GetOpt_Obj( goi, &o );
-       if ( r == JIM_OK ){
-               r = Jim_GetWide( goi->interp, o, puthere );
+       r = Jim_GetOpt_Obj(goi, &o );
+       if (r == JIM_OK ){
+               r = Jim_GetWide(goi->interp, o, puthere );
        }
        return r;
 }
 
        }
        return r;
 }
 
-int Jim_GetOpt_Nvp( Jim_GetOptInfo *goi, 
+int Jim_GetOpt_Nvp(Jim_GetOptInfo *goi, 
                                        const Jim_Nvp *nvp, 
                                        Jim_Nvp **puthere)
 {
                                        const Jim_Nvp *nvp, 
                                        Jim_Nvp **puthere)
 {
@@ -12699,13 +12699,13 @@ int Jim_GetOpt_Nvp( Jim_GetOptInfo *goi,
        Jim_Obj *o;
        int e;
 
        Jim_Obj *o;
        int e;
 
-       if ( puthere == NULL ){
+       if (puthere == NULL ){
                puthere = &_safe;
        }
 
                puthere = &_safe;
        }
 
-       e = Jim_GetOpt_Obj( goi, &o );
-       if ( e == JIM_OK ){
-               e = Jim_Nvp_name2value_obj( goi->interp,
+       e = Jim_GetOpt_Obj(goi, &o );
+       if (e == JIM_OK ){
+               e = Jim_Nvp_name2value_obj(goi->interp,
                                                                        nvp, 
                                                                        o,
                                                                        puthere );
                                                                        nvp, 
                                                                        o,
                                                                        puthere );
@@ -12715,17 +12715,17 @@ int Jim_GetOpt_Nvp( Jim_GetOptInfo *goi,
 }
 
 void
 }
 
 void
-Jim_GetOpt_NvpUnknown( Jim_GetOptInfo *goi,
+Jim_GetOpt_NvpUnknown(Jim_GetOptInfo *goi,
                                           const Jim_Nvp *nvptable,
                                           int hadprefix )
 {
                                           const Jim_Nvp *nvptable,
                                           int hadprefix )
 {
-       if ( hadprefix ){
-               Jim_SetResult_NvpUnknown( goi->interp,
+       if (hadprefix ){
+               Jim_SetResult_NvpUnknown(goi->interp,
                                                                  goi->argv[-2],
                                                                  goi->argv[-1],
                                                                  nvptable );
        } else {
                                                                  goi->argv[-2],
                                                                  goi->argv[-1],
                                                                  nvptable );
        } else {
-               Jim_SetResult_NvpUnknown( goi->interp,
+               Jim_SetResult_NvpUnknown(goi->interp,
                                                                  NULL,
                                                                  goi->argv[-1],
                                                                  nvptable );
                                                                  NULL,
                                                                  goi->argv[-1],
                                                                  nvptable );
@@ -12734,7 +12734,7 @@ Jim_GetOpt_NvpUnknown( Jim_GetOptInfo *goi,
                                           
 
 int 
                                           
 
 int 
-Jim_GetOpt_Enum( Jim_GetOptInfo *goi,
+Jim_GetOpt_Enum(Jim_GetOptInfo *goi,
                                 const char * const *  lookup,
                                 int *puthere)
 {
                                 const char * const *  lookup,
                                 int *puthere)
 {
@@ -12742,12 +12742,12 @@ Jim_GetOpt_Enum( Jim_GetOptInfo *goi,
        Jim_Obj *o;
        int e;
 
        Jim_Obj *o;
        int e;
 
-       if ( puthere == NULL ){
+       if (puthere == NULL ){
                puthere = &_safe;
        }
                puthere = &_safe;
        }
-       e = Jim_GetOpt_Obj( goi, &o );
-       if ( e == JIM_OK ){
-               e = Jim_GetEnum( goi->interp,
+       e = Jim_GetOpt_Obj(goi, &o );
+       if (e == JIM_OK ){
+               e = Jim_GetEnum(goi->interp,
                                                 o,
                                                 lookup,
                                                 puthere,
                                                 o,
                                                 lookup,
                                                 puthere,
@@ -12760,16 +12760,16 @@ Jim_GetOpt_Enum( Jim_GetOptInfo *goi,
 
 
 int
 
 
 int
-Jim_SetResult_sprintf( Jim_Interp *interp, const char *fmt,... )
+Jim_SetResult_sprintf(Jim_Interp *interp, const char *fmt,... )
 {
        va_list ap;
        char *buf;
 
        va_start(ap,fmt);
 {
        va_list ap;
        char *buf;
 
        va_start(ap,fmt);
-       buf = jim_vasprintf( fmt, ap );
+       buf = jim_vasprintf(fmt, ap );
        va_end(ap);
        va_end(ap);
-       if ( buf ){
-               Jim_SetResultString( interp, buf, -1 );
+       if (buf ){
+               Jim_SetResultString(interp, buf, -1 );
                jim_vasprintf_done(buf);
        }
        return JIM_OK;
                jim_vasprintf_done(buf);
        }
        return JIM_OK;
@@ -12777,33 +12777,33 @@ Jim_SetResult_sprintf( Jim_Interp *interp, const char *fmt,... )
        
 
 void
        
 
 void
-Jim_SetResult_NvpUnknown( Jim_Interp *interp, 
+Jim_SetResult_NvpUnknown(Jim_Interp *interp, 
                                                  Jim_Obj *param_name,
                                                  Jim_Obj *param_value,
                                                  const Jim_Nvp *nvp )
 {
                                                  Jim_Obj *param_name,
                                                  Jim_Obj *param_value,
                                                  const Jim_Nvp *nvp )
 {
-       if ( param_name ){
-               Jim_SetResult_sprintf( interp,
+       if (param_name ){
+               Jim_SetResult_sprintf(interp,
                                                           "%s: Unknown: %s, try one of: ",
                                                           "%s: Unknown: %s, try one of: ",
-                                                          Jim_GetString( param_name, NULL ),
-                                                          Jim_GetString( param_value, NULL ) );
+                                                          Jim_GetString(param_name, NULL ),
+                                                          Jim_GetString(param_value, NULL ) );
        } else {
        } else {
-               Jim_SetResult_sprintf( interp,
+               Jim_SetResult_sprintf(interp,
                                                           "Unknown param: %s, try one of: ",
                                                           "Unknown param: %s, try one of: ",
-                                                          Jim_GetString( param_value, NULL ) );
+                                                          Jim_GetString(param_value, NULL ) );
        }
        }
-       while ( nvp->name ){
+       while (nvp->name ){
                const char *a;
                const char *b;
 
                const char *a;
                const char *b;
 
-               if ( (nvp + 1)->name ){
+               if ((nvp + 1)->name ){
                        a = nvp->name;
                        b = ", ";
                } else {
                        a = "or ";
                        b = nvp->name;
                }
                        a = nvp->name;
                        b = ", ";
                } else {
                        a = "or ";
                        b = nvp->name;
                }
-               Jim_AppendStrings( interp,
+               Jim_AppendStrings(interp,
                                                   Jim_GetResult(interp),
                                                   a, b, NULL );
                nvp++;
                                                   Jim_GetResult(interp),
                                                   a, b, NULL );
                nvp++;
@@ -12814,22 +12814,22 @@ Jim_SetResult_NvpUnknown( Jim_Interp *interp,
 static Jim_Obj *debug_string_obj;
 
 const char *
 static Jim_Obj *debug_string_obj;
 
 const char *
-Jim_Debug_ArgvString( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
+Jim_Debug_ArgvString(Jim_Interp *interp, int argc, Jim_Obj *const *argv )
 {
        int x;
 
 {
        int x;
 
-       if ( debug_string_obj ){
-               Jim_FreeObj( interp, debug_string_obj );
+       if (debug_string_obj ){
+               Jim_FreeObj(interp, debug_string_obj );
        }
 
        }
 
-       debug_string_obj = Jim_NewEmptyStringObj( interp );
-       for ( x = 0 ; x < argc ; x++ ){
-               Jim_AppendStrings( interp,
+       debug_string_obj = Jim_NewEmptyStringObj(interp );
+       for (x = 0 ; x < argc ; x++ ){
+               Jim_AppendStrings(interp,
                                                   debug_string_obj,
                                                   debug_string_obj,
-                                                  Jim_GetString( argv[x], NULL ),
+                                                  Jim_GetString(argv[x], NULL ),
                                                   " ",
                                                   NULL );
        }
 
                                                   " ",
                                                   NULL );
        }
 
-       return Jim_GetString( debug_string_obj, NULL );
+       return Jim_GetString(debug_string_obj, NULL );
 }
 }
index a5ae150171f897f3e9dc5e8be0ae4a3e1a06d480..99362affa426cff1db73edeffe8f04de65d47450 100644 (file)
@@ -530,11 +530,11 @@ typedef struct Jim_Interp {
     void *cookie_stdin; /* input file pointer, 'stdin' by default */
     void *cookie_stdout; /* output file pointer, 'stdout' by default */
     void *cookie_stderr; /* errors file pointer, 'stderr' by default */
     void *cookie_stdin; /* input file pointer, 'stdin' by default */
     void *cookie_stdout; /* output file pointer, 'stdout' by default */
     void *cookie_stderr; /* errors file pointer, 'stderr' by default */
-    size_t (*cb_fwrite  )( const void *ptr, size_t size, size_t n, void *cookie );
-       size_t (*cb_fread   )( void *ptr, size_t size, size_t n, void *cookie );
-       int    (*cb_vfprintf)( void *cookie, const char *fmt, va_list ap );
-       int    (*cb_fflush  )( void *cookie );
-       char  *(*cb_fgets   )( char *s, int size, void *cookie );
+    size_t (*cb_fwrite  )(const void *ptr, size_t size, size_t n, void *cookie );
+       size_t (*cb_fread   )(void *ptr, size_t size, size_t n, void *cookie );
+       int    (*cb_vfprintf)(void *cookie, const char *fmt, va_list ap );
+       int    (*cb_fflush  )(void *cookie );
+       char  *(*cb_fgets   )(char *s, int size, void *cookie );
 } Jim_Interp;
 
 /* Currently provided as macro that performs the increment.
 } Jim_Interp;
 
 /* Currently provided as macro that performs the increment.
@@ -591,11 +591,11 @@ typedef struct Jim_Reference {
  *      };
  *
  *  Jim_Nvp *result
  *      };
  *
  *  Jim_Nvp *result
- *  e = Jim_Nvp_name2value( interp, yn, "y", &result ); 
+ *  e = Jim_Nvp_name2value(interp, yn, "y", &result ); 
  *         returns &yn[0];
  *         returns &yn[0];
- *  e = Jim_Nvp_name2value( interp, yn, "n", &result );
+ *  e = Jim_Nvp_name2value(interp, yn, "n", &result );
  *         returns &yn[1];
  *         returns &yn[1];
- *  e = Jim_Nvp_name2value( interp, yn, "Blah", &result );
+ *  e = Jim_Nvp_name2value(interp, yn, "Blah", &result );
  *         returns &yn[4];
  * \endcode
  *
  *         returns &yn[4];
  * \endcode
  *
@@ -629,7 +629,7 @@ typedef struct {
 
 #ifdef DOXYGEN
 #define JIM_STATIC 
 
 #ifdef DOXYGEN
 #define JIM_STATIC 
-#define JIM_API( X )  X
+#define JIM_API(X )  X
 #else
 #ifndef __JIM_CORE__
 # if defined JIM_EMBEDDED
 #else
 #ifndef __JIM_CORE__
 # if defined JIM_EMBEDDED
@@ -650,7 +650,7 @@ typedef struct {
 #endif /* DOXYGEN */
 
 /** Set the result - printf() style */
 #endif /* DOXYGEN */
 
 /** Set the result - printf() style */
-JIM_STATIC int JIM_API( Jim_SetResult_sprintf )( Jim_Interp *p, const char *fmt, ... );
+JIM_STATIC int JIM_API(Jim_SetResult_sprintf )(Jim_Interp *p, const char *fmt, ... );
 
 /* Memory allocation */
 JIM_STATIC void * JIM_API(Jim_Alloc) (int size);
 
 /* Memory allocation */
 JIM_STATIC void * JIM_API(Jim_Alloc) (int size);
@@ -660,7 +660,7 @@ JIM_STATIC char * JIM_API(Jim_StrDup) (const char *s);
 /* evaluation */
 JIM_STATIC int JIM_API(Jim_Eval)(Jim_Interp *interp, const char *script);
 /* in C code, you can do this and get better error messages */
 /* evaluation */
 JIM_STATIC int JIM_API(Jim_Eval)(Jim_Interp *interp, const char *script);
 /* in C code, you can do this and get better error messages */
-/*   Jim_Eval_Named( interp, "some tcl commands", __FILE__, __LINE__ ); */
+/*   Jim_Eval_Named(interp, "some tcl commands", __FILE__, __LINE__ ); */
 JIM_STATIC int JIM_API(Jim_Eval_Named)(Jim_Interp *interp, const char *script,const char *filename, int lineno);
 JIM_STATIC int JIM_API(Jim_EvalGlobal)(Jim_Interp *interp, const char *script);
 JIM_STATIC int JIM_API(Jim_EvalFile)(Jim_Interp *interp, const char *filename);
 JIM_STATIC int JIM_API(Jim_Eval_Named)(Jim_Interp *interp, const char *script,const char *filename, int lineno);
 JIM_STATIC int JIM_API(Jim_EvalGlobal)(Jim_Interp *interp, const char *script);
 JIM_STATIC int JIM_API(Jim_EvalFile)(Jim_Interp *interp, const char *filename);
@@ -911,28 +911,28 @@ JIM_STATIC int JIM_API(Jim_InteractivePrompt) (Jim_Interp *interp);
 JIM_STATIC void JIM_API(Jim_Panic) (Jim_Interp *interp, const char *fmt, ...);
 
 /* Jim's STDIO */
 JIM_STATIC void JIM_API(Jim_Panic) (Jim_Interp *interp, const char *fmt, ...);
 
 /* Jim's STDIO */
-JIM_STATIC int     JIM_API( Jim_fprintf  )( Jim_Interp *interp, void *cookie, const char *fmt, ... );
-JIM_STATIC int     JIM_API( Jim_vfprintf )( Jim_Interp *interp, void *cookie, const char *fmt, va_list ap );
-JIM_STATIC size_t  JIM_API( Jim_fwrite   )( Jim_Interp *interp, const void *ptr, size_t size, size_t nmeb, void *cookie );
-JIM_STATIC size_t  JIM_API( Jim_fread    )( Jim_Interp *interp, void *ptr, size_t size, size_t nmeb, void *cookie );
-JIM_STATIC int     JIM_API( Jim_fflush   )( Jim_Interp *interp, void *cookie );
-JIM_STATIC char *  JIM_API( Jim_fgets    )( Jim_Interp *interp, char *s, int size, void *cookie );
+JIM_STATIC int     JIM_API(Jim_fprintf  )(Jim_Interp *interp, void *cookie, const char *fmt, ... );
+JIM_STATIC int     JIM_API(Jim_vfprintf )(Jim_Interp *interp, void *cookie, const char *fmt, va_list ap );
+JIM_STATIC size_t  JIM_API(Jim_fwrite   )(Jim_Interp *interp, const void *ptr, size_t size, size_t nmeb, void *cookie );
+JIM_STATIC size_t  JIM_API(Jim_fread    )(Jim_Interp *interp, void *ptr, size_t size, size_t nmeb, void *cookie );
+JIM_STATIC int     JIM_API(Jim_fflush   )(Jim_Interp *interp, void *cookie );
+JIM_STATIC char *  JIM_API(Jim_fgets    )(Jim_Interp *interp, char *s, int size, void *cookie );
 
 /* Name Value Pairs Operations */
 
 /* Name Value Pairs Operations */
-JIM_STATIC Jim_Nvp *JIM_API(Jim_Nvp_name2value_simple)( const Jim_Nvp *nvp_table, const char *name );
-JIM_STATIC Jim_Nvp *JIM_API(Jim_Nvp_name2value_nocase_simple)( const Jim_Nvp *nvp_table, const char *name );
-JIM_STATIC Jim_Nvp *JIM_API(Jim_Nvp_value2name_simple)( const Jim_Nvp *nvp_table, int v );
+JIM_STATIC Jim_Nvp *JIM_API(Jim_Nvp_name2value_simple)(const Jim_Nvp *nvp_table, const char *name );
+JIM_STATIC Jim_Nvp *JIM_API(Jim_Nvp_name2value_nocase_simple)(const Jim_Nvp *nvp_table, const char *name );
+JIM_STATIC Jim_Nvp *JIM_API(Jim_Nvp_value2name_simple)(const Jim_Nvp *nvp_table, int v );
 
 
-JIM_STATIC int JIM_API(Jim_Nvp_name2value)( Jim_Interp *interp, const Jim_Nvp *nvp_table, const char *name, Jim_Nvp **result );
-JIM_STATIC int JIM_API(Jim_Nvp_name2value_nocase)( Jim_Interp *interp, const Jim_Nvp *nvp_table, const char *name, Jim_Nvp **result);
-JIM_STATIC int JIM_API(Jim_Nvp_value2name)( Jim_Interp *interp, const Jim_Nvp *nvp_table, int value, Jim_Nvp **result );
+JIM_STATIC int JIM_API(Jim_Nvp_name2value)(Jim_Interp *interp, const Jim_Nvp *nvp_table, const char *name, Jim_Nvp **result );
+JIM_STATIC int JIM_API(Jim_Nvp_name2value_nocase)(Jim_Interp *interp, const Jim_Nvp *nvp_table, const char *name, Jim_Nvp **result);
+JIM_STATIC int JIM_API(Jim_Nvp_value2name)(Jim_Interp *interp, const Jim_Nvp *nvp_table, int value, Jim_Nvp **result );
 
 
-JIM_STATIC int JIM_API(Jim_Nvp_name2value_obj)( Jim_Interp *interp, const Jim_Nvp *nvp_table, Jim_Obj *name_obj, Jim_Nvp **result );
-JIM_STATIC int JIM_API(Jim_Nvp_name2value_obj_nocase)( Jim_Interp *interp, const Jim_Nvp *nvp_table, Jim_Obj *name_obj, Jim_Nvp **result );
-JIM_STATIC int JIM_API(Jim_Nvp_value2name_obj)( Jim_Interp *interp, const Jim_Nvp *nvp_table, Jim_Obj *value_obj, Jim_Nvp **result );
+JIM_STATIC int JIM_API(Jim_Nvp_name2value_obj)(Jim_Interp *interp, const Jim_Nvp *nvp_table, Jim_Obj *name_obj, Jim_Nvp **result );
+JIM_STATIC int JIM_API(Jim_Nvp_name2value_obj_nocase)(Jim_Interp *interp, const Jim_Nvp *nvp_table, Jim_Obj *name_obj, Jim_Nvp **result );
+JIM_STATIC int JIM_API(Jim_Nvp_value2name_obj)(Jim_Interp *interp, const Jim_Nvp *nvp_table, Jim_Obj *value_obj, Jim_Nvp **result );
 
 /** prints a nice 'unknown' parameter error message to the 'result' */
 
 /** prints a nice 'unknown' parameter error message to the 'result' */
-JIM_STATIC void JIM_API(Jim_SetResult_NvpUnknown)( Jim_Interp *interp, 
+JIM_STATIC void JIM_API(Jim_SetResult_NvpUnknown)(Jim_Interp *interp, 
                                                                                                   Jim_Obj *param_name,
                                                                                                   Jim_Obj *param_value,
                                                                                                   const Jim_Nvp *nvp_table );
                                                                                                   Jim_Obj *param_name,
                                                                                                   Jim_Obj *param_value,
                                                                                                   const Jim_Nvp *nvp_table );
@@ -951,11 +951,11 @@ JIM_STATIC void JIM_API(Jim_SetResult_NvpUnknown)( Jim_Interp *interp,
  * For example might want do this:
  * \code
  *     fp = fopen("some.file.log", "a" );
  * For example might want do this:
  * \code
  *     fp = fopen("some.file.log", "a" );
- *     fprintf( fp, "PARAMS are: %s\n", Jim_DebugArgvString( interp, argc, argv ) );
+ *     fprintf(fp, "PARAMS are: %s\n", Jim_DebugArgvString(interp, argc, argv ) );
  *     fclose(fp);
  * \endcode
  */
  *     fclose(fp);
  * \endcode
  */
-JIM_STATIC const char *JIM_API( Jim_Debug_ArgvString )( Jim_Interp *interp, int argc, Jim_Obj *const *argv );
+JIM_STATIC const char *JIM_API(Jim_Debug_ArgvString )(Jim_Interp *interp, int argc, Jim_Obj *const *argv );
 
 
 /** A TCL -ish GetOpt like code. 
 
 
 /** A TCL -ish GetOpt like code. 
@@ -983,33 +983,33 @@ typedef struct jim_getopt {
  * \code
  *   Jim_GetOptInfo goi; 
  *
  * \code
  *   Jim_GetOptInfo goi; 
  *
- *   Jim_GetOpt_Setup( &goi, interp, argc, argv );
+ *   Jim_GetOpt_Setup(&goi, interp, argc, argv );
  *
  *
- *   while ( goi.argc ){
- *         e = Jim_GetOpt_Nvp( &goi, nvp_options, &n );
- *         if ( e != JIM_OK ){
- *               Jim_GetOpt_NvpUnknown( &goi, nvp_options, 0 );
+ *   while (goi.argc ){
+ *         e = Jim_GetOpt_Nvp(&goi, nvp_options, &n );
+ *         if (e != JIM_OK ){
+ *               Jim_GetOpt_NvpUnknown(&goi, nvp_options, 0 );
  *               return e;
  *         }
  *
  *               return e;
  *         }
  *
- *         switch ( n->value ){
+ *         switch (n->value ){
  *         case ALIVE:
  *             printf("Option ALIVE specified\n");
  *             break;
  *         case FIRST:
  *         case ALIVE:
  *             printf("Option ALIVE specified\n");
  *             break;
  *         case FIRST:
- *             if ( goi.argc < 1 ){
+ *             if (goi.argc < 1 ){
  *                     .. not enough args error ..
  *             }
  *                     .. not enough args error ..
  *             }
- *             Jim_GetOpt_String( &goi, &cp, NULL );
+ *             Jim_GetOpt_String(&goi, &cp, NULL );
  *             printf("FIRSTNAME: %s\n", cp );
  *         case AGE:
  *             printf("FIRSTNAME: %s\n", cp );
  *         case AGE:
- *             Jim_GetOpt_Wide( &goi, &w );
+ *             Jim_GetOpt_Wide(&goi, &w );
  *             printf("AGE: %d\n", (int)(w) );
  *             break;
  *         case POLITICS:
  *             printf("AGE: %d\n", (int)(w) );
  *             break;
  *         case POLITICS:
- *             e = Jim_GetOpt_Nvp( &goi, nvp_politics, &n );
- *             if ( e != JIM_OK ){
- *                 Jim_GetOpt_NvpUnknown( &goi, nvp_politics, 1 );
+ *             e = Jim_GetOpt_Nvp(&goi, nvp_politics, &n );
+ *             if (e != JIM_OK ){
+ *                 Jim_GetOpt_NvpUnknown(&goi, nvp_politics, 1 );
  *                 return e;
  *             }
  *         }
  *                 return e;
  *             }
  *         }
@@ -1029,11 +1029,11 @@ typedef struct jim_getopt {
  * \code
  *     Jim_GetOptInfo  goi;
  *   
  * \code
  *     Jim_GetOptInfo  goi;
  *   
- *     Jim_GetOptSetup( &goi, interp, argc, argv );
+ *     Jim_GetOptSetup(&goi, interp, argc, argv );
  * \endcode
  */
 
  * \endcode
  */
 
-JIM_STATIC int JIM_API( Jim_GetOpt_Setup )( Jim_GetOptInfo *goi, 
+JIM_STATIC int JIM_API(Jim_GetOpt_Setup )(Jim_GetOptInfo *goi, 
                                                                                        Jim_Interp *interp, 
                                                                                        int argc, 
                                                                                        Jim_Obj * const *  argv );
                                                                                        Jim_Interp *interp, 
                                                                                        int argc, 
                                                                                        Jim_Obj * const *  argv );
@@ -1042,7 +1042,7 @@ JIM_STATIC int JIM_API( Jim_GetOpt_Setup )( Jim_GetOptInfo *goi,
 /** Debug - Dump parameters to stderr
  * \param goi - current parameters
  */
 /** Debug - Dump parameters to stderr
  * \param goi - current parameters
  */
-JIM_STATIC void JIM_API( Jim_GetOpt_Debug )( Jim_GetOptInfo *goi);
+JIM_STATIC void JIM_API(Jim_GetOpt_Debug )(Jim_GetOptInfo *goi);
 
 
 
 
 
 
@@ -1052,7 +1052,7 @@ JIM_STATIC void JIM_API( Jim_GetOpt_Debug )( Jim_GetOptInfo *goi);
  * \param puthere - where param is put
  * 
  */
  * \param puthere - where param is put
  * 
  */
-JIM_STATIC int JIM_API( Jim_GetOpt_Obj)( Jim_GetOptInfo *goi, Jim_Obj **puthere );
+JIM_STATIC int JIM_API(Jim_GetOpt_Obj)(Jim_GetOptInfo *goi, Jim_Obj **puthere );
 
 /** Remove argv[0] as string.
  *
 
 /** Remove argv[0] as string.
  *
@@ -1060,7 +1060,7 @@ JIM_STATIC int JIM_API( Jim_GetOpt_Obj)( Jim_GetOptInfo *goi, Jim_Obj **puthere
  * \param puthere - where param is put
  * \param len     - return its length
  */
  * \param puthere - where param is put
  * \param len     - return its length
  */
-JIM_STATIC int JIM_API( Jim_GetOpt_String )( Jim_GetOptInfo *goi, char **puthere, int *len );
+JIM_STATIC int JIM_API(Jim_GetOpt_String )(Jim_GetOptInfo *goi, char **puthere, int *len );
 
 /** Remove argv[0] as double.
  *
 
 /** Remove argv[0] as double.
  *
@@ -1068,14 +1068,14 @@ JIM_STATIC int JIM_API( Jim_GetOpt_String )( Jim_GetOptInfo *goi, char **puthere
  * \param puthere - where param is put.
  *
  */
  * \param puthere - where param is put.
  *
  */
-JIM_STATIC int JIM_API( Jim_GetOpt_Double )( Jim_GetOptInfo *goi, double *puthere );
+JIM_STATIC int JIM_API(Jim_GetOpt_Double )(Jim_GetOptInfo *goi, double *puthere );
 
 /** Remove argv[0] as wide.
  *
  * \param goi     - get opt info
  * \param puthere - where param is put.
  */
 
 /** Remove argv[0] as wide.
  *
  * \param goi     - get opt info
  * \param puthere - where param is put.
  */
-JIM_STATIC int JIM_API( Jim_GetOpt_Wide )( Jim_GetOptInfo *goi, jim_wide *puthere );
+JIM_STATIC int JIM_API(Jim_GetOpt_Wide )(Jim_GetOptInfo *goi, jim_wide *puthere );
 
 /** Remove argv[0] as NVP.
  *
 
 /** Remove argv[0] as NVP.
  *
@@ -1084,7 +1084,7 @@ JIM_STATIC int JIM_API( Jim_GetOpt_Wide )( Jim_GetOptInfo *goi, jim_wide *puther
  * \param puthere - where param is put.
  *
  */
  * \param puthere - where param is put.
  *
  */
-JIM_STATIC int JIM_API( Jim_GetOpt_Nvp)( Jim_GetOptInfo *goi, const Jim_Nvp *lookup, Jim_Nvp **puthere );
+JIM_STATIC int JIM_API(Jim_GetOpt_Nvp)(Jim_GetOptInfo *goi, const Jim_Nvp *lookup, Jim_Nvp **puthere );
 
 /** Create an appropriate error message for an NVP.
  *
 
 /** Create an appropriate error message for an NVP.
  *
@@ -1102,22 +1102,22 @@ JIM_STATIC int JIM_API( Jim_GetOpt_Nvp)( Jim_GetOptInfo *goi, const Jim_Nvp *loo
  * Example:
  * \code
  *
  * Example:
  * \code
  *
- *  while ( goi.argc ){
+ *  while (goi.argc ){
  *     // Get the next option 
  *     // Get the next option 
- *     e = Jim_GetOpt_Nvp( &goi, cmd_options, &n );
- *     if ( e != JIM_OK ){
+ *     e = Jim_GetOpt_Nvp(&goi, cmd_options, &n );
+ *     if (e != JIM_OK ){
  *          // option was not recognized
  *          // pass 'hadprefix = 0' because there is no prefix
  *          // option was not recognized
  *          // pass 'hadprefix = 0' because there is no prefix
- *          Jim_GetOpt_NvpUnknown( &goi, cmd_options, 0 );
+ *          Jim_GetOpt_NvpUnknown(&goi, cmd_options, 0 );
  *          return e;
  *     }
  *
  *          return e;
  *     }
  *
- *     switch ( n->value ){
+ *     switch (n->value ){
  *     case OPT_SEX:
  *          // handle:  --sex male | female | lots | needmore
  *     case OPT_SEX:
  *          // handle:  --sex male | female | lots | needmore
- *          e = Jim_GetOpt_Nvp( &goi, &nvp_sex, &n );
- *          if ( e != JIM_OK ){
- *               Jim_GetOpt_NvpUnknown( &ogi, nvp_sex, 1 );
+ *          e = Jim_GetOpt_Nvp(&goi, &nvp_sex, &n );
+ *          if (e != JIM_OK ){
+ *               Jim_GetOpt_NvpUnknown(&ogi, nvp_sex, 1 );
  *               return e;
  *          }
  *          printf("Code: (%d) is %s\n", n->value, n->name );
  *               return e;
  *          }
  *          printf("Code: (%d) is %s\n", n->value, n->name );
@@ -1129,7 +1129,7 @@ JIM_STATIC int JIM_API( Jim_GetOpt_Nvp)( Jim_GetOptInfo *goi, const Jim_Nvp *loo
  * \endcode
  *
  */
  * \endcode
  *
  */
-JIM_STATIC void JIM_API( Jim_GetOpt_NvpUnknown)( Jim_GetOptInfo *goi, const Jim_Nvp *lookup, int hadprefix );
+JIM_STATIC void JIM_API(Jim_GetOpt_NvpUnknown)(Jim_GetOptInfo *goi, const Jim_Nvp *lookup, int hadprefix );
 
 
 /** Remove argv[0] as Enum
 
 
 /** Remove argv[0] as Enum
@@ -1139,7 +1139,7 @@ JIM_STATIC void JIM_API( Jim_GetOpt_NvpUnknown)( Jim_GetOptInfo *goi, const Jim_
  * \param puthere - where param is put.
  *
  */
  * \param puthere - where param is put.
  *
  */
-JIM_STATIC int JIM_API( Jim_GetOpt_Enum)( Jim_GetOptInfo *goi, const char * const *  lookup, int *puthere );
+JIM_STATIC int JIM_API(Jim_GetOpt_Enum)(Jim_GetOptInfo *goi, const char * const *  lookup, int *puthere );
 
 
 #undef JIM_STATIC
 
 
 #undef JIM_STATIC
index cfdc8aa552641d6f8e47eda737cf47f8c285c1ce..f788dc9427365c573e92e48ecf220e50095866e7 100644 (file)
@@ -85,7 +85,7 @@ extern int debug_level;
 /* Avoid fn call and building parameter list if we're not outputting the information.
  * Matters on feeble CPUs for DEBUG/INFO statements that are involved frequently */
 
 /* Avoid fn call and building parameter list if we're not outputting the information.
  * Matters on feeble CPUs for DEBUG/INFO statements that are involved frequently */
 
-#define LOG_LEVEL_IS( FOO )  ((debug_level) >= (FOO))
+#define LOG_LEVEL_IS(FOO )  ((debug_level) >= (FOO))
 
 #define LOG_DEBUG(expr ...) \
                ((debug_level >= LOG_LVL_DEBUG) ? log_printf_lf (LOG_LVL_DEBUG, __FILE__, __LINE__, __FUNCTION__, expr) , 0 : 0)
 
 #define LOG_DEBUG(expr ...) \
                ((debug_level >= LOG_LVL_DEBUG) ? log_printf_lf (LOG_LVL_DEBUG, __FILE__, __LINE__, __FUNCTION__, expr) , 0 : 0)
index 27a7f6d50d871600d38255f7e209af2ea81c81ba..43eab021503799a595bfb4122a9ca5a5f1422a5f 100644 (file)
@@ -161,7 +161,7 @@ int win_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, struct time
 #endif  /* _WIN32 */
 
 /* generic socket functions for Windows and Posix */
 #endif  /* _WIN32 */
 
 /* generic socket functions for Windows and Posix */
-static __inline int write_socket( int handle, const void *buffer, unsigned int count )
+static __inline int write_socket(int handle, const void *buffer, unsigned int count )
 {
 #ifdef _WIN32
        return send(handle, buffer, count, 0);
 {
 #ifdef _WIN32
        return send(handle, buffer, count, 0);
@@ -170,7 +170,7 @@ static __inline int write_socket( int handle, const void *buffer, unsigned int c
 #endif
 }
 
 #endif
 }
 
-static __inline int read_socket( int handle, void *buffer, unsigned int count )
+static __inline int read_socket(int handle, void *buffer, unsigned int count )
 {
 #ifdef _WIN32
        return recv(handle, buffer, count, 0);
 {
 #ifdef _WIN32
        return recv(handle, buffer, count, 0);
index c059d920628cdb81d60425dfecc545fb4e5b5cdd..691153602f96974849fa261908bd341ce4d86bc8 100644 (file)
@@ -395,20 +395,20 @@ int amt_jtagaccel_get_giveio_access(void)
        OSVERSIONINFO version;
 
        version.dwOSVersionInfoSize = sizeof version;
        OSVERSIONINFO version;
 
        version.dwOSVersionInfoSize = sizeof version;
-       if (!GetVersionEx( &version )) {
+       if (!GetVersionEx(&version )) {
        errno = EINVAL;
        return -1;
        }
        if (version.dwPlatformId != VER_PLATFORM_WIN32_NT)
        return 0;
 
        errno = EINVAL;
        return -1;
        }
        if (version.dwPlatformId != VER_PLATFORM_WIN32_NT)
        return 0;
 
-       h = CreateFile( "\\\\.\\giveio", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
+       h = CreateFile("\\\\.\\giveio", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
        if (h == INVALID_HANDLE_VALUE) {
        errno = ENODEV;
        return -1;
        }
 
        if (h == INVALID_HANDLE_VALUE) {
        errno = ENODEV;
        return -1;
        }
 
-       CloseHandle( h );
+       CloseHandle(h );
 
        return 0;
 }
 
        return 0;
 }
index 3068a15f47c30feac528f101b54728e22b2a7e1c..cd13cff0197ced52f9b19764b1254603580d146c 100644 (file)
@@ -133,7 +133,7 @@ static int armjtagew_execute_queue(void)
                switch (cmd->type)
                {
                        case JTAG_RUNTEST:
                switch (cmd->type)
                {
                        case JTAG_RUNTEST:
-                               DEBUG_JTAG_IO( "runtest %i cycles, end in %i", cmd->cmd.runtest->num_cycles, \
+                               DEBUG_JTAG_IO("runtest %i cycles, end in %i", cmd->cmd.runtest->num_cycles, \
                                        cmd->cmd.runtest->end_state);
 
                                armjtagew_end_state(cmd->cmd.runtest->end_state);
                                        cmd->cmd.runtest->end_state);
 
                                armjtagew_end_state(cmd->cmd.runtest->end_state);
index 2a153b2f1b4bcd0fcc577b379f5b13475d5ac70e..47654a2df0a31faaaa5caa6923dcb6d657ddc40f 100644 (file)
@@ -83,7 +83,7 @@ void bitq_in_proc(void)
                                                                        bitq_in_bufsize *= 2;
                                                        }
                                                        /* if necessary, allocate buffer and check for malloc error */
                                                                        bitq_in_bufsize *= 2;
                                                        }
                                                        /* if necessary, allocate buffer and check for malloc error */
-                                                       if (bitq_in_buffer == NULL && ( bitq_in_buffer = malloc(bitq_in_bufsize) ) == NULL)
+                                                       if (bitq_in_buffer == NULL && (bitq_in_buffer = malloc(bitq_in_bufsize) ) == NULL)
                                                        {
                                                                LOG_ERROR("malloc error");
                                                                exit(-1);
                                                        {
                                                                LOG_ERROR("malloc error");
                                                                exit(-1);
@@ -95,7 +95,7 @@ void bitq_in_proc(void)
                                        /* field scanning */
                                        while (bitq_in_state.bit_pos < field->num_bits)
                                        {
                                        /* field scanning */
                                        while (bitq_in_state.bit_pos < field->num_bits)
                                        {
-                                               if ( ( tdo = bitq_interface->in() ) < 0 )
+                                               if ((tdo = bitq_interface->in() ) < 0 )
                                                {
 #ifdef _DEBUG_JTAG_IO_
                                                        LOG_DEBUG("bitq in EOF");
                                                {
 #ifdef _DEBUG_JTAG_IO_
                                                        LOG_DEBUG("bitq in EOF");
@@ -131,7 +131,7 @@ void bitq_io(int tms, int tdi, int tdo_req)
 {
        bitq_interface->out(tms, tdi, tdo_req);
        /* check and process the input queue */
 {
        bitq_interface->out(tms, tdi, tdo_req);
        /* check and process the input queue */
-       if ( bitq_interface->in_rdy() )
+       if (bitq_interface->in_rdy() )
                bitq_in_proc();
 }
 
                bitq_in_proc();
 }
 
@@ -183,7 +183,7 @@ void bitq_path_move(pathmove_command_t* cmd)
                        bitq_io(1, 0, 0);
                else
                {
                        bitq_io(1, 0, 0);
                else
                {
-                       LOG_ERROR( "BUG: %s -> %s isn't a valid TAP transition", tap_state_name(
+                       LOG_ERROR("BUG: %s -> %s isn't a valid TAP transition", tap_state_name(
                                                         tap_get_state() ), tap_state_name(cmd->path[i]) );
                        exit(-1);
                }
                                                         tap_get_state() ), tap_state_name(cmd->path[i]) );
                        exit(-1);
                }
@@ -191,7 +191,7 @@ void bitq_path_move(pathmove_command_t* cmd)
                tap_set_state(cmd->path[i]);
        }
 
                tap_set_state(cmd->path[i]);
        }
 
-       tap_set_end_state( tap_get_state() );
+       tap_set_end_state(tap_get_state() );
 }
 
 
 }
 
 
@@ -208,8 +208,8 @@ void bitq_runtest(int num_cycles)
                bitq_io(0, 0, 0);
 
        /* finish in end_state */
                bitq_io(0, 0, 0);
 
        /* finish in end_state */
-       if ( tap_get_state() != tap_get_end_state() )
-               bitq_state_move( tap_get_end_state() );
+       if (tap_get_state() != tap_get_end_state() )
+               bitq_state_move(tap_get_end_state() );
 }
 
 
 }
 
 
@@ -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--)
                {
                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;
                        if (out_mask == 0x80)
                        {
                                out_mask = 0x01;
@@ -251,7 +251,7 @@ void bitq_scan_field(scan_field_t* field, int pause)
                                out_mask <<= 1;
                }
 
                                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)
        }
 
        if (pause)
@@ -298,12 +298,12 @@ int bitq_execute_queue(void)
 #ifdef _DEBUG_JTAG_IO_
                        LOG_DEBUG("reset trst: %i srst %i", cmd->cmd.reset->trst, cmd->cmd.reset->srst);
 #endif
 #ifdef _DEBUG_JTAG_IO_
                        LOG_DEBUG("reset trst: %i srst %i", cmd->cmd.reset->trst, cmd->cmd.reset->srst);
 #endif
-                       if ( (cmd->cmd.reset->trst == 1) || ( cmd->cmd.reset->srst && (jtag_get_reset_config() & RESET_SRST_PULLS_TRST) ) )
+                       if ((cmd->cmd.reset->trst == 1) || (cmd->cmd.reset->srst && (jtag_get_reset_config() & RESET_SRST_PULLS_TRST) ) )
                        {
                                tap_set_state(TAP_RESET);
                        }
                        bitq_interface->reset(cmd->cmd.reset->trst, cmd->cmd.reset->srst);
                        {
                                tap_set_state(TAP_RESET);
                        }
                        bitq_interface->reset(cmd->cmd.reset->trst, cmd->cmd.reset->srst);
-                       if ( bitq_interface->in_rdy() )
+                       if (bitq_interface->in_rdy() )
                                bitq_in_proc();
                        break;
 
                                bitq_in_proc();
                        break;
 
@@ -320,7 +320,7 @@ int bitq_execute_queue(void)
                        LOG_DEBUG("statemove end in %i", cmd->cmd.statemove->end_state);
 #endif
                        bitq_end_state(cmd->cmd.statemove->end_state);
                        LOG_DEBUG("statemove end in %i", cmd->cmd.statemove->end_state);
 #endif
                        bitq_end_state(cmd->cmd.statemove->end_state);
-                       bitq_state_move( tap_get_end_state() );   /* uncoditional TAP move */
+                       bitq_state_move(tap_get_end_state() );   /* uncoditional TAP move */
                        break;
 
                case JTAG_PATHMOVE:
                        break;
 
                case JTAG_PATHMOVE:
@@ -341,8 +341,8 @@ int bitq_execute_queue(void)
 #endif
                        bitq_end_state(cmd->cmd.scan->end_state);
                        bitq_scan(cmd->cmd.scan);
 #endif
                        bitq_end_state(cmd->cmd.scan->end_state);
                        bitq_scan(cmd->cmd.scan);
-                       if ( tap_get_state() != tap_get_end_state() )
-                               bitq_state_move( tap_get_end_state() );
+                       if (tap_get_state() != tap_get_end_state() )
+                               bitq_state_move(tap_get_end_state() );
                        break;
 
                case JTAG_SLEEP:
                        break;
 
                case JTAG_SLEEP:
@@ -350,7 +350,7 @@ int bitq_execute_queue(void)
                        LOG_DEBUG("sleep %i", cmd->cmd.sleep->us);
 #endif
                        bitq_interface->sleep(cmd->cmd.sleep->us);
                        LOG_DEBUG("sleep %i", cmd->cmd.sleep->us);
 #endif
                        bitq_interface->sleep(cmd->cmd.sleep->us);
-                       if ( bitq_interface->in_rdy() )
+                       if (bitq_interface->in_rdy() )
                                bitq_in_proc();
                        break;
 
                                bitq_in_proc();
                        break;
 
index 4e41eb17063b432d10d136036305c807f4952334..58c8e3415d347a47fc813a92490d22552ed00c47 100644 (file)
@@ -482,7 +482,7 @@ void jtag_add_pathmove(int num_states, const tap_state_t *path)
                        return;
                }
 
                        return;
                }
 
-               if ( tap_state_transition(cur_state, true)  != path[i]
+               if (tap_state_transition(cur_state, true)  != path[i]
                  && tap_state_transition(cur_state, false) != path[i])
                {
                        LOG_ERROR("BUG: %s -> %s isn't a valid TAP transition",
                  && tap_state_transition(cur_state, false) != path[i])
                {
                        LOG_ERROR("BUG: %s -> %s isn't a valid TAP transition",
@@ -503,18 +503,18 @@ int jtag_add_statemove(tap_state_t goal_state)
 {
        tap_state_t cur_state = cmd_queue_cur_state;
 
 {
        tap_state_t cur_state = cmd_queue_cur_state;
 
-       LOG_DEBUG( "cur_state=%s goal_state=%s",
+       LOG_DEBUG("cur_state=%s goal_state=%s",
                tap_state_name(cur_state),
                tap_state_name(goal_state) );
 
 
        if (goal_state == cur_state )
                ;       /* nothing to do */
                tap_state_name(cur_state),
                tap_state_name(goal_state) );
 
 
        if (goal_state == cur_state )
                ;       /* nothing to do */
-       else if ( goal_state == TAP_RESET )
+       else if (goal_state == TAP_RESET )
        {
                jtag_add_tlr();
        }
        {
                jtag_add_tlr();
        }
-       else if ( tap_is_state_stable(cur_state) && tap_is_state_stable(goal_state) )
+       else if (tap_is_state_stable(cur_state) && tap_is_state_stable(goal_state) )
        {
                unsigned tms_bits  = tap_get_tms_path(cur_state, goal_state);
                unsigned tms_count = tap_get_tms_path_len(cur_state, goal_state);
        {
                unsigned tms_bits  = tap_get_tms_path(cur_state, goal_state);
                unsigned tms_count = tap_get_tms_path_len(cur_state, goal_state);
@@ -531,7 +531,7 @@ int jtag_add_statemove(tap_state_t goal_state)
 
                jtag_add_pathmove(tms_count, moves);
        }
 
                jtag_add_pathmove(tms_count, moves);
        }
-       else if ( tap_state_transition(cur_state, true)  == goal_state
+       else if (tap_state_transition(cur_state, true)  == goal_state
                ||   tap_state_transition(cur_state, false) == goal_state )
        {
                jtag_add_pathmove(1, &goal_state);
                ||   tap_state_transition(cur_state, false) == goal_state )
        {
                jtag_add_pathmove(1, &goal_state);
@@ -885,7 +885,7 @@ static bool jtag_idcode_is_final(uint32_t idcode)
 static void jtag_examine_chain_end(uint8_t *idcodes, unsigned count, unsigned max)
 {
        bool triggered = false;
 static void jtag_examine_chain_end(uint8_t *idcodes, unsigned count, unsigned max)
 {
        bool triggered = false;
-       for ( ; count < max - 31; count += 32)
+       for (; count < max - 31; count += 32)
        {
                uint32_t idcode = buf_get_u32(idcodes, count, 32);
                // do not trigger the warning if the data looks good
        {
                uint32_t idcode = buf_get_u32(idcodes, count, 32);
                // do not trigger the warning if the data looks good
@@ -1026,7 +1026,7 @@ int jtag_validate_chain(void)
        total_ir_length = 0;
        for (;;){
                tap = jtag_tap_next_enabled(tap);
        total_ir_length = 0;
        for (;;){
                tap = jtag_tap_next_enabled(tap);
-               if ( tap == NULL ){
+               if (tap == NULL ){
                        break;
                }
                total_ir_length += tap->ir_length;
                        break;
                }
                total_ir_length += tap->ir_length;
@@ -1050,7 +1050,7 @@ int jtag_validate_chain(void)
        int val;
        for (;;){
                tap = jtag_tap_next_enabled(tap);
        int val;
        for (;;){
                tap = jtag_tap_next_enabled(tap);
-               if ( tap == NULL ){
+               if (tap == NULL ){
                        break;
                }
 
                        break;
                }
 
@@ -1151,7 +1151,7 @@ static int jtag_init_inner(struct command_context_s *cmd_ctx)
        LOG_DEBUG("Init JTAG chain");
 
        tap = jtag_tap_next_enabled(NULL);
        LOG_DEBUG("Init JTAG chain");
 
        tap = jtag_tap_next_enabled(NULL);
-       if ( tap == NULL ){
+       if (tap == NULL ){
                LOG_ERROR("There are no enabled taps?");
                return ERROR_JTAG_INIT_FAILED;
        }
                LOG_ERROR("There are no enabled taps?");
                return ERROR_JTAG_INIT_FAILED;
        }
index 1555561d6c3629c9be53f5e3c7011f0e6bb1aa54..cc1342849f75c113768b48e89e5f6825903fb6c3 100644 (file)
@@ -418,7 +418,7 @@ int interface_jtag_add_runtest(int num_cycles, tap_state_t state)
        return ERROR_OK;
 }
 
        return ERROR_OK;
 }
 
-int interface_jtag_add_clocks( int num_cycles )
+int interface_jtag_add_clocks(int num_cycles )
 {
        /* allocate memory for a new list member */
        jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t));
 {
        /* allocate memory for a new list member */
        jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t));
index 75630d966a32102e11ac9b07470c46a2bb40d33f..d41725ab21a1eedf3bcd245900822606a81f50d5 100644 (file)
@@ -85,16 +85,16 @@ static int dummy_read(void)
 static void dummy_write(int tck, int tms, int tdi)
 {
        /* TAP standard: "state transitions occur on rising edge of clock" */
 static void dummy_write(int tck, int tms, int tdi)
 {
        /* TAP standard: "state transitions occur on rising edge of clock" */
-       if ( tck != dummy_clock )
+       if (tck != dummy_clock )
        {
        {
-               if ( tck )
+               if (tck )
                {
                        tap_state_t old_state = dummy_state;
                {
                        tap_state_t old_state = dummy_state;
-                       dummy_state = tap_state_transition( old_state, tms );
+                       dummy_state = tap_state_transition(old_state, tms );
 
 
-                       if ( old_state != dummy_state )
+                       if (old_state != dummy_state )
                        {
                        {
-                               if ( clock_count )
+                               if (clock_count )
                                {
                                        LOG_DEBUG("dummy_tap: %d stable clocks", clock_count);
                                        clock_count = 0;
                                {
                                        LOG_DEBUG("dummy_tap: %d stable clocks", clock_count);
                                        clock_count = 0;
index 5cea4d48af232e4c0c8cb29aa6b2980a08c5c502..47a03e9a055ccc4d95614ebcb459b8c9a5db4715 100644 (file)
@@ -876,7 +876,7 @@ static void ft2232_add_scan(bool ir_scan, enum scan_type type, uint8_t* buffer,
                        buffer_write(buffer[cur_byte]);
        }
 
                        buffer_write(buffer[cur_byte]);
        }
 
-       if (( ir_scan && (tap_get_end_state() == TAP_IRSHIFT))
+       if ((ir_scan && (tap_get_end_state() == TAP_IRSHIFT))
          || (!ir_scan && (tap_get_end_state() == TAP_DRSHIFT)))
        {
                if (type == SCAN_IO)
          || (!ir_scan && (tap_get_end_state() == TAP_DRSHIFT)))
        {
                if (type == SCAN_IO)
index 7096d62c04fa0100c58c5be6a8a16e36917e0835..63dcd627f3d4a1517e6461e33939a490e543f129 100644 (file)
@@ -422,20 +422,20 @@ static int gw16012_get_giveio_access(void)
        OSVERSIONINFO version;
 
        version.dwOSVersionInfoSize = sizeof version;
        OSVERSIONINFO version;
 
        version.dwOSVersionInfoSize = sizeof version;
-       if (!GetVersionEx( &version )) {
+       if (!GetVersionEx(&version )) {
                errno = EINVAL;
                return -1;
        }
        if (version.dwPlatformId != VER_PLATFORM_WIN32_NT)
                return 0;
 
                errno = EINVAL;
                return -1;
        }
        if (version.dwPlatformId != VER_PLATFORM_WIN32_NT)
                return 0;
 
-       h = CreateFile( "\\\\.\\giveio", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
+       h = CreateFile("\\\\.\\giveio", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
        if (h == INVALID_HANDLE_VALUE) {
                errno = ENODEV;
                return -1;
        }
 
        if (h == INVALID_HANDLE_VALUE) {
                errno = ENODEV;
                return -1;
        }
 
-       CloseHandle( h );
+       CloseHandle(h );
 
        return 0;
 }
 
        return 0;
 }
index e9998011139d720f11f49f15d140da22f3c668b7..e856fe381d35372e8f48c6b64be8ddafea9c4191 100644 (file)
@@ -40,7 +40,7 @@
  */
 static tap_state_t state_follower = TAP_RESET;
 
  */
 static tap_state_t state_follower = TAP_RESET;
 
-void tap_set_state_impl( tap_state_t new_state )
+void tap_set_state_impl(tap_state_t new_state )
 {
        /* this is the state we think the TAPs are in now, was cur_state */
        state_follower = new_state;
 {
        /* this is the state we think the TAPs are in now, was cur_state */
        state_follower = new_state;
@@ -57,7 +57,7 @@ tap_state_t tap_get_state()
  */
 static tap_state_t end_state_follower = TAP_RESET;
 
  */
 static tap_state_t end_state_follower = TAP_RESET;
 
-void tap_set_end_state( tap_state_t new_end_state )
+void tap_set_end_state(tap_state_t new_end_state )
 {
        /* this is the state we think the TAPs will be in at completion of the
           current TAP operation, was end_state
 {
        /* this is the state we think the TAPs will be in at completion of the
           current TAP operation, was end_state
@@ -71,13 +71,13 @@ tap_state_t tap_get_end_state()
 }
 
 
 }
 
 
-int tap_move_ndx( tap_state_t astate )
+int tap_move_ndx(tap_state_t astate )
 {
        /* given a stable state, return the index into the tms_seqs[] array within tap_get_tms_path() */
 
        int ndx;
 
 {
        /* given a stable state, return the index into the tms_seqs[] array within tap_get_tms_path() */
 
        int ndx;
 
-       switch ( astate )
+       switch (astate )
        {
        case TAP_RESET:         ndx = 0;                        break;
        case TAP_DRSHIFT:       ndx = 2;                        break;
        {
        case TAP_RESET:         ndx = 0;                        break;
        case TAP_DRSHIFT:       ndx = 2;                        break;
@@ -86,7 +86,7 @@ int tap_move_ndx( tap_state_t astate )
        case TAP_IRSHIFT:       ndx = 4;                        break;
        case TAP_IRPAUSE:       ndx = 5;                        break;
        default:
        case TAP_IRSHIFT:       ndx = 4;                        break;
        case TAP_IRPAUSE:       ndx = 5;                        break;
        default:
-               LOG_ERROR( "fatal: unstable state \"%s\" used in tap_move_ndx()", tap_state_name(astate) );
+               LOG_ERROR("fatal: unstable state \"%s\" used in tap_move_ndx()", tap_state_name(astate) );
                exit(1);
        }
 
                exit(1);
        }
 
@@ -193,13 +193,13 @@ typedef const struct tms_sequences tms_table[6][6];
 
 static tms_table *tms_seqs=&short_tms_seqs;
 
 
 static tms_table *tms_seqs=&short_tms_seqs;
 
-int tap_get_tms_path( tap_state_t from, tap_state_t to )
+int tap_get_tms_path(tap_state_t from, tap_state_t to )
 {
        return (*tms_seqs)[tap_move_ndx(from)][tap_move_ndx(to)].bits;
 }
 
 
 {
        return (*tms_seqs)[tap_move_ndx(from)][tap_move_ndx(to)].bits;
 }
 
 
-int tap_get_tms_path_len( tap_state_t from, tap_state_t to )
+int tap_get_tms_path_len(tap_state_t from, tap_state_t to )
 {
        return (*tms_seqs)[tap_move_ndx(from)][tap_move_ndx(to)].bit_count;
 }
 {
        return (*tms_seqs)[tap_move_ndx(from)][tap_move_ndx(to)].bit_count;
 }
@@ -212,7 +212,7 @@ bool tap_is_state_stable(tap_state_t astate)
        /*      A switch () is used because it is symbol dependent
                (not value dependent like an array), and can also check bounds.
        */
        /*      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:
        {
        case TAP_RESET:
        case TAP_IDLE:
@@ -278,7 +278,7 @@ tap_state_t tap_state_transition(tap_state_t cur_state, bool tms)
                        new_state = TAP_IREXIT2;
                        break;
                default:
                        new_state = TAP_IREXIT2;
                        break;
                default:
-                       LOG_ERROR( "fatal: invalid argument cur_state=%d", cur_state );
+                       LOG_ERROR("fatal: invalid argument cur_state=%d", cur_state );
                        exit(1);
                        break;
                }
                        exit(1);
                        break;
                }
@@ -318,7 +318,7 @@ tap_state_t tap_state_transition(tap_state_t cur_state, bool tms)
                        new_state = TAP_IRPAUSE;
                        break;
                default:
                        new_state = TAP_IRPAUSE;
                        break;
                default:
-                       LOG_ERROR( "fatal: invalid argument cur_state=%d", cur_state );
+                       LOG_ERROR("fatal: invalid argument cur_state=%d", cur_state );
                        exit(1);
                        break;
                }
                        exit(1);
                        break;
                }
@@ -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_IDLE:          ret = "RUN/IDLE";               break;
        {
        case TAP_RESET:         ret = "RESET";                  break;
        case TAP_IDLE:          ret = "RUN/IDLE";               break;
@@ -359,9 +359,9 @@ tap_state_t tap_state_by_name(const char *name)
 {
        tap_state_t x;
 
 {
        tap_state_t x;
 
-       for ( x = 0 ; x < TAP_NUM_STATES ; x++ ){
+       for (x = 0 ; x < TAP_NUM_STATES ; x++ ){
                /* be nice to the human */
                /* be nice to the human */
-               if ( 0 == strcasecmp( name, tap_state_name(x) ) ){
+               if (0 == strcasecmp(name, tap_state_name(x) ) ){
                        return x;
                }
        }
                        return x;
                }
        }
index 1fdd8879116590f335e74a192fc4d080276fcc7f..a0a1ed6734c86f5a3f22ddac2c1e17dc3693eef6 100644 (file)
@@ -59,7 +59,7 @@ void tap_set_state_impl(tap_state_t new_state);
 #if defined(_DEBUG_JTAG_IO_)
 #define tap_set_state(new_state) \
        do { \
 #if defined(_DEBUG_JTAG_IO_)
 #define tap_set_state(new_state) \
        do { \
-               LOG_DEBUG( "tap_set_state(%s)", tap_state_name(new_state) ); \
+               LOG_DEBUG("tap_set_state(%s)", tap_state_name(new_state) ); \
                tap_set_state_impl(new_state); \
        } while (0)
 #else
                tap_set_state_impl(new_state); \
        } while (0)
 #else
index 50c08314b9beca8f5fa2459f368b5a7f4ce75f41..ec6a862f6d68151201d4613e83d5e6e6563800f3 100644 (file)
@@ -263,20 +263,20 @@ static int parport_get_giveio_access(void)
        OSVERSIONINFO version;
 
        version.dwOSVersionInfoSize = sizeof version;
        OSVERSIONINFO version;
 
        version.dwOSVersionInfoSize = sizeof version;
-       if (!GetVersionEx( &version )) {
+       if (!GetVersionEx(&version )) {
                errno = EINVAL;
                return -1;
        }
        if (version.dwPlatformId != VER_PLATFORM_WIN32_NT)
                return 0;
 
                errno = EINVAL;
                return -1;
        }
        if (version.dwPlatformId != VER_PLATFORM_WIN32_NT)
                return 0;
 
-       h = CreateFile( "\\\\.\\giveio", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
+       h = CreateFile("\\\\.\\giveio", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
        if (h == INVALID_HANDLE_VALUE) {
                errno = ENODEV;
                return -1;
        }
 
        if (h == INVALID_HANDLE_VALUE) {
                errno = ENODEV;
                return -1;
        }
 
-       CloseHandle( h );
+       CloseHandle(h );
 
        return 0;
 }
 
        return 0;
 }
index 9070e8431ac77c838be014d98e259365f5e3678d..04475b01b0ca7ff801800f60f01daf6fb0fd50a9 100644 (file)
 #define DTC_CMD_SHIFT_TDIO_BYTES(bytes)        ((0x6 << 4) | ((bytes) - 1))
 /* Shift 1-16 bytes out TDI and in TDO. TMS is unaffected. */
 
 #define DTC_CMD_SHIFT_TDIO_BYTES(bytes)        ((0x6 << 4) | ((bytes) - 1))
 /* Shift 1-16 bytes out TDI and in TDO. TMS is unaffected. */
 
-#define DTC_CMD_SHIFT_TMS_TDI_BIT_PAIR(tms, tdi, tdo)  ((0x8 << 4) | ( \
+#define DTC_CMD_SHIFT_TMS_TDI_BIT_PAIR(tms, tdi, tdo)  ((0x8 << 4) | (\
                (tms) ? (1 << 0) : 0    \
                (tms) ? (1 << 0) : 0    \
-       ) | (   \
+       ) | (\
                (tdi) ? (1 << 1) : 0    \
                (tdi) ? (1 << 1) : 0    \
-       ) | (   \
+       ) | (\
                (tdo) ? (1 << 3) : 0    \
        ))
 /* Single bit shift. */
                (tdo) ? (1 << 3) : 0    \
        ))
 /* Single bit shift. */
index 2f14e86fc540bd5389f4bfce614dd06a7317f3ca..add945807ac493ac9372eccb98039906fb732202 100644 (file)
@@ -1636,26 +1636,26 @@ int rlink_init(void)
 
                for (dev = bus->devices; dev; dev = dev->next)
                {
 
                for (dev = bus->devices; dev; dev = dev->next)
                {
-                       if ( (dev->descriptor.idVendor == USB_IDVENDOR) && (dev->descriptor.idProduct == USB_IDPRODUCT) )
+                       if ((dev->descriptor.idVendor == USB_IDVENDOR) && (dev->descriptor.idProduct == USB_IDPRODUCT) )
                        {
                                found = 1;
                                LOG_DEBUG("Found device on bus.\n");
 
                                do
                                {
                        {
                                found = 1;
                                LOG_DEBUG("Found device on bus.\n");
 
                                do
                                {
-                                       if ( dev->descriptor.bNumConfigurations > 1 )
+                                       if (dev->descriptor.bNumConfigurations > 1 )
                                        {
                                                LOG_ERROR("Whoops! NumConfigurations is not 1, don't know what to do...\n");
                                                break;
                                        }
                                        {
                                                LOG_ERROR("Whoops! NumConfigurations is not 1, don't know what to do...\n");
                                                break;
                                        }
-                                       if ( dev->config->bNumInterfaces > 1 )
+                                       if (dev->config->bNumInterfaces > 1 )
                                        {
                                                LOG_ERROR("Whoops! NumInterfaces is not 1, don't know what to do...\n");
                                                break;
                                        }
 
                                        pHDev = usb_open(dev);
                                        {
                                                LOG_ERROR("Whoops! NumInterfaces is not 1, don't know what to do...\n");
                                                break;
                                        }
 
                                        pHDev = usb_open(dev);
-                                       if ( !pHDev )
+                                       if (!pHDev )
                                                LOG_ERROR ("Failed to open device.\n");
                                        else
                                        {
                                                LOG_ERROR ("Failed to open device.\n");
                                        else
                                        {
@@ -1686,7 +1686,7 @@ int rlink_init(void)
 
                                                if (!i)
                                                {
 
                                                if (!i)
                                                {
-                                                       if ( usb_set_altinterface(pHDev,0) )
+                                                       if (usb_set_altinterface(pHDev,0) )
                                                        {
                                                                LOG_ERROR("Failed to set interface.\n");
                                                                break;
                                                        {
                                                                LOG_ERROR("Failed to set interface.\n");
                                                                break;
@@ -1700,13 +1700,13 @@ int rlink_init(void)
                }
        }
 
                }
        }
 
-       if ( !found )
+       if (!found )
        {
                LOG_ERROR("No device found on bus.\n");
                exit(1);
        }
 
        {
                LOG_ERROR("No device found on bus.\n");
                exit(1);
        }
 
-       if ( !success )
+       if (!success )
        {
                LOG_ERROR("Initialisation failed.");
                exit(1);
        {
                LOG_ERROR("Initialisation failed.");
                exit(1);
index a6f7b5dd4725f15beaaa94451d307811fbdc882f..4422111bb71403b4f8a3c0e3d25a77f6decb420a 100644 (file)
@@ -209,7 +209,7 @@ static Jim_Nvp nvp_config_opts[] = {
        { .name = NULL,          .value = -1 }
 };
 
        { .name = NULL,          .value = -1 }
 };
 
-static int jtag_tap_configure_cmd( Jim_GetOptInfo *goi, jtag_tap_t * tap)
+static int jtag_tap_configure_cmd(Jim_GetOptInfo *goi, jtag_tap_t * tap)
 {
        Jim_Nvp *n;
        Jim_Obj *o;
 {
        Jim_Nvp *n;
        Jim_Obj *o;
@@ -228,11 +228,11 @@ static int jtag_tap_configure_cmd( Jim_GetOptInfo *goi, jtag_tap_t * tap)
                switch (n->value) {
                        case JCFG_EVENT:
                                if (goi->argc == 0) {
                switch (n->value) {
                        case JCFG_EVENT:
                                if (goi->argc == 0) {
-                                       Jim_WrongNumArgs( goi->interp, goi->argc, goi->argv, "-event ?event-name? ..." );
+                                       Jim_WrongNumArgs(goi->interp, goi->argc, goi->argv, "-event ?event-name? ..." );
                                        return JIM_ERR;
                                }
 
                                        return JIM_ERR;
                                }
 
-                               e = Jim_GetOpt_Nvp( goi, nvp_jtag_tap_event, &n );
+                               e = Jim_GetOpt_Nvp(goi, nvp_jtag_tap_event, &n );
                                if (e != JIM_OK) {
                                        Jim_GetOpt_NvpUnknown(goi, nvp_jtag_tap_event, 1);
                                        return e;
                                if (e != JIM_OK) {
                                        Jim_GetOpt_NvpUnknown(goi, nvp_jtag_tap_event, 1);
                                        return e;
@@ -268,7 +268,7 @@ static int jtag_tap_configure_cmd( Jim_GetOptInfo *goi, jtag_tap_t * tap)
                                                        jteap = calloc(1, sizeof (*jteap));
                                                }
                                                jteap->event = n->value;
                                                        jteap = calloc(1, sizeof (*jteap));
                                                }
                                                jteap->event = n->value;
-                                               Jim_GetOpt_Obj( goi, &o);
+                                               Jim_GetOpt_Obj(goi, &o);
                                                if (jteap->body) {
                                                        Jim_DecrRefCount(interp, jteap->body);
                                                }
                                                if (jteap->body) {
                                                        Jim_DecrRefCount(interp, jteap->body);
                                                }
@@ -306,7 +306,7 @@ static int is_bad_irval(int ir_length, jim_wide w)
        return (w & v) != 0;
 }
 
        return (w & v) != 0;
 }
 
-static int jim_newtap_cmd( Jim_GetOptInfo *goi )
+static int jim_newtap_cmd(Jim_GetOptInfo *goi )
 {
        jtag_tap_t *pTap;
        jim_wide w;
 {
        jtag_tap_t *pTap;
        jim_wide w;
@@ -340,20 +340,20 @@ static int jim_newtap_cmd( Jim_GetOptInfo *goi )
        /*
         * we expect CHIP + TAP + OPTIONS
         * */
        /*
         * we expect CHIP + TAP + OPTIONS
         * */
-       if ( goi->argc < 3 ){
+       if (goi->argc < 3 ){
                Jim_SetResult_sprintf(goi->interp, "Missing CHIP TAP OPTIONS ....");
                return JIM_ERR;
        }
                Jim_SetResult_sprintf(goi->interp, "Missing CHIP TAP OPTIONS ....");
                return JIM_ERR;
        }
-       Jim_GetOpt_String( goi, &cp, NULL );
+       Jim_GetOpt_String(goi, &cp, NULL );
        pTap->chip = strdup(cp);
 
        pTap->chip = strdup(cp);
 
-       Jim_GetOpt_String( goi, &cp, NULL );
+       Jim_GetOpt_String(goi, &cp, NULL );
        pTap->tapname = strdup(cp);
 
        /* name + dot + name + null */
        x = strlen(pTap->chip) + 1 + strlen(pTap->tapname) + 1;
        pTap->tapname = strdup(cp);
 
        /* name + dot + name + null */
        x = strlen(pTap->chip) + 1 + strlen(pTap->tapname) + 1;
-       cp = malloc( x );
-       sprintf( cp, "%s.%s", pTap->chip, pTap->tapname );
+       cp = malloc(x );
+       sprintf(cp, "%s.%s", pTap->chip, pTap->tapname );
        pTap->dotted_name = cp;
 
        LOG_DEBUG("Creating New Tap, Chip: %s, Tap: %s, Dotted: %s, %d params",
        pTap->dotted_name = cp;
 
        LOG_DEBUG("Creating New Tap, Chip: %s, Tap: %s, Dotted: %s, %d params",
@@ -367,14 +367,14 @@ static int jim_newtap_cmd( Jim_GetOptInfo *goi )
        /* clear them as we find them */
        reqbits = (NTREQ_IRLEN | NTREQ_IRCAPTURE | NTREQ_IRMASK);
 
        /* clear them as we find them */
        reqbits = (NTREQ_IRLEN | NTREQ_IRCAPTURE | NTREQ_IRMASK);
 
-       while ( goi->argc ){
-               e = Jim_GetOpt_Nvp( goi, opts, &n );
-               if ( e != JIM_OK ){
-                       Jim_GetOpt_NvpUnknown( goi, opts, 0 );
+       while (goi->argc ){
+               e = Jim_GetOpt_Nvp(goi, opts, &n );
+               if (e != JIM_OK ){
+                       Jim_GetOpt_NvpUnknown(goi, opts, 0 );
                        return e;
                }
                LOG_DEBUG("Processing option: %s", n->name );
                        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;
                case NTAP_OPT_ENABLED:
                        pTap->disabled_after_reset = false;
                        break;
@@ -385,15 +385,15 @@ static int jim_newtap_cmd( Jim_GetOptInfo *goi )
                {
                        uint32_t *new_expected_ids;
 
                {
                        uint32_t *new_expected_ids;
 
-                       e = Jim_GetOpt_Wide( goi, &w );
-                       if ( e != JIM_OK) {
+                       e = Jim_GetOpt_Wide(goi, &w );
+                       if (e != JIM_OK) {
                                Jim_SetResult_sprintf(goi->interp, "option: %s bad parameter", n->name);
                                return e;
                        }
 
                        new_expected_ids = malloc(sizeof(uint32_t) * (pTap->expected_ids_cnt + 1));
                        if (new_expected_ids == NULL) {
                                Jim_SetResult_sprintf(goi->interp, "option: %s bad parameter", n->name);
                                return e;
                        }
 
                        new_expected_ids = malloc(sizeof(uint32_t) * (pTap->expected_ids_cnt + 1));
                        if (new_expected_ids == NULL) {
-                               Jim_SetResult_sprintf( goi->interp, "no memory");
+                               Jim_SetResult_sprintf(goi->interp, "no memory");
                                return JIM_ERR;
                        }
 
                                return JIM_ERR;
                        }
 
@@ -409,9 +409,9 @@ static int jim_newtap_cmd( Jim_GetOptInfo *goi )
                case NTAP_OPT_IRLEN:
                case NTAP_OPT_IRMASK:
                case NTAP_OPT_IRCAPTURE:
                case NTAP_OPT_IRLEN:
                case NTAP_OPT_IRMASK:
                case NTAP_OPT_IRCAPTURE:
-                       e = Jim_GetOpt_Wide( goi, &w );
-                       if ( e != JIM_OK ){
-                               Jim_SetResult_sprintf( goi->interp, "option: %s bad parameter", n->name );
+                       e = Jim_GetOpt_Wide(goi, &w );
+                       if (e != JIM_OK ){
+                               Jim_SetResult_sprintf(goi->interp, "option: %s bad parameter", n->name );
                                return e;
                        }
                        switch (n->value){
                                return e;
                        }
                        switch (n->value){
@@ -441,7 +441,7 @@ static int jim_newtap_cmd( Jim_GetOptInfo *goi )
                                break;
                        }
                } /* switch (n->value) */
                                break;
                        }
                } /* switch (n->value) */
-       } /* while ( goi->argc ) */
+       } /* while (goi->argc ) */
 
        /* default is enabled-after-reset */
        pTap->enabled = !pTap->disabled_after_reset;
 
        /* default is enabled-after-reset */
        pTap->enabled = !pTap->disabled_after_reset;
@@ -471,7 +471,7 @@ static void jtag_tap_handle_event(jtag_tap_t *tap, enum jtag_event e)
        while (jteap) {
                if (jteap->event == e) {
                        done = 1;
        while (jteap) {
                if (jteap->event == e) {
                        done = 1;
-                       LOG_DEBUG( "JTAG tap: %s event: %d (%s) action: %s\n",
+                       LOG_DEBUG("JTAG tap: %s event: %d (%s) action: %s\n",
                                        tap->dotted_name,
                                        e,
                                        Jim_Nvp_value2name_simple(nvp_jtag_tap_event, e)->name,
                                        tap->dotted_name,
                                        e,
                                        Jim_Nvp_value2name_simple(nvp_jtag_tap_event, e)->name,
@@ -491,14 +491,14 @@ static void jtag_tap_handle_event(jtag_tap_t *tap, enum jtag_event e)
        }
 
        if (!done) {
        }
 
        if (!done) {
-               LOG_DEBUG( "event %d %s - no action",
+               LOG_DEBUG("event %d %s - no action",
                                e,
                                e,
-                               Jim_Nvp_value2name_simple( nvp_jtag_tap_event, e)->name);
+                               Jim_Nvp_value2name_simple(nvp_jtag_tap_event, e)->name);
        }
 }
 
 
        }
 }
 
 
-static int jim_jtag_command( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
+static int jim_jtag_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv )
 {
        Jim_GetOptInfo goi;
        int e;
 {
        Jim_GetOptInfo goi;
        int e;
@@ -532,44 +532,44 @@ static int jim_jtag_command( Jim_Interp *interp, int argc, Jim_Obj *const *argv
 
        context = Jim_GetAssocData(interp, "context");
        /* go past the command */
 
        context = Jim_GetAssocData(interp, "context");
        /* go past the command */
-       Jim_GetOpt_Setup( &goi, interp, argc-1, argv + 1 );
+       Jim_GetOpt_Setup(&goi, interp, argc-1, argv + 1 );
 
 
-       e = Jim_GetOpt_Nvp( &goi, jtag_cmds, &n );
-       if ( e != JIM_OK ){
-               Jim_GetOpt_NvpUnknown( &goi, jtag_cmds, 0 );
+       e = Jim_GetOpt_Nvp(&goi, jtag_cmds, &n );
+       if (e != JIM_OK ){
+               Jim_GetOpt_NvpUnknown(&goi, jtag_cmds, 0 );
                return e;
        }
                return e;
        }
-               Jim_SetEmptyResult( goi.interp );
-       switch ( n->value ){
+               Jim_SetEmptyResult(goi.interp );
+       switch (n->value ){
        case JTAG_CMD_INTERFACE:
                /* return the name of the interface */
                /* TCL code might need to know the exact type... */
                /* FUTURE: we allow this as a means to "set" the interface. */
        case JTAG_CMD_INTERFACE:
                /* return the name of the interface */
                /* TCL code might need to know the exact type... */
                /* FUTURE: we allow this as a means to "set" the interface. */
-               if ( goi.argc != 0 ){
-                       Jim_WrongNumArgs( goi.interp, 1, goi.argv-1, "(no params)");
+               if (goi.argc != 0 ){
+                       Jim_WrongNumArgs(goi.interp, 1, goi.argv-1, "(no params)");
                        return JIM_ERR;
                }
                        return JIM_ERR;
                }
-               Jim_SetResultString( goi.interp, jtag_interface->name, -1 );
+               Jim_SetResultString(goi.interp, jtag_interface->name, -1 );
                return JIM_OK;
        case JTAG_CMD_INIT_RESET:
                return JIM_OK;
        case JTAG_CMD_INIT_RESET:
-               if ( goi.argc != 0 ){
-                       Jim_WrongNumArgs( goi.interp, 1, goi.argv-1, "(no params)");
+               if (goi.argc != 0 ){
+                       Jim_WrongNumArgs(goi.interp, 1, goi.argv-1, "(no params)");
                        return JIM_ERR;
                }
                e = jtag_init_reset(context);
                        return JIM_ERR;
                }
                e = jtag_init_reset(context);
-               if ( e != ERROR_OK ){
-                       Jim_SetResult_sprintf( goi.interp, "error: %d", e);
+               if (e != ERROR_OK ){
+                       Jim_SetResult_sprintf(goi.interp, "error: %d", e);
                        return JIM_ERR;
                }
                return JIM_OK;
        case JTAG_CMD_NEWTAP:
                        return JIM_ERR;
                }
                return JIM_OK;
        case JTAG_CMD_NEWTAP:
-               return jim_newtap_cmd( &goi );
+               return jim_newtap_cmd(&goi );
                break;
        case JTAG_CMD_TAPISENABLED:
        case JTAG_CMD_TAPENABLE:
        case JTAG_CMD_TAPDISABLE:
                break;
        case JTAG_CMD_TAPISENABLED:
        case JTAG_CMD_TAPENABLE:
        case JTAG_CMD_TAPDISABLE:
-               if ( goi.argc != 1 ){
-                       Jim_SetResultString( goi.interp, "Too many parameters",-1 );
+               if (goi.argc != 1 ){
+                       Jim_SetResultString(goi.interp, "Too many parameters",-1 );
                        return JIM_ERR;
                }
 
                        return JIM_ERR;
                }
 
@@ -619,8 +619,8 @@ static int jim_jtag_command( Jim_Interp *interp, int argc, Jim_Obj *const *argv
                break;
 
        case JTAG_CMD_CGET:
                break;
 
        case JTAG_CMD_CGET:
-               if ( goi.argc < 2 ){
-                       Jim_WrongNumArgs( goi.interp, 0, NULL, "?tap-name? -option ...");
+               if (goi.argc < 2 ){
+                       Jim_WrongNumArgs(goi.interp, 0, NULL, "?tap-name? -option ...");
                        return JIM_ERR;
                }
 
                        return JIM_ERR;
                }
 
@@ -628,19 +628,19 @@ static int jim_jtag_command( Jim_Interp *interp, int argc, Jim_Obj *const *argv
                        jtag_tap_t *t;
 
                        Jim_GetOpt_Obj(&goi, &o);
                        jtag_tap_t *t;
 
                        Jim_GetOpt_Obj(&goi, &o);
-                       t = jtag_tap_by_jim_obj( goi.interp, o );
-                       if ( t == NULL ){
+                       t = jtag_tap_by_jim_obj(goi.interp, o );
+                       if (t == NULL ){
                                return JIM_ERR;
                        }
 
                        goi.isconfigure = 0;
                                return JIM_ERR;
                        }
 
                        goi.isconfigure = 0;
-                       return jtag_tap_configure_cmd( &goi, t);
+                       return jtag_tap_configure_cmd(&goi, t);
                }
                break;
 
        case JTAG_CMD_CONFIGURE:
                }
                break;
 
        case JTAG_CMD_CONFIGURE:
-               if ( goi.argc < 3 ){
-                       Jim_WrongNumArgs( goi.interp, 0, NULL, "?tap-name? -option ?VALUE? ...");
+               if (goi.argc < 3 ){
+                       Jim_WrongNumArgs(goi.interp, 0, NULL, "?tap-name? -option ?VALUE? ...");
                        return JIM_ERR;
                }
 
                        return JIM_ERR;
                }
 
@@ -648,13 +648,13 @@ static int jim_jtag_command( Jim_Interp *interp, int argc, Jim_Obj *const *argv
                        jtag_tap_t *t;
 
                        Jim_GetOpt_Obj(&goi, &o);
                        jtag_tap_t *t;
 
                        Jim_GetOpt_Obj(&goi, &o);
-                       t = jtag_tap_by_jim_obj( goi.interp, o );
-                       if ( t == NULL ){
+                       t = jtag_tap_by_jim_obj(goi.interp, o );
+                       if (t == NULL ){
                                return JIM_ERR;
                        }
 
                        goi.isconfigure = 1;
                                return JIM_ERR;
                        }
 
                        goi.isconfigure = 1;
-                       return jtag_tap_configure_cmd( &goi, t);
+                       return jtag_tap_configure_cmd(&goi, t);
                }
        }
 
                }
        }
 
@@ -663,7 +663,7 @@ static int jim_jtag_command( Jim_Interp *interp, int argc, Jim_Obj *const *argv
 
 int jtag_register_commands(struct command_context_s *cmd_ctx)
 {
 
 int jtag_register_commands(struct command_context_s *cmd_ctx)
 {
-       register_jim( cmd_ctx, "jtag", jim_jtag_command, "perform jtag tap actions");
+       register_jim(cmd_ctx, "jtag", jim_jtag_command, "perform jtag tap actions");
 
        register_command(cmd_ctx, NULL, "interface", handle_interface_command,
                COMMAND_CONFIG, "try to configure interface");
 
        register_command(cmd_ctx, NULL, "interface", handle_interface_command,
                COMMAND_CONFIG, "try to configure interface");
@@ -806,49 +806,49 @@ static int handle_jtag_device_command(struct command_context_s *cmd_ctx, char *c
         * argv[ 3] = not actually used by anything but in the docs
         */
 
         * argv[ 3] = not actually used by anything but in the docs
         */
 
-       if ( argc < 4 ){
-               command_print( cmd_ctx, "OLD DEPRECATED SYNTAX: Please use the NEW syntax");
+       if (argc < 4 ){
+               command_print(cmd_ctx, "OLD DEPRECATED SYNTAX: Please use the NEW syntax");
                return ERROR_OK;
        }
                return ERROR_OK;
        }
-       command_print( cmd_ctx, "OLD SYNTAX: DEPRECATED - translating to new syntax");
-       command_print( cmd_ctx, "jtag newtap CHIP TAP -irlen %s -ircapture %s -irvalue %s",
+       command_print(cmd_ctx, "OLD SYNTAX: DEPRECATED - translating to new syntax");
+       command_print(cmd_ctx, "jtag newtap CHIP TAP -irlen %s -ircapture %s -irvalue %s",
                                   args[0],
                                   args[1],
                                   args[2] );
                                   args[0],
                                   args[1],
                                   args[2] );
-       command_print( cmd_ctx, "Example: STM32 has 2 taps, the cortexM3(len4) + boundaryscan(len5)");
-       command_print( cmd_ctx, "jtag newtap stm32 cortexm3 ....., thus creating the tap: \"stm32.cortexm3\"");
-       command_print( cmd_ctx, "jtag newtap stm32 boundary ....., and the tap: \"stm32.boundary\"");
-       command_print( cmd_ctx, "And then refer to the taps by the dotted name.");
-
-       newargs[0] = Jim_NewStringObj( interp, "jtag", -1   );
-       newargs[1] = Jim_NewStringObj( interp, "newtap", -1 );
-       sprintf( buf, "chip%d", jtag_tap_count() );
-       newargs[2] = Jim_NewStringObj( interp, buf, -1 );
-       sprintf( buf, "tap%d", jtag_tap_count() );
-       newargs[3] = Jim_NewStringObj( interp, buf, -1  );
-       newargs[4] = Jim_NewStringObj( interp, "-irlen", -1  );
-       newargs[5] = Jim_NewStringObj( interp, args[0], -1  );
-       newargs[6] = Jim_NewStringObj( interp, "-ircapture", -1  );
-       newargs[7] = Jim_NewStringObj( interp, args[1], -1  );
-       newargs[8] = Jim_NewStringObj( interp, "-irmask", -1  );
-       newargs[9] = Jim_NewStringObj( interp, args[2], -1  );
-
-       command_print( cmd_ctx, "NEW COMMAND:");
-       sprintf( buf, "%s %s %s %s %s %s %s %s %s %s",
-                        Jim_GetString( newargs[0], NULL ),
-                        Jim_GetString( newargs[1], NULL ),
-                        Jim_GetString( newargs[2], NULL ),
-                        Jim_GetString( newargs[3], NULL ),
-                        Jim_GetString( newargs[4], NULL ),
-                        Jim_GetString( newargs[5], NULL ),
-                        Jim_GetString( newargs[6], NULL ),
-                        Jim_GetString( newargs[7], NULL ),
-                        Jim_GetString( newargs[8], NULL ),
-                        Jim_GetString( newargs[9], NULL ) );
-
-       e = jim_jtag_command( interp, 10, newargs );
-       if ( e != JIM_OK ){
-               command_print( cmd_ctx, "%s", Jim_GetString( Jim_GetResult(interp), NULL ) );
+       command_print(cmd_ctx, "Example: STM32 has 2 taps, the cortexM3(len4) + boundaryscan(len5)");
+       command_print(cmd_ctx, "jtag newtap stm32 cortexm3 ....., thus creating the tap: \"stm32.cortexm3\"");
+       command_print(cmd_ctx, "jtag newtap stm32 boundary ....., and the tap: \"stm32.boundary\"");
+       command_print(cmd_ctx, "And then refer to the taps by the dotted name.");
+
+       newargs[0] = Jim_NewStringObj(interp, "jtag", -1   );
+       newargs[1] = Jim_NewStringObj(interp, "newtap", -1 );
+       sprintf(buf, "chip%d", jtag_tap_count() );
+       newargs[2] = Jim_NewStringObj(interp, buf, -1 );
+       sprintf(buf, "tap%d", jtag_tap_count() );
+       newargs[3] = Jim_NewStringObj(interp, buf, -1  );
+       newargs[4] = Jim_NewStringObj(interp, "-irlen", -1  );
+       newargs[5] = Jim_NewStringObj(interp, args[0], -1  );
+       newargs[6] = Jim_NewStringObj(interp, "-ircapture", -1  );
+       newargs[7] = Jim_NewStringObj(interp, args[1], -1  );
+       newargs[8] = Jim_NewStringObj(interp, "-irmask", -1  );
+       newargs[9] = Jim_NewStringObj(interp, args[2], -1  );
+
+       command_print(cmd_ctx, "NEW COMMAND:");
+       sprintf(buf, "%s %s %s %s %s %s %s %s %s %s",
+                        Jim_GetString(newargs[0], NULL ),
+                        Jim_GetString(newargs[1], NULL ),
+                        Jim_GetString(newargs[2], NULL ),
+                        Jim_GetString(newargs[3], NULL ),
+                        Jim_GetString(newargs[4], NULL ),
+                        Jim_GetString(newargs[5], NULL ),
+                        Jim_GetString(newargs[6], NULL ),
+                        Jim_GetString(newargs[7], NULL ),
+                        Jim_GetString(newargs[8], NULL ),
+                        Jim_GetString(newargs[9], NULL ) );
+
+       e = jim_jtag_command(interp, 10, newargs );
+       if (e != JIM_OK ){
+               command_print(cmd_ctx, "%s", Jim_GetString(Jim_GetResult(interp), NULL ) );
        }
        return e;
 }
        }
        return e;
 }
@@ -861,7 +861,7 @@ static int handle_scan_chain_command(struct command_context_s *cmd_ctx, char *cm
        command_print(cmd_ctx, "     TapName            | Enabled |   IdCode      Expected    IrLen IrCap  IrMask Instr     ");
        command_print(cmd_ctx, "---|--------------------|---------|------------|------------|------|------|------|---------");
 
        command_print(cmd_ctx, "     TapName            | Enabled |   IdCode      Expected    IrLen IrCap  IrMask Instr     ");
        command_print(cmd_ctx, "---|--------------------|---------|------------|------------|------|------|------|---------");
 
-       while ( tap ){
+       while (tap ){
                uint32_t expected, expected_mask, cur_instr, ii;
                expected = buf_get_u32(tap->expected, 0, tap->ir_length);
                expected_mask = buf_get_u32(tap->expected_mask, 0, tap->ir_length);
                uint32_t expected, expected_mask, cur_instr, ii;
                expected = buf_get_u32(tap->expected, 0, tap->ir_length);
                expected_mask = buf_get_u32(tap->expected_mask, 0, tap->ir_length);
@@ -1174,20 +1174,20 @@ static int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, c
         */
        endstate = TAP_IDLE;
 
         */
        endstate = TAP_IDLE;
 
-       if ( argc >= 4 ){
+       if (argc >= 4 ){
                /* have at least one pair of numbers. */
                /* is last pair the magic text? */
                /* have at least one pair of numbers. */
                /* is last pair the magic text? */
-               if ( 0 == strcmp( "-endstate", args[ argc - 2 ] ) ){
+               if (0 == strcmp("-endstate", args[ argc - 2 ] ) ){
                        const char *cpA;
                        const char *cpS;
                        cpA = args[ argc-1 ];
                        const char *cpA;
                        const char *cpS;
                        cpA = args[ argc-1 ];
-                       for ( endstate = 0 ; endstate < TAP_NUM_STATES ; endstate++ ){
-                               cpS = tap_state_name( endstate );
-                               if ( 0 == strcmp( cpA, cpS ) ){
+                       for (endstate = 0 ; endstate < TAP_NUM_STATES ; endstate++ ){
+                               cpS = tap_state_name(endstate );
+                               if (0 == strcmp(cpA, cpS ) ){
                                        break;
                                }
                        }
                                        break;
                                }
                        }
-                       if ( endstate >= TAP_NUM_STATES ){
+                       if (endstate >= TAP_NUM_STATES ){
                                return ERROR_COMMAND_SYNTAX_ERROR;
                        } else {
                                if (!scan_is_safe(endstate))
                                return ERROR_COMMAND_SYNTAX_ERROR;
                        } else {
                                if (!scan_is_safe(endstate))
@@ -1207,10 +1207,10 @@ static int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, c
        int retval;
        for (i = 0; i < num_fields; i++)
        {
        int retval;
        for (i = 0; i < num_fields; i++)
        {
-               tap = jtag_tap_by_string( args[i*2] );
+               tap = jtag_tap_by_string(args[i*2] );
                if (tap == NULL)
                {
                if (tap == NULL)
                {
-                       command_print( cmd_ctx, "Tap: %s unknown", args[i*2] );
+                       command_print(cmd_ctx, "Tap: %s unknown", args[i*2] );
                        return ERROR_FAIL;
                }
                int field_size = tap->ir_length;
                        return ERROR_FAIL;
                }
                int field_size = tap->ir_length;
@@ -1281,12 +1281,12 @@ static int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args
 
                e = Jim_GetLong(interp, args[i], &bits);
                /* If valid - try next arg */
 
                e = Jim_GetLong(interp, args[i], &bits);
                /* If valid - try next arg */
-               if ( e == JIM_OK ){
+               if (e == JIM_OK ){
                        continue;
                }
 
                /* Not valid.. are we at the end? */
                        continue;
                }
 
                /* Not valid.. are we at the end? */
-               if ( ((i + 2) != argc) ){
+               if (((i + 2) != argc) ){
                        /* nope, then error */
                        return e;
                }
                        /* nope, then error */
                        return e;
                }
@@ -1297,15 +1297,15 @@ static int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args
                 */
 
                /* get arg as a string. */
                 */
 
                /* get arg as a string. */
-               cp = Jim_GetString( args[i], NULL );
+               cp = Jim_GetString(args[i], NULL );
                /* is it the magic? */
                /* is it the magic? */
-               if ( 0 == strcmp( "-endstate", cp ) ){
+               if (0 == strcmp("-endstate", cp ) ){
                        /* is the statename valid? */
                        /* is the statename valid? */
-                       cp = Jim_GetString( args[i + 1], NULL );
+                       cp = Jim_GetString(args[i + 1], NULL );
 
                        /* see if it is a valid state name */
                        endstate = tap_state_by_name(cp);
 
                        /* see if it is a valid state name */
                        endstate = tap_state_by_name(cp);
-                       if ( endstate < 0 ){
+                       if (endstate < 0 ){
                                /* update the error message */
                                Jim_SetResult_sprintf(interp,"endstate: %s invalid", cp );
                        } else {
                                /* update the error message */
                                Jim_SetResult_sprintf(interp,"endstate: %s invalid", cp );
                        } else {
@@ -1321,13 +1321,13 @@ static int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args
                }
 
                /* Still an error? */
                }
 
                /* Still an error? */
-               if ( e != JIM_OK ){
+               if (e != JIM_OK ){
                        return e; /* too bad */
                }
        } /* validate args */
 
                        return e; /* too bad */
                }
        } /* validate args */
 
-       tap = jtag_tap_by_jim_obj( interp, args[1] );
-       if ( tap == NULL ){
+       tap = jtag_tap_by_jim_obj(interp, args[1] );
+       if (tap == NULL ){
                return JIM_ERR;
        }
 
                return JIM_ERR;
        }
 
@@ -1399,9 +1399,9 @@ static int Jim_Command_pathmove(Jim_Interp *interp, int argc, Jim_Obj *const *ar
        for (i = 0; i < argc-1; i++)
        {
                const char *cp;
        for (i = 0; i < argc-1; i++)
        {
                const char *cp;
-               cp = Jim_GetString( args[i + 1], NULL );
+               cp = Jim_GetString(args[i + 1], NULL );
                states[i] = tap_state_by_name(cp);
                states[i] = tap_state_by_name(cp);
-               if ( states[i] < 0 )
+               if (states[i] < 0 )
                {
                        /* update the error message */
                        Jim_SetResult_sprintf(interp,"endstate: %s invalid", cp );
                {
                        /* update the error message */
                        Jim_SetResult_sprintf(interp,"endstate: %s invalid", cp );
@@ -1409,7 +1409,7 @@ static int Jim_Command_pathmove(Jim_Interp *interp, int argc, Jim_Obj *const *ar
                }
        }
 
                }
        }
 
-       if ((jtag_add_statemove(states[0]) != ERROR_OK) || ( jtag_execute_queue()!= ERROR_OK))
+       if ((jtag_add_statemove(states[0]) != ERROR_OK) || (jtag_execute_queue()!= ERROR_OK))
        {
                Jim_SetResultString(interp, "pathmove: jtag execute failed",-1);
                return JIM_ERR;
        {
                Jim_SetResultString(interp, "pathmove: jtag execute failed",-1);
                return JIM_ERR;
index 41a9190938e933e5d770f3ce9763cc2ab3ce62c9..56f92abe9ffa329c8fc3839d336399009c0dc943 100644 (file)
@@ -298,7 +298,7 @@ static int vsllink_execute_queue(void)
                switch (cmd->type)
                {
                        case JTAG_RUNTEST:
                switch (cmd->type)
                {
                        case JTAG_RUNTEST:
-                               DEBUG_JTAG_IO( "runtest %i cycles, end in %s", cmd->cmd.runtest->num_cycles, \
+                               DEBUG_JTAG_IO("runtest %i cycles, end in %s", cmd->cmd.runtest->num_cycles, \
                                        tap_state_name(cmd->cmd.runtest->end_state));
 
                                vsllink_end_state(cmd->cmd.runtest->end_state);
                                        tap_state_name(cmd->cmd.runtest->end_state));
 
                                vsllink_end_state(cmd->cmd.runtest->end_state);
@@ -377,7 +377,7 @@ static int vsllink_execute_queue(void)
                                        scan_size = 0;
                                        break;                  /* above stable states are OK */
                                default:
                                        scan_size = 0;
                                        break;                  /* above stable states are OK */
                                default:
-                                        LOG_ERROR( "jtag_add_clocks() was called with TAP in non-stable state \"%s\"",
+                                        LOG_ERROR("jtag_add_clocks() was called with TAP in non-stable state \"%s\"",
                                                         tap_state_name(tap_get_state()) );
                                         exit(-1);
                                }
                                                         tap_state_name(tap_get_state()) );
                                         exit(-1);
                                }
index 103a692c4da73a27aa160001bdb8e7da551d32a2..cd950c30a04498b5cc7d75da1cb007e46ccd89e3 100644 (file)
@@ -26,7 +26,7 @@
 #define TEST_MANUAL() 0
 
 #if 0
 #define TEST_MANUAL() 0
 
 #if 0
-int  diag_printf( const char *fmt, ... );
+int  diag_printf(const char *fmt, ... );
 #define ZY1000_POKE(a, b) HAL_WRITE_UINT32(a, b); diag_printf("poke 0x%08x,0x%08x\n", a, b)
 #define ZY1000_PEEK(a, b) HAL_READ_UINT32(a, b); diag_printf("peek 0x%08x = 0x%08x\n", a, b)
 #else
 #define ZY1000_POKE(a, b) HAL_WRITE_UINT32(a, b); diag_printf("poke 0x%08x,0x%08x\n", a, b)
 #define ZY1000_PEEK(a, b) HAL_READ_UINT32(a, b); diag_printf("peek 0x%08x = 0x%08x\n", a, b)
 #else
index c490b9c1c7d1d6432f73ca8393cd478e4a44621c..2e886e34ce3f620f02e5f4cdd3221db356c4e8df 100644 (file)
@@ -208,7 +208,7 @@ command_context_t *setup_command_handler(void)
        }
        LOG_DEBUG("log init complete");
 
        }
        LOG_DEBUG("log init complete");
 
-       LOG_OUTPUT( OPENOCD_VERSION "\n" );
+       LOG_OUTPUT(OPENOCD_VERSION "\n" );
 
        register_command(cmd_ctx, NULL, "init", handle_init_command,
                                         COMMAND_ANY, "initializes target and servers - nop on subsequent invocations");
 
        register_command(cmd_ctx, NULL, "init", handle_init_command,
                                         COMMAND_ANY, "initializes target and servers - nop on subsequent invocations");
@@ -264,7 +264,7 @@ int openocd_main(int argc, char *argv[])
                return EXIT_FAILURE;
 
        ret = parse_config_file(cmd_ctx);
                return EXIT_FAILURE;
 
        ret = parse_config_file(cmd_ctx);
-       if ( (ret != ERROR_OK) && (ret != ERROR_COMMAND_CLOSE_CONNECTION) )
+       if ((ret != ERROR_OK) && (ret != ERROR_COMMAND_CLOSE_CONNECTION) )
                return EXIT_FAILURE;
 
 #if BUILD_HTTPD
                return EXIT_FAILURE;
 
 #if BUILD_HTTPD
index 91427a05c91ac173ab5233b40de8c1d39796cb84..048b0a7831962d28d3dbc669db4ae723e09aae74 100644 (file)
@@ -243,7 +243,7 @@ static int virtex2_pld_device_command(struct command_context_s *cmd_ctx,
 
        tap = jtag_tap_by_string(args[1]);
        if (tap == NULL) {
 
        tap = jtag_tap_by_string(args[1]);
        if (tap == NULL) {
-               command_print( cmd_ctx, "Tap: %s does not exist", args[1] );
+               command_print(cmd_ctx, "Tap: %s does not exist", args[1] );
                return ERROR_OK;
        }
 
                return ERROR_OK;
        }
 
index fc7a2821d1fda077eb24e4beb24ea1ac800fdea8..9b22ce274ef4002c3cdfba762512e93d8e50d74a 100644 (file)
@@ -319,9 +319,9 @@ int gdb_put_packet_inner(connection_t *connection, char *buffer, int len)
                        break;
                if ((retval = gdb_get_char(connection, &reply)) != ERROR_OK)
                        return retval;
                        break;
                if ((retval = gdb_get_char(connection, &reply)) != ERROR_OK)
                        return retval;
-               if ( reply == '$' ){
+               if (reply == '$' ){
                        /* fix a problem with some IAR tools */
                        /* fix a problem with some IAR tools */
-                       gdb_putback_char( connection, reply );
+                       gdb_putback_char(connection, reply );
                        LOG_DEBUG("Unexpected start of new packet");
                        break;
                }
                        LOG_DEBUG("Unexpected start of new packet");
                        break;
                }
@@ -402,9 +402,9 @@ int gdb_put_packet_inner(connection_t *connection, char *buffer, int len)
                                log_remove_callback(gdb_log_callback, connection);
                                LOG_WARNING("negative reply, retrying");
                        }
                                log_remove_callback(gdb_log_callback, connection);
                                LOG_WARNING("negative reply, retrying");
                        }
-                       else if ( reply == '$' ){
+                       else if (reply == '$' ){
                                LOG_ERROR("GDB missing ack(1) - assumed good");
                                LOG_ERROR("GDB missing ack(1) - assumed good");
-                               gdb_putback_char( connection, reply );
+                               gdb_putback_char(connection, reply );
                                return ERROR_OK;
                        } else {
 
                                return ERROR_OK;
                        } else {
 
@@ -413,9 +413,9 @@ int gdb_put_packet_inner(connection_t *connection, char *buffer, int len)
                                return ERROR_SERVER_REMOTE_CLOSED;
                        }
                }
                                return ERROR_SERVER_REMOTE_CLOSED;
                        }
                }
-               else if ( reply == '$' ){
+               else if (reply == '$' ){
                        LOG_ERROR("GDB missing ack(2) - assumed good");
                        LOG_ERROR("GDB missing ack(2) - assumed good");
-                       gdb_putback_char( connection, reply );
+                       gdb_putback_char(connection, reply );
                        return ERROR_OK;
                }
                else
                        return ERROR_OK;
                }
                else
@@ -709,7 +709,7 @@ int gdb_target_callback_event_handler(struct target_s *target, enum target_event
        int retval;
        connection_t *connection = priv;
 
        int retval;
        connection_t *connection = priv;
 
-       target_handle_event( target, event );
+       target_handle_event(target, event );
        switch (event)
        {
                case TARGET_EVENT_EARLY_HALTED:
        switch (event)
        {
                case TARGET_EVENT_EARLY_HALTED:
@@ -719,7 +719,7 @@ int gdb_target_callback_event_handler(struct target_s *target, enum target_event
                        target_call_event_callbacks(target, TARGET_EVENT_GDB_END);
                        break;
                case TARGET_EVENT_GDB_FLASH_ERASE_START:
                        target_call_event_callbacks(target, TARGET_EVENT_GDB_END);
                        break;
                case TARGET_EVENT_GDB_FLASH_ERASE_START:
-                       target_handle_event( target, TARGET_EVENT_OLD_gdb_program_config );
+                       target_handle_event(target, TARGET_EVENT_OLD_gdb_program_config );
                        if ((retval = jtag_execute_queue()) != ERROR_OK)
                        {
                                return retval;
                        if ((retval = jtag_execute_queue()) != ERROR_OK)
                        {
                                return retval;
@@ -1360,7 +1360,7 @@ int gdb_step_continue_packet(connection_t *connection, target_t *target, char *p
        if (packet[0] == 'c')
        {
                LOG_DEBUG("continue");
        if (packet[0] == 'c')
        {
                LOG_DEBUG("continue");
-               target_handle_event( target, TARGET_EVENT_OLD_pre_resume );
+               target_handle_event(target, TARGET_EVENT_OLD_pre_resume );
                retval = target_resume(target, current, address, 0, 0); /* resume at current address, don't handle breakpoints, not debugging */
        }
        else if (packet[0] == 's')
                retval = target_resume(target, current, address, 0, 0); /* resume at current address, don't handle breakpoints, not debugging */
        }
        else if (packet[0] == 's')
@@ -1937,7 +1937,7 @@ int gdb_v_packet(connection_t *connection, target_t *target, char *packet, int p
                target_call_event_callbacks(gdb_service->target, TARGET_EVENT_GDB_FLASH_WRITE_START);
                result = flash_write(gdb_service->target, gdb_connection->vflash_image, &written, 0);
                target_call_event_callbacks(gdb_service->target, TARGET_EVENT_GDB_FLASH_WRITE_END);
                target_call_event_callbacks(gdb_service->target, TARGET_EVENT_GDB_FLASH_WRITE_START);
                result = flash_write(gdb_service->target, gdb_connection->vflash_image, &written, 0);
                target_call_event_callbacks(gdb_service->target, TARGET_EVENT_GDB_FLASH_WRITE_END);
-               if ( result != ERROR_OK)
+               if (result != ERROR_OK)
                {
                        if (result == ERROR_FLASH_DST_OUT_OF_BANK)
                                gdb_put_packet(connection, "E.memtype", 9);
                {
                        if (result == ERROR_FLASH_DST_OUT_OF_BANK)
                                gdb_put_packet(connection, "E.memtype", 9);
@@ -1964,10 +1964,10 @@ 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 );
                        target_resume(target, 1, 0, 1, 0);
                        break;
 
                        target_resume(target, 1, 0, 1, 0);
                        break;
 
@@ -2036,12 +2036,12 @@ int gdb_input_inner(connection_t *connection)
                /* terminate with zero */
                packet[packet_size] = 0;
 
                /* terminate with zero */
                packet[packet_size] = 0;
 
-               if ( LOG_LEVEL_IS( LOG_LVL_DEBUG ) ){
-                       if ( packet[0] == 'X' ){
+               if (LOG_LEVEL_IS(LOG_LVL_DEBUG ) ){
+                       if (packet[0] == 'X' ){
                                // binary packets spew junk into the debug log stream
                                char buf[ 50 ];
                                int x;
                                // binary packets spew junk into the debug log stream
                                char buf[ 50 ];
                                int x;
-                               for ( x = 0 ; (x < 49) && (packet[x] != ':') ; x++ ){
+                               for (x = 0 ; (x < 49) && (packet[x] != ':') ; x++ ){
                                        buf[x] = packet[x];
                                }
                                buf[x] = 0;
                                        buf[x] = packet[x];
                                }
                                buf[x] = 0;
index a3137d90a1359645163a78259543df9e431b1372..e396bc36c468493704b1c83a10ecac3c320351d2 100644 (file)
@@ -415,8 +415,8 @@ static pthread_mutex_t mutex;
 int httpd_start(void)
 {
        pthread_mutexattr_t attr;
 int httpd_start(void)
 {
        pthread_mutexattr_t attr;
-       pthread_mutexattr_init( &attr );
-       pthread_mutex_init( &mutex, &attr );
+       pthread_mutexattr_init(&attr );
+       pthread_mutex_init(&mutex, &attr );
 
        int port = 8888;
        LOG_USER("Launching httpd server on port %d", port);
 
        int port = 8888;
        LOG_USER("Launching httpd server on port %d", port);
@@ -446,16 +446,16 @@ int httpd_start(void)
 void httpd_stop(void)
 {
        MHD_stop_daemon(d);
 void httpd_stop(void)
 {
        MHD_stop_daemon(d);
-       pthread_mutex_destroy( &mutex );
+       pthread_mutex_destroy(&mutex );
 }
 
 void openocd_sleep_prelude(void)
 {
 }
 
 void openocd_sleep_prelude(void)
 {
-       pthread_mutex_unlock( &mutex );
+       pthread_mutex_unlock(&mutex );
 }
 
 void openocd_sleep_postlude(void)
 {
 }
 
 void openocd_sleep_postlude(void)
 {
-       pthread_mutex_lock( &mutex );
+       pthread_mutex_lock(&mutex );
 }
 
 }
 
index a93d6ada4c8b4d11deb30831255731d43b5d30cc..af457814009cf3ea6fa28b59b37f0fd5182c79fb 100644 (file)
@@ -528,7 +528,7 @@ int server_quit(void)
 
 #ifdef _WIN32
        WSACleanup();
 
 #ifdef _WIN32
        WSACleanup();
-       SetConsoleCtrlHandler( ControlHandler, FALSE );
+       SetConsoleCtrlHandler(ControlHandler, FALSE );
 #endif
 
        return ERROR_OK;
 #endif
 
        return ERROR_OK;
index 833b029e834cad42e69cc811bd164c6e2f37498e..36bc5f7f96eb5740299e0e7daa8c5f6126728b75 100644 (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_IDLE:          ret = "IDLE";           break;
        {
        case TAP_RESET:         ret = "RESET";          break;
        case TAP_IDLE:          ret = "IDLE";           break;
@@ -422,7 +422,7 @@ static int handle_svf_command(struct command_context_s *cmd_ctx, char *cmd, char
        // TAP_RESET
        jtag_add_tlr();
 
        // TAP_RESET
        jtag_add_tlr();
 
-       while ( ERROR_OK == svf_read_command_from_file(svf_fd) )
+       while (ERROR_OK == svf_read_command_from_file(svf_fd) )
        {
                if (ERROR_OK != svf_run_command(cmd_ctx, svf_command_buffer))
                {
        {
                if (ERROR_OK != svf_run_command(cmd_ctx, svf_command_buffer))
                {
index 54289d7cd6860e32414a5d99e44a2fcf874be63d..77ff6dc00c514687c44485bef37b075f5c003ed5 100644 (file)
@@ -709,7 +709,7 @@ int arm11_arch_state(struct target_s *target)
        arm11_common_t * arm11 = target->arch_info;
 
        LOG_USER("target halted due to %s\ncpsr: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "",
        arm11_common_t * arm11 = target->arch_info;
 
        LOG_USER("target halted due to %s\ncpsr: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "",
-                        Jim_Nvp_value2name_simple( nvp_target_debug_reason, target->debug_reason )->name,
+                        Jim_Nvp_value2name_simple(nvp_target_debug_reason, target->debug_reason )->name,
                         R(CPSR),
                         R(PC));
 
                         R(CPSR),
                         R(PC));
 
@@ -732,7 +732,7 @@ int arm11_halt(struct target_s *target)
        arm11_common_t * arm11 = target->arch_info;
 
        LOG_DEBUG("target->state: %s",
        arm11_common_t * arm11 = target->arch_info;
 
        LOG_DEBUG("target->state: %s",
-               Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name );
+               Jim_Nvp_value2name_simple(nvp_target_state, target->state )->name );
 
        if (target->state == TARGET_UNKNOWN)
        {
 
        if (target->state == TARGET_UNKNOWN)
        {
@@ -789,7 +789,7 @@ int arm11_resume(struct target_s *target, int current, uint32_t address, int han
        arm11_common_t * arm11 = target->arch_info;
 
        LOG_DEBUG("target->state: %s",
        arm11_common_t * arm11 = target->arch_info;
 
        LOG_DEBUG("target->state: %s",
-               Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name );
+               Jim_Nvp_value2name_simple(nvp_target_state, target->state )->name );
 
 
        if (target->state != TARGET_HALTED)
 
 
        if (target->state != TARGET_HALTED)
@@ -889,7 +889,7 @@ int arm11_step(struct target_s *target, int current, uint32_t address, int handl
        FNC_INFO;
 
        LOG_DEBUG("target->state: %s",
        FNC_INFO;
 
        LOG_DEBUG("target->state: %s",
-               Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name );
+               Jim_Nvp_value2name_simple(nvp_target_state, target->state )->name );
 
        if (target->state != TARGET_HALTED)
        {
 
        if (target->state != TARGET_HALTED)
        {
@@ -1035,7 +1035,7 @@ int arm11_deassert_reset(struct target_s *target)
 
 #if 0
        LOG_DEBUG("target->state: %s",
 
 #if 0
        LOG_DEBUG("target->state: %s",
-               Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name );
+               Jim_Nvp_value2name_simple(nvp_target_state, target->state )->name );
 
 
        /* deassert reset lines */
 
 
        /* deassert reset lines */
@@ -1951,30 +1951,30 @@ int arm11_register_commands(struct command_context_s *cmd_ctx)
 
        command_t * top_cmd = NULL;
 
 
        command_t * top_cmd = NULL;
 
-       RC_TOP(                         "arm11",                                "arm11 specific commands",
+       RC_TOP("arm11",                         "arm11 specific commands",
 
 
-       RC_TOP(                         "memwrite",                             "Control memory write transfer mode",
+       RC_TOP("memwrite",                              "Control memory write transfer mode",
 
 
-               RC_FINAL_BOOL(  "burst",                                "Enable/Disable non-standard but fast burst mode (default: enabled)",
+               RC_FINAL_BOOL("burst",                          "Enable/Disable non-standard but fast burst mode (default: enabled)",
                                                memwrite_burst)
 
                                                memwrite_burst)
 
-               RC_FINAL_BOOL(  "error_fatal",                  "Terminate program if transfer error was found (default: enabled)",
+               RC_FINAL_BOOL("error_fatal",                    "Terminate program if transfer error was found (default: enabled)",
                                                memwrite_error_fatal)
        ) /* memwrite */
 
                                                memwrite_error_fatal)
        ) /* memwrite */
 
-       RC_FINAL_BOOL(          "no_increment",                 "Don't increment address on multi-read/-write (default: disabled)",
+       RC_FINAL_BOOL("no_increment",                   "Don't increment address on multi-read/-write (default: disabled)",
                                                memrw_no_increment)
 
                                                memrw_no_increment)
 
-       RC_FINAL_BOOL(          "step_irq_enable",              "Enable interrupts while stepping (default: disabled)",
+       RC_FINAL_BOOL("step_irq_enable",                "Enable interrupts while stepping (default: disabled)",
                                                step_irq_enable)
 
                                                step_irq_enable)
 
-       RC_FINAL(                       "vcr",                                  "Control (Interrupt) Vector Catch Register",
+       RC_FINAL("vcr",                                 "Control (Interrupt) Vector Catch Register",
                                                arm11_handle_vcr)
 
                                                arm11_handle_vcr)
 
-       RC_FINAL(                       "mrc",                                  "Read Coprocessor register",
+       RC_FINAL("mrc",                                 "Read Coprocessor register",
                                                arm11_handle_mrc)
 
                                                arm11_handle_mrc)
 
-       RC_FINAL(                       "mcr",                                  "Write Coprocessor register",
+       RC_FINAL("mcr",                                 "Write Coprocessor register",
                                                arm11_handle_mcr)
        ) /* arm11 */
 
                                                arm11_handle_mcr)
        ) /* arm11 */
 
index 49bdb88744463b8e2118c635c62b493388ecd7f3..4e9e6fd72b290e7c35915236de68f8fd72375753 100644 (file)
@@ -319,7 +319,7 @@ int arm720t_arch_state(struct target_s *target)
                        "cpsr: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "\n"
                        "MMU: %s, Cache: %s",
                         armv4_5_state_strings[armv4_5->core_state],
                        "cpsr: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "\n"
                        "MMU: %s, Cache: %s",
                         armv4_5_state_strings[armv4_5->core_state],
-                        Jim_Nvp_value2name_simple( nvp_target_debug_reason, target->debug_reason )->name ,
+                        Jim_Nvp_value2name_simple(nvp_target_debug_reason, target->debug_reason )->name ,
                         armv4_5_mode_strings[armv4_5_mode_to_number(armv4_5->core_mode)],
                         buf_get_u32(armv4_5->core_cache->reg_list[ARMV4_5_CPSR].value, 0, 32),
                         buf_get_u32(armv4_5->core_cache->reg_list[15].value, 0, 32),
                         armv4_5_mode_strings[armv4_5_mode_to_number(armv4_5->core_mode)],
                         buf_get_u32(armv4_5->core_cache->reg_list[ARMV4_5_CPSR].value, 0, 32),
                         buf_get_u32(armv4_5->core_cache->reg_list[15].value, 0, 32),
index 266b7bf48dbe9a458c17625fb2cc2e1aabe4485b..b6fd69701cf722effe4c09e4950a57fcea59b2fb 100644 (file)
@@ -526,7 +526,7 @@ int arm7_9_set_watchpoint(struct target_s *target, watchpoint_t *watchpoint)
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_ADDR_VALUE], watchpoint->address);
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_ADDR_MASK], mask);
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_DATA_MASK], watchpoint->mask);
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_ADDR_VALUE], watchpoint->address);
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_ADDR_MASK], mask);
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_DATA_MASK], watchpoint->mask);
-               if ( watchpoint->mask != 0xffffffffu )
+               if (watchpoint->mask != 0xffffffffu )
                        embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_DATA_VALUE], watchpoint->value);
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_CONTROL_MASK], 0xff & ~EICE_W_CTRL_nOPC & ~rw_mask);
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_CONTROL_VALUE], EICE_W_CTRL_ENABLE | EICE_W_CTRL_nOPC | (watchpoint->rw & 1));
                        embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_DATA_VALUE], watchpoint->value);
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_CONTROL_MASK], 0xff & ~EICE_W_CTRL_nOPC & ~rw_mask);
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W0_CONTROL_VALUE], EICE_W_CTRL_ENABLE | EICE_W_CTRL_nOPC | (watchpoint->rw & 1));
@@ -543,7 +543,7 @@ int arm7_9_set_watchpoint(struct target_s *target, watchpoint_t *watchpoint)
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_ADDR_VALUE], watchpoint->address);
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_ADDR_MASK], mask);
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_DATA_MASK], watchpoint->mask);
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_ADDR_VALUE], watchpoint->address);
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_ADDR_MASK], mask);
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_DATA_MASK], watchpoint->mask);
-               if ( watchpoint->mask != 0xffffffffu )
+               if (watchpoint->mask != 0xffffffffu )
                        embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_DATA_VALUE], watchpoint->value);
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_CONTROL_MASK], 0xff & ~EICE_W_CTRL_nOPC & ~rw_mask);
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_CONTROL_VALUE], EICE_W_CTRL_ENABLE | EICE_W_CTRL_nOPC | (watchpoint->rw & 1));
                        embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_DATA_VALUE], watchpoint->value);
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_CONTROL_MASK], 0xff & ~EICE_W_CTRL_nOPC & ~rw_mask);
                embeddedice_set_reg(&arm7_9->eice_cache->reg_list[EICE_W1_CONTROL_VALUE], EICE_W_CTRL_ENABLE | EICE_W_CTRL_nOPC | (watchpoint->rw & 1));
@@ -974,7 +974,7 @@ int arm7_9_assert_reset(target_t *target)
        armv4_5_common_t *armv4_5 = target->arch_info;
        arm7_9_common_t *arm7_9 = armv4_5->arch_info;
        LOG_DEBUG("target->state: %s",
        armv4_5_common_t *armv4_5 = target->arch_info;
        arm7_9_common_t *arm7_9 = armv4_5->arch_info;
        LOG_DEBUG("target->state: %s",
-                 Jim_Nvp_value2name_simple( nvp_target_state,target->state)->name);
+                 Jim_Nvp_value2name_simple(nvp_target_state,target->state)->name);
 
        enum reset_types jtag_reset_config = jtag_get_reset_config();
        if (!(jtag_reset_config & RESET_HAS_SRST))
 
        enum reset_types jtag_reset_config = jtag_get_reset_config();
        if (!(jtag_reset_config & RESET_HAS_SRST))
@@ -1044,7 +1044,7 @@ int arm7_9_deassert_reset(target_t *target)
 {
        int retval = ERROR_OK;
        LOG_DEBUG("target->state: %s",
 {
        int retval = ERROR_OK;
        LOG_DEBUG("target->state: %s",
-               Jim_Nvp_value2name_simple( nvp_target_state,target->state)->name);
+               Jim_Nvp_value2name_simple(nvp_target_state,target->state)->name);
 
        /* deassert reset lines */
        jtag_add_reset(0, 0);
 
        /* deassert reset lines */
        jtag_add_reset(0, 0);
@@ -1257,7 +1257,7 @@ int arm7_9_halt(target_t *target)
        reg_t *dbg_ctrl = &arm7_9->eice_cache->reg_list[EICE_DBG_CTRL];
 
        LOG_DEBUG("target->state: %s",
        reg_t *dbg_ctrl = &arm7_9->eice_cache->reg_list[EICE_DBG_CTRL];
 
        LOG_DEBUG("target->state: %s",
-                 Jim_Nvp_value2name_simple( nvp_target_state,target->state)->name);
+                 Jim_Nvp_value2name_simple(nvp_target_state,target->state)->name);
 
        if (target->state == TARGET_HALTED)
        {
 
        if (target->state == TARGET_HALTED)
        {
index ba533a41ee136c80db1a0618faef420a0534497f..c94d974b8da274fc9fa97e97993c71ebb3d9a8d6 100644 (file)
@@ -822,7 +822,7 @@ int arm7tdmi_init_arch_info(target_t *target, arm7tdmi_common_t *arm7tdmi, jtag_
        return ERROR_OK;
 }
 
        return ERROR_OK;
 }
 
-int arm7tdmi_target_create( struct target_s *target, Jim_Interp *interp )
+int arm7tdmi_target_create(struct target_s *target, Jim_Interp *interp )
 {
        arm7tdmi_common_t *arm7tdmi;
 
 {
        arm7tdmi_common_t *arm7tdmi;
 
index 92cee83c5687172bd128e97e0e6ce0d7d452a640..3d119bd6f1fdedb306be145ad5805975b8553d26 100644 (file)
@@ -497,7 +497,7 @@ int arm920t_arch_state(struct target_s *target)
                exit(-1);
        }
 
                exit(-1);
        }
 
-       LOG_USER(       "target halted in %s state due to %s, current mode: %s\n"
+       LOG_USER("target halted in %s state due to %s, current mode: %s\n"
                        "cpsr: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "\n"
                        "MMU: %s, D-Cache: %s, I-Cache: %s",
                         armv4_5_state_strings[armv4_5->core_state],
                        "cpsr: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "\n"
                        "MMU: %s, D-Cache: %s, I-Cache: %s",
                         armv4_5_state_strings[armv4_5->core_state],
index 04981abec3623961e5ded7ae8f0e465e18d54187..589dfdea4190057a6d216ce091af7cd14754fe45 100644 (file)
@@ -547,7 +547,7 @@ int arm926ejs_arch_state(struct target_s *target)
                        "cpsr: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "\n"
                        "MMU: %s, D-Cache: %s, I-Cache: %s",
                         armv4_5_state_strings[armv4_5->core_state],
                        "cpsr: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "\n"
                        "MMU: %s, D-Cache: %s, I-Cache: %s",
                         armv4_5_state_strings[armv4_5->core_state],
-                        Jim_Nvp_value2name_simple( nvp_target_debug_reason,target->debug_reason)->name,
+                        Jim_Nvp_value2name_simple(nvp_target_debug_reason,target->debug_reason)->name,
                         armv4_5_mode_strings[armv4_5_mode_to_number(armv4_5->core_mode)],
                         buf_get_u32(armv4_5->core_cache->reg_list[ARMV4_5_CPSR].value, 0, 32),
                         buf_get_u32(armv4_5->core_cache->reg_list[15].value, 0, 32),
                         armv4_5_mode_strings[armv4_5_mode_to_number(armv4_5->core_mode)],
                         buf_get_u32(armv4_5->core_cache->reg_list[ARMV4_5_CPSR].value, 0, 32),
                         buf_get_u32(armv4_5->core_cache->reg_list[15].value, 0, 32),
index 67ff8a6b452a11524bc005487af391fd8bca6c3b..5409fd3492d927fe7313d8a54a90637da34a4519 100644 (file)
@@ -110,7 +110,7 @@ int arm966e_init_arch_info(target_t *target, arm966e_common_t *arm966e, jtag_tap
        return ERROR_OK;
 }
 
        return ERROR_OK;
 }
 
-int arm966e_target_create( struct target_s *target, Jim_Interp *interp )
+int arm966e_target_create(struct target_s *target, Jim_Interp *interp )
 {
        arm966e_common_t *arm966e = calloc(1,sizeof(arm966e_common_t));
 
 {
        arm966e_common_t *arm966e = calloc(1,sizeof(arm966e_common_t));
 
index 3179a6137e669a3f6518cd56fe1ea877ead7bc98..e4fc06e2ceb1aeae35ea354ffb0bf4ea03f96610 100644 (file)
@@ -39,7 +39,7 @@
 int handle_arm9tdmi_catch_vectors_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
 
 /* forward declarations */
 int handle_arm9tdmi_catch_vectors_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
 
 /* forward declarations */
-int arm9tdmi_target_create( struct target_s *target, Jim_Interp *interp );
+int arm9tdmi_target_create(struct target_s *target, Jim_Interp *interp );
 
 int arm9tdmi_quit(void);
 
 
 int arm9tdmi_quit(void);
 
index 0466ff5b2073a5774da4c6fce78aec1d42d9810f..01b7e0cbfc02e7e6520a26794c01c008bff23cbe 100644 (file)
@@ -107,7 +107,7 @@ typedef struct swjdp_common_s
 /* Accessor function for currently selected DAP-AP number */ 
 static inline uint8_t dap_ap_get_select(swjdp_common_t *swjdp)
 {
 /* Accessor function for currently selected DAP-AP number */ 
 static inline uint8_t dap_ap_get_select(swjdp_common_t *swjdp)
 {
-       return (uint8_t)( swjdp ->apsel >> 24);
+       return (uint8_t)(swjdp ->apsel >> 24);
 }
 
 /* Internal functions used in the module, partial transactions, use with caution */
 }
 
 /* Internal functions used in the module, partial transactions, use with caution */
index 77ca2e254455429ae41c5c2b54359567179a4125..e1b137f968fb307a581d4ad31641b575d624a3c1 100644 (file)
@@ -299,7 +299,7 @@ int armv4_5_arch_state(struct target_s *target)
 
        LOG_USER("target halted in %s state due to %s, current mode: %s\ncpsr: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "",
                         armv4_5_state_strings[armv4_5->core_state],
 
        LOG_USER("target halted in %s state due to %s, current mode: %s\ncpsr: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "",
                         armv4_5_state_strings[armv4_5->core_state],
-                        Jim_Nvp_value2name_simple( nvp_target_debug_reason, target->debug_reason )->name,
+                        Jim_Nvp_value2name_simple(nvp_target_debug_reason, target->debug_reason )->name,
                         armv4_5_mode_strings[armv4_5_mode_to_number(armv4_5->core_mode)],
                         buf_get_u32(armv4_5->core_cache->reg_list[ARMV4_5_CPSR].value, 0, 32),
                         buf_get_u32(armv4_5->core_cache->reg_list[15].value, 0, 32));
                         armv4_5_mode_strings[armv4_5_mode_to_number(armv4_5->core_mode)],
                         buf_get_u32(armv4_5->core_cache->reg_list[ARMV4_5_CPSR].value, 0, 32),
                         buf_get_u32(armv4_5->core_cache->reg_list[15].value, 0, 32));
index 3f162f5824b0eb06a18705e4e38d92e5a328c7e1..b93dda3671f5282c16699a54e99ea9abe5a8f497 100644 (file)
@@ -462,7 +462,7 @@ int armv7m_arch_state(struct target_s *target)
        armv7m_common_t *armv7m = target->arch_info;
 
        LOG_USER("target halted due to %s, current mode: %s %s\nxPSR: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "",
        armv7m_common_t *armv7m = target->arch_info;
 
        LOG_USER("target halted due to %s, current mode: %s %s\nxPSR: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "",
-                Jim_Nvp_value2name_simple( nvp_target_debug_reason,target->debug_reason)->name,
+                Jim_Nvp_value2name_simple(nvp_target_debug_reason,target->debug_reason)->name,
                armv7m_mode_strings[armv7m->core_mode],
                armv7m_exception_string(armv7m->exception_number),
                buf_get_u32(armv7m->core_cache->reg_list[ARMV7M_xPSR].value, 0, 32),
                armv7m_mode_strings[armv7m->core_mode],
                armv7m_exception_string(armv7m->exception_number),
                buf_get_u32(armv7m->core_cache->reg_list[ARMV7M_xPSR].value, 0, 32),
index 6c751332b4f1f3cfd5dfcea49849f492b08a858f..e3087cd9006100cda9b93f5ab8b520ed2cbb09d4 100644 (file)
@@ -144,7 +144,7 @@ extern int armv7m_blank_check_memory(struct target_s *target, uint32_t address,
  * Rd: source register
  * SYSm: destination special register
  */
  * Rd: source register
  * SYSm: destination special register
  */
-#define ARMV7M_T_MSR(SYSm, Rn) ((0xF380 | ( Rn << 8 )) | ((0x8800 | SYSm) << 16)) 
+#define ARMV7M_T_MSR(SYSm, Rn) ((0xF380 | (Rn << 8 )) | ((0x8800 | SYSm) << 16)) 
 
 /* Change Processor State. The instruction modifies the PRIMASK and FAULTMASK 
  * special-purpose register values  (Thumb mode) 16 bit Thumb2 instruction
 
 /* Change Processor State. The instruction modifies the PRIMASK and FAULTMASK 
  * special-purpose register values  (Thumb mode) 16 bit Thumb2 instruction
index 477223bd459f21638f94c317fc26f6138d0110b9..52b60eb543a2f5a561f84eeb61c3be91fa6f2edf 100644 (file)
@@ -87,7 +87,7 @@ int cortex_a8_dcc_read(swjdp_common_t *swjdp, uint8_t *value, uint8_t *ctrl)
 {
        uint16_t dcrdr;
 
 {
        uint16_t dcrdr;
 
-       mem_ap_read_buf_u16( swjdp, (uint8_t*)&dcrdr, 1, DCB_DCRDR);
+       mem_ap_read_buf_u16(swjdp, (uint8_t*)&dcrdr, 1, DCB_DCRDR);
        *ctrl = (uint8_t)dcrdr;
        *value = (uint8_t)(dcrdr >> 8);
 
        *ctrl = (uint8_t)dcrdr;
        *value = (uint8_t)(dcrdr >> 8);
 
@@ -98,7 +98,7 @@ int cortex_a8_dcc_read(swjdp_common_t *swjdp, uint8_t *value, uint8_t *ctrl)
        if (dcrdr & (1 << 0))
        {
                dcrdr = 0;
        if (dcrdr & (1 << 0))
        {
                dcrdr = 0;
-               mem_ap_write_buf_u16( swjdp, (uint8_t*)&dcrdr, 1, DCB_DCRDR);
+               mem_ap_write_buf_u16(swjdp, (uint8_t*)&dcrdr, 1, DCB_DCRDR);
        }
 
        return ERROR_OK;
        }
 
        return ERROR_OK;
index 9f4ef5232fb4543e1e98f27ab1618f9cefd163f8..4fe4acc510e6709f4b71639960fe140211263754 100644 (file)
@@ -444,7 +444,7 @@ int cortex_m3_debug_entry(target_t *target)
        LOG_DEBUG("entered debug state in core mode: %s at PC 0x%" PRIx32 ", target->state: %s",
                armv7m_mode_strings[armv7m->core_mode],
                *(uint32_t*)(armv7m->core_cache->reg_list[15].value),
        LOG_DEBUG("entered debug state in core mode: %s at PC 0x%" PRIx32 ", target->state: %s",
                armv7m_mode_strings[armv7m->core_mode],
                *(uint32_t*)(armv7m->core_cache->reg_list[15].value),
-               Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name);
+               Jim_Nvp_value2name_simple(nvp_target_state, target->state )->name);
 
        if (armv7m->post_debug_entry)
                armv7m->post_debug_entry(target);
 
        if (armv7m->post_debug_entry)
                armv7m->post_debug_entry(target);
@@ -520,7 +520,7 @@ int cortex_m3_poll(target_t *target)
 #if 0
        /* Read Debug Fault Status Register, added to figure out the lockup when running flashtest.script  */
        mem_ap_read_atomic_u32(swjdp, NVIC_DFSR, &cortex_m3->nvic_dfsr);
 #if 0
        /* Read Debug Fault Status Register, added to figure out the lockup when running flashtest.script  */
        mem_ap_read_atomic_u32(swjdp, NVIC_DFSR, &cortex_m3->nvic_dfsr);
-       LOG_DEBUG("dcb_dhcsr 0x%x, nvic_dfsr 0x%x, target->state: %s", cortex_m3->dcb_dhcsr, cortex_m3->nvic_dfsr, Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name );
+       LOG_DEBUG("dcb_dhcsr 0x%x, nvic_dfsr 0x%x, target->state: %s", cortex_m3->dcb_dhcsr, cortex_m3->nvic_dfsr, Jim_Nvp_value2name_simple(nvp_target_state, target->state )->name );
 #endif
 
        return ERROR_OK;
 #endif
 
        return ERROR_OK;
@@ -751,7 +751,7 @@ int cortex_m3_assert_reset(target_t *target)
        int assert_srst = 1;
 
        LOG_DEBUG("target->state: %s",
        int assert_srst = 1;
 
        LOG_DEBUG("target->state: %s",
-               Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name );
+               Jim_Nvp_value2name_simple(nvp_target_state, target->state )->name );
 
        enum reset_types jtag_reset_config = jtag_get_reset_config();
        if (!(jtag_reset_config & RESET_HAS_SRST))
 
        enum reset_types jtag_reset_config = jtag_get_reset_config();
        if (!(jtag_reset_config & RESET_HAS_SRST))
@@ -1491,7 +1491,7 @@ int cortex_m3_dcc_read(swjdp_common_t *swjdp, uint8_t *value, uint8_t *ctrl)
 {
        uint16_t dcrdr;
 
 {
        uint16_t dcrdr;
 
-       mem_ap_read_buf_u16( swjdp, (uint8_t*)&dcrdr, 1, DCB_DCRDR);
+       mem_ap_read_buf_u16(swjdp, (uint8_t*)&dcrdr, 1, DCB_DCRDR);
        *ctrl = (uint8_t)dcrdr;
        *value = (uint8_t)(dcrdr >> 8);
 
        *ctrl = (uint8_t)dcrdr;
        *value = (uint8_t)(dcrdr >> 8);
 
@@ -1502,7 +1502,7 @@ int cortex_m3_dcc_read(swjdp_common_t *swjdp, uint8_t *value, uint8_t *ctrl)
        if (dcrdr & (1 << 0))
        {
                dcrdr = 0;
        if (dcrdr & (1 << 0))
        {
                dcrdr = 0;
-               mem_ap_write_buf_u16( swjdp, (uint8_t*)&dcrdr, 1, DCB_DCRDR);
+               mem_ap_write_buf_u16(swjdp, (uint8_t*)&dcrdr, 1, DCB_DCRDR);
        }
 
        return ERROR_OK;
        }
 
        return ERROR_OK;
index 4f6a33c844f653a672e8e500d6a32699dbf62d83..5ed66603a6afa59b14c945e79738d0dd8be7a428 100644 (file)
@@ -108,7 +108,7 @@ extern int embeddedice_handshake(arm_jtag_t *jtag_info, int hsbit, uint32_t time
 /* If many embeddedice_write_reg() follow eachother, then the >1 invocations can be this faster version of
  * embeddedice_write_reg
  */
 /* If many embeddedice_write_reg() follow eachother, then the >1 invocations can be this faster version of
  * embeddedice_write_reg
  */
-static __inline__ void embeddedice_write_reg_inner( jtag_tap_t *tap, int reg_addr, uint32_t value)
+static __inline__ void embeddedice_write_reg_inner(jtag_tap_t *tap, int reg_addr, uint32_t value)
 {
        static const int embeddedice_num_bits[]={32,5,1};
        uint32_t values[3];
 {
        static const int embeddedice_num_bits[]={32,5,1};
        uint32_t values[3];
@@ -117,7 +117,7 @@ static __inline__ void embeddedice_write_reg_inner( jtag_tap_t *tap, int reg_add
        values[1]=reg_addr;
        values[2]=1;
 
        values[1]=reg_addr;
        values[2]=1;
 
-       jtag_add_dr_out( tap,
+       jtag_add_dr_out(tap,
                        3,
                        embeddedice_num_bits,
                        values,
                        3,
                        embeddedice_num_bits,
                        values,
index ad6eb03e304a3562a1686dbb4811f3bba7b22ca7..0e16b22bdecf3c62a43836040bc8e2db9d7ca68d 100644 (file)
@@ -387,7 +387,7 @@ static int handle_etb_config_command(struct command_context_s *cmd_ctx, char *cm
                return ERROR_FAIL;
        }
 
                return ERROR_FAIL;
        }
 
-       tap = jtag_tap_by_string( args[1] );
+       tap = jtag_tap_by_string(args[1] );
        if (tap == NULL)
        {
                command_print(cmd_ctx, "Tap: %s does not exist", args[1] );
        if (tap == NULL)
        {
                command_print(cmd_ctx, "Tap: %s does not exist", args[1] );
index 0ffa5fd3d9b6d96d394b5d19fb869a82826e491a..ea9f3d343f005fe0d954ac2c3794e3d4f2aa6896 100644 (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:
                                        /* S1 - 16 bit address data record */
                        {
                                case 1:
                                        /* S1 - 16 bit address data record */
@@ -636,7 +636,7 @@ static int image_mot_buffer_complete(image_t *image)
                cal_checksum += (uint8_t)checksum;
                bytes_read += 2;
 
                cal_checksum += (uint8_t)checksum;
                bytes_read += 2;
 
-               if ( cal_checksum != 0xFF )
+               if (cal_checksum != 0xFF )
                {
                        /* checksum failed */
                        LOG_ERROR("incorrect record checksum found in S19 file");
                {
                        /* checksum failed */
                        LOG_ERROR("incorrect record checksum found in S19 file");
index aa6d921ceb269f22d0c4d47478e330b41fe7537d..b5131c3cb919ca3f1a322ff6233ea637e59d2254 100644 (file)
@@ -265,7 +265,7 @@ int mips32_arch_state(struct target_s *target)
        }
        
        LOG_USER("target halted due to %s, pc: 0x%8.8" PRIx32 "",
        }
        
        LOG_USER("target halted due to %s, pc: 0x%8.8" PRIx32 "",
-               Jim_Nvp_value2name_simple( nvp_target_debug_reason, target->debug_reason )->name ,
+               Jim_Nvp_value2name_simple(nvp_target_debug_reason, target->debug_reason )->name ,
                buf_get_u32(mips32->core_cache->reg_list[MIPS32_PC].value, 0, 32));
        
        return ERROR_OK;
                buf_get_u32(mips32->core_cache->reg_list[MIPS32_PC].value, 0, 32));
        
        return ERROR_OK;
index d7d5995f733524ebb9d99935c7eb3845376b4f3c..55755065149c8f9c1f0028ec8f896aa1b9907fff 100644 (file)
@@ -207,7 +207,7 @@ static int mips32_pracc_exec_write(mips32_pracc_context *ctx, uint32_t address)
        return ERROR_OK;
 }
 
        return ERROR_OK;
 }
 
-int mips32_pracc_exec( mips_ejtag_t *ejtag_info, int code_len, uint32_t *code, int num_param_in, uint32_t *param_in, int num_param_out, uint32_t *param_out, int cycle)
+int mips32_pracc_exec(mips_ejtag_t *ejtag_info, int code_len, uint32_t *code, int num_param_in, uint32_t *param_in, int num_param_out, uint32_t *param_out, int cycle)
 {
        uint32_t ejtag_ctrl;
        uint32_t address, data;
 {
        uint32_t ejtag_ctrl;
        uint32_t address, data;
index 3ff4cf20c61efafd3ce55a0569809ece736d841f..e9b53ed1fa846ceaa58649728d0a902f289a16aa 100644 (file)
@@ -35,7 +35,7 @@
 #define UPPER16(uint32_t) (uint32_t >> 16)
 #define LOWER16(uint32_t) (uint32_t & 0xFFFF)
 #define NEG16(v) (((~(v)) + 1) & 0xFFFF)
 #define UPPER16(uint32_t) (uint32_t >> 16)
 #define LOWER16(uint32_t) (uint32_t & 0xFFFF)
 #define NEG16(v) (((~(v)) + 1) & 0xFFFF)
-/*#define NEG18(v) ( ((~(v)) + 1) & 0x3FFFF )*/
+/*#define NEG18(v) (((~(v)) + 1) & 0x3FFFF )*/
 
 extern int mips32_pracc_read_mem(mips_ejtag_t *ejtag_info, uint32_t addr, int size, int count, void *buf);
 extern int mips32_pracc_write_mem(mips_ejtag_t *ejtag_info, uint32_t addr, int size, int count, void *buf);
 
 extern int mips32_pracc_read_mem(mips_ejtag_t *ejtag_info, uint32_t addr, int size, int count, void *buf);
 extern int mips32_pracc_write_mem(mips_ejtag_t *ejtag_info, uint32_t addr, int size, int count, void *buf);
@@ -53,6 +53,6 @@ extern int mips32_pracc_write_u32(mips_ejtag_t *ejtag_info, uint32_t addr, uint3
 extern int mips32_pracc_read_regs(mips_ejtag_t *ejtag_info, uint32_t *regs);
 extern int mips32_pracc_write_regs(mips_ejtag_t *ejtag_info, uint32_t *regs);
 
 extern int mips32_pracc_read_regs(mips_ejtag_t *ejtag_info, uint32_t *regs);
 extern int mips32_pracc_write_regs(mips_ejtag_t *ejtag_info, uint32_t *regs);
 
-extern int mips32_pracc_exec( mips_ejtag_t *ejtag_info, int code_len, uint32_t *code, int num_param_in, uint32_t *param_in, int num_param_out, uint32_t *param_out, int cycle);
+extern int mips32_pracc_exec(mips_ejtag_t *ejtag_info, int code_len, uint32_t *code, int num_param_in, uint32_t *param_in, int num_param_out, uint32_t *param_out, int cycle);
 
 #endif
 
 #endif
index 0fef0772a77d1f7b75df9f930016dfbac9dc9f22..b8c032d9ab5199b939ef5460edc5992f0868d791 100644 (file)
@@ -148,7 +148,7 @@ int mips_m4k_debug_entry(target_t *target)
 
        LOG_DEBUG("entered debug state at PC 0x%" PRIx32 ", target->state: %s",
                *(uint32_t*)(mips32->core_cache->reg_list[MIPS32_PC].value),
 
        LOG_DEBUG("entered debug state at PC 0x%" PRIx32 ", target->state: %s",
                *(uint32_t*)(mips32->core_cache->reg_list[MIPS32_PC].value),
-                 Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name);
+                 Jim_Nvp_value2name_simple(nvp_target_state, target->state )->name);
 
        return ERROR_OK;
 }
 
        return ERROR_OK;
 }
@@ -220,7 +220,7 @@ int mips_m4k_halt(struct target_s *target)
        mips_ejtag_t *ejtag_info = &mips32->ejtag_info;
 
        LOG_DEBUG("target->state: %s",
        mips_ejtag_t *ejtag_info = &mips32->ejtag_info;
 
        LOG_DEBUG("target->state: %s",
-                 Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name);
+                 Jim_Nvp_value2name_simple(nvp_target_state, target->state )->name);
 
        if (target->state == TARGET_HALTED)
        {
 
        if (target->state == TARGET_HALTED)
        {
@@ -265,7 +265,7 @@ int mips_m4k_assert_reset(target_t *target)
        mips_ejtag_t *ejtag_info = &mips32->ejtag_info;
 
        LOG_DEBUG("target->state: %s",
        mips_ejtag_t *ejtag_info = &mips32->ejtag_info;
 
        LOG_DEBUG("target->state: %s",
-               Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name);
+               Jim_Nvp_value2name_simple(nvp_target_state, target->state )->name);
 
        enum reset_types jtag_reset_config = jtag_get_reset_config();
        if (!(jtag_reset_config & RESET_HAS_SRST))
 
        enum reset_types jtag_reset_config = jtag_get_reset_config();
        if (!(jtag_reset_config & RESET_HAS_SRST))
@@ -324,7 +324,7 @@ int mips_m4k_assert_reset(target_t *target)
 int mips_m4k_deassert_reset(target_t *target)
 {
        LOG_DEBUG("target->state: %s",
 int mips_m4k_deassert_reset(target_t *target)
 {
        LOG_DEBUG("target->state: %s",
-               Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name);
+               Jim_Nvp_value2name_simple(nvp_target_state, target->state )->name);
 
        /* deassert reset lines */
        jtag_add_reset(0, 0);
 
        /* deassert reset lines */
        jtag_add_reset(0, 0);
index 6f83d2e1e464bc876317ebb5341cf00f0c39ba67..ccb050a753c4bd1ce945ec6416d9a3e845944e60 100644 (file)
@@ -70,7 +70,7 @@ static int handle_fast_load_command(struct command_context_s *cmd_ctx, char *cmd
 
 static int jim_array2mem(Jim_Interp *interp, int argc, Jim_Obj *const *argv);
 static int jim_mem2array(Jim_Interp *interp, int argc, Jim_Obj *const *argv);
 
 static int jim_array2mem(Jim_Interp *interp, int argc, Jim_Obj *const *argv);
 static int jim_mem2array(Jim_Interp *interp, int argc, Jim_Obj *const *argv);
-static int jim_target( Jim_Interp *interp, int argc, Jim_Obj *const *argv);
+static int jim_target(Jim_Interp *interp, int argc, Jim_Obj *const *argv);
 
 static int target_array2mem(Jim_Interp *interp, target_t *target, int argc, Jim_Obj *const *argv);
 static int target_mem2array(Jim_Interp *interp, target_t *target, int argc, Jim_Obj *const *argv);
 
 static int target_array2mem(Jim_Interp *interp, target_t *target, int argc, Jim_Obj *const *argv);
 static int target_mem2array(Jim_Interp *interp, target_t *target, int argc, Jim_Obj *const *argv);
@@ -139,12 +139,12 @@ const Jim_Nvp nvp_error_target[] = {
        { .value = -1, .name = NULL }
 };
 
        { .value = -1, .name = NULL }
 };
 
-const char *target_strerror_safe( int err )
+const char *target_strerror_safe(int err )
 {
        const Jim_Nvp *n;
 
 {
        const Jim_Nvp *n;
 
-       n = Jim_Nvp_value2name_simple( nvp_error_target, err );
-       if ( n->name == NULL ){
+       n = Jim_Nvp_value2name_simple(nvp_error_target, err );
+       if (n->name == NULL ){
                return "unknown";
        } else {
                return n->name;
                return "unknown";
        } else {
                return n->name;
@@ -244,8 +244,8 @@ static int max_target_number(void)
 
        x = -1;
        t = all_targets;
 
        x = -1;
        t = all_targets;
-       while ( t ){
-               if ( x < t->target_number ){
+       while (t ){
+               if (x < t->target_number ){
                        x = (t->target_number) + 1;
                }
                t = t->next;
                        x = (t->target_number) + 1;
                }
                t = t->next;
@@ -263,7 +263,7 @@ static int new_target_number(void)
        x = -1;
        t = all_targets;
        while (t){
        x = -1;
        t = all_targets;
        while (t){
-               if ( x < t->target_number ){
+               if (x < t->target_number ){
                        x = t->target_number;
                }
                t = t->next;
                        x = t->target_number;
                }
                t = t->next;
@@ -353,7 +353,7 @@ static target_t *get_target_by_num(int num)
        target_t *target = all_targets;
 
        while (target){
        target_t *target = all_targets;
 
        while (target){
-               if ( target->target_number == num ){
+               if (target->target_number == num ){
                        return target;
                }
                target = target->next;
                        return target;
                }
                target = target->next;
@@ -428,8 +428,8 @@ int target_process_reset(struct command_context_s *cmd_ctx, enum target_reset_mo
        char buf[100];
        int retval;
        Jim_Nvp *n;
        char buf[100];
        int retval;
        Jim_Nvp *n;
-       n = Jim_Nvp_value2name_simple( nvp_reset_modes, reset_mode );
-       if ( n->name == NULL ){
+       n = Jim_Nvp_value2name_simple(nvp_reset_modes, reset_mode );
+       if (n->name == NULL ){
                LOG_ERROR("invalid reset mode");
                return ERROR_FAIL;
        }
                LOG_ERROR("invalid reset mode");
                return ERROR_FAIL;
        }
@@ -441,8 +441,8 @@ int target_process_reset(struct command_context_s *cmd_ctx, enum target_reset_mo
        int save_poll = target_continuous_poll;
        target_continuous_poll = 0;
 
        int save_poll = target_continuous_poll;
        target_continuous_poll = 0;
 
-       sprintf( buf, "ocd_process_reset %s", n->name );
-       retval = Jim_Eval( interp, buf );
+       sprintf(buf, "ocd_process_reset %s", n->name );
+       retval = Jim_Eval(interp, buf );
 
        target_continuous_poll = save_poll;
 
 
        target_continuous_poll = save_poll;
 
@@ -823,9 +823,9 @@ int target_call_event_callbacks(target_t *target, enum target_event event)
 
        LOG_DEBUG("target event %i (%s)",
                          event,
 
        LOG_DEBUG("target event %i (%s)",
                          event,
-                         Jim_Nvp_value2name_simple( nvp_target_event, event )->name );
+                         Jim_Nvp_value2name_simple(nvp_target_event, event )->name );
 
 
-       target_handle_event( target, event );
+       target_handle_event(target, event );
 
        while (callback)
        {
 
        while (callback)
        {
@@ -1286,7 +1286,7 @@ int target_checksum_memory(struct target_s *target, uint32_t address, uint32_t s
                        target_buffer_set_u32(target, &buffer[i*sizeof(uint32_t)], target_data);
                }
 
                        target_buffer_set_u32(target, &buffer[i*sizeof(uint32_t)], target_data);
                }
 
-               retval = image_calculate_checksum( buffer, size, &checksum );
+               retval = image_calculate_checksum(buffer, size, &checksum );
                free(buffer);
        }
 
                free(buffer);
        }
 
@@ -1654,22 +1654,22 @@ int handle_target(void *priv)
                int did_something = 0;
                if (runSrstAsserted)
                {
                int did_something = 0;
                if (runSrstAsserted)
                {
-                       Jim_Eval( interp, "srst_asserted");
+                       Jim_Eval(interp, "srst_asserted");
                        did_something = 1;
                }
                if (runSrstDeasserted)
                {
                        did_something = 1;
                }
                if (runSrstDeasserted)
                {
-                       Jim_Eval( interp, "srst_deasserted");
+                       Jim_Eval(interp, "srst_deasserted");
                        did_something = 1;
                }
                if (runPowerDropout)
                {
                        did_something = 1;
                }
                if (runPowerDropout)
                {
-                       Jim_Eval( interp, "power_dropout");
+                       Jim_Eval(interp, "power_dropout");
                        did_something = 1;
                }
                if (runPowerRestore)
                {
                        did_something = 1;
                }
                if (runPowerRestore)
                {
-                       Jim_Eval( interp, "power_restore");
+                       Jim_Eval(interp, "power_restore");
                        did_something = 1;
                }
 
                        did_something = 1;
                }
 
@@ -1982,8 +1982,8 @@ static int handle_reset_command(struct command_context_s *cmd_ctx, char *cmd, ch
        if (argc == 1)
        {
                const Jim_Nvp *n;
        if (argc == 1)
        {
                const Jim_Nvp *n;
-               n = Jim_Nvp_name2value_simple( nvp_reset_modes, args[0] );
-               if ( (n->name == NULL) || (n->value == RESET_UNKNOWN) ){
+               n = Jim_Nvp_name2value_simple(nvp_reset_modes, args[0] );
+               if ((n->name == NULL) || (n->value == RESET_UNKNOWN) ){
                        return ERROR_COMMAND_SYNTAX_ERROR;
                }
                reset_mode = n->value;
                        return ERROR_COMMAND_SYNTAX_ERROR;
                }
                reset_mode = n->value;
@@ -2473,16 +2473,16 @@ static int handle_verify_image_command_internal(struct command_context_s *cmd_ct
                if (verify)
                {
                        /* calculate checksum of image */
                if (verify)
                {
                        /* calculate checksum of image */
-                       image_calculate_checksum( buffer, buf_cnt, &checksum );
+                       image_calculate_checksum(buffer, buf_cnt, &checksum );
 
                        retval = target_checksum_memory(target, image.sections[i].base_address, buf_cnt, &mem_checksum);
 
                        retval = target_checksum_memory(target, image.sections[i].base_address, buf_cnt, &mem_checksum);
-                       if ( retval != ERROR_OK )
+                       if (retval != ERROR_OK )
                        {
                                free(buffer);
                                break;
                        }
 
                        {
                                free(buffer);
                                break;
                        }
 
-                       if ( checksum != mem_checksum )
+                       if (checksum != mem_checksum )
                        {
                                /* failed crc checksum, fall back to a binary compare */
                                uint8_t *data;
                        {
                                /* failed crc checksum, fall back to a binary compare */
                                uint8_t *data;
@@ -3084,7 +3084,7 @@ static int target_mem2array(Jim_Interp *interp, target_t *target, int argc, Jim_
                        break;
                default:
                        Jim_SetResult(interp, Jim_NewEmptyStringObj(interp));
                        break;
                default:
                        Jim_SetResult(interp, Jim_NewEmptyStringObj(interp));
-                       Jim_AppendStrings( interp, Jim_GetResult(interp), "Invalid width param, must be 8/16/32", NULL );
+                       Jim_AppendStrings(interp, Jim_GetResult(interp), "Invalid width param, must be 8/16/32", NULL );
                        return JIM_ERR;
        }
        if (len == 0) {
                        return JIM_ERR;
        }
        if (len == 0) {
@@ -3132,7 +3132,7 @@ static int target_mem2array(Jim_Interp *interp, target_t *target, int argc, Jim_
                        count = (sizeof(buffer)/width);
                }
 
                        count = (sizeof(buffer)/width);
                }
 
-               retval = target_read_memory( target, addr, width, count, buffer );
+               retval = target_read_memory(target, addr, width, count, buffer );
                if (retval != ERROR_OK) {
                        /* BOO !*/
                        LOG_ERROR("mem2array: Read @ 0x%08x, w=%d, cnt=%d, failed", 
                if (retval != ERROR_OK) {
                        /* BOO !*/
                        LOG_ERROR("mem2array: Read @ 0x%08x, w=%d, cnt=%d, failed", 
@@ -3215,7 +3215,7 @@ static int jim_array2mem(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
                return JIM_ERR;
        }
 
                return JIM_ERR;
        }
 
-       return target_array2mem( interp,target, argc-1, argv + 1 );
+       return target_array2mem(interp,target, argc-1, argv + 1 );
 }
 
 static int target_array2mem(Jim_Interp *interp, target_t *target, int argc, Jim_Obj *const *argv)
 }
 
 static int target_array2mem(Jim_Interp *interp, target_t *target, int argc, Jim_Obj *const *argv)
@@ -3271,7 +3271,7 @@ static int target_array2mem(Jim_Interp *interp, target_t *target, int argc, Jim_
                        break;
                default:
                        Jim_SetResult(interp, Jim_NewEmptyStringObj(interp));
                        break;
                default:
                        Jim_SetResult(interp, Jim_NewEmptyStringObj(interp));
-                       Jim_AppendStrings( interp, Jim_GetResult(interp), "Invalid width param, must be 8/16/32", NULL );
+                       Jim_AppendStrings(interp, Jim_GetResult(interp), "Invalid width param, must be 8/16/32", NULL );
                        return JIM_ERR;
        }
        if (len == 0) {
                        return JIM_ERR;
        }
        if (len == 0) {
@@ -3355,22 +3355,22 @@ static int target_array2mem(Jim_Interp *interp, target_t *target, int argc, Jim_
        return JIM_OK;
 }
 
        return JIM_OK;
 }
 
-void target_all_handle_event( enum target_event e )
+void target_all_handle_event(enum target_event e )
 {
        target_t *target;
 
 {
        target_t *target;
 
-       LOG_DEBUG( "**all*targets: event: %d, %s",
+       LOG_DEBUG("**all*targets: event: %d, %s",
                           (int)e,
                           (int)e,
-                          Jim_Nvp_value2name_simple( nvp_target_event, e )->name );
+                          Jim_Nvp_value2name_simple(nvp_target_event, e )->name );
 
        target = all_targets;
        while (target){
 
        target = all_targets;
        while (target){
-               target_handle_event( target, e );
+               target_handle_event(target, e );
                target = target->next;
        }
 }
 
                target = target->next;
        }
 }
 
-void target_handle_event( target_t *target, enum target_event e )
+void target_handle_event(target_t *target, enum target_event e )
 {
        target_event_action_t *teap;
        int done;
 {
        target_event_action_t *teap;
        int done;
@@ -3378,27 +3378,27 @@ void target_handle_event( target_t *target, enum target_event e )
        teap = target->event_action;
 
        done = 0;
        teap = target->event_action;
 
        done = 0;
-       while ( teap ){
-               if ( teap->event == e ){
+       while (teap ){
+               if (teap->event == e ){
                        done = 1;
                        done = 1;
-                       LOG_DEBUG( "target: (%d) %s (%s) event: %d (%s) action: %s\n",
+                       LOG_DEBUG("target: (%d) %s (%s) event: %d (%s) action: %s\n",
                                           target->target_number,
                                           target->cmd_name,
                                           target_get_name(target),
                                           e,
                                           target->target_number,
                                           target->cmd_name,
                                           target_get_name(target),
                                           e,
-                                          Jim_Nvp_value2name_simple( nvp_target_event, e )->name,
-                                          Jim_GetString( teap->body, NULL ) );
-                       if (Jim_EvalObj( interp, teap->body ) != JIM_OK)
+                                          Jim_Nvp_value2name_simple(nvp_target_event, e )->name,
+                                          Jim_GetString(teap->body, NULL ) );
+                       if (Jim_EvalObj(interp, teap->body ) != JIM_OK)
                        {
                                Jim_PrintErrorMessage(interp);
                        }
                }
                teap = teap->next;
        }
                        {
                                Jim_PrintErrorMessage(interp);
                        }
                }
                teap = teap->next;
        }
-       if ( !done ){
-               LOG_DEBUG( "event: %d %s - no action",
+       if (!done ){
+               LOG_DEBUG("event: %d %s - no action",
                                   e,
                                   e,
-                                  Jim_Nvp_value2name_simple( nvp_target_event, e )->name );
+                                  Jim_Nvp_value2name_simple(nvp_target_event, e )->name );
        }
 }
 
        }
 }
 
@@ -3428,7 +3428,7 @@ static Jim_Nvp nvp_config_opts[] = {
        { .name = NULL, .value = -1 }
 };
 
        { .name = NULL, .value = -1 }
 };
 
-static int target_configure( Jim_GetOptInfo *goi, target_t *target )
+static int target_configure(Jim_GetOptInfo *goi, target_t *target )
 {
        Jim_Nvp *n;
        Jim_Obj *o;
 {
        Jim_Nvp *n;
        Jim_Obj *o;
@@ -3437,64 +3437,64 @@ static int target_configure( Jim_GetOptInfo *goi, target_t *target )
        int e;
 
        /* parse config or cget options ... */
        int e;
 
        /* parse config or cget options ... */
-       while ( goi->argc > 0 ){
-               Jim_SetEmptyResult( goi->interp );
-               /* Jim_GetOpt_Debug( goi ); */
+       while (goi->argc > 0 ){
+               Jim_SetEmptyResult(goi->interp );
+               /* Jim_GetOpt_Debug(goi ); */
 
 
-               if ( target->type->target_jim_configure ){
+               if (target->type->target_jim_configure ){
                        /* target defines a configure function */
                        /* target gets first dibs on parameters */
                        /* target defines a configure function */
                        /* target gets first dibs on parameters */
-                       e = (*(target->type->target_jim_configure))( target, goi );
-                       if ( e == JIM_OK ){
+                       e = (*(target->type->target_jim_configure))(target, goi );
+                       if (e == JIM_OK ){
                                /* more? */
                                continue;
                        }
                                /* more? */
                                continue;
                        }
-                       if ( e == JIM_ERR ){
+                       if (e == JIM_ERR ){
                                /* An error */
                                return e;
                        }
                        /* otherwise we 'continue' below */
                }
                                /* An error */
                                return e;
                        }
                        /* otherwise we 'continue' below */
                }
-               e = Jim_GetOpt_Nvp( goi, nvp_config_opts, &n );
-               if ( e != JIM_OK ){
-                       Jim_GetOpt_NvpUnknown( goi, nvp_config_opts, 0 );
+               e = Jim_GetOpt_Nvp(goi, nvp_config_opts, &n );
+               if (e != JIM_OK ){
+                       Jim_GetOpt_NvpUnknown(goi, nvp_config_opts, 0 );
                        return e;
                }
                        return e;
                }
-               switch ( n->value ){
+               switch (n->value ){
                case TCFG_TYPE:
                        /* not setable */
                case TCFG_TYPE:
                        /* not setable */
-                       if ( goi->isconfigure ){
-                               Jim_SetResult_sprintf( goi->interp, "not setable: %s", n->name );
+                       if (goi->isconfigure ){
+                               Jim_SetResult_sprintf(goi->interp, "not setable: %s", n->name );
                                return JIM_ERR;
                        } else {
                        no_params:
                                return JIM_ERR;
                        } else {
                        no_params:
-                               if ( goi->argc != 0 ){
-                                       Jim_WrongNumArgs( goi->interp, goi->argc, goi->argv, "NO PARAMS");
+                               if (goi->argc != 0 ){
+                                       Jim_WrongNumArgs(goi->interp, goi->argc, goi->argv, "NO PARAMS");
                                        return JIM_ERR;
                                }
                        }
                                        return JIM_ERR;
                                }
                        }
-                       Jim_SetResultString( goi->interp, target_get_name(target), -1 );
+                       Jim_SetResultString(goi->interp, target_get_name(target), -1 );
                        /* loop for more */
                        break;
                case TCFG_EVENT:
                        /* loop for more */
                        break;
                case TCFG_EVENT:
-                       if ( goi->argc == 0 ){
-                               Jim_WrongNumArgs( goi->interp, goi->argc, goi->argv, "-event ?event-name? ...");
+                       if (goi->argc == 0 ){
+                               Jim_WrongNumArgs(goi->interp, goi->argc, goi->argv, "-event ?event-name? ...");
                                return JIM_ERR;
                        }
 
                                return JIM_ERR;
                        }
 
-                       e = Jim_GetOpt_Nvp( goi, nvp_target_event, &n );
-                       if ( e != JIM_OK ){
-                               Jim_GetOpt_NvpUnknown( goi, nvp_target_event, 1 );
+                       e = Jim_GetOpt_Nvp(goi, nvp_target_event, &n );
+                       if (e != JIM_OK ){
+                               Jim_GetOpt_NvpUnknown(goi, nvp_target_event, 1 );
                                return e;
                        }
 
                                return e;
                        }
 
-                       if ( goi->isconfigure ){
-                               if ( goi->argc != 1 ){
-                                       Jim_WrongNumArgs( goi->interp, goi->argc, goi->argv, "-event ?event-name? ?EVENT-BODY?");
+                       if (goi->isconfigure ){
+                               if (goi->argc != 1 ){
+                                       Jim_WrongNumArgs(goi->interp, goi->argc, goi->argv, "-event ?event-name? ?EVENT-BODY?");
                                        return JIM_ERR;
                                }
                        } else {
                                        return JIM_ERR;
                                }
                        } else {
-                               if ( goi->argc != 0 ){
+                               if (goi->argc != 0 ){
                                        Jim_WrongNumArgs(goi->interp, goi->argc, goi->argv, "-event ?event-name?");
                                        return JIM_ERR;
                                }
                                        Jim_WrongNumArgs(goi->interp, goi->argc, goi->argv, "-event ?event-name?");
                                        return JIM_ERR;
                                }
@@ -3505,24 +3505,24 @@ static int target_configure( Jim_GetOptInfo *goi, target_t *target )
 
                                teap = target->event_action;
                                /* replace existing? */
 
                                teap = target->event_action;
                                /* replace existing? */
-                               while ( teap ){
-                                       if ( teap->event == (enum target_event)n->value ){
+                               while (teap ){
+                                       if (teap->event == (enum target_event)n->value ){
                                                break;
                                        }
                                        teap = teap->next;
                                }
 
                                                break;
                                        }
                                        teap = teap->next;
                                }
 
-                               if ( goi->isconfigure ){
-                                       if ( teap == NULL ){
+                               if (goi->isconfigure ){
+                                       if (teap == NULL ){
                                                /* create new */
                                                /* create new */
-                                               teap = calloc( 1, sizeof(*teap) );
+                                               teap = calloc(1, sizeof(*teap) );
                                        }
                                        teap->event = n->value;
                                        }
                                        teap->event = n->value;
-                                       Jim_GetOpt_Obj( goi, &o );
-                                       if ( teap->body ){
-                                               Jim_DecrRefCount( interp, teap->body );
+                                       Jim_GetOpt_Obj(goi, &o );
+                                       if (teap->body ){
+                                               Jim_DecrRefCount(interp, teap->body );
                                        }
                                        }
-                                       teap->body  = Jim_DuplicateObj( goi->interp, o );
+                                       teap->body  = Jim_DuplicateObj(goi->interp, o );
                                        /*
                                         * FIXME:
                                         *     Tcl/TK - "tk events" have a nice feature.
                                        /*
                                         * FIXME:
                                         *     Tcl/TK - "tk events" have a nice feature.
@@ -3533,7 +3533,7 @@ static int target_configure( Jim_GetOptInfo *goi, target_t *target )
                                         *     The idea is: %N - target number
                                         *     The idea is: %E - event name.
                                         */
                                         *     The idea is: %N - target number
                                         *     The idea is: %E - event name.
                                         */
-                                       Jim_IncrRefCount( teap->body );
+                                       Jim_IncrRefCount(teap->body );
 
                                        /* add to head of event list */
                                        teap->next = target->event_action;
 
                                        /* add to head of event list */
                                        teap->next = target->event_action;
@@ -3541,10 +3541,10 @@ static int target_configure( Jim_GetOptInfo *goi, target_t *target )
                                        Jim_SetEmptyResult(goi->interp);
                                } else {
                                        /* get */
                                        Jim_SetEmptyResult(goi->interp);
                                } else {
                                        /* get */
-                                       if ( teap == NULL ){
-                                               Jim_SetEmptyResult( goi->interp );
+                                       if (teap == NULL ){
+                                               Jim_SetEmptyResult(goi->interp );
                                        } else {
                                        } else {
-                                               Jim_SetResult( goi->interp, Jim_DuplicateObj( goi->interp, teap->body ) );
+                                               Jim_SetResult(goi->interp, Jim_DuplicateObj(goi->interp, teap->body ) );
                                        }
                                }
                        }
                                        }
                                }
                        }
@@ -3552,67 +3552,67 @@ static int target_configure( Jim_GetOptInfo *goi, target_t *target )
                        break;
 
                case TCFG_WORK_AREA_VIRT:
                        break;
 
                case TCFG_WORK_AREA_VIRT:
-                       if ( goi->isconfigure ){
+                       if (goi->isconfigure ){
                                target_free_all_working_areas(target);
                                target_free_all_working_areas(target);
-                               e = Jim_GetOpt_Wide( goi, &w );
-                               if ( e != JIM_OK ){
+                               e = Jim_GetOpt_Wide(goi, &w );
+                               if (e != JIM_OK ){
                                        return e;
                                }
                                target->working_area_virt = w;
                        } else {
                                        return e;
                                }
                                target->working_area_virt = w;
                        } else {
-                               if ( goi->argc != 0 ){
+                               if (goi->argc != 0 ){
                                        goto no_params;
                                }
                        }
                                        goto no_params;
                                }
                        }
-                       Jim_SetResult( interp, Jim_NewIntObj( goi->interp, target->working_area_virt ) );
+                       Jim_SetResult(interp, Jim_NewIntObj(goi->interp, target->working_area_virt ) );
                        /* loop for more */
                        break;
 
                case TCFG_WORK_AREA_PHYS:
                        /* loop for more */
                        break;
 
                case TCFG_WORK_AREA_PHYS:
-                       if ( goi->isconfigure ){
+                       if (goi->isconfigure ){
                                target_free_all_working_areas(target);
                                target_free_all_working_areas(target);
-                               e = Jim_GetOpt_Wide( goi, &w );
-                               if ( e != JIM_OK ){
+                               e = Jim_GetOpt_Wide(goi, &w );
+                               if (e != JIM_OK ){
                                        return e;
                                }
                                target->working_area_phys = w;
                        } else {
                                        return e;
                                }
                                target->working_area_phys = w;
                        } else {
-                               if ( goi->argc != 0 ){
+                               if (goi->argc != 0 ){
                                        goto no_params;
                                }
                        }
                                        goto no_params;
                                }
                        }
-                       Jim_SetResult( interp, Jim_NewIntObj( goi->interp, target->working_area_phys ) );
+                       Jim_SetResult(interp, Jim_NewIntObj(goi->interp, target->working_area_phys ) );
                        /* loop for more */
                        break;
 
                case TCFG_WORK_AREA_SIZE:
                        /* loop for more */
                        break;
 
                case TCFG_WORK_AREA_SIZE:
-                       if ( goi->isconfigure ){
+                       if (goi->isconfigure ){
                                target_free_all_working_areas(target);
                                target_free_all_working_areas(target);
-                               e = Jim_GetOpt_Wide( goi, &w );
-                               if ( e != JIM_OK ){
+                               e = Jim_GetOpt_Wide(goi, &w );
+                               if (e != JIM_OK ){
                                        return e;
                                }
                                target->working_area_size = w;
                        } else {
                                        return e;
                                }
                                target->working_area_size = w;
                        } else {
-                               if ( goi->argc != 0 ){
+                               if (goi->argc != 0 ){
                                        goto no_params;
                                }
                        }
                                        goto no_params;
                                }
                        }
-                       Jim_SetResult( interp, Jim_NewIntObj( goi->interp, target->working_area_size ) );
+                       Jim_SetResult(interp, Jim_NewIntObj(goi->interp, target->working_area_size ) );
                        /* loop for more */
                        break;
 
                case TCFG_WORK_AREA_BACKUP:
                        /* loop for more */
                        break;
 
                case TCFG_WORK_AREA_BACKUP:
-                       if ( goi->isconfigure ){
+                       if (goi->isconfigure ){
                                target_free_all_working_areas(target);
                                target_free_all_working_areas(target);
-                               e = Jim_GetOpt_Wide( goi, &w );
-                               if ( e != JIM_OK ){
+                               e = Jim_GetOpt_Wide(goi, &w );
+                               if (e != JIM_OK ){
                                        return e;
                                }
                                /* make this exactly 1 or 0 */
                                target->backup_working_area = (!!w);
                        } else {
                                        return e;
                                }
                                /* make this exactly 1 or 0 */
                                target->backup_working_area = (!!w);
                        } else {
-                               if ( goi->argc != 0 ){
+                               if (goi->argc != 0 ){
                                        goto no_params;
                                }
                        }
                                        goto no_params;
                                }
                        }
@@ -3621,73 +3621,73 @@ static int target_configure( Jim_GetOptInfo *goi, target_t *target )
                        break;
 
                case TCFG_ENDIAN:
                        break;
 
                case TCFG_ENDIAN:
-                       if ( goi->isconfigure ){
-                               e = Jim_GetOpt_Nvp( goi, nvp_target_endian, &n );
-                               if ( e != JIM_OK ){
-                                       Jim_GetOpt_NvpUnknown( goi, nvp_target_endian, 1 );
+                       if (goi->isconfigure ){
+                               e = Jim_GetOpt_Nvp(goi, nvp_target_endian, &n );
+                               if (e != JIM_OK ){
+                                       Jim_GetOpt_NvpUnknown(goi, nvp_target_endian, 1 );
                                        return e;
                                }
                                target->endianness = n->value;
                        } else {
                                        return e;
                                }
                                target->endianness = n->value;
                        } else {
-                               if ( goi->argc != 0 ){
+                               if (goi->argc != 0 ){
                                        goto no_params;
                                }
                        }
                                        goto no_params;
                                }
                        }
-                       n = Jim_Nvp_value2name_simple( nvp_target_endian, target->endianness );
-                       if ( n->name == NULL ){
+                       n = Jim_Nvp_value2name_simple(nvp_target_endian, target->endianness );
+                       if (n->name == NULL ){
                                target->endianness = TARGET_LITTLE_ENDIAN;
                                target->endianness = TARGET_LITTLE_ENDIAN;
-                               n = Jim_Nvp_value2name_simple( nvp_target_endian, target->endianness );
+                               n = Jim_Nvp_value2name_simple(nvp_target_endian, target->endianness );
                        }
                        }
-                       Jim_SetResultString( goi->interp, n->name, -1 );
+                       Jim_SetResultString(goi->interp, n->name, -1 );
                        /* loop for more */
                        break;
 
                case TCFG_VARIANT:
                        /* loop for more */
                        break;
 
                case TCFG_VARIANT:
-                       if ( goi->isconfigure ){
-                               if ( goi->argc < 1 ){
-                                       Jim_SetResult_sprintf( goi->interp,
+                       if (goi->isconfigure ){
+                               if (goi->argc < 1 ){
+                                       Jim_SetResult_sprintf(goi->interp,
                                                                                   "%s ?STRING?",
                                                                                   n->name );
                                        return JIM_ERR;
                                }
                                                                                   "%s ?STRING?",
                                                                                   n->name );
                                        return JIM_ERR;
                                }
-                               if ( target->variant ){
+                               if (target->variant ){
                                        free((void *)(target->variant));
                                }
                                        free((void *)(target->variant));
                                }
-                               e = Jim_GetOpt_String( goi, &cp, NULL );
+                               e = Jim_GetOpt_String(goi, &cp, NULL );
                                target->variant = strdup(cp);
                        } else {
                                target->variant = strdup(cp);
                        } else {
-                               if ( goi->argc != 0 ){
+                               if (goi->argc != 0 ){
                                        goto no_params;
                                }
                        }
                                        goto no_params;
                                }
                        }
-                       Jim_SetResultString( goi->interp, target->variant,-1 );
+                       Jim_SetResultString(goi->interp, target->variant,-1 );
                        /* loop for more */
                        break;
                case TCFG_CHAIN_POSITION:
                        /* loop for more */
                        break;
                case TCFG_CHAIN_POSITION:
-                       if ( goi->isconfigure ){
+                       if (goi->isconfigure ){
                                Jim_Obj *o;
                                jtag_tap_t *tap;
                                target_free_all_working_areas(target);
                                Jim_Obj *o;
                                jtag_tap_t *tap;
                                target_free_all_working_areas(target);
-                               e = Jim_GetOpt_Obj( goi, &o );
-                               if ( e != JIM_OK ){
+                               e = Jim_GetOpt_Obj(goi, &o );
+                               if (e != JIM_OK ){
                                        return e;
                                }
                                        return e;
                                }
-                               tap = jtag_tap_by_jim_obj( goi->interp, o );
-                               if ( tap == NULL ){
+                               tap = jtag_tap_by_jim_obj(goi->interp, o );
+                               if (tap == NULL ){
                                        return JIM_ERR;
                                }
                                /* make this exactly 1 or 0 */
                                target->tap = tap;
                        } else {
                                        return JIM_ERR;
                                }
                                /* make this exactly 1 or 0 */
                                target->tap = tap;
                        } else {
-                               if ( goi->argc != 0 ){
+                               if (goi->argc != 0 ){
                                        goto no_params;
                                }
                        }
                                        goto no_params;
                                }
                        }
-                       Jim_SetResultString( interp, target->tap->dotted_name, -1 );
+                       Jim_SetResultString(interp, target->tap->dotted_name, -1 );
                        /* loop for more e*/
                        break;
                }
                        /* loop for more e*/
                        break;
                }
-       } /* while ( goi->argc ) */
+       } /* while (goi->argc ) */
 
 
                /* done - we return */
 
 
                /* done - we return */
@@ -3695,7 +3695,7 @@ static int target_configure( Jim_GetOptInfo *goi, target_t *target )
 }
 
 /** this is the 'tcl' handler for the target specific command */
 }
 
 /** this is the 'tcl' handler for the target specific command */
-static int tcl_target_func( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
+static int tcl_target_func(Jim_Interp *interp, int argc, Jim_Obj *const *argv )
 {
        Jim_GetOptInfo goi;
        jim_wide a,b,c;
 {
        Jim_GetOptInfo goi;
        jim_wide a,b,c;
@@ -3749,36 +3749,36 @@ static int tcl_target_func( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
        };
 
        /* go past the "command" */
        };
 
        /* go past the "command" */
-       Jim_GetOpt_Setup( &goi, interp, argc-1, argv + 1 );
+       Jim_GetOpt_Setup(&goi, interp, argc-1, argv + 1 );
 
 
-       target = Jim_CmdPrivData( goi.interp );
+       target = Jim_CmdPrivData(goi.interp );
        cmd_ctx = Jim_GetAssocData(goi.interp, "context");
 
        /* commands here are in an NVP table */
        cmd_ctx = Jim_GetAssocData(goi.interp, "context");
 
        /* commands here are in an NVP table */
-       e = Jim_GetOpt_Nvp( &goi, target_options, &n );
-       if ( e != JIM_OK ){
-               Jim_GetOpt_NvpUnknown( &goi, target_options, 0 );
+       e = Jim_GetOpt_Nvp(&goi, target_options, &n );
+       if (e != JIM_OK ){
+               Jim_GetOpt_NvpUnknown(&goi, target_options, 0 );
                return e;
        }
        /* Assume blank result */
                return e;
        }
        /* 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 ){
-                       Jim_WrongNumArgs( goi.interp, goi.argc, goi.argv, "missing: -option VALUE ...");
+               if (goi.argc < 2 ){
+                       Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv, "missing: -option VALUE ...");
                        return JIM_ERR;
                }
                goi.isconfigure = 1;
                        return JIM_ERR;
                }
                goi.isconfigure = 1;
-               return target_configure( &goi, target );
+               return target_configure(&goi, target );
        case TS_CMD_CGET:
                // some things take params
        case TS_CMD_CGET:
                // some things take params
-               if ( goi.argc < 1 ){
-                       Jim_WrongNumArgs( goi.interp, 0, goi.argv, "missing: ?-option?");
+               if (goi.argc < 1 ){
+                       Jim_WrongNumArgs(goi.interp, 0, goi.argv, "missing: ?-option?");
                        return JIM_ERR;
                }
                goi.isconfigure = 0;
                        return JIM_ERR;
                }
                goi.isconfigure = 0;
-               return target_configure( &goi, target );
+               return target_configure(&goi, target );
                break;
        case TS_CMD_MWW:
        case TS_CMD_MWH:
                break;
        case TS_CMD_MWW:
        case TS_CMD_MWH:
@@ -3789,50 +3789,50 @@ static int tcl_target_func( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
                 * argv[3] = optional count.
                 */
 
                 * argv[3] = optional count.
                 */
 
-               if ( (goi.argc == 2) || (goi.argc == 3) ){
+               if ((goi.argc == 2) || (goi.argc == 3) ){
                        /* all is well */
                } else {
                mwx_error:
                        /* all is well */
                } else {
                mwx_error:
-                       Jim_SetResult_sprintf( goi.interp, "expected: %s ADDR DATA [COUNT]", n->name );
+                       Jim_SetResult_sprintf(goi.interp, "expected: %s ADDR DATA [COUNT]", n->name );
                        return JIM_ERR;
                }
 
                        return JIM_ERR;
                }
 
-               e = Jim_GetOpt_Wide( &goi, &a );
-               if ( e != JIM_OK ){
+               e = Jim_GetOpt_Wide(&goi, &a );
+               if (e != JIM_OK ){
                        goto mwx_error;
                }
 
                        goto mwx_error;
                }
 
-               e = Jim_GetOpt_Wide( &goi, &b );
-               if ( e != JIM_OK ){
+               e = Jim_GetOpt_Wide(&goi, &b );
+               if (e != JIM_OK ){
                        goto mwx_error;
                }
                if (goi.argc == 3) {
                        goto mwx_error;
                }
                if (goi.argc == 3) {
-                       e = Jim_GetOpt_Wide( &goi, &c );
-                       if ( e != JIM_OK ){
+                       e = Jim_GetOpt_Wide(&goi, &c );
+                       if (e != JIM_OK ){
                                goto mwx_error;
                        }
                } else {
                        c = 1;
                }
 
                                goto mwx_error;
                        }
                } else {
                        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;
                        break;
                case TS_CMD_MWH:
                        b = 4;
                        break;
                case TS_CMD_MWH:
-                       target_buffer_set_u16( target, target_buf, b );
+                       target_buffer_set_u16(target, target_buf, b );
                        b = 2;
                        break;
                case TS_CMD_MWB:
                        b = 2;
                        break;
                case TS_CMD_MWB:
-                       target_buffer_set_u8( target, target_buf, b );
+                       target_buffer_set_u8(target, target_buf, b );
                        b = 1;
                        break;
                }
                        b = 1;
                        break;
                }
-               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 );
+               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 );
                                return JIM_ERR;
                        }
                        /* b = width */
                                return JIM_ERR;
                        }
                        /* b = width */
@@ -3849,24 +3849,24 @@ static int tcl_target_func( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
                 * argv[1] = address
                 * argv[2] = optional count
                 */
                 * argv[1] = address
                 * argv[2] = optional count
                 */
-               if ( (goi.argc == 2) || (goi.argc == 3) ){
-                       Jim_SetResult_sprintf( goi.interp, "expected: %s ADDR [COUNT]", n->name );
+               if ((goi.argc == 2) || (goi.argc == 3) ){
+                       Jim_SetResult_sprintf(goi.interp, "expected: %s ADDR [COUNT]", n->name );
                        return JIM_ERR;
                }
                        return JIM_ERR;
                }
-               e = Jim_GetOpt_Wide( &goi, &a );
-               if ( e != JIM_OK ){
+               e = Jim_GetOpt_Wide(&goi, &a );
+               if (e != JIM_OK ){
                        return JIM_ERR;
                }
                        return JIM_ERR;
                }
-               if ( goi.argc ){
-                       e = Jim_GetOpt_Wide( &goi, &c );
-                       if ( e != JIM_OK ){
+               if (goi.argc ){
+                       e = Jim_GetOpt_Wide(&goi, &c );
+                       if (e != JIM_OK ){
                                return JIM_ERR;
                        }
                } else {
                        c = 1;
                }
                b = 1; /* shut up gcc */
                                return JIM_ERR;
                        }
                } else {
                        c = 1;
                }
                b = 1; /* shut up gcc */
-               switch ( n->value ){
+               switch (n->value ){
                case TS_CMD_MDW:
                        b =  4;
                        break;
                case TS_CMD_MDW:
                        b =  4;
                        break;
@@ -3881,51 +3881,51 @@ 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' */
                /* convert to "bytes" */
                c = c * b;
                /* count is now in 'BYTES' */
-               while ( c > 0 ){
+               while (c > 0 ){
                        y = c;
                        y = c;
-                       if ( y > 16 ){
+                       if (y > 16 ){
                                y = 16;
                        }
                                y = 16;
                        }
-                       e = target_read_memory( target, a, b, y / b, target_buf );
-                       if ( e != ERROR_OK ){
-                               Jim_SetResult_sprintf( interp, "error reading target @ 0x%08lx", (int)(a) );
+                       e = target_read_memory(target, a, b, y / b, target_buf );
+                       if (e != ERROR_OK ){
+                               Jim_SetResult_sprintf(interp, "error reading target @ 0x%08lx", (int)(a) );
                                return JIM_ERR;
                        }
 
                                return JIM_ERR;
                        }
 
-                       Jim_fprintf( interp, interp->cookie_stdout, "0x%08x ", (int)(a) );
-                       switch ( b ){
+                       Jim_fprintf(interp, interp->cookie_stdout, "0x%08x ", (int)(a) );
+                       switch (b ){
                        case 4:
                        case 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 = 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 ){
-                                       Jim_fprintf( interp, interp->cookie_stdout, "         " );
+                               for (; (x < 16) ; x += 4 ){
+                                       Jim_fprintf(interp, interp->cookie_stdout, "         " );
                                }
                                break;
                        case 2:
                                }
                                break;
                        case 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 = 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 ){
-                                       Jim_fprintf( interp, interp->cookie_stdout, "     " );
+                               for (; (x < 16) ; x += 2 ){
+                                       Jim_fprintf(interp, interp->cookie_stdout, "     " );
                                }
                                break;
                        case 1:
                        default:
                                }
                                break;
                        case 1:
                        default:
-                               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 = 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 ){
-                                       Jim_fprintf( interp, interp->cookie_stdout, "   " );
+                               for (; (x < 16) ; x += 1 ){
+                                       Jim_fprintf(interp, interp->cookie_stdout, "   " );
                                }
                                break;
                        }
                        /* ascii-ify the bytes */
                                }
                                break;
                        }
                        /* ascii-ify the bytes */
-                       for ( x = 0 ; x < y ; x++ ){
-                               if ( (target_buf[x] >= 0x20) &&
+                       for (x = 0 ; x < y ; x++ ){
+                               if ((target_buf[x] >= 0x20) &&
                                        (target_buf[x] <= 0x7e) ){
                                        /* good */
                                } else {
                                        (target_buf[x] <= 0x7e) ){
                                        /* good */
                                } else {
@@ -3934,70 +3934,70 @@ static int tcl_target_func( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
                                }
                        }
                        /* space pad  */
                                }
                        }
                        /* space pad  */
-                       while ( x < 16 ){
+                       while (x < 16 ){
                                target_buf[x] = ' ';
                                x++;
                        }
                        /* terminate */
                        target_buf[16] = 0;
                        /* print - with a newline */
                                target_buf[x] = ' ';
                                x++;
                        }
                        /* terminate */
                        target_buf[16] = 0;
                        /* print - with a newline */
-                       Jim_fprintf( interp, interp->cookie_stdout, "%s\n", target_buf );
+                       Jim_fprintf(interp, interp->cookie_stdout, "%s\n", target_buf );
                        /* NEXT... */
                        c -= 16;
                        a += 16;
                }
                return JIM_OK;
        case TS_CMD_MEM2ARRAY:
                        /* NEXT... */
                        c -= 16;
                        a += 16;
                }
                return JIM_OK;
        case TS_CMD_MEM2ARRAY:
-               return target_mem2array( goi.interp, target, goi.argc, goi.argv );
+               return target_mem2array(goi.interp, target, goi.argc, goi.argv );
                break;
        case TS_CMD_ARRAY2MEM:
                break;
        case TS_CMD_ARRAY2MEM:
-               return target_array2mem( goi.interp, target, goi.argc, goi.argv );
+               return target_array2mem(goi.interp, target, goi.argc, goi.argv );
                break;
        case TS_CMD_EXAMINE:
                break;
        case TS_CMD_EXAMINE:
-               if ( goi.argc ){
-                       Jim_WrongNumArgs( goi.interp, 2, argv, "[no parameters]");
+               if (goi.argc ){
+                       Jim_WrongNumArgs(goi.interp, 2, argv, "[no parameters]");
                        return JIM_ERR;
                }
                if (!target->tap->enabled)
                        goto err_tap_disabled;
                        return JIM_ERR;
                }
                if (!target->tap->enabled)
                        goto err_tap_disabled;
-               e = target->type->examine( target );
-               if ( e != ERROR_OK ){
-                       Jim_SetResult_sprintf( interp, "examine-fails: %d", e );
+               e = target->type->examine(target );
+               if (e != ERROR_OK ){
+                       Jim_SetResult_sprintf(interp, "examine-fails: %d", e );
                        return JIM_ERR;
                }
                return JIM_OK;
        case TS_CMD_POLL:
                        return JIM_ERR;
                }
                return JIM_OK;
        case TS_CMD_POLL:
-               if ( goi.argc ){
-                       Jim_WrongNumArgs( goi.interp, 2, argv, "[no parameters]");
+               if (goi.argc ){
+                       Jim_WrongNumArgs(goi.interp, 2, argv, "[no parameters]");
                        return JIM_ERR;
                }
                if (!target->tap->enabled)
                        goto err_tap_disabled;
                        return JIM_ERR;
                }
                if (!target->tap->enabled)
                        goto err_tap_disabled;
-               if ( !(target_was_examined(target)) ){
+               if (!(target_was_examined(target)) ){
                        e = ERROR_TARGET_NOT_EXAMINED;
                } else {
                        e = ERROR_TARGET_NOT_EXAMINED;
                } else {
-                       e = target->type->poll( target );
+                       e = target->type->poll(target );
                }
                }
-               if ( e != ERROR_OK ){
-                       Jim_SetResult_sprintf( interp, "poll-fails: %d", e );
+               if (e != ERROR_OK ){
+                       Jim_SetResult_sprintf(interp, "poll-fails: %d", e );
                        return JIM_ERR;
                } else {
                        return JIM_OK;
                }
                break;
        case TS_CMD_RESET:
                        return JIM_ERR;
                } else {
                        return JIM_OK;
                }
                break;
        case TS_CMD_RESET:
-               if ( goi.argc != 2 ){
-                       Jim_WrongNumArgs( interp, 2, argv, "t | f|assert | deassert BOOL");
+               if (goi.argc != 2 ){
+                       Jim_WrongNumArgs(interp, 2, argv, "t | f|assert | deassert BOOL");
                        return JIM_ERR;
                }
                        return JIM_ERR;
                }
-               e = Jim_GetOpt_Nvp( &goi, nvp_assert, &n );
-               if ( e != JIM_OK ){
-                       Jim_GetOpt_NvpUnknown( &goi, nvp_assert, 1 );
+               e = Jim_GetOpt_Nvp(&goi, nvp_assert, &n );
+               if (e != JIM_OK ){
+                       Jim_GetOpt_NvpUnknown(&goi, nvp_assert, 1 );
                        return e;
                }
                /* the halt or not param */
                        return e;
                }
                /* the halt or not param */
-               e = Jim_GetOpt_Wide( &goi, &a);
-               if ( e != JIM_OK ){
+               e = Jim_GetOpt_Wide(&goi, &a);
+               if (e != JIM_OK ){
                        return e;
                }
                if (!target->tap->enabled)
                        return e;
                }
                if (!target->tap->enabled)
@@ -4008,41 +4008,41 @@ static int tcl_target_func( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
                target_free_all_working_areas_restore(target, 0);
 
                /* do the assert */
                target_free_all_working_areas_restore(target, 0);
 
                /* do the assert */
-               if ( n->value == NVP_ASSERT ){
-                       target->type->assert_reset( target );
+               if (n->value == NVP_ASSERT ){
+                       target->type->assert_reset(target );
                } else {
                } else {
-                       target->type->deassert_reset( target );
+                       target->type->deassert_reset(target );
                }
                return JIM_OK;
        case TS_CMD_HALT:
                }
                return JIM_OK;
        case TS_CMD_HALT:
-               if ( goi.argc ){
-                       Jim_WrongNumArgs( goi.interp, 0, argv, "halt [no parameters]");
+               if (goi.argc ){
+                       Jim_WrongNumArgs(goi.interp, 0, argv, "halt [no parameters]");
                        return JIM_ERR;
                }
                if (!target->tap->enabled)
                        goto err_tap_disabled;
                        return JIM_ERR;
                }
                if (!target->tap->enabled)
                        goto err_tap_disabled;
-               target->type->halt( target );
+               target->type->halt(target );
                return JIM_OK;
        case TS_CMD_WAITSTATE:
                /* params:  <name>  statename timeoutmsecs */
                return JIM_OK;
        case TS_CMD_WAITSTATE:
                /* params:  <name>  statename timeoutmsecs */
-               if ( goi.argc != 2 ){
-                       Jim_SetResult_sprintf( goi.interp, "%s STATENAME TIMEOUTMSECS", n->name );
+               if (goi.argc != 2 ){
+                       Jim_SetResult_sprintf(goi.interp, "%s STATENAME TIMEOUTMSECS", n->name );
                        return JIM_ERR;
                }
                        return JIM_ERR;
                }
-               e = Jim_GetOpt_Nvp( &goi, nvp_target_state, &n );
-               if ( e != JIM_OK ){
-                       Jim_GetOpt_NvpUnknown( &goi, nvp_target_state,1 );
+               e = Jim_GetOpt_Nvp(&goi, nvp_target_state, &n );
+               if (e != JIM_OK ){
+                       Jim_GetOpt_NvpUnknown(&goi, nvp_target_state,1 );
                        return e;
                }
                        return e;
                }
-               e = Jim_GetOpt_Wide( &goi, &a );
-               if ( e != JIM_OK ){
+               e = Jim_GetOpt_Wide(&goi, &a );
+               if (e != JIM_OK ){
                        return e;
                }
                if (!target->tap->enabled)
                        goto err_tap_disabled;
                        return e;
                }
                if (!target->tap->enabled)
                        goto err_tap_disabled;
-               e = target_wait_state( target, n->value, a );
-               if ( e != ERROR_OK ){
-                       Jim_SetResult_sprintf( goi.interp,
+               e = target_wait_state(target, n->value, a );
+               if (e != ERROR_OK ){
+                       Jim_SetResult_sprintf(goi.interp,
                                                                   "target: %s wait %s fails (%d) %s",
                                                                   target->cmd_name,
                                                                   n->name,
                                                                   "target: %s wait %s fails (%d) %s",
                                                                   target->cmd_name,
                                                                   n->name,
@@ -4058,40 +4058,40 @@ static int tcl_target_func( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
                {
                        target_event_action_t *teap;
                        teap = target->event_action;
                {
                        target_event_action_t *teap;
                        teap = target->event_action;
-                       command_print( cmd_ctx, "Event actions for target (%d) %s\n",
+                       command_print(cmd_ctx, "Event actions for target (%d) %s\n",
                                                   target->target_number,
                                                   target->cmd_name );
                                                   target->target_number,
                                                   target->cmd_name );
-                       command_print( cmd_ctx, "%-25s | Body", "Event");
-                       command_print( cmd_ctx, "------------------------- | ----------------------------------------");
-                       while ( teap ){
-                               command_print( cmd_ctx,
+                       command_print(cmd_ctx, "%-25s | Body", "Event");
+                       command_print(cmd_ctx, "------------------------- | ----------------------------------------");
+                       while (teap ){
+                               command_print(cmd_ctx,
                                                           "%-25s | %s",
                                                           "%-25s | %s",
-                                                          Jim_Nvp_value2name_simple( nvp_target_event, teap->event )->name,
-                                                          Jim_GetString( teap->body, NULL ) );
+                                                          Jim_Nvp_value2name_simple(nvp_target_event, teap->event )->name,
+                                                          Jim_GetString(teap->body, NULL ) );
                                teap = teap->next;
                        }
                                teap = teap->next;
                        }
-                       command_print( cmd_ctx, "***END***");
+                       command_print(cmd_ctx, "***END***");
                        return JIM_OK;
                }
        case TS_CMD_CURSTATE:
                        return JIM_OK;
                }
        case TS_CMD_CURSTATE:
-               if ( goi.argc != 0 ){
-                       Jim_WrongNumArgs( goi.interp, 0, argv, "[no parameters]");
+               if (goi.argc != 0 ){
+                       Jim_WrongNumArgs(goi.interp, 0, argv, "[no parameters]");
                        return JIM_ERR;
                }
                        return JIM_ERR;
                }
-               Jim_SetResultString( goi.interp,
+               Jim_SetResultString(goi.interp,
                                                         Jim_Nvp_value2name_simple(nvp_target_state,target->state)->name,-1);
                return JIM_OK;
        case TS_CMD_INVOKE_EVENT:
                                                         Jim_Nvp_value2name_simple(nvp_target_state,target->state)->name,-1);
                return JIM_OK;
        case TS_CMD_INVOKE_EVENT:
-               if ( goi.argc != 1 ){
-                       Jim_SetResult_sprintf( goi.interp, "%s ?EVENTNAME?",n->name);
+               if (goi.argc != 1 ){
+                       Jim_SetResult_sprintf(goi.interp, "%s ?EVENTNAME?",n->name);
                        return JIM_ERR;
                }
                        return JIM_ERR;
                }
-               e = Jim_GetOpt_Nvp( &goi, nvp_target_event, &n );
-               if ( e != JIM_OK ){
-                       Jim_GetOpt_NvpUnknown( &goi, nvp_target_event, 1 );
+               e = Jim_GetOpt_Nvp(&goi, nvp_target_event, &n );
+               if (e != JIM_OK ){
+                       Jim_GetOpt_NvpUnknown(&goi, nvp_target_event, 1 );
                        return e;
                }
                        return e;
                }
-               target_handle_event( target, n->value );
+               target_handle_event(target, n->value );
                return JIM_OK;
        }
        return JIM_ERR;
                return JIM_OK;
        }
        return JIM_ERR;
@@ -4101,7 +4101,7 @@ err_tap_disabled:
        return JIM_ERR;
 }
 
        return JIM_ERR;
 }
 
-static int target_create( Jim_GetOptInfo *goi )
+static int target_create(Jim_GetOptInfo *goi )
 {
        Jim_Obj *new_cmd;
        Jim_Cmd *cmd;
 {
        Jim_Obj *new_cmd;
        Jim_Cmd *cmd;
@@ -4113,41 +4113,41 @@ static int target_create( Jim_GetOptInfo *goi )
        struct command_context_s *cmd_ctx;
 
        cmd_ctx = Jim_GetAssocData(goi->interp, "context");
        struct command_context_s *cmd_ctx;
 
        cmd_ctx = Jim_GetAssocData(goi->interp, "context");
-       if ( goi->argc < 3 ){
-               Jim_WrongNumArgs( goi->interp, 1, goi->argv, "?name? ?type? ..options...");
+       if (goi->argc < 3 ){
+               Jim_WrongNumArgs(goi->interp, 1, goi->argv, "?name? ?type? ..options...");
                return JIM_ERR;
        }
 
        /* COMMAND */
                return JIM_ERR;
        }
 
        /* COMMAND */
-       Jim_GetOpt_Obj( goi, &new_cmd );
+       Jim_GetOpt_Obj(goi, &new_cmd );
        /* does this command exist? */
        /* does this command exist? */
-       cmd = Jim_GetCommand( goi->interp, new_cmd, JIM_ERRMSG );
-       if ( cmd ){
-               cp = Jim_GetString( new_cmd, NULL );
+       cmd = Jim_GetCommand(goi->interp, new_cmd, JIM_ERRMSG );
+       if (cmd ){
+               cp = Jim_GetString(new_cmd, NULL );
                Jim_SetResult_sprintf(goi->interp, "Command/target: %s Exists", cp);
                return JIM_ERR;
        }
 
        /* TYPE */
                Jim_SetResult_sprintf(goi->interp, "Command/target: %s Exists", cp);
                return JIM_ERR;
        }
 
        /* TYPE */
-       e = Jim_GetOpt_String( goi, &cp2, NULL );
+       e = Jim_GetOpt_String(goi, &cp2, NULL );
        cp = cp2;
        /* now does target type exist */
        cp = cp2;
        /* now does target type exist */
-       for ( x = 0 ; target_types[x] ; x++ ){
-               if ( 0 == strcmp( cp, target_types[x]->name ) ){
+       for (x = 0 ; target_types[x] ; x++ ){
+               if (0 == strcmp(cp, target_types[x]->name ) ){
                        /* found */
                        break;
                }
        }
                        /* found */
                        break;
                }
        }
-       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++ ){
-                       if ( target_types[x + 1] ){
-                               Jim_AppendStrings( goi->interp,
+       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++ ){
+                       if (target_types[x + 1] ){
+                               Jim_AppendStrings(goi->interp,
                                                                   Jim_GetResult(goi->interp),
                                                                   target_types[x]->name,
                                                                   ", ", NULL);
                        } else {
                                                                   Jim_GetResult(goi->interp),
                                                                   target_types[x]->name,
                                                                   ", ", NULL);
                        } else {
-                               Jim_AppendStrings( goi->interp,
+                               Jim_AppendStrings(goi->interp,
                                                                   Jim_GetResult(goi->interp),
                                                                   " or ",
                                                                   target_types[x]->name,NULL );
                                                                   Jim_GetResult(goi->interp),
                                                                   " or ",
                                                                   target_types[x]->name,NULL );
@@ -4164,7 +4164,7 @@ static int target_create( Jim_GetOptInfo *goi )
        /* allocate memory for each unique target type */
        target->type = (target_type_t*)calloc(1,sizeof(target_type_t));
 
        /* allocate memory for each unique target type */
        target->type = (target_type_t*)calloc(1,sizeof(target_type_t));
 
-       memcpy( target->type, target_types[x], sizeof(target_type_t));
+       memcpy(target->type, target_types[x], sizeof(target_type_t));
 
        /* will be set by "-endian" */
        target->endianness = TARGET_ENDIAN_UNKNOWN;
 
        /* will be set by "-endian" */
        target->endianness = TARGET_ENDIAN_UNKNOWN;
@@ -4201,21 +4201,21 @@ static int target_create( Jim_GetOptInfo *goi )
 
        /* Do the rest as "configure" options */
        goi->isconfigure = 1;
 
        /* Do the rest as "configure" options */
        goi->isconfigure = 1;
-       e = target_configure( goi, target);
+       e = target_configure(goi, target);
 
        if (target->tap == NULL)
        {
 
        if (target->tap == NULL)
        {
-               Jim_SetResultString( interp, "-chain-position required when creating target", -1);
+               Jim_SetResultString(interp, "-chain-position required when creating target", -1);
                e = JIM_ERR;
        }
 
                e = JIM_ERR;
        }
 
-       if ( e != JIM_OK ){
-               free( target->type );
-               free( target );
+       if (e != JIM_OK ){
+               free(target->type );
+               free(target );
                return e;
        }
 
                return e;
        }
 
-       if ( target->endianness == TARGET_ENDIAN_UNKNOWN ){
+       if (target->endianness == TARGET_ENDIAN_UNKNOWN ){
                /* default endian to little if not specified */
                target->endianness = TARGET_LITTLE_ENDIAN;
        }
                /* default endian to little if not specified */
                target->endianness = TARGET_LITTLE_ENDIAN;
        }
@@ -4225,28 +4225,28 @@ static int target_create( Jim_GetOptInfo *goi )
                target->variant = strdup("");
 
        /* create the target specific commands */
                target->variant = strdup("");
 
        /* create the target specific commands */
-       if ( target->type->register_commands ){
-               (*(target->type->register_commands))( cmd_ctx );
+       if (target->type->register_commands ){
+               (*(target->type->register_commands))(cmd_ctx );
        }
        }
-       if ( target->type->target_create ){
-               (*(target->type->target_create))( target, goi->interp );
+       if (target->type->target_create ){
+               (*(target->type->target_create))(target, goi->interp );
        }
 
        /* append to end of list */
        {
                target_t **tpp;
                tpp = &(all_targets);
        }
 
        /* append to end of list */
        {
                target_t **tpp;
                tpp = &(all_targets);
-               while ( *tpp ){
-                       tpp = &( (*tpp)->next );
+               while (*tpp ){
+                       tpp = &((*tpp)->next );
                }
                *tpp = target;
        }
 
                }
                *tpp = target;
        }
 
-       cp = Jim_GetString( new_cmd, NULL );
+       cp = Jim_GetString(new_cmd, NULL );
        target->cmd_name = strdup(cp);
 
        /* now - create the new target name command */
        target->cmd_name = strdup(cp);
 
        /* now - create the new target name command */
-       e = Jim_CreateCommand( goi->interp,
+       e = Jim_CreateCommand(goi->interp,
                                                   /* name */
                                                   cp,
                                                   tcl_target_func, /* C function */
                                                   /* name */
                                                   cp,
                                                   tcl_target_func, /* C function */
@@ -4256,7 +4256,7 @@ static int target_create( Jim_GetOptInfo *goi )
        return e;
 }
 
        return e;
 }
 
-static int jim_target( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
+static int jim_target(Jim_Interp *interp, int argc, Jim_Obj *const *argv )
 {
        int x,r,e;
        jim_wide w;
 {
        int x,r,e;
        jim_wide w;
@@ -4281,18 +4281,18 @@ static int jim_target( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
        LOG_DEBUG("Target command params:");
        LOG_DEBUG("%s", Jim_Debug_ArgvString(interp, argc, argv));
 
        LOG_DEBUG("Target command params:");
        LOG_DEBUG("%s", Jim_Debug_ArgvString(interp, argc, argv));
 
-       cmd_ctx = Jim_GetAssocData( interp, "context" );
+       cmd_ctx = Jim_GetAssocData(interp, "context" );
 
 
-       Jim_GetOpt_Setup( &goi, interp, argc-1, argv + 1 );
+       Jim_GetOpt_Setup(&goi, interp, argc-1, argv + 1 );
 
 
-       if ( goi.argc == 0 ){
+       if (goi.argc == 0 ){
                Jim_WrongNumArgs(interp, 1, argv, "missing: command ...");
                return JIM_ERR;
        }
 
                Jim_WrongNumArgs(interp, 1, argv, "missing: command ...");
                return JIM_ERR;
        }
 
-       /* Jim_GetOpt_Debug( &goi ); */
-       r = Jim_GetOpt_Enum( &goi, target_cmds, &x   );
-       if ( r != JIM_OK ){
+       /* Jim_GetOpt_Debug(&goi ); */
+       r = Jim_GetOpt_Enum(&goi, target_cmds, &x   );
+       if (r != JIM_OK ){
                return r;
        }
 
                return r;
        }
 
@@ -4301,71 +4301,71 @@ static int jim_target( Jim_Interp *interp, int argc, Jim_Obj *const *argv )
                Jim_Panic(goi.interp,"Why am I here?");
                return JIM_ERR;
        case TG_CMD_CURRENT:
                Jim_Panic(goi.interp,"Why am I here?");
                return JIM_ERR;
        case TG_CMD_CURRENT:
-               if ( goi.argc != 0 ){
-                       Jim_WrongNumArgs( goi.interp, 1, goi.argv, "Too many parameters");
+               if (goi.argc != 0 ){
+                       Jim_WrongNumArgs(goi.interp, 1, goi.argv, "Too many parameters");
                        return JIM_ERR;
                }
                        return JIM_ERR;
                }
-               Jim_SetResultString( goi.interp, get_current_target( cmd_ctx )->cmd_name, -1 );
+               Jim_SetResultString(goi.interp, get_current_target(cmd_ctx )->cmd_name, -1 );
                return JIM_OK;
        case TG_CMD_TYPES:
                return JIM_OK;
        case TG_CMD_TYPES:
-               if ( goi.argc != 0 ){
-                       Jim_WrongNumArgs( goi.interp, 1, goi.argv, "Too many parameters" );
+               if (goi.argc != 0 ){
+                       Jim_WrongNumArgs(goi.interp, 1, goi.argv, "Too many parameters" );
                        return JIM_ERR;
                }
                        return JIM_ERR;
                }
-               Jim_SetResult( goi.interp, Jim_NewListObj( goi.interp, NULL, 0 ) );
-               for ( x = 0 ; target_types[x] ; x++ ){
-                       Jim_ListAppendElement( goi.interp,
+               Jim_SetResult(goi.interp, Jim_NewListObj(goi.interp, NULL, 0 ) );
+               for (x = 0 ; target_types[x] ; x++ ){
+                       Jim_ListAppendElement(goi.interp,
                                                                   Jim_GetResult(goi.interp),
                                                                   Jim_GetResult(goi.interp),
-                                                                  Jim_NewStringObj( goi.interp, target_types[x]->name, -1 ) );
+                                                                  Jim_NewStringObj(goi.interp, target_types[x]->name, -1 ) );
                }
                return JIM_OK;
        case TG_CMD_NAMES:
                }
                return JIM_OK;
        case TG_CMD_NAMES:
-               if ( goi.argc != 0 ){
-                       Jim_WrongNumArgs( goi.interp, 1, goi.argv, "Too many parameters" );
+               if (goi.argc != 0 ){
+                       Jim_WrongNumArgs(goi.interp, 1, goi.argv, "Too many parameters" );
                        return JIM_ERR;
                }
                        return JIM_ERR;
                }
-               Jim_SetResult( goi.interp, Jim_NewListObj( goi.interp, NULL, 0 ) );
+               Jim_SetResult(goi.interp, Jim_NewListObj(goi.interp, NULL, 0 ) );
                target = all_targets;
                target = all_targets;
-               while ( target ){
-                       Jim_ListAppendElement( goi.interp,
+               while (target ){
+                       Jim_ListAppendElement(goi.interp,
                                                                   Jim_GetResult(goi.interp),
                                                                   Jim_GetResult(goi.interp),
-                                                                  Jim_NewStringObj( goi.interp, target->cmd_name, -1 ) );
+                                                                  Jim_NewStringObj(goi.interp, target->cmd_name, -1 ) );
                        target = target->next;
                }
                return JIM_OK;
        case TG_CMD_CREATE:
                        target = target->next;
                }
                return JIM_OK;
        case TG_CMD_CREATE:
-               if ( goi.argc < 3 ){
-                       Jim_WrongNumArgs( goi.interp, goi.argc, goi.argv, "?name  ... config options ...");
+               if (goi.argc < 3 ){
+                       Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv, "?name  ... config options ...");
                        return JIM_ERR;
                }
                        return JIM_ERR;
                }
-               return target_create( &goi );
+               return target_create(&goi );
                break;
        case TG_CMD_NUMBER:
                break;
        case TG_CMD_NUMBER:
-               if ( goi.argc != 1 ){
-                       Jim_SetResult_sprintf( goi.interp, "expected: target number ?NUMBER?");
+               if (goi.argc != 1 ){
+                       Jim_SetResult_sprintf(goi.interp, "expected: target number ?NUMBER?");
                        return JIM_ERR;
                }
                        return JIM_ERR;
                }
-               e = Jim_GetOpt_Wide( &goi, &w );
-               if ( e != JIM_OK ){
+               e = Jim_GetOpt_Wide(&goi, &w );
+               if (e != JIM_OK ){
                        return JIM_ERR;
                }
                {
                        target_t *t;
                        t = get_target_by_num(w);
                        return JIM_ERR;
                }
                {
                        target_t *t;
                        t = get_target_by_num(w);
-                       if ( t == NULL ){
-                               Jim_SetResult_sprintf( goi.interp,"Target: number %d does not exist", (int)(w));
+                       if (t == NULL ){
+                               Jim_SetResult_sprintf(goi.interp,"Target: number %d does not exist", (int)(w));
                                return JIM_ERR;
                        }
                                return JIM_ERR;
                        }
-                       Jim_SetResultString( goi.interp, t->cmd_name, -1 );
+                       Jim_SetResultString(goi.interp, t->cmd_name, -1 );
                        return JIM_OK;
                }
        case TG_CMD_COUNT:
                        return JIM_OK;
                }
        case TG_CMD_COUNT:
-               if ( goi.argc != 0 ){
-                       Jim_WrongNumArgs( goi.interp, 0, goi.argv, "<no parameters>");
+               if (goi.argc != 0 ){
+                       Jim_WrongNumArgs(goi.interp, 0, goi.argv, "<no parameters>");
                        return JIM_ERR;
                }
                        return JIM_ERR;
                }
-               Jim_SetResult( goi.interp,
-                                          Jim_NewIntObj( goi.interp, max_target_number()));
+               Jim_SetResult(goi.interp,
+                                          Jim_NewIntObj(goi.interp, max_target_number()));
                return JIM_OK;
        }
 
                return JIM_OK;
        }
 
index f7744460cd60c275562a5fbb1973645520f26d69..687ff0aee5ec2f3443b17e11129f42c400509894 100644 (file)
@@ -396,8 +396,8 @@ int target_write_u8(struct target_s *target, uint32_t address, uint8_t value);
 /* Issues USER() statements with target state information */
 int target_arch_state(struct target_s *target);
 
 /* Issues USER() statements with target state information */
 int target_arch_state(struct target_s *target);
 
-void target_handle_event( target_t *t, enum target_event e);
-void target_all_handle_event( enum target_event e );
+void target_handle_event(target_t *t, enum target_event e);
+void target_all_handle_event(enum target_event e );
 
 #define ERROR_TARGET_INVALID   (-300)
 #define ERROR_TARGET_INIT_FAILED (-301)
 
 #define ERROR_TARGET_INVALID   (-300)
 #define ERROR_TARGET_INIT_FAILED (-301)
@@ -412,6 +412,6 @@ void target_all_handle_event( enum target_event e );
 #define ERROR_TARGET_NOT_EXAMINED (-311)
 
 extern const Jim_Nvp nvp_error_target[];
 #define ERROR_TARGET_NOT_EXAMINED (-311)
 
 extern const Jim_Nvp nvp_error_target[];
-extern const char *target_strerror_safe( int err );
+extern const char *target_strerror_safe(int err );
 
 #endif /* TARGET_H */
 
 #endif /* TARGET_H */
index 54d8df684249372db8c0f04fa1144991a3500872..af59a6df10ff49af377c4d77fef0406ef16d612c 100644 (file)
@@ -117,7 +117,7 @@ int target_request(target_t *target, uint32_t request)
 {
        target_req_cmd_t target_req_cmd = request & 0xff;
 
 {
        target_req_cmd_t target_req_cmd = request & 0xff;
 
-       if ( charmsg_mode ) {
+       if (charmsg_mode ) {
                target_charmsg(target, target_req_cmd );
                return ERROR_OK;
        }
                target_charmsg(target, target_req_cmd );
                return ERROR_OK;
        }
index dd69d8c2074709824fc4906aaef98aa6ba6826f7..5ef6741d3b2b2bdaadb9b8bb7460127a154c4f34 100644 (file)
@@ -129,16 +129,16 @@ struct target_type_s
        int (*register_commands)(struct command_context_s *cmd_ctx);
 
        /* called when target is created */
        int (*register_commands)(struct command_context_s *cmd_ctx);
 
        /* called when target is created */
-       int (*target_create)( struct target_s *target, Jim_Interp *interp );
+       int (*target_create)(struct target_s *target, Jim_Interp *interp );
 
        /* called for various config parameters */
        /* returns JIM_CONTINUE - if option not understood */
        /* otherwise: JIM_OK, or JIM_ERR, */
 
        /* called for various config parameters */
        /* returns JIM_CONTINUE - if option not understood */
        /* otherwise: JIM_OK, or JIM_ERR, */
-       int (*target_jim_configure)( struct target_s *target, Jim_GetOptInfo *goi );
+       int (*target_jim_configure)(struct target_s *target, Jim_GetOptInfo *goi );
 
        /* target commands specifically handled by the target */
        /* returns JIM_OK, or JIM_ERR, or JIM_CONTINUE - if option not understood */
 
        /* target commands specifically handled by the target */
        /* returns JIM_OK, or JIM_ERR, or JIM_CONTINUE - if option not understood */
-       int (*target_jim_commands)( struct target_s *target, Jim_GetOptInfo *goi );
+       int (*target_jim_commands)(struct target_s *target, Jim_GetOptInfo *goi );
 
        /* invoked after JTAG chain has been examined & validated. During
         * this stage the target is examined and any additional setup is
 
        /* invoked after JTAG chain has been examined & validated. During
         * this stage the target is examined and any additional setup is
index 17f899fba20f39a94b47545b6a9f9e1eb57ac6cb..7c1519cf0b4d2f06eff268a30cb18e22c2fb17df 100644 (file)
@@ -123,7 +123,7 @@ static int handle_trace_history_command(struct command_context_s *cmd_ctx, char
                uint32_t first = 0;
                uint32_t last = trace->trace_history_pos;
 
                uint32_t first = 0;
                uint32_t last = trace->trace_history_pos;
 
-               if ( !trace->trace_history_size ) {
+               if (!trace->trace_history_size ) {
                        command_print(cmd_ctx, "trace history buffer is not allocated");
                        return ERROR_OK;
                }
                        command_print(cmd_ctx, "trace history buffer is not allocated");
                        return ERROR_OK;
                }
index e87f5527a4de179c74b5d531e0f0dea9cb6f3a5b..d0180b97676cc6a7f9942715a4c65ae9486c8e81 100644 (file)
@@ -959,7 +959,7 @@ int xscale_arch_state(struct target_s *target)
                        "MMU: %s, D-Cache: %s, I-Cache: %s"
                        "%s",
                         armv4_5_state_strings[armv4_5->core_state],
                        "MMU: %s, D-Cache: %s, I-Cache: %s"
                        "%s",
                         armv4_5_state_strings[armv4_5->core_state],
-                        Jim_Nvp_value2name_simple( nvp_target_debug_reason, target->debug_reason )->name ,
+                        Jim_Nvp_value2name_simple(nvp_target_debug_reason, target->debug_reason )->name ,
                         armv4_5_mode_strings[armv4_5_mode_to_number(armv4_5->core_mode)],
                         buf_get_u32(armv4_5->core_cache->reg_list[ARMV4_5_CPSR].value, 0, 32),
                         buf_get_u32(armv4_5->core_cache->reg_list[15].value, 0, 32),
                         armv4_5_mode_strings[armv4_5_mode_to_number(armv4_5->core_mode)],
                         buf_get_u32(armv4_5->core_cache->reg_list[ARMV4_5_CPSR].value, 0, 32),
                         buf_get_u32(armv4_5->core_cache->reg_list[15].value, 0, 32),
@@ -1202,7 +1202,7 @@ int xscale_halt(target_t *target)
        xscale_common_t *xscale = armv4_5->arch_info;
 
        LOG_DEBUG("target->state: %s",
        xscale_common_t *xscale = armv4_5->arch_info;
 
        LOG_DEBUG("target->state: %s",
-                 Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name);
+                 Jim_Nvp_value2name_simple(nvp_target_state, target->state )->name);
 
        if (target->state == TARGET_HALTED)
        {
 
        if (target->state == TARGET_HALTED)
        {
@@ -1568,7 +1568,7 @@ int xscale_assert_reset(target_t *target)
        xscale_common_t *xscale = armv4_5->arch_info;
 
        LOG_DEBUG("target->state: %s",
        xscale_common_t *xscale = armv4_5->arch_info;
 
        LOG_DEBUG("target->state: %s",
-                 Jim_Nvp_value2name_simple( nvp_target_state, target->state )->name);
+                 Jim_Nvp_value2name_simple(nvp_target_state, target->state )->name);
 
        /* select DCSR instruction (set endstate to R-T-I to ensure we don't
         * end up in T-L-R, which would reset JTAG
 
        /* select DCSR instruction (set endstate to R-T-I to ensure we don't
         * end up in T-L-R, which would reset JTAG
index b9bf4146cf6f0fee02bcb84b504258d30d0759a9..dc76ed797b37ee37739133fa4977c4cf3eeb4d09 100644 (file)
@@ -129,11 +129,11 @@ static int xsvf_fd = 0;
 
 
 /* map xsvf tap state to an openocd "tap_state_t" */
 
 
 /* map xsvf tap state to an openocd "tap_state_t" */
-static tap_state_t xsvf_to_tap( int xsvf_state )
+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_IDLE:                  ret = TAP_IDLE;                 break;
        {
        case XSV_RESET:                 ret = TAP_RESET;                        break;
        case XSV_IDLE:                  ret = TAP_IDLE;                 break;
@@ -152,7 +152,7 @@ static tap_state_t xsvf_to_tap( int xsvf_state )
        case XSV_IREXIT2:               ret = TAP_IREXIT2;              break;
        case XSV_IRUPDATE:              ret = TAP_IRUPDATE;             break;
        default:
        case XSV_IREXIT2:               ret = TAP_IREXIT2;              break;
        case XSV_IRUPDATE:              ret = TAP_IRUPDATE;             break;
        default:
-               LOG_ERROR( "UNKNOWN XSVF STATE 0x%02X", xsvf_state );
+               LOG_ERROR("UNKNOWN XSVF STATE 0x%02X", xsvf_state );
                exit(1);
        }
 
                exit(1);
        }
 
@@ -232,10 +232,10 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
 
        if (strcmp(args[0], "plain") != 0)
        {
 
        if (strcmp(args[0], "plain") != 0)
        {
-               tap = jtag_tap_by_string( args[0] );
+               tap = jtag_tap_by_string(args[0] );
                if (!tap )
                {
                if (!tap )
                {
-                       command_print( cmd_ctx, "Tap: %s unknown", args[0] );
+                       command_print(cmd_ctx, "Tap: %s unknown", args[0] );
                        return ERROR_FAIL;
                }
        }
                        return ERROR_FAIL;
                }
        }
@@ -261,7 +261,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
 
        LOG_USER("xsvf processing file: \"%s\"", filename);
 
 
        LOG_USER("xsvf processing file: \"%s\"", filename);
 
-       while ( read(xsvf_fd, &opcode, 1) > 0 )
+       while (read(xsvf_fd, &opcode, 1) > 0 )
        {
                /* record the position of the just read opcode within the file */
                file_offset = lseek(xsvf_fd, 0, SEEK_CUR) - 1;
        {
                /* record the position of the just read opcode within the file */
                file_offset = lseek(xsvf_fd, 0, SEEK_CUR) - 1;
@@ -327,9 +327,9 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                                xsdrsize = be_to_h_u32(xsdrsize_buf);
                                LOG_DEBUG("XSDRSIZE %d", xsdrsize);
 
                                xsdrsize = be_to_h_u32(xsdrsize_buf);
                                LOG_DEBUG("XSDRSIZE %d", xsdrsize);
 
-                               if ( dr_out_buf ) free(dr_out_buf);
-                               if ( dr_in_buf)   free(dr_in_buf);
-                               if ( dr_in_mask)  free(dr_in_mask);
+                               if (dr_out_buf ) free(dr_out_buf);
+                               if (dr_in_buf)   free(dr_in_buf);
+                               if (dr_in_mask)  free(dr_in_mask);
 
                                dr_out_buf = malloc((xsdrsize + 7) / 8);
                                dr_in_buf = malloc((xsdrsize + 7) / 8);
 
                                dr_out_buf = malloc((xsdrsize + 7) / 8);
                                dr_in_buf = malloc((xsdrsize + 7) / 8);
@@ -366,11 +366,11 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
 
                                LOG_DEBUG("%s %d", op_name, xsdrsize);
 
 
                                LOG_DEBUG("%s %d", op_name, xsdrsize);
 
-                               for ( attempt = 0; attempt < limit;  ++attempt )
+                               for (attempt = 0; attempt < limit;  ++attempt )
                                {
                                        scan_field_t field;
 
                                {
                                        scan_field_t field;
 
-                                       if ( attempt > 0 )
+                                       if (attempt > 0 )
                                        {
                                                /* perform the XC9500 exception handling sequence shown in xapp067.pdf and
                                                   illustrated in psuedo code at end of this file.  We start from state
                                        {
                                                /* perform the XC9500 exception handling sequence shown in xapp067.pdf and
                                                   illustrated in psuedo code at end of this file.  We start from state
@@ -393,7 +393,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                                                        TAP_IDLE,
                                                };
 
                                                        TAP_IDLE,
                                                };
 
-                                               jtag_add_pathmove( DIM(exception_path), exception_path );
+                                               jtag_add_pathmove(DIM(exception_path), exception_path );
 
                                                if (verbose)
                                                        LOG_USER("%s mismatch, xsdrsize=%d retry=%d", op_name, xsdrsize, attempt);
 
                                                if (verbose)
                                                        LOG_USER("%s mismatch, xsdrsize=%d retry=%d", op_name, xsdrsize, attempt);
@@ -425,7 +425,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
 
                                if (!matched)
                                {
 
                                if (!matched)
                                {
-                                       LOG_USER( "%s mismatch", op_name);
+                                       LOG_USER("%s mismatch", op_name);
                                        tdo_mismatch = 1;
                                        break;
                                }
                                        tdo_mismatch = 1;
                                        break;
                                }
@@ -505,7 +505,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                                        the XSTATE.
                                */
 
                                        the XSTATE.
                                */
 
-                               if ( jtag_add_statemove( mystate ) != ERROR_OK )
+                               if (jtag_add_statemove(mystate ) != ERROR_OK )
                                {
                                        /*      For special states known as stable states
                                                (Test-Logic-Reset, Run-Test/Idle, Pause-DR, Pause- IR),
                                {
                                        /*      For special states known as stable states
                                                (Test-Logic-Reset, Run-Test/Idle, Pause-DR, Pause- IR),
@@ -538,9 +538,9 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                        }
 
                        /* see page 22 of XSVF spec */
                        }
 
                        /* see page 22 of XSVF spec */
-                       if ( uc == 0 )
+                       if (uc == 0 )
                                xendir = TAP_IDLE;
                                xendir = TAP_IDLE;
-                       else if ( uc == 1 )
+                       else if (uc == 1 )
                                xendir = TAP_IRPAUSE;
                        else
                        {
                                xendir = TAP_IRPAUSE;
                        else
                        {
@@ -561,9 +561,9 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                        }
 
                        /* see page 22 of XSVF spec */
                        }
 
                        /* see page 22 of XSVF spec */
-                       if ( uc == 0 )
+                       if (uc == 0 )
                                xenddr = TAP_IDLE;
                                xenddr = TAP_IDLE;
-                       else if ( uc == 1 )
+                       else if (uc == 1 )
                                xenddr = TAP_DRPAUSE;
                        else
                        {
                                xenddr = TAP_DRPAUSE;
                        else
                        {
@@ -583,7 +583,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                                int bitcount;
                                tap_state_t my_end_state = xruntest ? TAP_IDLE : xendir;
 
                                int bitcount;
                                tap_state_t my_end_state = xruntest ? TAP_IDLE : xendir;
 
-                               if ( opcode == XSIR )
+                               if (opcode == XSIR )
                                {
                                        /* one byte bitcount */
                                        if (read(xsvf_fd, short_buf, 1) < 0)
                                {
                                        /* one byte bitcount */
                                        if (read(xsvf_fd, short_buf, 1) < 0)
@@ -664,7 +664,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                                                break;
                                        }
 
                                                break;
                                        }
 
-                                       if ( ndx < sizeof(comment)-1 )
+                                       if (ndx < sizeof(comment)-1 )
                                                comment[ndx++] = uc;
 
                                } while (uc != 0);
                                                comment[ndx++] = uc;
 
                                } while (uc != 0);
@@ -689,7 +689,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                                tap_state_t end_state;
                                int     delay;
 
                                tap_state_t end_state;
                                int     delay;
 
-                               if ( read(xsvf_fd, &wait, 1) < 0
+                               if (read(xsvf_fd, &wait, 1) < 0
                                  || read(xsvf_fd, &end, 1) < 0
                                  || read(xsvf_fd, delay_buf, 4) < 0)
                                {
                                  || read(xsvf_fd, &end, 1) < 0
                                  || read(xsvf_fd, delay_buf, 4) < 0)
                                {
@@ -709,9 +709,9 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                                }
                                else
                                {
                                }
                                else
                                {
-                                       jtag_add_statemove( wait_state );
+                                       jtag_add_statemove(wait_state );
                                        jtag_add_sleep(delay);
                                        jtag_add_sleep(delay);
-                                       jtag_add_statemove( end_state );
+                                       jtag_add_statemove(end_state );
                                }
                        }
                        break;
                                }
                        }
                        break;
@@ -731,7 +731,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                                int clock_count;
                                int usecs;
 
                                int clock_count;
                                int usecs;
 
-                               if ( read(xsvf_fd, &wait, 1) < 0
+                               if (read(xsvf_fd, &wait, 1) < 0
                                 ||  read(xsvf_fd, &end, 1) < 0
                                 ||  read(xsvf_fd, clock_buf, 4) < 0
                                 ||  read(xsvf_fd, usecs_buf, 4) < 0 )
                                 ||  read(xsvf_fd, &end, 1) < 0
                                 ||  read(xsvf_fd, clock_buf, 4) < 0
                                 ||  read(xsvf_fd, usecs_buf, 4) < 0 )
@@ -740,8 +740,8 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                                        break;
                                }
 
                                        break;
                                }
 
-                               wait_state = xsvf_to_tap( wait );
-                               end_state  = xsvf_to_tap( end );
+                               wait_state = xsvf_to_tap(wait );
+                               end_state  = xsvf_to_tap(end );
 
                                clock_count = be_to_h_u32(clock_buf);
                                usecs       = be_to_h_u32(usecs_buf);
 
                                clock_count = be_to_h_u32(clock_buf);
                                usecs       = be_to_h_u32(usecs_buf);
@@ -758,17 +758,17 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                                 */
                                if (wait_state != TAP_IRPAUSE && wait_state != TAP_DRPAUSE && wait_state != TAP_RESET && wait_state != TAP_IDLE)
                                {
                                 */
                                if (wait_state != TAP_IRPAUSE && wait_state != TAP_DRPAUSE && wait_state != TAP_RESET && wait_state != TAP_IDLE)
                                {
-                                       LOG_ERROR("illegal XWAITSTATE wait_state: \"%s\"", tap_state_name( wait_state ));
+                                       LOG_ERROR("illegal XWAITSTATE wait_state: \"%s\"", tap_state_name(wait_state ));
                                        unsupported = 1;
                                }
 
                                        unsupported = 1;
                                }
 
-                               jtag_add_statemove( wait_state );
+                               jtag_add_statemove(wait_state );
 
 
-                               jtag_add_clocks( clock_count );
+                               jtag_add_clocks(clock_count );
 
 
-                               jtag_add_sleep( usecs );
+                               jtag_add_sleep(usecs );
 
 
-                               jtag_add_statemove( end_state );
+                               jtag_add_statemove(end_state );
                        }
                        break;
 
                        }
                        break;
 
@@ -779,7 +779,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                                */
                                uint8_t  count_buf[4];
 
                                */
                                uint8_t  count_buf[4];
 
-                               if ( read(xsvf_fd, count_buf, 4) < 0 )
+                               if (read(xsvf_fd, count_buf, 4) < 0 )
                                {
                                        do_abort = 1;
                                        break;
                                {
                                        do_abort = 1;
                                        break;
@@ -799,7 +799,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                                uint8_t  clock_buf[4];
                                uint8_t  usecs_buf[4];
 
                                uint8_t  clock_buf[4];
                                uint8_t  usecs_buf[4];
 
-                               if ( read(xsvf_fd, &state, 1) < 0
+                               if (read(xsvf_fd, &state, 1) < 0
                                  || read(xsvf_fd, clock_buf, 4) < 0
                                  ||     read(xsvf_fd, usecs_buf, 4) < 0 )
                                {
                                  || read(xsvf_fd, clock_buf, 4) < 0
                                  ||     read(xsvf_fd, usecs_buf, 4) < 0 )
                                {
@@ -826,7 +826,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
 
                                LOG_DEBUG("LSDR");
 
 
                                LOG_DEBUG("LSDR");
 
-                               if ( xsvf_read_buffer(xsdrsize, xsvf_fd, dr_out_buf) != ERROR_OK
+                               if (xsvf_read_buffer(xsdrsize, xsvf_fd, dr_out_buf) != ERROR_OK
                                  || xsvf_read_buffer(xsdrsize, xsvf_fd, dr_in_buf) != ERROR_OK )
                                {
                                        do_abort = 1;
                                  || xsvf_read_buffer(xsdrsize, xsvf_fd, dr_in_buf) != ERROR_OK )
                                {
                                        do_abort = 1;
@@ -836,11 +836,11 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                                if (limit < 1)
                                        limit = 1;
 
                                if (limit < 1)
                                        limit = 1;
 
-                               for ( attempt = 0; attempt < limit;  ++attempt )
+                               for (attempt = 0; attempt < limit;  ++attempt )
                                {
                                        scan_field_t field;
 
                                {
                                        scan_field_t field;
 
-                                       jtag_add_statemove( loop_state );
+                                       jtag_add_statemove(loop_state );
                                        jtag_add_clocks(loop_clocks);
                                        jtag_add_sleep(loop_usecs);
 
                                        jtag_add_clocks(loop_clocks);
                                        jtag_add_sleep(loop_usecs);
 
@@ -873,7 +873,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
 
                                if (!matched )
                                {
 
                                if (!matched )
                                {
-                                       LOG_USER( "LSDR mismatch" );
+                                       LOG_USER("LSDR mismatch" );
                                        tdo_mismatch = 1;
                                        break;
                                }
                                        tdo_mismatch = 1;
                                        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:
                                        jtag_add_reset(1, 0);
                                {
                                case XTRST_ON:
                                        jtag_add_reset(1, 0);
@@ -902,7 +902,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                                case XTRST_ABSENT:
                                        break;
                                default:
                                case XTRST_ABSENT:
                                        break;
                                default:
-                                       LOG_ERROR( "XTRST mode argument (0x%02X) out of range", trst_mode );
+                                       LOG_ERROR("XTRST mode argument (0x%02X) out of range", trst_mode );
                                        do_abort = 1;
                                }
                        }
                                        do_abort = 1;
                                }
                        }
@@ -918,7 +918,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                        LOG_DEBUG("xsvf failed, setting taps to reasonable state");
 
                        /* upon error, return the TAPs to a reasonable state */
                        LOG_DEBUG("xsvf failed, setting taps to reasonable state");
 
                        /* upon error, return the TAPs to a reasonable state */
-                       jtag_add_statemove( TAP_IDLE );
+                       jtag_add_statemove(TAP_IDLE );
                        jtag_execute_queue();
                        break;
                }
                        jtag_execute_queue();
                        break;
                }