From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH 03/12] [gdb] Use using instead of typedef some more (part 3)
Date: Tue, 16 Jun 2026 08:22:48 +0200 [thread overview]
Message-ID: <20260616062257.3164438-4-tdevries@suse.de> (raw)
In-Reply-To: <20260616062257.3164438-1-tdevries@suse.de>
Fix the remaining hits of:
...
$ find gdb* -type f -name "*.[ch]" -o -name "*.cc" \
| egrep -v /testsuite/ \
| xargs grep '^[ \t]*typedef .*;.*$' \
| grep -v WINAPI
...
except for C example in a comment.
---
gdb/expop.h | 2 +-
gdb/frv-linux-tdep.c | 2 +-
gdb/go32-nat.c | 2 +-
gdb/interps.h | 2 +-
gdb/stubs/m68k-stub.c | 4 ++--
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/gdb/expop.h b/gdb/expop.h
index fb4139d3b33..41331c4a780 100644
--- a/gdb/expop.h
+++ b/gdb/expop.h
@@ -2094,7 +2094,7 @@ class unop_cast_type_operation
override;
};
-typedef value *cxx_cast_ftype (struct type *, value *);
+using cxx_cast_ftype = value * (struct type *, value *);
/* This implements dynamic_cast and reinterpret_cast. static_cast and
const_cast are handled by the ordinary case operations. */
diff --git a/gdb/frv-linux-tdep.c b/gdb/frv-linux-tdep.c
index cd9d21c2f14..66f434ed8b7 100644
--- a/gdb/frv-linux-tdep.c
+++ b/gdb/frv-linux-tdep.c
@@ -347,7 +347,7 @@ static const struct frame_unwind_legacy frv_linux_sigtramp_frame_unwind (
the loadmap addresses in the register set. (See below for more info.) */
#define FRV_ELF_NGREG (46 + 2)
using frv_elf_greg_t = unsigned char[4];
-typedef struct { frv_elf_greg_t reg[FRV_ELF_NGREG]; } frv_elf_gregset_t;
+using frv_elf_gregset_t = struct { frv_elf_greg_t reg[FRV_ELF_NGREG]; };
using frv_elf_fpreg_t = unsigned char[4];
typedef struct
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index b3ea5c1fd5c..eeaff9d8117 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -219,7 +219,7 @@ redir_debug_init (cmdline_t *ptr)
}
#endif /* __DJGPP_MINOR < 3 */
-typedef enum { wp_insert, wp_remove, wp_count } wp_op;
+using wp_op = enum { wp_insert, wp_remove, wp_count };
/* This holds the current reference counts for each debug register. */
static int dr_ref_count[4];
diff --git a/gdb/interps.h b/gdb/interps.h
index d92d6b977cf..121f2ecca84 100644
--- a/gdb/interps.h
+++ b/gdb/interps.h
@@ -35,7 +35,7 @@ struct inferior;
struct solib;
struct trace_state_variable;
-typedef struct interp *(*interp_factory_func) (const char *name);
+using interp_factory_func = struct interp * (*) (const char *name);
/* Each interpreter kind (CLI, MI, etc.) registers itself with a call
to this function, passing along its name, and a pointer to a
diff --git a/gdb/stubs/m68k-stub.c b/gdb/stubs/m68k-stub.c
index c63eee7d2c9..57437dd04f7 100644
--- a/gdb/stubs/m68k-stub.c
+++ b/gdb/stubs/m68k-stub.c
@@ -113,8 +113,8 @@
*
* external low-level support routines
*/
-typedef void (*ExceptionHook)(int); /* pointer to function with int parm */
-typedef void (*Function)(); /* pointer to a function */
+using ExceptionHook = void (*) (int); /* Pointer to function with int parm. */
+using Function = void (*) (); /* Pointer to a function. */
extern void putDebugChar(); /* write a single character */
extern int getDebugChar(); /* read and return a single char */
--
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 ` Tom de Vries [this message]
2026-06-26 15:49 ` [PATCH 03/12] [gdb] Use using instead of typedef some more (part 3) Tom Tromey
2026-06-16 6:22 ` [PATCH 04/12] [gdb] Convert function pointer typedefs to using Tom de Vries
2026-06-16 6:22 ` [PATCH 05/12] [gdb] Convert template " 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-4-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