[nios2] Add type casts to nios2_fill/store_gregset

Message ID 4269377f-c882-f3c6-0d4d-e715fc3aca58@codesourcery.com
State New, archived
Headers

Commit Message

Chung-Lin Tang July 8, 2016, 9:47 a.m. UTC
  Hi Yao,
This fixes the nios2 gdbserver build; the C++ compiler was complaining
about pointer type mismatches. Is this okay to commit?

Thanks,
Chung-Lin

2016-07-08  Chung-Lin Tang  <cltang@codesourcery.com>

	gdbserver/
        * linux-nios2-low.c (nios2_fill_gregset): Add type cast
        to buf parameter.
        (nios2_store_gregset): Likewise.
  

Comments

Yao Qi July 12, 2016, 9:29 a.m. UTC | #1
Hi Chung-Lin,

On Fri, Jul 8, 2016 at 10:47 AM, Chung-Lin Tang <cltang@codesourcery.com> wrote:
> Hi Yao,
> This fixes the nios2 gdbserver build; the C++ compiler was complaining
> about pointer type mismatches. Is this okay to commit?

Yes, the patch is good to me.
  

Patch

diff --git a/gdb/gdbserver/linux-nios2-low.c b/gdb/gdbserver/linux-nios2-low.c
index ea0ded1..a32bc1a 100644
--- a/gdb/gdbserver/linux-nios2-low.c
+++ b/gdb/gdbserver/linux-nios2-low.c
@@ -183,7 +183,7 @@  nios2_supply_register (struct regcache *regcache, int regno,
 static void
 nios2_fill_gregset (struct regcache *regcache, void *buf)
 {
-  union nios2_register *regset = buf;
+  union nios2_register *regset = (union nios2_register *) buf;
   int i;
 
   for (i = 1; i < nios2_num_regs; i++)
@@ -193,7 +193,7 @@  nios2_fill_gregset (struct regcache *regcache, void *buf)
 static void
 nios2_store_gregset (struct regcache *regcache, const void *buf)
 {
-  const union nios2_register *regset = buf;
+  const union nios2_register *regset = (union nios2_register *) buf;
   int i;
 
   for (i = 0; i < nios2_num_regs; i++)