This is the mail archive of the gdb-patches@sources.redhat.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]

[RFA] testsuite/gdb.c++/cplusfuncs.cc: remove superfluous casts


Here is a small patch to remove some superfluous casts from
testsuite/gdb.c++/cplusfuncs.cc.

The casts are in a group of marker functions whose purpose is to help
figure out which demangler is in use (v2 or v3).  When I originally wrote
these marker functions, I made all the return types 'int' for uniformity.
This uniformity is actually not needed; the test script is not even
looking at this return type.  And it involves some pointer->integer
casts which cause problems on some platforms.

Testing: I tested this on native Red Hat Linux 7 and native Solaris 2.8,
with both gcc 2.95.3 and gcc 3pre 2001-05-25.  Kevin Buettner tested
on ia64-unknown-linux with gcc 2.96.

OK to apply?

Michael Elizabeth Chastain
<chastain@redhat.com>
"love without fear"

===

2001-05-31  Michael Chastain  <chastain@redhat.com>

	* gdb.c++/cplusfuncs.cc (dm_type_char_star): Remove superfluous cast.
	(dm_type_int_star): Likewise.
	(dm_type_long_star): Likewise.
	(dm_type_void_star): Likewise.

===

Index: gdb/testsuite/gdb.c++/cplusfuncs.cc
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/cplusfuncs.cc,v
retrieving revision 1.2
diff -c -3 -p -r1.2 cplusfuncs.cc
*** gdb/testsuite/gdb.c++/cplusfuncs.cc	2001/02/14 19:54:04	1.2
--- gdb/testsuite/gdb.c++/cplusfuncs.cc	2001/05/31 19:43:38
*************** int	  hairyfunc7 (PFPFPc_i_PFl_i arg)	{ 
*** 187,196 ****
  /* gdb has two demanglers (one for g++ 2.95, one for g++ 3).
     These marker functions help me figure out which demangler is in use. */
  
! int	dm_type_char_star (char * p)		{ return (int) p; }
  int	dm_type_foo_ref (foo & foo)		{ return foo.ifoo; }
! int	dm_type_int_star (int * p)		{ return (int) p; }
! int	dm_type_long_star (long * p)		{ return (int) p; }
  int	dm_type_unsigned_int (unsigned int i)	{ return i; }
  int	dm_type_void (void)			{ return 0; }
! int	dm_type_void_star (void * p)		{ return (int) p; }
--- 187,196 ----
  /* gdb has two demanglers (one for g++ 2.95, one for g++ 3).
     These marker functions help me figure out which demangler is in use. */
  
! char *	dm_type_char_star (char * p)		{ return p; }
  int	dm_type_foo_ref (foo & foo)		{ return foo.ifoo; }
! int *	dm_type_int_star (int * p)		{ return p; }
! long *	dm_type_long_star (long * p)		{ return p; }
  int	dm_type_unsigned_int (unsigned int i)	{ return i; }
  int	dm_type_void (void)			{ return 0; }
! void *	dm_type_void_star (void * p)		{ return p; }


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