- Fixes '>>' whitespace - Replace ')\(>>\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\(>>\)(' with '\1 \2 ('. - Replace '\(\w\)\(>>\)\(\w\)' with '\1 \2 \3'. --- flash/at91sam7.c | 42 ++++++++++++++++++++--------------------- flash/flash.c | 4 +-- flash/ocl/at91sam7x/samflash.c | 4 +-- flash/pic32mx.c | 10 ++++----- flash/stellaris.c | 18 ++++++++--------- helper/binarybuffer.h | 8 +++---- helper/jim.c | 6 ++--- jtag/zy1000/jtag_minidriver.h | 6 ++--- jtag/zy1000/zy1000.c | 2 - target/arm_adi_v5.c | 6 ++--- target/arm_disassembler.h | 2 - target/target.c | 4 +-- 12 files changed, 56 insertions(+), 56 deletions(-)
Fix two-character binary operator whitespace issues throughout the tree: - Fixes '>>' whitespace - Replace ')\(>>\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\(>>\)(' with '\1 \2 ('. - Replace '\(\w\)\(>>\)\(\w\)' with '\1 \2 \3'. --- flash/at91sam7.c | 42 ++++++++++++++++++++--------------------- flash/flash.c | 4 +-- flash/ocl/at91sam7x/samflash.c | 4 +-- flash/pic32mx.c | 10 ++++----- flash/stellaris.c | 18 ++++++++--------- helper/binarybuffer.h | 8 +++---- helper/jim.c | 6 ++--- jtag/zy1000/jtag_minidriver.h | 6 ++--- jtag/zy1000/zy1000.c | 2 - target/arm_adi_v5.c | 6 ++--- target/arm_disassembler.h | 2 - target/target.c | 4 +-- 12 files changed, 56 insertions(+), 56 deletions(-) ====== diff -u src/helper/jim.c src/helper/jim.c --- src/helper/jim.c (working copy) +++ src/helper/jim.c (working copy) @@ -6958,7 +6958,7 @@ case JIM_EXPROP_LTE: wC = wA <= wB; break; case JIM_EXPROP_GTE: wC = wA >= wB; break; case JIM_EXPROP_LSHIFT: wC = wA<<wB; break; - case JIM_EXPROP_RSHIFT: wC = wA>>wB; break; + case JIM_EXPROP_RSHIFT: wC = wA >> wB; break; case JIM_EXPROP_NUMEQ: wC = wA==wB; break; case JIM_EXPROP_NUMNE: wC = wA != wB; break; case JIM_EXPROP_BITAND: wC = wA&wB; break; @@ -6996,7 +6996,7 @@ wC = _rotl(uA,(unsigned long)wB); #else const unsigned int S = sizeof(unsigned long) * 8; - wC = (unsigned long)((uA<<wB)|(uA>>(S-wB))); + wC = (unsigned long)((uA<<wB)|(uA >> (S-wB))); #endif break; } @@ -7006,7 +7006,7 @@ wC = _rotr(uA,(unsigned long)wB); #else const unsigned int S = sizeof(unsigned long) * 8; - wC = (unsigned long)((uA>>wB)|(uA<<(S-wB))); + wC = (unsigned long)((uA >> wB)|(uA<<(S-wB))); #endif break; } diff -u src/helper/binarybuffer.h src/helper/binarybuffer.h --- src/helper/binarybuffer.h (working copy) +++ src/helper/binarybuffer.h (working copy) @@ -34,10 +34,10 @@ { if ((num==32) && (first==0)) { - buffer[3]=(value>>24)&0xff; - buffer[2]=(value>>16)&0xff; - buffer[1]=(value>>8)&0xff; - buffer[0]=(value>>0)&0xff; + buffer[3]=(value >> 24)&0xff; + buffer[2]=(value >> 16)&0xff; + buffer[1]=(value >> 8)&0xff; + buffer[0]=(value >> 0)&0xff; } else { unsigned int i; diff -u src/jtag/zy1000/jtag_minidriver.h src/jtag/zy1000/jtag_minidriver.h --- src/jtag/zy1000/jtag_minidriver.h (working copy) +++ src/jtag/zy1000/jtag_minidriver.h (working copy) @@ -106,7 +106,7 @@ } /* shift out value */ waitIdle(); - ZY1000_POKE(ZY1000_JTAG_BASE+0x28, (((value>>i)&1)<<1)|tms); + ZY1000_POKE(ZY1000_JTAG_BASE+0x28, (((value >> i)&1)<<1)|tms); } waitIdle(); ZY1000_POKE(ZY1000_JTAG_BASE+0x28, 0); @@ -131,11 +131,11 @@ for (i=0; i<repeat-1; i++) { sampleShiftRegister(); - ZY1000_POKE(ZY1000_JTAG_BASE+0xc, value>>i); + ZY1000_POKE(ZY1000_JTAG_BASE+0xc, value >> i); ZY1000_POKE(ZY1000_JTAG_BASE+0x8, (1<<8)|(a<<4)|a); } sampleShiftRegister(); - ZY1000_POKE(ZY1000_JTAG_BASE+0xc, value>>(repeat-1)); + ZY1000_POKE(ZY1000_JTAG_BASE+0xc, value >> (repeat-1)); ZY1000_POKE(ZY1000_JTAG_BASE+0x8, (1<<8)|(a<<4)|b); } else { diff -u src/jtag/zy1000/zy1000.c src/jtag/zy1000/zy1000.c --- src/jtag/zy1000/zy1000.c (working copy) +++ src/jtag/zy1000/zy1000.c (working copy) @@ -490,7 +490,7 @@ for (l=0; l<k; l += 8) { - inBuffer[(j+l)/8]=(value>>l)&0xff; + inBuffer[(j+l)/8]=(value >> l)&0xff; } } j += k; diff -u src/target/arm_adi_v5.c src/target/arm_adi_v5.c --- src/target/arm_adi_v5.c (working copy) +++ src/target/arm_adi_v5.c (working copy) @@ -1103,12 +1103,12 @@ mem_ap_read_atomic_u32(swjdp, (component_base&0xFFFFF000)|0xFF4, &c_cid1); mem_ap_read_atomic_u32(swjdp, (component_base&0xFFFFF000)|0xFF8, &c_cid2); mem_ap_read_atomic_u32(swjdp, (component_base&0xFFFFF000)|0xFFC, &c_cid3); - component_start = component_base - 0x1000*(c_pid4>>4); + component_start = component_base - 0x1000*(c_pid4 >> 4); command_print(cmd_ctx, "\t\tComponent base address 0x%x, pid4 0x%x, start address 0x%x",component_base,c_pid4,component_start); - command_print(cmd_ctx, "\t\tComponent cid1 0x%x, class is %s",c_cid1,class_description[(c_cid1>>4)&0xF]); /* Se ARM DDI 0314 C Table 2.2 */ + command_print(cmd_ctx, "\t\tComponent cid1 0x%x, class is %s",c_cid1,class_description[(c_cid1 >> 4)&0xF]); /* Se ARM DDI 0314 C Table 2.2 */ command_print(cmd_ctx, "\t\tCID3 0x%x, CID2 0x%x, CID1 0x%x, CID0, 0x%x",c_cid3,c_cid2,c_cid1,c_cid0); command_print(cmd_ctx, "\t\tPID3 0x%x, PID2 0x%x, PID1 0x%x, PID0, 0x%x",c_pid3,c_pid2,c_pid1,c_pid0); - /* For CoreSight components, (c_cid1>>4)&0xF==9 , we also read 0xFC8 DevId and 0xFCC DevType */ + /* For CoreSight components, (c_cid1 >> 4)&0xF==9 , we also read 0xFC8 DevId and 0xFCC DevType */ } else { diff -u src/target/arm_disassembler.h src/target/arm_disassembler.h --- src/target/arm_disassembler.h (working copy) +++ src/target/arm_disassembler.h (working copy) @@ -199,5 +199,5 @@ extern int arm_access_size(arm_instruction_t *instruction); -#define COND(opcode) (arm_condition_strings[(opcode & 0xf0000000)>>28]) +#define COND(opcode) (arm_condition_strings[(opcode & 0xf0000000) >> 28]) #endif /* ARM_DISASSEMBLER_H */ diff -u src/target/target.c src/target/target.c --- src/target/target.c (working copy) +++ src/target/target.c (working copy) @@ -2736,7 +2736,7 @@ int i; for (i=0; i<4; i++) { - char c=(l>>(i*8))&0xff; + char c=(l >> (i*8))&0xff; writeData(f, &c, 1); } @@ -2827,7 +2827,7 @@ val=65535; } data[i*2]=val&0xff; - data[i*2+1]=(val>>8)&0xff; + data[i*2+1]=(val >> 8)&0xff; } free(buckets); writeData(f, data, length * 2); diff -u src/flash/at91sam7.c src/flash/at91sam7.c --- src/flash/at91sam7.c (working copy) +++ src/flash/at91sam7.c (working copy) @@ -366,13 +366,13 @@ at91sam7_info = t_bank->driver_priv; at91sam7_info->cidr = cidr; - at91sam7_info->cidr_ext = (cidr>>31)&0x0001; - at91sam7_info->cidr_nvptyp = (cidr>>28)&0x0007; - at91sam7_info->cidr_arch = (cidr>>20)&0x00FF; - at91sam7_info->cidr_sramsiz = (cidr>>16)&0x000F; - at91sam7_info->cidr_nvpsiz2 = (cidr>>12)&0x000F; - at91sam7_info->cidr_nvpsiz = (cidr>>8)&0x000F; - at91sam7_info->cidr_eproc = (cidr>>5)&0x0007; + at91sam7_info->cidr_ext = (cidr >> 31)&0x0001; + at91sam7_info->cidr_nvptyp = (cidr >> 28)&0x0007; + at91sam7_info->cidr_arch = (cidr >> 20)&0x00FF; + at91sam7_info->cidr_sramsiz = (cidr >> 16)&0x000F; + at91sam7_info->cidr_nvpsiz2 = (cidr >> 12)&0x000F; + at91sam7_info->cidr_nvpsiz = (cidr >> 8)&0x000F; + at91sam7_info->cidr_eproc = (cidr >> 5)&0x0007; at91sam7_info->cidr_version = cidr&0x001F; /* calculate master clock frequency */ @@ -391,10 +391,10 @@ return ERROR_OK; } - arch = (cidr>>20)&0x00FF; + arch = (cidr >> 20)&0x00FF; /* check flash size */ - switch ((cidr>>8)&0x000F) + switch ((cidr >> 8)&0x000F) { case FLASH_SIZE_8KB: break; @@ -586,13 +586,13 @@ at91sam7_info = t_bank->driver_priv; at91sam7_info->cidr = cidr; - at91sam7_info->cidr_ext = (cidr>>31)&0x0001; - at91sam7_info->cidr_nvptyp = (cidr>>28)&0x0007; - at91sam7_info->cidr_arch = (cidr>>20)&0x00FF; - at91sam7_info->cidr_sramsiz = (cidr>>16)&0x000F; - at91sam7_info->cidr_nvpsiz2 = (cidr>>12)&0x000F; - at91sam7_info->cidr_nvpsiz = (cidr>>8)&0x000F; - at91sam7_info->cidr_eproc = (cidr>>5)&0x0007; + at91sam7_info->cidr_ext = (cidr >> 31)&0x0001; + at91sam7_info->cidr_nvptyp = (cidr >> 28)&0x0007; + at91sam7_info->cidr_arch = (cidr >> 20)&0x00FF; + at91sam7_info->cidr_sramsiz = (cidr >> 16)&0x000F; + at91sam7_info->cidr_nvpsiz2 = (cidr >> 12)&0x000F; + at91sam7_info->cidr_nvpsiz = (cidr >> 8)&0x000F; + at91sam7_info->cidr_eproc = (cidr >> 5)&0x0007; at91sam7_info->cidr_version = cidr&0x001F; at91sam7_info->target_name = target_name; @@ -702,12 +702,12 @@ } status = at91sam7_get_flash_status(bank->target, bank->bank_number); - at91sam7_info->lockbits = (status>>16); + at91sam7_info->lockbits = (status >> 16); 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; @@ -719,13 +719,13 @@ /* GPNVM and SECURITY bits apply only for MC_FSR of EFC0 */ status = at91sam7_get_flash_status(bank->target, 0); - at91sam7_info->securitybit = (status>>4)&0x01; - at91sam7_info->nvmbits = (status>>8)&0xFF; + at91sam7_info->securitybit = (status >> 4)&0x01; + at91sam7_info->nvmbits = (status >> 8)&0xFF; 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++; } diff -u src/flash/ocl/at91sam7x/samflash.c src/flash/ocl/at91sam7x/samflash.c --- src/flash/ocl/at91sam7x/samflash.c (working copy) +++ src/flash/ocl/at91sam7x/samflash.c (working copy) @@ -32,7 +32,7 @@ { unsigned int nvpsiz; - nvpsiz=(inr(DBGU_CIDR)>>8)&0xf; + nvpsiz=(inr(DBGU_CIDR) >> 8)&0xf; switch (nvpsiz) { case 3: @@ -129,7 +129,7 @@ int page_num; page_num=0; - lockbits=inr(MC_FSR+efc_ofs)>>16; + lockbits=inr(MC_FSR+efc_ofs) >> 16; while (lockbits) { if (lockbits&1) { diff -u src/flash/stellaris.c src/flash/stellaris.c --- src/flash/stellaris.c (working copy) +++ src/flash/stellaris.c (working copy) @@ -33,7 +33,7 @@ #include "binarybuffer.h" -#define DID0_VER(did0) ((did0>>28)&0x07) +#define DID0_VER(did0) ((did0 >> 28)&0x07) static int stellaris_register_commands(struct command_context_s *cmd_ctx); static int stellaris_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank); static int stellaris_erase(struct flash_bank_s *bank, int first, int last); @@ -286,7 +286,7 @@ if (DID0_VER(stellaris_info->did0) > 0) { - device_class = (stellaris_info->did0>>16) & 0xFF; + device_class = (stellaris_info->did0 >> 16) & 0xFF; } else { @@ -294,12 +294,12 @@ } printed = snprintf(buf, buf_size, "\nLMI Stellaris information: Chip is class %i(%s) %s v%c.%i\n", device_class, StellarisClassname[device_class], stellaris_info->target_name, - 'A' + ((stellaris_info->did0>>8) & 0xFF), (stellaris_info->did0) & 0xFF); + 'A' + ((stellaris_info->did0 >> 8) & 0xFF), (stellaris_info->did0) & 0xFF); buf += printed; buf_size -= printed; printed = snprintf(buf, buf_size, "did1: 0x%8.8x, arch: 0x%4.4x, eproc: %s, ramsize:%ik, flashsize: %ik\n", - stellaris_info->did1, stellaris_info->did1, "ARMV7M", (1+((stellaris_info->dc0>>16) & 0xFFFF))/4, (1+(stellaris_info->dc0 & 0xFFFF))*2); + stellaris_info->did1, stellaris_info->did1, "ARMV7M", (1+((stellaris_info->dc0 >> 16) & 0xFFFF))/4, (1+(stellaris_info->dc0 & 0xFFFF))*2); buf += printed; buf_size -= printed; @@ -345,11 +345,11 @@ LOG_DEBUG("Stellaris PLLCFG %x", pllcfg); stellaris_info->rcc = rcc; - sysdiv = (rcc>>23) & 0xF; - usesysdiv = (rcc>>22) & 0x1; - bypass = (rcc>>11) & 0x1; - oscsrc = (rcc>>4) & 0x3; - /* xtal = (rcc>>6)&0xF; */ + sysdiv = (rcc >> 23) & 0xF; + usesysdiv = (rcc >> 22) & 0x1; + bypass = (rcc >> 11) & 0x1; + oscsrc = (rcc >> 4) & 0x3; + /* xtal = (rcc >> 6)&0xF; */ switch (oscsrc) { case 0: diff -u src/flash/pic32mx.c src/flash/pic32mx.c --- src/flash/pic32mx.c (working copy) +++ src/flash/pic32mx.c (working copy) @@ -603,9 +603,9 @@ pic32mx_info->probed = 0; device_id = ejtag_info->idcode; - LOG_INFO( "device id = 0x%08x (manuf 0x%03x dev 0x%02x, ver 0x%03x)", device_id, (device_id>>1)&0x7ff, (device_id>>12)&0xff, (device_id>>20)&0xfff ); + LOG_INFO( "device id = 0x%08x (manuf 0x%03x dev 0x%02x, ver 0x%03x)", device_id, (device_id >> 1)&0x7ff, (device_id >> 12)&0xff, (device_id >> 20)&0xfff ); - if (((device_id>>1)&0x7ff) != PIC32MX_MANUF_ID) { + if (((device_id >> 1)&0x7ff) != PIC32MX_MANUF_ID) { LOG_WARNING( "Cannot identify target as a PIC32MX family." ); return ERROR_FLASH_OPERATION_FAILED; } @@ -693,8 +693,8 @@ device_id = ejtag_info->idcode; - if (((device_id>>1)&0x7ff) != PIC32MX_MANUF_ID) { - snprintf(buf, buf_size, "Cannot identify target as a PIC32MX family (manufacturer 0x%03d != 0x%03d)\n", (device_id>>1)&0x7ff, PIC32MX_MANUF_ID); + if (((device_id >> 1)&0x7ff) != PIC32MX_MANUF_ID) { + snprintf(buf, buf_size, "Cannot identify target as a PIC32MX family (manufacturer 0x%03d != 0x%03d)\n", (device_id >> 1)&0x7ff, PIC32MX_MANUF_ID); return ERROR_FLASH_OPERATION_FAILED; } for (i=0; pic32mx_devs[i].name != NULL; i++) @@ -708,7 +708,7 @@ } buf += printed; buf_size -= printed; - printed = snprintf(buf, buf_size, " Ver: 0x%03x", (device_id>>20)&0xfff); + printed = snprintf(buf, buf_size, " Ver: 0x%03x", (device_id >> 20)&0xfff); return ERROR_OK; } diff -u src/flash/flash.c src/flash/flash.c --- src/flash/flash.c (working copy) +++ src/flash/flash.c (working copy) @@ -363,7 +363,7 @@ protect_state = "protection state unknown"; command_print(cmd_ctx, "\t#%3i: 0x%8.8x (0x%x %ikB) %s", - j, p->sectors[j].offset, p->sectors[j].size, p->sectors[j].size>>10, + j, p->sectors[j].offset, p->sectors[j].size, p->sectors[j].size >> 10, protect_state); } @@ -450,7 +450,7 @@ erase_state = "erase state unknown"; command_print(cmd_ctx, "\t#%3i: 0x%8.8x (0x%x %ikB) %s", - j, p->sectors[j].offset, p->sectors[j].size, p->sectors[j].size>>10, + j, p->sectors[j].offset, p->sectors[j].size, p->sectors[j].size >> 10, erase_state); } }
_______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development