mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2026-08-27 00:26:02 -04:00
[gdb] Use using instead of typedef some more (part 1)
Result of:
...
$ find gdb* -type f -name "*.[ch]" -o -name "*.cc" \
| egrep -v /testsuite/ \
| xargs sed -i \
's/^\([ \t]*\)typedef \([a-zA-Z_0-9:<>,.() ]*\) \([a-zA-Z_0-9]*\)\(\[.*\]\);/\1using \3 = \2\4;/'
$ find gdb* -type f -name "*.[ch]" -o -name "*.cc" \
| egrep -v /testsuite/ \
| xargs sed -i \
's/^\([ \t]*\)typedef \([a-zA-Z_0-9:<>,.()\* ]*\) \([a-zA-Z_0-9]*\);/\1using \3 = \2;/'
...
and manually reverting to changes in comments.
Approved-By: Tom Tromey <tom@tromey.com>
This commit is contained in:
parent
5befd84f46
commit
7e670147b6
12 changed files with 36 additions and 36 deletions
|
|
@ -3750,14 +3750,14 @@ cris_gdb_func (struct gdbarch *gdbarch, enum cris_op_type op_type,
|
|||
}
|
||||
|
||||
/* Originally from <asm/elf.h>. */
|
||||
typedef unsigned char cris_elf_greg_t[4];
|
||||
using cris_elf_greg_t = unsigned char[4];
|
||||
|
||||
/* Same as user_regs_struct struct in <asm/user.h>. */
|
||||
#define CRISV10_ELF_NGREG 35
|
||||
typedef cris_elf_greg_t cris_elf_gregset_t[CRISV10_ELF_NGREG];
|
||||
using cris_elf_gregset_t = cris_elf_greg_t[CRISV10_ELF_NGREG];
|
||||
|
||||
#define CRISV32_ELF_NGREG 32
|
||||
typedef cris_elf_greg_t crisv32_elf_gregset_t[CRISV32_ELF_NGREG];
|
||||
using crisv32_elf_gregset_t = cris_elf_greg_t[CRISV32_ELF_NGREG];
|
||||
|
||||
/* Unpack a cris_elf_gregset_t into GDB's register cache. */
|
||||
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ struct dwarf2_fde
|
|||
unsigned char eh_frame_p;
|
||||
};
|
||||
|
||||
typedef std::vector<dwarf2_fde *> dwarf2_fde_table;
|
||||
using dwarf2_fde_table = std::vector<dwarf2_fde *>;
|
||||
|
||||
/* A minimal decoding of DWARF2 compilation units. We only decode
|
||||
what's needed to get to the call frame information. */
|
||||
|
|
|
|||
|
|
@ -346,10 +346,10 @@ static const struct frame_unwind_legacy frv_linux_sigtramp_frame_unwind (
|
|||
/* The FRV kernel defines ELF_NGREG as 46. We add 2 in order to include
|
||||
the loadmap addresses in the register set. (See below for more info.) */
|
||||
#define FRV_ELF_NGREG (46 + 2)
|
||||
typedef unsigned char frv_elf_greg_t[4];
|
||||
using frv_elf_greg_t = unsigned char[4];
|
||||
typedef struct { frv_elf_greg_t reg[FRV_ELF_NGREG]; } frv_elf_gregset_t;
|
||||
|
||||
typedef unsigned char frv_elf_fpreg_t[4];
|
||||
using frv_elf_fpreg_t = unsigned char[4];
|
||||
typedef struct
|
||||
{
|
||||
frv_elf_fpreg_t fr[64];
|
||||
|
|
|
|||
|
|
@ -26,11 +26,11 @@
|
|||
#define ELF_NGREG 45
|
||||
#define ELF_NFPREG 33
|
||||
|
||||
typedef unsigned char mips_elf_greg_t[4];
|
||||
typedef mips_elf_greg_t mips_elf_gregset_t[ELF_NGREG];
|
||||
using mips_elf_greg_t = unsigned char[4];
|
||||
using mips_elf_gregset_t = mips_elf_greg_t[ELF_NGREG];
|
||||
|
||||
typedef unsigned char mips_elf_fpreg_t[8];
|
||||
typedef mips_elf_fpreg_t mips_elf_fpregset_t[ELF_NFPREG];
|
||||
using mips_elf_fpreg_t = unsigned char[8];
|
||||
using mips_elf_fpregset_t = mips_elf_fpreg_t[ELF_NFPREG];
|
||||
|
||||
/* 0 - 31 are integer registers, 32 - 63 are fp registers. */
|
||||
#define FPR_BASE 32
|
||||
|
|
@ -64,11 +64,11 @@ void mips_fill_gregset (const struct regcache *, mips_elf_gregset_t *, int);
|
|||
#define MIPS64_ELF_NGREG 45
|
||||
#define MIPS64_ELF_NFPREG 33
|
||||
|
||||
typedef unsigned char mips64_elf_greg_t[8];
|
||||
typedef mips64_elf_greg_t mips64_elf_gregset_t[MIPS64_ELF_NGREG];
|
||||
using mips64_elf_greg_t = unsigned char[8];
|
||||
using mips64_elf_gregset_t = mips64_elf_greg_t[MIPS64_ELF_NGREG];
|
||||
|
||||
typedef unsigned char mips64_elf_fpreg_t[8];
|
||||
typedef mips64_elf_fpreg_t mips64_elf_fpregset_t[MIPS64_ELF_NFPREG];
|
||||
using mips64_elf_fpreg_t = unsigned char[8];
|
||||
using mips64_elf_fpregset_t = mips64_elf_fpreg_t[MIPS64_ELF_NFPREG];
|
||||
|
||||
/* 0 - 31 are integer registers, 32 - 63 are fp registers. */
|
||||
#define MIPS64_FPR_BASE 32
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@
|
|||
#define MN10300_ELF_NGREG 28
|
||||
#define MN10300_ELF_NFPREG 32
|
||||
|
||||
typedef gdb_byte mn10300_elf_greg_t[4];
|
||||
typedef mn10300_elf_greg_t mn10300_elf_gregset_t[MN10300_ELF_NGREG];
|
||||
using mn10300_elf_greg_t = gdb_byte [4];
|
||||
using mn10300_elf_gregset_t = mn10300_elf_greg_t[MN10300_ELF_NGREG];
|
||||
|
||||
typedef gdb_byte mn10300_elf_fpreg_t[4];
|
||||
using mn10300_elf_fpreg_t = gdb_byte [4];
|
||||
typedef struct
|
||||
{
|
||||
mn10300_elf_fpreg_t fpregs[MN10300_ELF_NFPREG];
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ Little-Endian:
|
|||
VR0 VR31 VSCR VRSAVE
|
||||
*/
|
||||
|
||||
typedef char gdb_vrregset_t[PPC_LINUX_SIZEOF_VRREGSET];
|
||||
using gdb_vrregset_t = char[PPC_LINUX_SIZEOF_VRREGSET];
|
||||
|
||||
/* This is the layout of the POWER7 VSX registers and the way they overlap
|
||||
with the existing FPR and VMX registers.
|
||||
|
|
@ -223,7 +223,7 @@ typedef char gdb_vrregset_t[PPC_LINUX_SIZEOF_VRREGSET];
|
|||
the FP registers (doubleword 0) and hence extend them with additional
|
||||
64 bits (doubleword 1). The other 32 regs overlap with the VMX
|
||||
registers. */
|
||||
typedef char gdb_vsxregset_t[PPC_LINUX_SIZEOF_VSXREGSET];
|
||||
using gdb_vsxregset_t = char[PPC_LINUX_SIZEOF_VSXREGSET];
|
||||
|
||||
/* On PPC processors that support the Signal Processing Extension
|
||||
(SPE) APU, the general-purpose registers are 64 bits long.
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ bool remote_debug = false;
|
|||
#define OPAQUETHREADBYTES 8
|
||||
|
||||
/* a 64 bit opaque identifier */
|
||||
typedef unsigned char threadref[OPAQUETHREADBYTES];
|
||||
using threadref = unsigned char[OPAQUETHREADBYTES];
|
||||
|
||||
struct gdb_ext_thread_info;
|
||||
struct threads_listing_context;
|
||||
|
|
|
|||
|
|
@ -42,9 +42,9 @@ enum { TIC6X_PTR_SIZE = 4 };
|
|||
/* External versions; the size and alignment of the fields should be
|
||||
the same as those on the target. When loaded, the placement of
|
||||
the bits in each field will be the same as on the target. */
|
||||
typedef gdb_byte ext_Elf32_Half[2];
|
||||
typedef gdb_byte ext_Elf32_Addr[4];
|
||||
typedef gdb_byte ext_Elf32_Word[4];
|
||||
using ext_Elf32_Half = gdb_byte[2];
|
||||
using ext_Elf32_Addr = gdb_byte[4];
|
||||
using ext_Elf32_Word = gdb_byte[4];
|
||||
|
||||
struct ext_elf32_dsbt_loadseg
|
||||
{
|
||||
|
|
@ -99,7 +99,7 @@ struct int_elf32_dsbt_loadmap
|
|||
|
||||
/* External link_map and elf32_dsbt_loadaddr struct definitions. */
|
||||
|
||||
typedef gdb_byte ext_ptr[4];
|
||||
using ext_ptr = gdb_byte[4];
|
||||
|
||||
struct ext_elf32_dsbt_loadaddr
|
||||
{
|
||||
|
|
|
|||
|
|
@ -57,9 +57,9 @@ enum { FRV_PTR_SIZE = 4 };
|
|||
/* External versions; the size and alignment of the fields should be
|
||||
the same as those on the target. When loaded, the placement of
|
||||
the bits in each field will be the same as on the target. */
|
||||
typedef gdb_byte ext_Elf32_Half[2];
|
||||
typedef gdb_byte ext_Elf32_Addr[4];
|
||||
typedef gdb_byte ext_Elf32_Word[4];
|
||||
using ext_Elf32_Half = gdb_byte[2];
|
||||
using ext_Elf32_Addr = gdb_byte[4];
|
||||
using ext_Elf32_Word = gdb_byte[4];
|
||||
|
||||
struct ext_elf32_fdpic_loadseg
|
||||
{
|
||||
|
|
@ -196,7 +196,7 @@ fetch_loadmap (CORE_ADDR ldmaddr)
|
|||
|
||||
/* External link_map and elf32_fdpic_loadaddr struct definitions. */
|
||||
|
||||
typedef gdb_byte ext_ptr[4];
|
||||
using ext_ptr = gdb_byte[4];
|
||||
|
||||
struct ext_elf32_fdpic_loadaddr
|
||||
{
|
||||
|
|
|
|||
|
|
@ -363,7 +363,7 @@ extern void tui_adjust_window_width (struct tui_win_info *win,
|
|||
|
||||
/* The type of a function that is used to create a TUI window. */
|
||||
|
||||
typedef std::function<tui_win_info * (const char *name)> window_factory;
|
||||
using window_factory = std::function<tui_win_info * (const char *name)>;
|
||||
|
||||
/* The type for a data structure that maps a window name to that window's
|
||||
factory function. */
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ struct tui_source_window_iterator
|
|||
{
|
||||
public:
|
||||
|
||||
typedef std::vector<tui_win_info *>::iterator inner_iterator;
|
||||
using inner_iterator = std::vector<tui_win_info *>::iterator;
|
||||
|
||||
using self_type = tui_source_window_iterator;
|
||||
using value_type = struct tui_source_window_base *;
|
||||
|
|
|
|||
|
|
@ -113,12 +113,12 @@ enum fileio_error
|
|||
#define FIO_LONG_LEN 8
|
||||
#define FIO_ULONG_LEN 8
|
||||
|
||||
typedef char fio_int_t[FIO_INT_LEN];
|
||||
typedef char fio_uint_t[FIO_UINT_LEN];
|
||||
typedef char fio_mode_t[FIO_MODE_LEN];
|
||||
typedef char fio_time_t[FIO_TIME_LEN];
|
||||
typedef char fio_long_t[FIO_LONG_LEN];
|
||||
typedef char fio_ulong_t[FIO_ULONG_LEN];
|
||||
using fio_int_t = char[FIO_INT_LEN];
|
||||
using fio_uint_t = char[FIO_UINT_LEN];
|
||||
using fio_mode_t = char[FIO_MODE_LEN];
|
||||
using fio_time_t = char[FIO_TIME_LEN];
|
||||
using fio_long_t = char[FIO_LONG_LEN];
|
||||
using fio_ulong_t = char[FIO_ULONG_LEN];
|
||||
|
||||
/* Struct stat as used in protocol. For complete independence
|
||||
of host/target systems, it's defined as an array with offsets
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue