]> git.sur5r.net Git - openocd/commitdiff
- Fixes '&&' whitespace
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Tue, 23 Jun 2009 22:39:47 +0000 (22:39 +0000)
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Tue, 23 Jun 2009 22:39:47 +0000 (22:39 +0000)
- Replace ')\(&&\)(' with ') \1 ('.
- Replace '\(\w\)\(&&\)(' with '\1 \2 ('.
- Replace '\(\w\)\(&&\)\(\w\)' with '\1 \2 \3'.

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

src/flash/at91sam7.c
src/helper/binarybuffer.h
src/helper/ioutil.c
src/jtag/core.c
src/jtag/zy1000/jtag_minidriver.h
src/jtag/zy1000/zy1000.c
src/server/gdb_server.c
src/target/arm7_9_common.c
src/target/arm_adi_v5.c
src/target/image.c
src/target/target.c

index ca6e2c47fb591a9317d42fb05ef253b0f0f93fdc..259f01217d7d107dc236f75334e6d7cf340694d3 100644 (file)
@@ -284,7 +284,7 @@ static int at91sam7_flash_command(struct flash_bank_s *bank, uint8_t cmd, uint16
        target_write_u32(target, MC_FCR[bank->bank_number], fcr);
        LOG_DEBUG("Flash command: 0x%" PRIx32 ", flash bank: %i, page number: %u", fcr, bank->bank_number+1, pagen);
 
-       if ((at91sam7_info->cidr_arch == 0x60)&&((cmd==SLB)|(cmd==CLB)))
+       if ((at91sam7_info->cidr_arch == 0x60) && ((cmd==SLB)|(cmd==CLB)))
        {
                /* Lock bit manipulation on AT91SAM7A3 waits for FC_FSR bit 1, EOL */
                if (at91sam7_wait_status_busy(bank, MC_FSR_EOL, 10)&0x0C)
index 01e8c1c05539cfadfad240dc18eb8df5a3fe3730..710ec3745b1580f29a99e609300c08ad413a9653 100644 (file)
@@ -32,7 +32,7 @@
 /* inlining this will help show what fn that is taking time during profiling. */
 static inline void buf_set_u32(uint8_t* buffer, unsigned int first, unsigned int num, uint32_t value)
 {
-       if ((num==32)&&(first==0))
+       if ((num==32) && (first==0))
        {
                buffer[3]=(value>>24)&0xff;
                buffer[2]=(value>>16)&0xff;
@@ -53,7 +53,7 @@ static inline void buf_set_u32(uint8_t* buffer, unsigned int first, unsigned int
 }
 static inline uint32_t buf_get_u32(const uint8_t* buffer, unsigned int first, unsigned int num)
 {
-       if ((num==32)&&(first==0))
+       if ((num==32) && (first==0))
        {
                return (((uint32_t)buffer[3])<<24)|(((uint32_t)buffer[2])<<16)|(((uint32_t)buffer[1])<<8)|(((uint32_t)buffer[0])<<0);
        } else
index de4e880ace19a5f6321069a4f687428b9c902b70..4c09b77911758f7160a9ece873accc26a6dcb4c6 100644 (file)
@@ -233,7 +233,7 @@ int handle_append_command(struct command_context_s *cmd_ctx, char *cmd,
                                        break;
                        }
                }
-               if ((i==argc)&&(fwrite("\n", 1, 1, config_file)==1))
+               if ((i==argc) && (fwrite("\n", 1, 1, config_file)==1))
                {
                        retval=ERROR_OK;
                }
@@ -274,7 +274,7 @@ int handle_cp_command(struct command_context_s *cmd_ctx, char *cmd, char **args,
                        chunk = maxChunk;
                }
 
-               if ((retval==ERROR_OK)&&(fwrite(((char *)data)+pos, 1, chunk, f) != chunk))
+               if ((retval==ERROR_OK) && (fwrite(((char *)data)+pos, 1, chunk, f) != chunk))
                        retval = ERROR_INVALID_ARGUMENTS;
 
                if (retval != ERROR_OK)
index 31909964fc210d671f7d374d165b429f5d204316..09f62c3052920b511d6e3f315f903225421c9bac 100644 (file)
@@ -324,7 +324,7 @@ void jtag_add_ir_scan_noverify(int in_count, const scan_field_t *in_fields,
 
 void jtag_add_ir_scan(int in_num_fields, scan_field_t *in_fields, tap_state_t state)
 {
-       if (jtag_verify&&jtag_verify_capture_ir)
+       if (jtag_verify && jtag_verify_capture_ir)
        {
                /* 8 x 32 bit id's is enough for all invocations */
 
@@ -579,9 +579,9 @@ void jtag_add_reset(int req_tlr_or_trst, int req_srst)
                        ((jtag_reset_config & RESET_SRST_PULLS_TRST)==0))
        {
                if (((req_tlr_or_trst&&!jtag_trst)||
-                               (!req_tlr_or_trst&&jtag_trst))&&
+                               (!req_tlr_or_trst && jtag_trst))&&
                                ((req_srst&&!jtag_srst)||
-                                               (!req_srst&&jtag_srst)))
+                                               (!req_srst && jtag_srst)))
                {
                        /* FIX!!! srst_pulls_trst allows 1,1 => 0,0 transition.... */
                        //LOG_ERROR("BUG: transition of req_tlr_or_trst and req_srst in the same jtag_add_reset() call is undefined");
index 22307aa9df9b5e368f4472d6afcf052cb92748a3..37e9b35a2f7a080811a073b039d8bce3a4fd1059 100644 (file)
@@ -92,7 +92,7 @@ static __inline__ void shiftValueInner(const enum tap_state state, const enum ta
        ZY1000_POKE(ZY1000_JTAG_BASE+0xc, value);
 #if 1
 #if TEST_MANUAL()
-       if ((state==TAP_DRSHIFT)&&(endState != TAP_DRSHIFT))
+       if ((state==TAP_DRSHIFT) && (endState != TAP_DRSHIFT))
        {
                int i;
                setCurrentState(state);
@@ -100,7 +100,7 @@ static __inline__ void shiftValueInner(const enum tap_state state, const enum ta
                {
                        int tms;
                        tms=0;
-                       if ((i==repeat-1)&&(state != endState))
+                       if ((i==repeat-1) && (state != endState))
                        {
                                tms=1;
                        }
@@ -124,7 +124,7 @@ static __inline__ void shiftValueInner(const enum tap_state state, const enum ta
 #endif
 #else
        /* maximum debug version */
-       if ((repeat>0)&&((state==TAP_DRSHIFT)||(state==TAP_SI)))
+       if ((repeat>0) && ((state==TAP_DRSHIFT)||(state==TAP_SI)))
        {
                int i;
                /* sample shift register for every bit. */
@@ -188,13 +188,13 @@ static __inline__ void interface_jtag_add_dr_out(jtag_tap_t *target_tap,
 {
 
        int singletap=(jtag_tap_next_enabled(jtag_tap_next_enabled(NULL))==NULL);
-       if ((singletap)&&(num_fields==3))
+       if ((singletap) && (num_fields==3))
        {
                /* used by embeddedice_write_reg_inner() */
                shiftValueInner(TAP_DRSHIFT, TAP_DRSHIFT, num_bits[0], value[0]);
                shiftValueInner(TAP_DRSHIFT, TAP_DRSHIFT, num_bits[1], value[1]);
                shiftValueInner(TAP_DRSHIFT, end_state, num_bits[2], value[2]);
-       } else if ((singletap)&&(num_fields==2))
+       } else if ((singletap) && (num_fields==2))
        {
                /* used by arm7 code */
                shiftValueInner(TAP_DRSHIFT, TAP_DRSHIFT, num_bits[0], value[0]);
index 5e4bda0f19ffb98b31064efad6671e9c4b52ff94..29ab3e46a50456fd9eb278f5e2740ef36e795986 100644 (file)
@@ -149,7 +149,7 @@ void zy1000_reset(int trst, int srst)
                ZY1000_POKE(ZY1000_JTAG_BASE+0x10, 0x00000002);
        }
 
-       if (trst||(srst&&(jtag_get_reset_config() & RESET_SRST_PULLS_TRST)))
+       if (trst||(srst && (jtag_get_reset_config() & RESET_SRST_PULLS_TRST)))
        {
                waitIdle();
                /* we're now in the RESET state until trst is deasserted */
index e6a1ce5596342515a43f9c8e3d11bdd780a0b6b5..3ae0b3108dd37325b3f1c2d485a36ddf59d3bc09 100644 (file)
@@ -1397,7 +1397,7 @@ int gdb_breakpoint_watchpoint_packet(connection_t *connection, target_t *target,
        else if (type == 4) /* access watchpoint */
                wp_type = WPT_ACCESS;
 
-       if (gdb_breakpoint_override&&((bp_type==BKPT_SOFT)||(bp_type==BKPT_HARD)))
+       if (gdb_breakpoint_override && ((bp_type==BKPT_SOFT)||(bp_type==BKPT_HARD)))
        {
                bp_type=gdb_breakpoint_override_type;
        }
@@ -1654,7 +1654,7 @@ int gdb_query_packet(connection_t *connection, target_t *target, char *packet, i
 
                xml_printf(&retval, &buffer, &pos, &size,
                                "PacketSize=%x;qXfer:memory-map:read%c;qXfer:features:read-;QStartNoAckMode+",
-                               (GDB_BUFFER_SIZE - 1), ((gdb_use_memory_map == 1)&&(flash_get_bank_count()>0)) ? '+' : '-');
+                               (GDB_BUFFER_SIZE - 1), ((gdb_use_memory_map == 1) && (flash_get_bank_count()>0)) ? '+' : '-');
 
                if (retval != ERROR_OK)
                {
@@ -1667,7 +1667,7 @@ int gdb_query_packet(connection_t *connection, target_t *target, char *packet, i
 
                return ERROR_OK;
        }
-       else if (strstr(packet, "qXfer:memory-map:read::")&&(flash_get_bank_count()>0))
+       else if (strstr(packet, "qXfer:memory-map:read::") && (flash_get_bank_count()>0))
        {
                /* We get away with only specifying flash here. Regions that are not
                 * specified are treated as if we provided no memory map(if not we
index 474f94678b6fcef61a7d3b3d557b27be6f75d24e..79b1bc745ea28ef7a9891841addb6b0e9dd22d71 100644 (file)
@@ -1022,7 +1022,7 @@ int arm7_9_assert_reset(target_t *target)
 
        armv4_5_invalidate_core_regs(target);
 
-       if ((target->reset_halt)&&((jtag_reset_config & RESET_SRST_PULLS_TRST)==0))
+       if ((target->reset_halt) && ((jtag_reset_config & RESET_SRST_PULLS_TRST)==0))
        {
                /* debug entry was already prepared in arm7_9_assert_reset() */
                target->debug_reason = DBG_REASON_DBGRQ;
@@ -1050,7 +1050,7 @@ int arm7_9_deassert_reset(target_t *target)
        jtag_add_reset(0, 0);
 
        enum reset_types jtag_reset_config = jtag_get_reset_config();
-       if (target->reset_halt&&(jtag_reset_config & RESET_SRST_PULLS_TRST) != 0)
+       if (target->reset_halt && (jtag_reset_config & RESET_SRST_PULLS_TRST) != 0)
        {
                LOG_WARNING("srst pulls trst - can not reset into halted mode. Issuing halt after reset.");
                /* set up embedded ice registers again */
index 2584dbc6f24537d976dc447e45f0b42e606050ab..ea3b2792ef68979bdbb3a932146df0e2c76f4e91 100644 (file)
@@ -1027,7 +1027,7 @@ int dap_info_command(struct command_context_s *cmd_ctx, swjdp_common_t *swjdp, i
        dap_ap_read_reg_u32(swjdp, 0xFC, &apid);
        swjdp_transaction_endcheck(swjdp);
        /* Now we read ROM table ID registers, ref. ARM IHI 0029B sec  */
-       mem_ap = ((apid&0x10000)&&((apid&0x0F) != 0));
+       mem_ap = ((apid&0x10000) && ((apid&0x0F) != 0));
        command_print(cmd_ctx, "ap identification register 0x%8.8" PRIx32 "", apid);
        if (apid)
        {
@@ -1053,7 +1053,7 @@ int dap_info_command(struct command_context_s *cmd_ctx, swjdp_common_t *swjdp, i
                command_print(cmd_ctx, "No AP found at this apsel 0x%x", apsel);
        }
 
-       romtable_present = ((mem_ap)&&(dbgbase != 0xFFFFFFFF));
+       romtable_present = ((mem_ap) && (dbgbase != 0xFFFFFFFF));
        if (romtable_present)
        {
                uint32_t cid0,cid1,cid2,cid3,memtype,romentry;
index 45107b4854860e7abccc20d3359cf68ec22e5f39..2ce03b829575af39d62cb1046ca6397180b4bb55 100644 (file)
@@ -81,7 +81,7 @@ static int autodetect_image_type(image_t *image, char *url)
                &&(isxdigit(buffer[5]))
                &&(isxdigit(buffer[6]))
                &&(buffer[7]=='0') /* record type : 00 -> 05 */
-               &&(buffer[8]>='0')&&(buffer[8]<'6'))
+               &&(buffer[8]>='0') && (buffer[8]<'6'))
        {
                LOG_DEBUG("IHEX image detected.");
                image->type = IMAGE_IHEX;
index 56bcdf05de2bf58b563d37fa7255bb47e3d1f268..781847fcb91d019eb3c4756aad27f8c7963a0965 100644 (file)
@@ -1014,7 +1014,7 @@ int target_free_working_area_restore(struct target_s *target, working_area_t *ar
        if (area->free)
                return ERROR_OK;
 
-       if (restore&&target->backup_working_area)
+       if (restore && target->backup_working_area)
        {
                int retval;
                if ((retval = target_write_memory(target, area->address, 4, area->size / 4, area->backup)) != ERROR_OK)