This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Fix compiler warnings in hppa-hpux-nat.c
- From: Mark Kettenis <kettenis at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 15 Jun 2005 18:34:50 +0200
- Subject: [commit] Fix compiler warnings in hppa-hpux-nat.c
Treating a native data type as a target byte buffer deserves a cast.
Committed,
Mark
2005-06-15 Mark Kettenis <kettenis@jive.nl>
* hppa-hpux-nat.c (hppa_hpux_fetch_register)
(hppa_hpux_store_register): Add casts in extract_unsigned_integer
and store_usigned_integer calls.
Index: hppa-hpux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-hpux-nat.c,v
retrieving revision 1.6
diff -u -p -r1.6 hppa-hpux-nat.c
--- hppa-hpux-nat.c 11 Feb 2005 04:05:50 -0000 1.6
+++ hppa-hpux-nat.c 15 Jun 2005 16:31:46 -0000
@@ -1,6 +1,6 @@
/* Native-dependent code for PA-RISC HP-UX.
- Copyright 2004 Free Software Foundation, Inc.
+ Copyright 2004, 2005 Free Software Foundation, Inc.
This file is part of GDB.
@@ -134,8 +134,8 @@ hppa_hpux_fetch_register (int regnum)
`struct save_state', even for 64-bit code. */
if (regnum == HPPA_FLAGS_REGNUM && size == 8)
{
- ULONGEST flags = extract_unsigned_integer (buf, 4);
- store_unsigned_integer (buf, 8, flags);
+ ULONGEST flags = extract_unsigned_integer ((gdb_byte *)buf, 4);
+ store_unsigned_integer ((gdb_byte *)buf, 8, flags);
}
regcache_raw_supply (current_regcache, regnum, buf);
@@ -176,8 +176,8 @@ hppa_hpux_store_register (int regnum)
`struct save_state', even for 64-bit code. */
if (regnum == HPPA_FLAGS_REGNUM && size == 8)
{
- ULONGEST flags = extract_unsigned_integer (buf, 8);
- store_unsigned_integer (buf, 4, flags);
+ ULONGEST flags = extract_unsigned_integer ((gdb_byte *)buf, 8);
+ store_unsigned_integer ((gdb_byte *)buf, 4, flags);
size = 4;
}