Skip to content

Commit

Permalink
avoid anonymous struct typedefs (#900)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiud authored Feb 24, 2023
1 parent 4ffb2f3 commit 88e2cd4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
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

0 comments on commit 88e2cd4

Please sign in to comment.