From: Andrew Burgess <aburgess@redhat.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>
Subject: [PUSHED] gdb: some int to bool conversion in remote-sim.c
Date: Thu, 15 Dec 2022 12:48:34 +0000 [thread overview]
Message-ID: <c896441822c9c5a506dfe302a292aaa41412058a.1671108465.git.aburgess@redhat.com> (raw)
Some obvious int to bool conversion in remote-sim.c, there should be
no user visible changes after this commit.
---
gdb/remote-sim.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index d383f47d302..c585905c409 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -96,7 +96,7 @@ struct sim_inferior_data {
~sim_inferior_data ();
/* Flag which indicates whether or not the program has been loaded. */
- int program_loaded = 0;
+ bool program_loaded = false;
/* Simulator descriptor for this inferior. */
SIM_DESC gdbsim_desc;
@@ -112,7 +112,7 @@ struct sim_inferior_data {
enum gdb_signal resume_siggnal = GDB_SIGNAL_0;
/* Flag which indicates whether resume should step or not. */
- int resume_step = 0;
+ bool resume_step = false;
};
static const target_info gdbsim_target_info = {
@@ -180,9 +180,9 @@ static struct gdbsim_target gdbsim_ops;
static const registry<inferior>::key<sim_inferior_data> sim_inferior_data_key;
-/* Flag indicating the "open" status of this module. It's set to 1
- in gdbsim_open() and 0 in gdbsim_close(). */
-static int gdbsim_is_open = 0;
+/* Flag indicating the "open" status of this module. It's set true
+ in gdbsim_open() and false in gdbsim_close(). */
+static bool gdbsim_is_open = false;
/* Argument list to pass to sim_open(). It is allocated in gdbsim_open()
and deallocated in gdbsim_close(). The lifetime needs to extend beyond
@@ -600,7 +600,7 @@ gdbsim_target::load (const char *args, int fromtty)
/* FIXME: If a load command should reset the targets registers then
a call to sim_create_inferior() should go here. */
- sim_data->program_loaded = 1;
+ sim_data->program_loaded = true;
}
@@ -768,7 +768,7 @@ gdbsim_target_open (const char *args, int from_tty)
"run". */
switch_to_no_thread ();
- gdbsim_is_open = 1;
+ gdbsim_is_open = true;
}
/* Helper for gdbsim_target::close. */
@@ -815,7 +815,7 @@ gdbsim_target::close ()
end_callbacks ();
- gdbsim_is_open = 0;
+ gdbsim_is_open = false;
}
/* Takes a program previously attached to and detaches it.
@@ -968,11 +968,11 @@ gdbsim_target::wait (ptid_t ptid, struct target_waitstatus *status,
#else
prev_sigint = signal (SIGINT, gdbsim_cntrl_c);
#endif
- sim_resume (sim_data->gdbsim_desc, sim_data->resume_step,
+ sim_resume (sim_data->gdbsim_desc, sim_data->resume_step ? 1 : 0,
sim_data->resume_siggnal);
signal (SIGINT, prev_sigint);
- sim_data->resume_step = 0;
+ sim_data->resume_step = false;
sim_stop_reason (sim_data->gdbsim_desc, &reason, &sigrc);
base-commit: 53cf95c3389a3ecd97276d322e4a60fe3396a201
--
2.25.4
reply other threads:[~2022-12-15 12:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c896441822c9c5a506dfe302a292aaa41412058a.1671108465.git.aburgess@redhat.com \
--to=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).