[clang-tidy] Use C++ using instead of typedef
Found with modernize-use-using Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
be036c443e
commit
8d3377e923
@ -1,5 +1,5 @@
|
||||
---
|
||||
Checks: 'clang-diagnostic-*,clang-analyzer-*,cert-*,performance-*,portability-*,modernize-use-auto,modernize-loop-convert,modernize-use-bool-literals'
|
||||
Checks: 'clang-diagnostic-*,clang-analyzer-*,cert-*,performance-*,portability-*,modernize-use-auto,modernize-loop-convert,modernize-use-bool-literals,modernize-use-using'
|
||||
WarningsAsErrors: ''
|
||||
HeaderFilterRegex: ''
|
||||
AnalyzeTemporaryDtors: false
|
||||
|
@ -133,7 +133,7 @@ class arg_iterator_t {
|
||||
|
||||
// This is used by the string subcommands to communicate with the option parser which flags are
|
||||
// valid and get the result of parsing the command for flags.
|
||||
typedef struct { //!OCLINT(too many fields)
|
||||
using options_t = struct options_t { //!OCLINT(too many fields)
|
||||
bool all_valid = false;
|
||||
bool chars_valid = false;
|
||||
bool count_valid = false;
|
||||
@ -185,7 +185,7 @@ typedef struct { //!OCLINT(too many fields)
|
||||
const wchar_t *arg2 = nullptr;
|
||||
|
||||
escape_string_style_t escape_style = STRING_STYLE_SCRIPT;
|
||||
} options_t;
|
||||
};
|
||||
|
||||
/// This handles the `--style=xxx` flag.
|
||||
static int handle_flag_1(wchar_t **argv, parser_t &parser, io_streams_t &streams,
|
||||
|
@ -89,7 +89,7 @@ static const wcstring &C_(const wcstring &s) { return s; }
|
||||
/// If option is non-empty, it specifies a switch for the command. If \c comp is also not empty, it
|
||||
/// contains a list of non-switch arguments that may only follow directly after the specified
|
||||
/// switch.
|
||||
typedef struct complete_entry_opt {
|
||||
using complete_entry_opt_t = struct complete_entry_opt {
|
||||
// Text of the option (like 'foo').
|
||||
wcstring option;
|
||||
// Type of the option: args-oly, short, single_long, or double_long.
|
||||
@ -119,8 +119,7 @@ typedef struct complete_entry_opt {
|
||||
}
|
||||
DIE("unreachable");
|
||||
}
|
||||
|
||||
} complete_entry_opt_t;
|
||||
};
|
||||
|
||||
/// Last value used in the order field of completion_entry_t.
|
||||
static std::atomic<unsigned int> k_complete_order{0};
|
||||
|
@ -74,13 +74,13 @@ typedef struct te_expr {
|
||||
te_expr *parameters[];
|
||||
} te_expr;
|
||||
|
||||
typedef struct te_builtin {
|
||||
using te_builtin = struct {
|
||||
const char *name;
|
||||
const void *address;
|
||||
int type;
|
||||
} te_builtin;
|
||||
};
|
||||
|
||||
typedef struct state {
|
||||
using state = struct {
|
||||
union {
|
||||
double value;
|
||||
const void *function;
|
||||
@ -89,7 +89,7 @@ typedef struct state {
|
||||
const char *next;
|
||||
int type;
|
||||
te_error_type_t error;
|
||||
} state;
|
||||
};
|
||||
|
||||
/* Parses the input expression. */
|
||||
/* Returns NULL on error. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user