[4/7] Fix two -Wnarrowing warnings in xtensa-tdep.h

Message ID 20180808232016.12777-5-tom@tromey.com
State New, archived
Headers

Commit Message

Tom Tromey Aug. 8, 2018, 11:20 p.m. UTC
  This fixes a couple of -Wnarrowing warnings in xtensa-tdep.h, by
introducing some casts to unsigned.

gdb/ChangeLog
2018-08-08  Tom Tromey  <tom@tromey.com>

	* xtensa-tdep.h (XTREG_END): Add cast to unsigned.
	(XTENSA_GDBARCH_TDEP_INSTANTIATE): Likewise.
---
 gdb/ChangeLog     | 5 +++++
 gdb/xtensa-tdep.h | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)
  

Comments

Pedro Alves Aug. 9, 2018, 6:09 p.m. UTC | #1
On 08/09/2018 12:20 AM, Tom Tromey wrote:
> This fixes a couple of -Wnarrowing warnings in xtensa-tdep.h, by
> introducing some casts to unsigned.

LGTM.

Thanks,
Pedro Alves
  

Patch

diff --git a/gdb/xtensa-tdep.h b/gdb/xtensa-tdep.h
index ccd3714640..d170e054d4 100644
--- a/gdb/xtensa-tdep.h
+++ b/gdb/xtensa-tdep.h
@@ -130,7 +130,7 @@  typedef struct
 	 ct, bsz, sz, al, tnum, flg, cp, mas, fet, sto},
 #define XTREG_END \
   {0, 0, (xtensa_register_type_t) 0, (xtensa_register_group_t) 0,	\
-   0, 0, 0, 0, -1, 0, 0, 0, 0, 0},
+   0, 0, 0, 0, (unsigned) -1, 0, 0, 0, 0, 0},
 
 #define XTENSA_REGISTER_FLAGS_PRIVILEGED	0x0001
 #define XTENSA_REGISTER_FLAGS_READABLE		0x0002
@@ -228,7 +228,7 @@  struct gdbarch_tdep
 #define XTENSA_GDBARCH_TDEP_INSTANTIATE(rmap,spillsz)			\
   {									\
     0,				/* target_flags */			\
-    -1,				/* spill_location */			\
+    (unsigned) -1,		/* spill_location */	\
     (spillsz),			/* spill_size */			\
     0,				/* unused */				\
     (XSHAL_ABI == XTHAL_ABI_CALL0					\