This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

RFA: Fix compile time warnings building iq2000-tdep.c


Hi Guys,

  The iq2000 port of GDB currently fails to build on the 6.6 branch
  and mainline because of compile time warnings triggered in
  iq2000-tdep.c, (which are now being treated as errors).  The
  patch below fixes them by changing various void* variables into
  gdb_byte*.

  May I apply the patch please ? 

Cheers
  Nick Clifton

gdb/ChangeLog
2006-11-28  Nick Clifton  <nickc@redhat.com>

	* iq2000-tdep.c: Fix compile time warnings:
	(iq2000_pointer_to_address): Change type of buf	parameter to
	gdb_byte*.
	(iq2000_address_to_pointer): Likewise.
	(iq2000_frame_prev_register): Likewise.
	(iq2000_extract_return_value): Change type of return_buffer to
	gdb_byte.
	(iq2000_return_value): Change type of readbuf and writebuf to
	gdb_byte.

Index: gdb/iq2000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/iq2000-tdep.c,v
retrieving revision 1.2
diff -c -3 -p -r1.2 iq2000-tdep.c
*** gdb/iq2000-tdep.c	17 Dec 2005 22:34:01 -0000	1.2
--- gdb/iq2000-tdep.c	28 Nov 2006 16:08:04 -0000
*************** insn_addr_from_ptr (CORE_ADDR ptr)	/* ta
*** 88,94 ****
     Convert a target pointer to an address in host (CORE_ADDR) format. */
  
  static CORE_ADDR
! iq2000_pointer_to_address (struct type * type, const void * buf)
  {
    enum type_code target = TYPE_CODE (TYPE_TARGET_TYPE (type));
    CORE_ADDR addr = extract_unsigned_integer (buf, TYPE_LENGTH (type));
--- 88,94 ----
     Convert a target pointer to an address in host (CORE_ADDR) format. */
  
  static CORE_ADDR
! iq2000_pointer_to_address (struct type * type, const gdb_byte * buf)
  {
    enum type_code target = TYPE_CODE (TYPE_TARGET_TYPE (type));
    CORE_ADDR addr = extract_unsigned_integer (buf, TYPE_LENGTH (type));
*************** iq2000_pointer_to_address (struct type *
*** 105,111 ****
     Convert a host-format address (CORE_ADDR) into a target pointer.  */
  
  static void
! iq2000_address_to_pointer (struct type *type, void *buf, CORE_ADDR addr)
  {
    enum type_code target = TYPE_CODE (TYPE_TARGET_TYPE (type));
  
--- 105,111 ----
     Convert a host-format address (CORE_ADDR) into a target pointer.  */
  
  static void
! iq2000_address_to_pointer (struct type *type, gdb_byte *buf, CORE_ADDR addr)
  {
    enum type_code target = TYPE_CODE (TYPE_TARGET_TYPE (type));
  
*************** static void
*** 395,401 ****
  iq2000_frame_prev_register (struct frame_info *next_frame, void **this_cache,
  			    int regnum, int *optimizedp,
  			    enum lval_type *lvalp, CORE_ADDR *addrp,
! 			    int *realnump, void *valuep)
  {
    struct iq2000_frame_cache *cache = iq2000_frame_cache (next_frame, this_cache);
    if (regnum == E_SP_REGNUM && cache->saved_sp)
--- 395,401 ----
  iq2000_frame_prev_register (struct frame_info *next_frame, void **this_cache,
  			    int regnum, int *optimizedp,
  			    enum lval_type *lvalp, CORE_ADDR *addrp,
! 			    int *realnump, gdb_byte *valuep)
  {
    struct iq2000_frame_cache *cache = iq2000_frame_cache (next_frame, this_cache);
    if (regnum == E_SP_REGNUM && cache->saved_sp)
*************** iq2000_extract_return_value (struct type
*** 558,564 ****
       returned in a register, and if larger than 8 bytes, it is 
       returned in a stack location which is pointed to by the same
       register.  */
!   CORE_ADDR return_buffer;
    int len = TYPE_LENGTH (type);
  
    if (len <= (2 * 4))
--- 558,564 ----
       returned in a register, and if larger than 8 bytes, it is 
       returned in a stack location which is pointed to by the same
       register.  */
!   gdb_byte return_buffer;
    int len = TYPE_LENGTH (type);
  
    if (len <= (2 * 4))
*************** iq2000_extract_return_value (struct type
*** 592,598 ****
  static enum return_value_convention
  iq2000_return_value (struct gdbarch *gdbarch, struct type *type,
  		     struct regcache *regcache,
! 		     void *readbuf, const void *writebuf)
  {
    if (iq2000_use_struct_convention (type))
      return RETURN_VALUE_STRUCT_CONVENTION;
--- 592,598 ----
  static enum return_value_convention
  iq2000_return_value (struct gdbarch *gdbarch, struct type *type,
  		     struct regcache *regcache,
! 		     gdb_byte *readbuf, const gdb_byte *writebuf)
  {
    if (iq2000_use_struct_convention (type))
      return RETURN_VALUE_STRUCT_CONVENTION;


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