Patchwork [v2,03/11] s390: gdbarch_tdep.have_* int -> bool

login
register
mail settings
Submitter Philipp Rudo
Date Dec. 5, 2017, 12:28 p.m.
Message ID <20171205122859.2919-4-prudo@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/24731/
State New
Headers show

Comments

Philipp Rudo - Dec. 5, 2017, 12:28 p.m.
Currently the gdbarch_tdep.have_* flags are a mix of int and bool.  Clean
this up by making them all bool.

gdb/ChangeLog:

	* s390-linux-tdep.c (gdbarch_tdep) <have_linux_v1, have_linux_v2>
	<have_tdb>: Change type to bool.
	(s390_gdbarch_tdep_alloc): Adjust.
	(s390_gdbarch_init): Adjust.
---
 gdb/s390-linux-tdep.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Patch

diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c
index 89e5ec55ba..afee82304c 100644
--- a/gdb/s390-linux-tdep.c
+++ b/gdb/s390-linux-tdep.c
@@ -113,9 +113,9 @@  struct gdbarch_tdep
   int v0_full_regnum;
 
   bool have_upper;
-  int have_linux_v1;
-  int have_linux_v2;
-  int have_tdb;
+  bool have_linux_v1;
+  bool have_linux_v2;
+  bool have_tdb;
   bool have_vx;
   bool have_gs;
 };
@@ -7825,9 +7825,9 @@  s390_gdbarch_tdep_alloc ()
   tdep->cc_regnum = -1;
 
   tdep->have_upper = false;
-  tdep->have_linux_v1 = 0;
-  tdep->have_linux_v2 = 0;
-  tdep->have_tdb = 0;
+  tdep->have_linux_v1 = false;
+  tdep->have_linux_v2 = false;
+  tdep->have_tdb = false;
   tdep->have_vx = false;
   tdep->have_gs = false;
 
@@ -8000,13 +8000,13 @@  s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
 	  if (tdesc_numbered_register (feature, tdesc_data,
 				       S390_LAST_BREAK_REGNUM, "last_break"))
-	    tdep->have_linux_v1 = 1;
+	    tdep->have_linux_v1 = true;
 
 	  if (tdesc_numbered_register (feature, tdesc_data,
 				       S390_SYSTEM_CALL_REGNUM, "system_call"))
-	    tdep->have_linux_v2 = 1;
+	    tdep->have_linux_v2 = true;
 
-	  if (tdep->have_linux_v2 > tdep->have_linux_v1)
+	  if (tdep->have_linux_v2 && !tdep->have_linux_v1)
 	    valid_p = 0;
 	}
 
@@ -8018,7 +8018,7 @@  s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 	    valid_p &= tdesc_numbered_register (feature, tdesc_data,
 						S390_TDB_DWORD0_REGNUM + i,
 						tdb_regs[i]);
-	  tdep->have_tdb = 1;
+	  tdep->have_tdb = true;
 	}
 
       /* Vector registers.  */