avoid anonymous struct typedefs (#900)

This commit is contained in:
Sergiu Deitsch 2023-02-24 20:15:03 +01:00 committed by GitHub
parent 4ffb2f3c40
commit 88e2cd4eef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 13 deletions

View File

@ -46,10 +46,10 @@
_START_GOOGLE_NAMESPACE_
#if !defined(GLOG_OS_WINDOWS)
typedef struct {
struct AbbrevPair {
const char *abbrev;
const char *real_name;
} AbbrevPair;
};
// List of operators from Itanium C++ ABI.
static const AbbrevPair kOperatorList[] = {
@ -148,7 +148,7 @@ static const AbbrevPair kSubstitutionList[] = {
};
// State needed for demangling.
typedef struct {
struct State {
const char *mangled_cur; // Cursor of mangled name.
char *out_cur; // Cursor of output string.
const char *out_begin; // Beginning of output string.
@ -158,7 +158,7 @@ typedef struct {
short nest_level; // For nested names.
bool append; // Append flag.
bool overflowed; // True if output gets overflowed.
} State;
};
// We don't use strlen() in libc since it's not guaranteed to be async
// signal safe.

View File

@ -38,13 +38,12 @@
_START_GOOGLE_NAMESPACE_
typedef struct {
struct trace_arg_t {
void **result;
int max_depth;
int skip_count;
int count;
} trace_arg_t;
};
// Workaround for the malloc() in _Unwind_Backtrace() issue.
static _Unwind_Reason_Code nop_backtrace(struct _Unwind_Context */*uc*/, void */*opq*/) {

View File

@ -237,11 +237,10 @@ struct _wdirent {
/* File name */
wchar_t d_name[PATH_MAX+1];
};
typedef struct _wdirent _wdirent;
struct _WDIR {
/* Current directory entry */
struct _wdirent ent;
_wdirent ent;
/* Private file data */
WIN32_FIND_DATAW data;
@ -255,7 +254,6 @@ struct _WDIR {
/* Initial directory name */
wchar_t *patt;
};
typedef struct _WDIR _WDIR;
/* Multi-byte character version */
struct dirent {
@ -277,14 +275,11 @@ struct dirent {
/* File name */
char d_name[PATH_MAX+1];
};
typedef struct dirent dirent;
struct DIR {
struct dirent ent;
struct _WDIR *wdirp;
};
typedef struct DIR DIR;
/* Dirent functions */
static DIR *opendir (const char *dirname);