This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Avoid -Wnarrowing warnings in aarch64-linux-tdep.c


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1885053bcb12dd05a6f129146cf514e966082c27

commit 1885053bcb12dd05a6f129146cf514e966082c27
Author: Tom Tromey <tom@tromey.com>
Date:   Mon Aug 27 11:55:39 2018 -0600

    Avoid -Wnarrowing warnings in aarch64-linux-tdep.c
    
    This avoids -Wnarrowing warnings in
    aarch64_linux_iterate_over_regset_sections, by adding some casts to
    int.
    
    gdb/ChangeLog
    2018-08-27  Tom Tromey  <tom@tromey.com>
    
    	* aarch64-linux-tdep.c
    	(aarch64_linux_iterate_over_regset_sections) <sve_regmap>: Add
    	casts to int.

Diff:
---
 gdb/ChangeLog            | 6 ++++++
 gdb/aarch64-linux-tdep.c | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 460e8cd..d087d43 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
 2018-08-27  Tom Tromey  <tom@tromey.com>
 
+	* aarch64-linux-tdep.c
+	(aarch64_linux_iterate_over_regset_sections) <sve_regmap>: Add
+	casts to int.
+
+2018-08-27  Tom Tromey  <tom@tromey.com>
+
 	* ppc64-tdep.c (insn_d, insn_ds, insn_xfx): Add casts to
 	unsigned.
 	(ppc64_standard_linkage1, ppc64_standard_linkage2)
diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index 0d46acd..dc2b891 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -411,8 +411,8 @@ aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
       /* Create this on the fly in order to handle vector register sizes.  */
       const struct regcache_map_entry sve_regmap[] =
 	{
-	  { 32, AARCH64_SVE_Z0_REGNUM, tdep->vq * 16 },
-	  { 16, AARCH64_SVE_P0_REGNUM, tdep->vq * 16 / 8 },
+	  { 32, AARCH64_SVE_Z0_REGNUM, (int) (tdep->vq * 16) },
+	  { 16, AARCH64_SVE_P0_REGNUM, (int) (tdep->vq * 16 / 8) },
 	  { 1, AARCH64_SVE_FFR_REGNUM, 4 },
 	  { 1, AARCH64_FPSR_REGNUM, 4 },
 	  { 1, AARCH64_FPCR_REGNUM, 4 },


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]