From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH 04/12] [gdb] Convert function pointer typedefs to using
Date: Tue, 16 Jun 2026 08:22:49 +0200 [thread overview]
Message-ID: <20260616062257.3164438-5-tdevries@suse.de> (raw)
In-Reply-To: <20260616062257.3164438-1-tdevries@suse.de>
Transform "typedef void (*foo) ()" into "using foo = void (*) ()".
Generated by a script written by Claude Code.
---
gdb/dwarf2/frame.h | 4 ++--
gdb/infrun.c | 4 ++--
gdb/rs6000-tdep.c | 4 ++--
gdb/target-descriptions.h | 6 +++---
gdbserver/tracepoint.cc | 4 ++--
5 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/gdb/dwarf2/frame.h b/gdb/dwarf2/frame.h
index d3c71c3d16e..6462d008cc2 100644
--- a/gdb/dwarf2/frame.h
+++ b/gdb/dwarf2/frame.h
@@ -66,8 +66,8 @@ enum dwarf2_frame_reg_rule
/* Register state. */
-typedef struct value *(*fn_prev_register) (const frame_info_ptr &this_frame,
- void **this_cache, int regnum);
+using fn_prev_register = struct value *(*) (const frame_info_ptr &this_frame,
+ void **this_cache, int regnum);
struct dwarf2_frame_state_reg
{
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 00bedc7b6ae..fe85a05dd36 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -3984,8 +3984,8 @@ delete_thread_infrun_breakpoints (struct thread_info *tp)
just stopped. In all-stop, that's all the non-exited threads; in
non-stop, that's the current thread, only. */
-typedef void (*for_each_just_stopped_thread_callback_func)
- (struct thread_info *tp);
+using for_each_just_stopped_thread_callback_func
+ = void (*) (struct thread_info *tp);
static void
for_each_just_stopped_thread (for_each_just_stopped_thread_callback_func func)
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index e135df94a40..a63f138047a 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -2769,8 +2769,8 @@ rs6000_value_from_register (gdbarch *gdbarch, type *type, int regnum,
/* The type of a function that moves the value of REG between CACHE
or BUF --- in either direction. */
-typedef enum register_status (*move_ev_register_func) (struct regcache *,
- int, void *);
+using move_ev_register_func = enum register_status (*) (struct regcache *,
+ int, void *);
/* Move SPE vector register values between a 64-bit buffer and the two
32-bit raw register halves in a regcache. This function handles
diff --git a/gdb/target-descriptions.h b/gdb/target-descriptions.h
index 25dbf393c2d..39b56d80e5f 100644
--- a/gdb/target-descriptions.h
+++ b/gdb/target-descriptions.h
@@ -80,9 +80,9 @@ void set_tdesc_pseudo_register_reggroup_p
appear in the target description. This means all unknown registers
within a single feature will be called one after another. */
-typedef int (*tdesc_unknown_register_ftype)
- (struct gdbarch *gdbarch, tdesc_feature *feature,
- const char *reg_name, int possible_regnum);
+using tdesc_unknown_register_ftype
+ = int (*) (struct gdbarch *gdbarch, tdesc_feature *feature,
+ const char *reg_name, int possible_regnum);
/* A deleter adapter for a target arch data. */
diff --git a/gdbserver/tracepoint.cc b/gdbserver/tracepoint.cc
index 4f1a03237c9..e5d95726422 100644
--- a/gdbserver/tracepoint.cc
+++ b/gdbserver/tracepoint.cc
@@ -585,8 +585,8 @@ enum tracepoint_type
fast_tracepoint,
};
-typedef enum eval_result_type (*condfn) (unsigned char *,
- ULONGEST *);
+using condfn = enum eval_result_type (*) (unsigned char *,
+ ULONGEST *);
/* The definition of a tracepoint. */
--
2.51.0
next prev parent reply other threads:[~2026-06-16 6:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-16 6:22 [PATCH 00/12] [gdb] Use using instead of typedef some more Tom de Vries
2026-06-16 6:22 ` [PATCH 01/12] [gdb] Use using instead of typedef some more (part 1) Tom de Vries
2026-06-26 15:40 ` Tom Tromey
2026-06-16 6:22 ` [PATCH 02/12] [gdb] Use using instead of typedef some more (part 2) Tom de Vries
2026-06-16 6:22 ` [PATCH 03/12] [gdb] Use using instead of typedef some more (part 3) Tom de Vries
2026-06-26 15:49 ` Tom Tromey
2026-06-16 6:22 ` Tom de Vries [this message]
2026-06-16 6:22 ` [PATCH 05/12] [gdb] Convert template typedefs to using Tom de Vries
2026-06-16 6:22 ` [PATCH 06/12] [gdb] Convert function " Tom de Vries
2026-06-16 6:22 ` [PATCH 07/12] [gdb] Fix redundant struct typedefs Tom de Vries
2026-06-16 6:22 ` [PATCH 08/12] [gdb] Convert anonymous " Tom de Vries
2026-06-16 6:22 ` [PATCH 09/12] [gdb] Convert typedef of named struct Tom de Vries
2026-06-26 16:04 ` Tom Tromey
2026-06-16 6:22 ` [PATCH 10/12] [gdb] convert struct pointer typedefs Tom de Vries
2026-06-16 6:22 ` [PATCH 11/12] [gdb] Convert typedef on separate line Tom de Vries
2026-06-16 6:22 ` [PATCH 12/12] [gdb] Use using in compat_x32_clock_t typedef Tom de Vries
2026-06-26 16:05 ` [PATCH 00/12] [gdb] Use using instead of typedef some more Tom Tromey
2026-07-13 13:07 ` Tom de Vries
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=20260616062257.3164438-5-tdevries@suse.de \
--to=tdevries@suse.de \
--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