diff options
author | Simon Marchi <simon.marchi@ericsson.com> | 2017-11-23 11:00:56 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2017-11-23 11:00:56 -0500 |
commit | 4c37490d92c0168e5192ce109a791c4b3fec9f8e (patch) | |
tree | 51ca155671475582d88cc8cb52f8d4259a4b5813 /gdb/mi | |
parent | eb02c04dc3600e18bb06dc1ef8fc3cf9a967d550 (diff) | |
download | gdb-4c37490d92c0168e5192ce109a791c4b3fec9f8e.zip gdb-4c37490d92c0168e5192ce109a791c4b3fec9f8e.tar.gz gdb-4c37490d92c0168e5192ce109a791c4b3fec9f8e.tar.bz2 |
Change int -> bool where applicable throughout varobj
This patch changes all the "int" I could find in varobj.{c,h} that are
really boolean values to use bool. I followed the ramifications
(parameters and return values of exported functions), so the changes
spilled a bit on other, related files (ada-varobj.c and c-varobj.c).
gdb/ChangeLog:
* ada-varobj.c (ada_value_is_changeable_p): Change int to bool where applicable.
(ada_value_has_mutated): Likewise.
* c-varobj.c (varobj_is_anonymous_child): Likewise.
(c_is_path_expr_parent): Likewise.
* mi/mi-cmd-var.c (varobj_update_one): Likewise.
(mi_cmd_var_set_frozen): Likewise.
(mi_cmd_var_update_iter): Likewise.
(mi_cmd_var_update): Likewise.
* varobj.c (pretty_printing): Likewise.
(varobj_enable_pretty_printing): Likewise.
(struct varobj_root) <floating, is_valid>: Likewise.
(struct varobj_dynamic) <children_requested>: Likewise.
(delete_variable): Likewise.
(delete_variable_1): Likewise.
(install_variable): Likewise.
(update_type_if_necessary): Likewise.
(install_new_value): Likewise.
(value_of_root): Likewise.
(is_root_p): Likewise.
(varobj_create): Likewise.
(varobj_delete): Likewise.
(varobj_has_more): Likewise.
(varobj_set_frozen): Likewise.
(varobj_get_frozen): Likewise.
(install_dynamic_child): Likewise.
(dynamic_varobj_has_child_method): Likewise.
(update_dynamic_varobj_children): Likewise.
(varobj_get_num_children): Likewise.
(varobj_list_children): Likewise.
(is_path_expr_parent): Likewise.
(varobj_default_is_path_expr_parent): Likewise.
(varobj_is_dynamic_p): Likewise.
(varobj_set_value): Likewise.
(varobj_value_has_mutated): Likewise.
(varobj_update): Likewise.
(check_scope): Likewise.
(value_of_root_1): Likewise.
(varobj_value_get_print_value): Likewise.
(varobj_editable_p): Likewise.
(varobj_value_is_changeable_p): Likewise.
(varobj_floating_p): Likewise.
(varobj_default_value_is_changeable_p): Likewise.
(varobj_invalidate_iter): Likewise.
* varobj.h (struct varobj_update_result) <type_changed,
children_changed, changed, value_installed>: Likewise.
(struct varobj) <updated, frozen, not_fetched>: Likewise.
(struct lang_varobj_ops) <value_is_changeable_p,
value_has_mutated, is_path_expr_parent>: Likewise.
(varobj_delete): Likewise.
(varobj_set_frozen): Likewise.
(varobj_get_frozen): Likewise.
(varobj_set_value): Likewise.
(varobj_update): Likewise.
(varobj_editable_p): Likewise.
(varobj_floating_p): Likewise.
(varobj_has_more): Likewise.
(varobj_is_dynamic_p): Likewise.
(varobj_default_value_is_changeable_p): Likewise.
(varobj_value_is_changeable_p): Likewise.
(varobj_is_anonymous_child): Likewise.
(varobj_default_is_path_expr_parent): Likewise.
Diffstat (limited to 'gdb/mi')
-rw-r--r-- | gdb/mi/mi-cmd-var.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c index d051874..fd18277 100644 --- a/gdb/mi/mi-cmd-var.c +++ b/gdb/mi/mi-cmd-var.c @@ -36,7 +36,7 @@ extern unsigned int varobjdebug; /* defined in varobj.c. */ static void varobj_update_one (struct varobj *var, enum print_values print_values, - int is_explicit); + bool is_explicit); static int mi_print_value_p (struct varobj *var, enum print_values print_values); @@ -260,7 +260,7 @@ void mi_cmd_var_set_frozen (const char *command, char **argv, int argc) { struct varobj *var; - int frozen; + bool frozen; if (argc != 2) error (_("-var-set-format: Usage: NAME FROZEN_FLAG.")); @@ -268,9 +268,9 @@ mi_cmd_var_set_frozen (const char *command, char **argv, int argc) var = varobj_get_handle (argv[0]); if (strcmp (argv[1], "0") == 0) - frozen = 0; + frozen = false; else if (strcmp (argv[1], "1") == 0) - frozen = 1; + frozen = true; else error (_("Invalid flag value")); @@ -620,7 +620,7 @@ mi_cmd_var_update_iter (struct varobj *var, void *data_pointer) if (thread_stopped && (!data->only_floating || varobj_floating_p (var))) - varobj_update_one (var, data->print_values, 0 /* implicit */); + varobj_update_one (var, data->print_values, false /* implicit */); } void @@ -674,7 +674,7 @@ mi_cmd_var_update (const char *command, char **argv, int argc) /* Get varobj handle, if a valid var obj name was specified. */ struct varobj *var = varobj_get_handle (name); - varobj_update_one (var, print_values, 1 /* explicit */); + varobj_update_one (var, print_values, true /* explicit */); } } @@ -682,7 +682,7 @@ mi_cmd_var_update (const char *command, char **argv, int argc) static void varobj_update_one (struct varobj *var, enum print_values print_values, - int is_explicit) + bool is_explicit) { struct ui_out *uiout = current_uiout; |