[PATCH/committed] sim: sh: fix a few compiler warnings

Message ID 20210529170636.31548-1-vapier@gentoo.org
State New
Headers show
Series
  • [PATCH/committed] sim: sh: fix a few compiler warnings
Related show

Commit Message

Philippe Waroquiers via Gdb-patches May 29, 2021, 5:06 p.m.
---
 sim/sh/ChangeLog | 5 +++++
 sim/sh/interp.c  | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

-- 
2.31.1

Patch

diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog
index de3cdef72617..a6b243fb2523 100644
--- a/sim/sh/ChangeLog
+++ b/sim/sh/ChangeLog
@@ -1,3 +1,8 @@ 
+2021-05-29  Mike Frysinger  <vapier@gentoo.org>
+
+	* interp.c (SET_RC): Add parenthesis.
+	(sim_open): Add const to p.
+
 2021-05-17  Mike Frysinger  <vapier@gentoo.org>
 
 	* sim-main.h (SIM_HAVE_COMMON_SIM_STATE): Delete.
diff --git a/sim/sh/interp.c b/sim/sh/interp.c
index 652450357766..87fb863887f7 100644
--- a/sim/sh/interp.c
+++ b/sim/sh/interp.c
@@ -214,7 +214,7 @@  do { \
 
 #define SET_RC(x) \
   (saved_state.asregs.cregs.named.sr \
-   = saved_state.asregs.cregs.named.sr & 0xf000ffff | ((x) & 0xfff) << 16)
+   = (saved_state.asregs.cregs.named.sr & 0xf000ffff) | ((x) & 0xfff) << 16)
 
 /* Manipulate FPSCR */
 
@@ -2345,7 +2345,7 @@  SIM_DESC
 sim_open (SIM_OPEN_KIND kind, host_callback *cb,
 	  struct bfd *abfd, char * const *argv)
 {
-  char **p;
+  char * const *p;
   int i;
   union
     {