From dab7264398ba8f7c476ffbdc965880270ae55c53 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 21 Nov 2020 09:16:41 -0700 Subject: [PATCH] Change watchpoint_exp_is_const to return bool I noticed that watchpoint_exp_is_const should return bool; this patch implements this change. gdb/ChangeLog 2020-11-21 Tom Tromey * breakpoint.c (watchpoint_exp_is_const): Return bool. --- gdb/ChangeLog | 4 ++++ gdb/breakpoint.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4663f562179..3d516df084b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2020-11-21 Tom Tromey + + * breakpoint.c (watchpoint_exp_is_const): Return bool. + 2020-11-20 Simon Marchi * unittests/gmp-utils-selftests.c (gdb_mpz_read_all_from_small): diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 27324a0c08d..61fbc3b92b1 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -10084,7 +10084,7 @@ break_range_command (const char *arg, int from_tty) some constant expressions and in such case still falsely return zero. */ -static int +static bool watchpoint_exp_is_const (const struct expression *exp) { int i = exp->nelts; @@ -10177,7 +10177,7 @@ watchpoint_exp_is_const (const struct expression *exp) if (SYMBOL_CLASS (s) != LOC_BLOCK && SYMBOL_CLASS (s) != LOC_CONST && SYMBOL_CLASS (s) != LOC_CONST_BYTES) - return 0; + return false; break; } @@ -10185,11 +10185,11 @@ watchpoint_exp_is_const (const struct expression *exp) the optimistic approach here: If we don't know something, then it is not a constant. */ default: - return 0; + return false; } } - return 1; + return true; } /* Watchpoint destructor. */ -- 2.30.2