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]
Other format: [Raw text]

[COMMIT] Fix gdb_byte fallout for i386/amd64


This fixes the compiler warnings Andrew warned about.

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* amd64-tdep.c (amd64_return_value): Change type of readbuf and
	writebuf arguments to `gdb_byte *'.  Remove now redundant casts.
	* i386-tdep.c (i386_return_value): Change type of readbuf and
	writebuf arguments to `gdb_byte *'.
	(i386_pseudo_register_read, i386_pseudo_register_write): Change
	type of last argument to `gdb_byte *'.
	(i386_register_to_value, i386_value_to_register): Change type of
	last argument to `gdb_byte *'.  Simplify function a bit.
	* i387-tdep.h (i387_value_to_register, i387_register_to_value):
	Change type of last argument to `gdb_byte *'.
	* i387-tdep.c: Likewise.

Index: amd64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/amd64-tdep.c,v
retrieving revision 1.23
diff -u -p -r1.23 amd64-tdep.c
--- amd64-tdep.c 8 May 2005 18:00:07 -0000 1.23
+++ amd64-tdep.c 14 May 2005 11:23:41 -0000
@@ -406,7 +406,7 @@ amd64_classify (struct type *type, enum 
 static enum return_value_convention
 amd64_return_value (struct gdbarch *gdbarch, struct type *type,
 		    struct regcache *regcache,
-		    void *readbuf, const void *writebuf)
+		    gdb_byte *readbuf, const gdb_byte *writebuf)
 {
   enum amd64_reg_class class[2];
   int len = TYPE_LENGTH (type);
@@ -503,10 +503,10 @@ amd64_return_value (struct gdbarch *gdba
 
       if (readbuf)
 	regcache_raw_read_part (regcache, regnum, offset, min (len, 8),
-				((gdb_byte *)readbuf) + i * 8);
+				readbuf + i * 8);
       if (writebuf)
 	regcache_raw_write_part (regcache, regnum, offset, min (len, 8),
-				 ((const gdb_byte *)writebuf) + i * 8);
+				 writebuf + i * 8);
     }
 
   return RETURN_VALUE_REGISTER_CONVENTION;
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.210
diff -u -p -r1.210 i386-tdep.c
--- i386-tdep.c 8 May 2005 16:27:34 -0000 1.210
+++ i386-tdep.c 14 May 2005 11:23:43 -0000
@@ -1438,8 +1438,8 @@ i386_reg_struct_return_p (struct gdbarch
 
 static enum return_value_convention
 i386_return_value (struct gdbarch *gdbarch, struct type *type,
-		   struct regcache *regcache, void *readbuf,
-		   const void *writebuf)
+		   struct regcache *regcache, gdb_byte *readbuf,
+		   const gdb_byte *writebuf)
 {
   enum type_code code = TYPE_CODE (type);
 
@@ -1603,7 +1603,7 @@ i386_mmx_regnum_to_fp_regnum (struct reg
 
 static void
 i386_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
-			   int regnum, void *buf)
+			   int regnum, gdb_byte *buf)
 {
   if (i386_mmx_regnum_p (gdbarch, regnum))
     {
@@ -1620,7 +1620,7 @@ i386_pseudo_register_read (struct gdbarc
 
 static void
 i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
-			    int regnum, const void *buf)
+			    int regnum, const gdb_byte *buf)
 {
   if (i386_mmx_regnum_p (gdbarch, regnum))
     {
@@ -1703,10 +1703,9 @@ i386_convert_register_p (int regnum, str
 
 static void
 i386_register_to_value (struct frame_info *frame, int regnum,
-			struct type *type, void *to)
+			struct type *type, gdb_byte *to)
 {
   int len = TYPE_LENGTH (type);
-  gdb_byte *buf = to;
 
   /* FIXME: kettenis/20030609: What should we do if REGNUM isn't
      available in FRAME (i.e. if it wasn't saved)?  */
@@ -1726,10 +1725,10 @@ i386_register_to_value (struct frame_inf
       gdb_assert (regnum != -1);
       gdb_assert (register_size (current_gdbarch, regnum) == 4);
 
-      get_frame_register (frame, regnum, buf);
+      get_frame_register (frame, regnum, to);
       regnum = i386_next_regnum (regnum);
       len -= 4;
-      buf += 4;
+      to += 4;
     }
 }
 
@@ -1738,10 +1737,9 @@ i386_register_to_value (struct frame_inf
 
 static void
 i386_value_to_register (struct frame_info *frame, int regnum,
-			struct type *type, const void *from)
+			struct type *type, const gdb_byte *from)
 {
   int len = TYPE_LENGTH (type);
-  const gdb_byte *buf = from;
 
   if (i386_fp_regnum_p (regnum))
     {
@@ -1758,10 +1756,10 @@ i386_value_to_register (struct frame_inf
       gdb_assert (regnum != -1);
       gdb_assert (register_size (current_gdbarch, regnum) == 4);
 
-      put_frame_register (frame, regnum, buf);
+      put_frame_register (frame, regnum, from);
       regnum = i386_next_regnum (regnum);
       len -= 4;
-      buf += 4;
+      from += 4;
     }
 }
 
Index: i387-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i387-tdep.c,v
retrieving revision 1.45
diff -u -p -r1.45 i387-tdep.c
--- i387-tdep.c 9 May 2005 19:53:44 -0000 1.45
+++ i387-tdep.c 14 May 2005 11:23:43 -0000
@@ -292,7 +292,7 @@ i387_print_float_info (struct gdbarch *g
 
 void
 i387_register_to_value (struct frame_info *frame, int regnum,
-			struct type *type, void *to)
+			struct type *type, gdb_byte *to)
 {
   char from[I386_MAX_REGISTER_SIZE];
 
@@ -317,7 +317,7 @@ i387_register_to_value (struct frame_inf
 
 void
 i387_value_to_register (struct frame_info *frame, int regnum,
-			struct type *type, const void *from)
+			struct type *type, const gdb_byte *from)
 {
   char to[I386_MAX_REGISTER_SIZE];
 
Index: i387-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/i387-tdep.h,v
retrieving revision 1.12
diff -u -p -r1.12 i387-tdep.h
--- i387-tdep.h 15 Mar 2004 22:44:12 -0000 1.12
+++ i387-tdep.h 14 May 2005 11:23:43 -0000
@@ -60,13 +60,13 @@ extern void i387_print_float_info (struc
    return its contents in TO.  */
 
 extern void i387_register_to_value (struct frame_info *frame, int regnum,
-				    struct type *type, void *to);
+				    struct type *type, gdb_byte *to);
 
 /* Write the contents FROM of a value of type TYPE into register
    REGNUM in frame FRAME.  */
 
 extern void i387_value_to_register (struct frame_info *frame, int regnum,
-				    struct type *type, const void *from);
+				    struct type *type, const gdb_byte *from);
 
 
 /* Size of the memory area use by the 'fsave' and 'fxsave'


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