[2/6] sim: mips: add casts to fpu conversions

Message ID 20210615051141.4801-2-vapier@gentoo.org
State New
Headers show
Series
  • [1/6] sim: mips: fix format warnings when setting up memory
Related show

Commit Message

Eli Zaretskii via Gdb-patches June 15, 2021, 5:11 a.m.
These funcs expect signed int pointers, but the code uses unsigned.
---
 sim/mips/cp1.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.31.1

Patch

diff --git a/sim/mips/cp1.c b/sim/mips/cp1.c
index 03ed0c0558ff..b9c7a4b8074f 100644
--- a/sim/mips/cp1.c
+++ b/sim/mips/cp1.c
@@ -1422,11 +1422,11 @@  convert (sim_cpu *cpu,
       sim_fpu_to64 (&result64, &wop);
       break;
     case fmt_word:
-      status |= sim_fpu_to32i (&result32, &wop, round);
+      status |= sim_fpu_to32i ((void*)&result32, &wop, round);
       result64 = result32;
       break;
     case fmt_long:
-      status |= sim_fpu_to64i (&result64, &wop, round);
+      status |= sim_fpu_to64i ((void*)&result64, &wop, round);
       break;
     default:
       result64 = 0;
@@ -1525,8 +1525,8 @@  convert_ps (sim_cpu *cpu,
   switch (to)
     {
     case fmt_word:   /* fmt_pw */
-      status_u |= sim_fpu_to32i (&res_u, &wop_u, round);
-      status_l |= sim_fpu_to32i (&res_l, &wop_l, round);
+      status_u |= sim_fpu_to32i ((void*)&res_u, &wop_u, round);
+      status_l |= sim_fpu_to32i ((void*)&res_l, &wop_l, round);
       result = (((unsigned64)res_u) << 32) | (unsigned64)res_l;
       break;
     case fmt_ps: