[PATCH 12/26] Cast result of obstack_base to gdb_byte * in a couple spots.

Pedro Alves
2013-04-11T23:00:27Z

obstack_base returns char *. Need to cast to gdb_byte * in a couple spots.

gdb/
2013-04-11 Pedro Alves <palves@redhat.com>

* c-lang.c (evaluate_subexp_c): Cast result of obstack_base to
gdb_byte *.
* linux-tdep.c (linux_make_mappings_corefile_notes): Likewise.
---
gdb/c-lang.c | 2 +-
gdb/linux-tdep.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 1c1d60b..46a6c73 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -658,7 +658,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp,
if (obstack_object_size (&output) != TYPE_LENGTH (type))
error (_("Could not convert character "
"constant to target character set"));
- value = unpack_long (type, obstack_base (&output));
+ value = unpack_long (type, (gdb_byte *) obstack_base (&output));
result = value_from_longest (type, value);
}
else
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index 9623d19..bfb6404 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -993,8 +993,8 @@ linux_make_mappings_corefile_notes (struct gdbarch *gdbarch, bfd *obfd,
if (mapping_data.file_count != 0)
{
/* Write the count to the obstack. */
- pack_long (obstack_base (&data_obstack), long_type,
- mapping_data.file_count);
+ pack_long ((gdb_byte *) obstack_base (&data_obstack),
+ long_type, mapping_data.file_count);

/* Copy the filenames to the data obstack. */
obstack_grow (&data_obstack, obstack_base (&filename_obstack),