Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid anonymous struct typedefs #900

Merged
merged 1 commit into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/demangle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down
5 changes: 2 additions & 3 deletions src/stacktrace_unwind-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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*/) {
Expand Down
7 changes: 1 addition & 6 deletions src/windows/dirent.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -255,7 +254,6 @@ struct _WDIR {
/* Initial directory name */
wchar_t *patt;
};
typedef struct _WDIR _WDIR;

/* Multi-byte character version */
struct dirent {
Expand All @@ -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);
Expand Down