From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [pushed] gdb: small cleanup of async-event.c structs
Date: Thu, 7 May 2020 11:42:27 -0400 [thread overview]
Message-ID: <20200507154227.419554-1-simon.marchi@efficios.com> (raw)
This is a small cleanup to normalize the structures in async-event.c
with the rest of the code base:
- Remove the unnecessary typedefs
- Fix indentation of struct bodies
- Put comments above fields
No functional changes expected.
gdb/ChangeLog:
* async-event.c (struct async_signal_handler, struct
async_event_handler): Reformat, remove typedef.
---
gdb/ChangeLog | 5 ++++
gdb/async-event.c | 74 +++++++++++++++++++++++++----------------------
2 files changed, 44 insertions(+), 35 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b7c2c4b08493..d287d3aa5e9e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-05-07 Simon Marchi <simon.marchi@efficios.com>
+
+ * async-event.c (struct async_signal_handler, struct
+ async_event_handler): Reformat, remove typedef.
+
2020-05-07 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.h (TYPE_DYN_PROP_LIST): Remove. Update all users
diff --git a/gdb/async-event.c b/gdb/async-event.c
index dd65c17468b1..4354175edfac 100644
--- a/gdb/async-event.c
+++ b/gdb/async-event.c
@@ -32,16 +32,21 @@
Async_init_signals takes care of setting up such an
async_signal_handler for each interesting signal. */
-typedef struct async_signal_handler
- {
- int ready; /* If ready, call this handler
- from the main event loop, using
- invoke_async_handler. */
- struct async_signal_handler *next_handler; /* Ptr to next handler. */
- sig_handler_func *proc; /* Function to call to do the work. */
- gdb_client_data client_data; /* Argument to async_handler_func. */
- }
-async_signal_handler;
+struct async_signal_handler
+{
+ /* If ready, call this handler from the main event loop, using
+ invoke_async_handler. */
+ int ready;
+
+ /* Pointer to next handler. */
+ struct async_signal_handler *next_handler;
+
+ /* Function to call to do the work. */
+ sig_handler_func *proc;
+
+ /* Argument to PROC. */
+ gdb_client_data client_data;
+};
/* PROC is a function to be invoked when the READY flag is set. This
happens when the event has been marked with
@@ -49,45 +54,44 @@ async_signal_handler;
to an event will be carried out by PROC at a later time, within
process_event. This provides a deferred execution of event
handlers. */
-typedef struct async_event_handler
- {
- /* If ready, call this handler from the main event loop, using
- invoke_event_handler. */
- int ready;
+struct async_event_handler
+{
+ /* If ready, call this handler from the main event loop, using
+ invoke_event_handler. */
+ int ready;
- /* Point to next handler. */
- struct async_event_handler *next_handler;
+ /* Pointer to next handler. */
+ struct async_event_handler *next_handler;
- /* Function to call to do the work. */
- async_event_handler_func *proc;
+ /* Function to call to do the work. */
+ async_event_handler_func *proc;
- /* Argument to PROC. */
- gdb_client_data client_data;
- }
-async_event_handler;
+ /* Argument to PROC. */
+ gdb_client_data client_data;
+};
/* All the async_signal_handlers gdb is interested in are kept onto
this list. */
static struct
- {
- /* Pointer to first in handler list. */
- async_signal_handler *first_handler;
+{
+ /* Pointer to first in handler list. */
+ async_signal_handler *first_handler;
- /* Pointer to last in handler list. */
- async_signal_handler *last_handler;
- }
+ /* Pointer to last in handler list. */
+ async_signal_handler *last_handler;
+}
sighandler_list;
/* All the async_event_handlers gdb is interested in are kept onto
this list. */
static struct
- {
- /* Pointer to first in handler list. */
- async_event_handler *first_handler;
+{
+ /* Pointer to first in handler list. */
+ async_event_handler *first_handler;
- /* Pointer to last in handler list. */
- async_event_handler *last_handler;
- }
+ /* Pointer to last in handler list. */
+ async_event_handler *last_handler;
+}
async_event_handler_list;
--
2.26.2
reply other threads:[~2020-05-07 15:42 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=20200507154227.419554-1-simon.marchi@efficios.com \
--to=simon.marchi@efficios.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).