[binutils-gdb] [gdb] Use using instead of typedef some more (part 3)
Tom de Vries via Gdb-cvs <[email protected]> Mon, 13 Jul 2026 13:06:58 +0000 (GMT)
| Newsgroups | gmane.comp.gdb.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D59eb2a28263c= 297c71a64f5fc7b1ab21d0f15e7c commit 59eb2a28263c297c71a64f5fc7b1ab21d0f15e7c Author: Tom de Vries <[email protected]> Date: Mon Jul 13 15:06:35 2026 +0200 [gdb] Use using instead of typedef some more (part 3) =20 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. =20 Approved-By: Tom Tromey <[email protected]> Diff: --- 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 @@ protected: override; }; =20 -typedef value *cxx_cast_ftype (struct type *, value *); +using cxx_cast_ftype =3D value * (struct type *, value *); =20 /* 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_sigtr= amp_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 =3D unsigned char[4]; -typedef struct { frv_elf_greg_t reg[FRV_ELF_NGREG]; } frv_elf_gregset_t; +using frv_elf_gregset_t =3D struct { frv_elf_greg_t reg[FRV_ELF_NGREG]; }; =20 using frv_elf_fpreg_t =3D unsigned char[4]; typedef struct diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c index fdfa6cd4209..f95e6bd11a3 100644 --- a/gdb/go32-nat.c +++ b/gdb/go32-nat.c @@ -220,7 +220,7 @@ redir_debug_init (cmdline_t *ptr) } #endif /* __DJGPP_MINOR < 3 */ =20 -typedef enum { wp_insert, wp_remove, wp_count } wp_op; +enum wp_op { wp_insert, wp_remove, wp_count }; =20 /* 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; =20 -typedef struct interp *(*interp_factory_func) (const char *name); +using interp_factory_func =3D struct interp * (*) (const char *name); =20 /* 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 =3D void (*) (int); /* Pointer to function with int pa= rm. */ +using Function =3D void (*) (); /* Pointer to a function. */ =20 extern void putDebugChar(); /* write a single character */ extern int getDebugChar(); /* read and return a single char */