Skip to content

Commit fc2dc85

Browse files
luciangfacebook-github-bot
authored andcommitted
fix anon-struct usage that's a warning/error -Wnon-c-typedef-for-linkage (#137)
Summary: Pull Request resolved: #137 Fix error: anonymous non-C-compatible type given name for linkage purposes by alias declaration; add a tag name here [-Werror,-Wnon-c-typedef-for-linkage] Reviewed By: philippv Differential Revision: D36043476 fbshipit-source-id: 45e2110b007e102388d1487a7f071de440d0bed3
1 parent 8a55e16 commit fc2dc85

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

cachelib/compact_cache/CCacheDescriptor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ template <unsigned MaxSize>
159159
struct VariableSizedValueDescriptor {
160160
constexpr static bool kFixedSize = false;
161161

162-
using Value = struct {
162+
struct Value {
163163
char data[0];
164164
// Data is here.
165165
} __attribute__((__packed__));

cachelib/compact_cache/CCacheFixedLruBucket.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ struct FixedLruBucket {
4848

4949
/** Type of the data stored in a bucket entry.
5050
* This contains the key and the value (if any). */
51-
using Entry = struct {
51+
struct Entry {
5252
Key key;
5353
/* Expands to NoValue (size 0) if this cache does not store values */
5454
Value val;
5555
} __attribute__((__packed__));
5656

5757
/** Type of a bucket.
5858
* Empty entry slots must be zeroed out to avoid spurious matches! */
59-
using Bucket = struct {
59+
struct Bucket {
6060
Entry entries[kEntriesPerBucket];
6161
} __attribute__((__packed__));
6262

cachelib/compact_cache/CCacheVariableLruBucket.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ struct VariableLruBucket {
131131
constexpr static size_t kMaxEntries = std::numeric_limits<EntryNum>::max();
132132

133133
/** An entry header. */
134-
using EntryHdr = struct {
134+
struct EntryHdr {
135135
Key key;
136136
/* Size in bytes of the corresponding EntryData's data field. */
137137
EntryDataSize dataSize;
@@ -140,7 +140,7 @@ struct VariableLruBucket {
140140
EntryDataOffset dataOffset;
141141
} __attribute__((__packed__));
142142

143-
using EntryData = struct {
143+
struct EntryData {
144144
/* Index of the corresponding EntryHdr header in the 'Entry
145145
* Headers' section. This is a value between 0 and the number of entries
146146
* in the bucket. */
@@ -155,7 +155,7 @@ struct VariableLruBucket {
155155
constexpr static size_t kBucketDataSize =
156156
kMaxValueSize + sizeof(EntryHdr) + sizeof(EntryData);
157157

158-
using Bucket = struct {
158+
struct Bucket {
159159
/* Number of entries in the bucket. */
160160
EntryNum numEntries;
161161
/* Size of the "Data" section.

0 commit comments

Comments
 (0)