This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [RFC] maint.c, move assignment to outside of IF expr


Andrew Cagney wrote:
> 
> OK?
> 
> The attatched moves an assignment out of an if conditional.  GCC was
> complaining about it.
> I'm guessing that the coder didn't intend to write ``=='' :-)

Oops, the GCC warnings have been quitely breeding in a corner.  I've
accumulated/applied the attatched.

	Andrew
Wed Mar 29 10:16:35 2000  Andrew Cagney  <cagney@b1.cygnus.com>
+ 
+ 	* breakpoint.h (remove_hw_watchpoints): Add declaration.
+ 	* breakpoints.c (remove_hw_watchpoints): Update.
+ 	* maint.c (maintenance_do_deprecate): Avoid assignment within IF
+  	condition.
+ 
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.6
diff -p -r1.6 breakpoint.c
*** breakpoint.c	2000/03/28 22:30:19	1.6
--- breakpoint.c	2000/03/29 00:47:47
*************** remove_breakpoints ()
*** 1096,1102 ****
  }
  
  int
! remove_hw_watchpoints ()
  {
    register struct breakpoint *b;
    int val;
--- 1096,1102 ----
  }
  
  int
! remove_hw_watchpoints (void)
  {
    register struct breakpoint *b;
    int val;
Index: breakpoint.h
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.h,v
retrieving revision 1.1.1.11
diff -p -r1.1.1.11 breakpoint.h
*** breakpoint.h	2000/02/03 04:14:27	1.1.1.11
--- breakpoint.h	2000/03/29 00:47:50
*************** extern struct breakpoint *set_breakpoint
*** 693,696 ****
--- 693,700 ----
     deletes all breakpoints. */
  extern void delete_command (char *arg, int from_tty);
  
+ /* Pull all H/W watchpoints from the target. Return non-zero if the
+    remove fails. */
+ extern int remove_hw_watchpoints (void);
+ 
  #endif /* !defined (BREAKPOINT_H) */
Index: maint.c
===================================================================
RCS file: /cvs/src/src/gdb/maint.c,v
retrieving revision 1.6
diff -p -r1.6 maint.c
*** maint.c	2000/03/25 15:32:18	1.6
--- maint.c	2000/03/29 00:47:54
*************** maintenance_do_deprecate (char *text, in
*** 425,434 ****
    if (deprecate)
      {
        /* look for a replacement command */
!       if (start_ptr = strchr (text, '\"'))
  	{
  	  start_ptr++;
! 	  if (end_ptr = strrchr (start_ptr, '\"'))
  	    {
  	      len = end_ptr - start_ptr;
  	      start_ptr[len] = '\0';
--- 425,436 ----
    if (deprecate)
      {
        /* look for a replacement command */
!       start_ptr = strchr (text, '\"');
!       if (start_ptr != NULL)
  	{
  	  start_ptr++;
! 	  end_ptr = strrchr (start_ptr, '\"');
! 	  if (end_ptr != NULL)
  	    {
  	      len = end_ptr - start_ptr;
  	      start_ptr[len] = '\0';

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]