misc: Remove typedef (struct|enum) Foo in cpp files.

In C, to refer to a type without a struct or enum tag on the type, you
need to typedef it like this:

typedef struct
{
} Foo;

Foo foo;

In C++, this is unnecessary:

struct Foo
{
};

Foo foo;

Remove all of the first form in C++ files and replace them with the
second form.

Change-Id: I37cc0d63b2777466dc6cc51eb5a3201de2e2cf43
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46199
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2021-05-28 21:03:47 -07:00
parent 9b1ff519aa
commit d58b4f004e
23 changed files with 142 additions and 142 deletions

View File

@@ -126,7 +126,7 @@ class ArmFreebsd32 : public ArmFreebsd
* sizeof st_lspare 4
*/
typedef struct
struct tgt_stat
{
uint32_t st_dev;
uint32_t st_ino;
@@ -149,9 +149,9 @@ class ArmFreebsd32 : public ArmFreebsd
uint32_t st_lspare;
uint64_t st_birthtimX;
uint64_t st_birthtim;
} tgt_stat;
};
typedef struct
struct tgt_stat64
{
uint32_t st_dev;
uint32_t st_ino;
@@ -174,7 +174,7 @@ class ArmFreebsd32 : public ArmFreebsd
uint32_t st_lspare;
uint64_t st_birthtimX;
uint64_t st_birthtim;
} tgt_stat64;
};
/// For getrusage().
struct rusage
@@ -296,7 +296,7 @@ class ArmFreebsd64 : public ArmFreebsd
uint64_t iov_len;
};
typedef struct
struct tgt_stat
{
uint32_t st_dev;
uint32_t st_ino;
@@ -319,9 +319,9 @@ class ArmFreebsd64 : public ArmFreebsd
uint32_t st_lspare;
uint64_t st_birthtimX;
uint64_t st_birthtim;
} tgt_stat;
};
typedef struct
struct tgt_stat64
{
uint32_t st_dev;
uint32_t st_ino;
@@ -344,7 +344,7 @@ class ArmFreebsd64 : public ArmFreebsd
uint32_t st_lspare;
uint64_t st_birthtimX;
uint64_t st_birthtim;
} tgt_stat64;
};
/// For getrusage().
struct rusage

View File

@@ -193,7 +193,7 @@ class ArmLinux32 : public ArmLinux
};
typedef struct
struct tgt_stat
{
uint32_t st_dev;
uint32_t st_ino;
@@ -213,9 +213,9 @@ class ArmLinux32 : public ArmLinux
uint32_t st_mtime_nsec;
uint32_t st_ctimeX;
uint32_t st_ctime_nsec;
} tgt_stat;
};
typedef struct
struct tgt_stat64
{
uint64_t st_dev;
uint8_t __pad0[4];
@@ -236,9 +236,9 @@ class ArmLinux32 : public ArmLinux
uint32_t st_ctimeX;
uint32_t st_ctime_nsec;
uint64_t st_ino;
} tgt_stat64;
};
typedef struct
struct tgt_sysinfo
{
int32_t uptime; /* Seconds since boot */
uint32_t loads[3]; /* 1, 5, and 15 minute load averages */
@@ -252,7 +252,7 @@ class ArmLinux32 : public ArmLinux
uint32_t totalhigh; /* Total high memory size */
uint32_t freehigh; /* Available high memory size */
uint32_t mem_unit; /* Memory unit size in bytes */
} tgt_sysinfo;
};
/// For getrusage().
struct rusage
@@ -457,7 +457,7 @@ class ArmLinux64 : public ArmLinux
uint64_t iov_len;
};
typedef struct
struct tgt_stat
{
uint64_t st_dev;
uint64_t st_ino;
@@ -476,9 +476,9 @@ class ArmLinux64 : public ArmLinux
uint64_t st_mtime_nsec;
uint64_t st_ctimeX;
uint64_t st_ctime_nsec;
} tgt_stat;
};
typedef struct
struct tgt_stat64
{
uint64_t st_dev;
uint64_t st_ino;
@@ -497,9 +497,9 @@ class ArmLinux64 : public ArmLinux
uint64_t st_mtime_nsec;
uint64_t st_ctimeX;
uint64_t st_ctime_nsec;
} tgt_stat64;
};
typedef struct
struct tgt_sysinfo
{
int64_t uptime; /* Seconds since boot */
uint64_t loads[3]; /* 1, 5, and 15 minute load averages */
@@ -514,7 +514,7 @@ class ArmLinux64 : public ArmLinux
uint64_t totalhigh; /* Total high memory size */
uint64_t freehigh; /* Available high memory size */
uint32_t mem_unit; /* Memory unit size in bytes */
} tgt_sysinfo;
};
/// For getrusage().
struct rusage

View File

@@ -179,7 +179,7 @@ class MipsLinux : public Linux
/// the root users.
static const int NUM_ROOT_PROCS = 2;
typedef struct
struct tgt_sysinfo
{
int32_t uptime; /* Seconds since boot */
uint32_t loads[3]; /* 1, 5, and 15 minute load averages */
@@ -193,7 +193,7 @@ class MipsLinux : public Linux
uint32_t totalhigh; /* Total high memory size */
uint32_t freehigh; /* Available high memory size */
uint32_t mem_unit; /* Memory unit size in bytes */
} tgt_sysinfo;
};
};

View File

@@ -52,7 +52,7 @@ class PowerLinux : public Linux
typedef int32_t time_t;
typedef struct
struct tgt_stat
{
uint64_t st_dev;
uint32_t __pad1;
@@ -74,9 +74,9 @@ class PowerLinux : public Linux
uint32_t st_ctime_nsec;
uint32_t __unused4;
uint32_t __unused5;
} tgt_stat;
};
typedef struct
struct tgt_stat64
{
uint64_t st_dev;
uint64_t st_ino;
@@ -98,7 +98,7 @@ class PowerLinux : public Linux
uint32_t st_ctime_nsec;
uint32_t __unused4;
uint32_t __unused5;
} tgt_stat64;
};
/// For times().
struct tms

View File

@@ -138,7 +138,7 @@ class RiscvLinux64 : public RiscvLinux
int64_t tv_nsec;
};
typedef struct
struct tgt_stat64
{
dev_t st_dev;
ino_t st_ino;
@@ -158,14 +158,14 @@ class RiscvLinux64 : public RiscvLinux
uint64_t st_ctimeX;
uint64_t st_ctime_nsec;
int32_t ___glibc_reserved[2];
} tgt_stat64;
};
typedef struct
struct tgt_fsid_t
{
int32_t val[2];
} tgt_fsid_t;
};
typedef struct
struct tgt_statfs
{
uint64_t f_type;
uint64_t f_bsize;
@@ -179,9 +179,9 @@ class RiscvLinux64 : public RiscvLinux
uint64_t f_frsize;
uint64_t f_flags;
uint64_t f_spare[4];
} tgt_statfs;
};
typedef struct
struct tgt_sysinfo
{
int64_t uptime;
uint64_t loads[3];
@@ -196,7 +196,7 @@ class RiscvLinux64 : public RiscvLinux
uint64_t totalhigh;
uint64_t freehigh;
uint32_t mem_unit;
} tgt_sysinfo;
};
static void
archClone(uint64_t flags,
@@ -309,12 +309,12 @@ class RiscvLinux32 : public RiscvLinux
int32_t tv_nsec;
};
typedef struct
struct tgt_fsid_t
{
int32_t val[2];
} tgt_fsid_t;
};
typedef struct
struct tgt_stat
{
uint64_t st_dev;
uint64_t st_ino;
@@ -336,9 +336,9 @@ class RiscvLinux32 : public RiscvLinux
int32_t st_ctime_nsec;
int32_t __unused4;
int32_t __unused5;
} tgt_stat;
};
typedef struct
struct tgt_statfs
{
uint32_t f_type;
uint32_t f_bsize;
@@ -352,9 +352,9 @@ class RiscvLinux32 : public RiscvLinux
uint32_t f_frsize;
uint32_t f_flags;
uint32_t f_spare[4];
} tgt_statfs;
};
typedef struct
struct tgt_sysinfo
{
int32_t uptime;
uint32_t loads[3];
@@ -369,7 +369,7 @@ class RiscvLinux32 : public RiscvLinux
uint32_t totalhigh;
uint32_t freehigh;
uint32_t mem_unit;
} tgt_sysinfo;
};
static void
archClone(uint64_t flags,

View File

@@ -68,12 +68,13 @@ class PMP : public SimObject
* PMP_NA4 = naturally aligned four byte region
* PMP_NAPOT = naturally aligned power of two region, >= 8 bytes
*/
typedef enum {
enum pmpAmatch
{
PMP_OFF,
PMP_TOR,
PMP_NA4,
PMP_NAPOT
} pmpAmatch;
};
/** pmpcfg address range read permission mask */
const uint8_t PMP_READ = 1 << 0;

View File

@@ -169,7 +169,7 @@ class SparcLinux : public Linux
static const unsigned TGT_MAP_FIXED = 0x00010;
static const unsigned TGT_MAP_INHERIT = 0x00080;
typedef struct
struct tgt_sysinfo
{
int64_t uptime; /* Seconds since boot */
uint64_t loads[3]; /* 1, 5, and 15 minute load averages */
@@ -183,7 +183,7 @@ class SparcLinux : public Linux
uint64_t totalhigh; /* Total high memory size */
uint64_t freehigh; /* Available high memory size */
uint64_t mem_unit; /* Memory unit size in bytes */
} tgt_sysinfo;
};
//@{
/// ioctl() command codes.
@@ -247,7 +247,7 @@ class Sparc32Linux : public SparcLinux
{
public:
typedef struct
struct tgt_stat64
{
uint64_t st_dev;
uint64_t st_ino;
@@ -269,9 +269,9 @@ class Sparc32Linux : public SparcLinux
uint64_t st_ctime_nsec;
uint32_t __unused4;
uint32_t __unused5;
} tgt_stat64;
};
typedef struct
struct tgt_sysinfo
{
int32_t uptime; /* Seconds since boot */
uint32_t loads[3]; /* 1, 5, and 15 minute load averages */
@@ -285,7 +285,7 @@ class Sparc32Linux : public SparcLinux
uint32_t totalhigh; /* Total high memory size */
uint32_t freehigh; /* Available high memory size */
uint32_t mem_unit; /* Memory unit size in bytes */
} tgt_sysinfo;
};
/// Resource constants for getrlimit() (overide some generics).
static const unsigned TGT_RLIMIT_NPROC = 7;

View File

@@ -99,7 +99,7 @@ class X86Linux64 : public X86Linux
{
public:
typedef struct
struct tgt_stat64
{
uint64_t st_dev;
uint64_t st_ino;
@@ -119,14 +119,14 @@ class X86Linux64 : public X86Linux
uint64_t st_ctimeX;
uint64_t st_ctime_nsec;
int64_t unused0[3];
} tgt_stat64;
};
typedef struct
struct tgt_fsid
{
long val[2];
} tgt_fsid;
};
typedef struct
struct tgt_statfs
{
long f_type;
long f_bsize;
@@ -139,7 +139,7 @@ class X86Linux64 : public X86Linux
long f_namelen;
long f_frsize;
long f_spare[5];
} tgt_statfs;
};
static const int TGT_SIGHUP = 0x000001;
static const int TGT_SIGINT = 0x000002;
@@ -223,13 +223,13 @@ class X86Linux64 : public X86Linux
static const unsigned TGT_MAP_ANONYMOUS = 0x00020;
static const unsigned TGT_MAP_FIXED = 0x00010;
typedef struct
struct tgt_iovec
{
uint64_t iov_base; // void *
uint64_t iov_len; // size_t
} tgt_iovec;
};
typedef struct
struct tgt_sysinfo
{
int64_t uptime; /* Seconds since boot */
uint64_t loads[3]; /* 1, 5, and 15 minute load averages */
@@ -243,14 +243,14 @@ class X86Linux64 : public X86Linux
uint64_t totalhigh; /* Total high memory size */
uint64_t freehigh; /* Available high memory size */
uint64_t mem_unit; /* Memory unit size in bytes */
} tgt_sysinfo;
};
};
class X86Linux32 : public X86Linux
{
public:
typedef struct GEM5_PACKED
struct GEM5_PACKED tgt_stat64
{
uint64_t st_dev;
uint8_t __pad0[4];
@@ -271,7 +271,7 @@ class X86Linux32 : public X86Linux
uint32_t st_ctimeX;
uint32_t st_ctime_nsec;
uint64_t st_ino;
} tgt_stat64;
};
static const int TGT_SIGHUP = 0x000001;
static const int TGT_SIGINT = 0x000002;
@@ -357,7 +357,7 @@ class X86Linux32 : public X86Linux
static const unsigned TGT_MAP_ANONYMOUS = 0x00020;
static const unsigned TGT_MAP_FIXED = 0x00010;
typedef struct
struct tgt_sysinfo
{
int32_t uptime; /* Seconds since boot */
uint32_t loads[3]; /* 1, 5, and 15 minute load averages */
@@ -371,7 +371,7 @@ class X86Linux32 : public X86Linux
uint32_t totalhigh; /* Total high memory size */
uint32_t freehigh; /* Available high memory size */
uint32_t mem_unit; /* Memory unit size in bytes */
} tgt_sysinfo;
};
};
} // namespace gem5

View File

@@ -81,27 +81,27 @@ class Gicv3 : public BaseGic
static const int PPI_MAX = 16;
// Interrupt states for PPIs, SGIs and SPIs, as per SPEC 4.1.2 section
typedef enum
enum IntStatus
{
INT_INACTIVE,
INT_PENDING,
INT_ACTIVE,
INT_ACTIVE_PENDING,
} IntStatus;
};
// Interrupt groups, as per SPEC section 4.6
typedef enum
enum GroupId
{
G0S,
G1S,
G1NS,
} GroupId;
};
typedef enum
enum IntTriggerType
{
INT_LEVEL_SENSITIVE,
INT_EDGE_TRIGGERED,
} IntTriggerType;
};
protected:

View File

@@ -154,12 +154,12 @@ class Gicv3CPUInterface : public ArmISA::BaseISADevice, public Serializable
static const uint8_t GIC_MIN_VBPR = 7 - VIRTUAL_PREEMPTION_BITS;
typedef struct
struct hppi_t
{
uint32_t intid;
uint8_t prio;
Gicv3::GroupId group;
} hppi_t;
};
hppi_t hppi;

View File

@@ -41,7 +41,7 @@
namespace gem5
{
typedef struct hsa_packet_header_s
struct hsa_packet_header_bitfield_t
{
// TODO: replace with more portable impl based on offset, length
uint16_t type:8;
@@ -49,10 +49,10 @@ typedef struct hsa_packet_header_s
uint16_t acquire_fence_scope:2;
uint16_t release_fence_scope:2;
uint16_t reserved:3;
} hsa_packet_header_bitfield_t;
};
//TODO: put an _ in front of these guys to avoud prob with hsa.h for now
typedef struct _hsa_dispatch_packet_s
struct _hsa_dispatch_packet_t
{
uint16_t header;
uint16_t setup;
@@ -69,9 +69,9 @@ typedef struct _hsa_dispatch_packet_s
uint64_t kernarg_address;
uint64_t reserved1;
uint64_t completion_signal;
} _hsa_dispatch_packet_t;
};
typedef struct _hsa_agent_dispatch_packet_s
struct _hsa_agent_dispatch_packet_t
{
uint16_t header;
uint16_t type;
@@ -80,9 +80,9 @@ typedef struct _hsa_agent_dispatch_packet_s
uint64_t arg[4];
uint64_t reserved2;
uint64_t completion_signal;
} _hsa_agent_dispatch_packet_t;
};
typedef struct _hsa_barrier_and_packet_s
struct _hsa_barrier_and_packet_t
{
uint16_t header;
uint16_t reserved0;
@@ -90,9 +90,9 @@ typedef struct _hsa_barrier_and_packet_s
uint64_t dep_signal[5];
uint64_t reserved2;
uint64_t completion_signal;
} _hsa_barrier_and_packet_t;
};
typedef struct _hsa_barrier_or_packet_s
struct _hsa_barrier_or_packet_t
{
uint16_t header;
uint16_t reserved0;
@@ -100,7 +100,7 @@ typedef struct _hsa_barrier_or_packet_s
uint64_t dep_signal[5];
uint64_t reserved2;
uint64_t completion_signal;
} _hsa_barrier_or_packet_t;
};
} // namespace gem5

View File

@@ -58,7 +58,7 @@ namespace gem5
// Ideally, each queue should store this status and
// the processPkt() should make decisions based on that
// status variable.
typedef enum
enum Q_STATE
{
UNBLOCKED = 0, // Unblocked queue, can submit packets.
BLOCKED_BBIT, // Queue blocked by barrier bit.
@@ -67,7 +67,7 @@ typedef enum
BLOCKED_BPKT, // Queue blocked by barrier packet.
// Can submit packet packets after
// barrier packet completes.
} Q_STATE;
};
class GPUCommandProcessor;
class HWScheduler;
@@ -209,18 +209,17 @@ class AQLRingBuffer
uint64_t compltnPending() { return (_dispIdx - _rdIdx); }
};
typedef struct QueueContext
struct QCntxt
{
HSAQueueDescriptor* qDesc;
AQLRingBuffer* aqlBuf;
// used for HSA packets that enforce synchronization with barrier bit
bool barrierBit;
QueueContext(HSAQueueDescriptor* q_desc,
AQLRingBuffer* aql_buf)
: qDesc(q_desc), aqlBuf(aql_buf), barrierBit(false)
QCntxt(HSAQueueDescriptor* q_desc, AQLRingBuffer* aql_buf) :
qDesc(q_desc), aqlBuf(aql_buf), barrierBit(false)
{}
QueueContext() : qDesc(NULL), aqlBuf(NULL), barrierBit(false) {}
} QCntxt;
QCntxt() : qDesc(NULL), aqlBuf(NULL), barrierBit(false) {}
};
class HSAPacketProcessor: public DmaDevice
{

View File

@@ -39,18 +39,18 @@
namespace gem5
{
typedef enum
enum _hsa_queue_type_t
{
_HSA_QUEUE_TYPE_MULTI = 0,
_HSA_QUEUE_TYPE_SINGLE = 1
} _hsa_queue_type_t;
};
typedef struct _hsa_signal_s
struct _hsa_signal_t
{
uint64_t handle;
} _hsa_signal_t;
};
typedef struct _hsa_queue_s
struct _hsa_queue_t
{
_hsa_queue_type_t type;
uint32_t features;
@@ -59,11 +59,11 @@ typedef struct _hsa_queue_s
uint32_t size;
uint32_t reserved1;
uint64_t id;
} _hsa_queue_t;
};
typedef uint32_t _amd_queue_properties32_t;
typedef struct _amd_queue_s
struct _amd_queue_t
{
_hsa_queue_t hsa_queue;
uint32_t reserved1[4];
@@ -88,7 +88,7 @@ typedef struct _amd_queue_s
uint32_t reserved3[2];
_hsa_signal_t queue_inactive_signal;
uint32_t reserved4[14];
} _amd_queue_t;
};
} // namespace gem5

View File

@@ -69,12 +69,12 @@ class ChunkGenerator;
#define PRD_COUNT_MASK 0xfffe
#define PRD_EOT_MASK 0x8000
typedef struct PrdEntry
struct PrdEntry_t
{
uint32_t baseAddr;
uint16_t byteCount;
uint16_t endOfTable;
} PrdEntry_t;
};
class PrdTableEntry
{
@@ -126,7 +126,7 @@ class PrdTableEntry
#define DEV0 (0)
#define DEV1 (1)
typedef struct CommandReg
struct CommandReg_t
{
uint16_t data;
uint8_t error;
@@ -140,9 +140,9 @@ typedef struct CommandReg
uint8_t head;
};
uint8_t command;
} CommandReg_t;
};
typedef enum Events
enum Events_t
{
None = 0,
Transfer,
@@ -151,9 +151,9 @@ typedef enum Events
PrdRead,
DmaRead,
DmaWrite
} Events_t;
};
typedef enum DevAction
enum DevAction_t
{
ACT_NONE = 0,
ACT_CMD_WRITE,
@@ -170,9 +170,9 @@ typedef enum DevAction
ACT_DMA_DONE,
ACT_SRST_SET,
ACT_SRST_CLEAR
} DevAction_t;
};
typedef enum DevState
enum DevState_t
{
// Device idle
Device_Idle_S = 0,
@@ -199,14 +199,14 @@ typedef enum DevState
Prepare_Data_Dma,
Transfer_Data_Dma,
Device_Dma_Abort
} DevState_t;
};
typedef enum DmaState
enum DmaState_t
{
Dma_Idle = 0,
Dma_Start,
Dma_Transfer
} DmaState_t;
};
class IdeController;

View File

@@ -64,7 +64,7 @@ class Linux : public OperatingSystem
/// Stat buffer. Note that we can't call it 'stat' since that
/// gets #defined to something else on some systems. This type
/// can be specialized by architecture specific "Linux" classes
typedef struct
struct tgt_stat
{
uint32_t st_dev; //!< device
uint32_t st_ino; //!< inode
@@ -82,10 +82,10 @@ class Linux : public OperatingSystem
int32_t st_blocks; //!< number of blocks allocated
uint32_t st_flags; //!< flags
uint32_t st_gen; //!< unknown
} tgt_stat;
};
// same for stat64
typedef struct
struct tgt_stat64
{
uint64_t st_dev;
uint64_t st_ino;
@@ -107,7 +107,7 @@ class Linux : public OperatingSystem
uint64_t st_ctimeX;
uint64_t st_ctime_nsec;
int64_t ___unused[3];
} tgt_stat64;
};
/// Length of strings in struct utsname (plus 1 for null char).
static const int _SYS_NMLN = 65;

View File

@@ -61,39 +61,39 @@ class OperatingSystem
static const int _SYS_NMLN = 65;
/// Interface struct for uname().
typedef struct
struct utsname
{
char sysname[_SYS_NMLN]; //!< System name.
char nodename[_SYS_NMLN]; //!< Node name.
char release[_SYS_NMLN]; //!< OS release.
char version[_SYS_NMLN]; //!< OS version.
char machine[_SYS_NMLN]; //!< Machine type.
} utsname;
};
/// Limit struct for getrlimit/setrlimit.
typedef struct
struct rlimit
{
uint64_t rlim_cur; //!< soft limit
uint64_t rlim_max; //!< hard limit
} rlimit;
};
/// For gettimeofday().
typedef struct
struct timeval
{
int64_t tv_sec; //!< seconds
int64_t tv_usec; //!< microseconds
} timeval;
};
// For writev/readv
typedef struct
struct tgt_iovec
{
uint64_t iov_base; // void *
uint64_t iov_len;
} tgt_iovec;
};
/// For getrusage().
typedef struct
struct rusage
{
timeval ru_utime; //!< user time used
timeval ru_stime; //!< system time used
@@ -111,7 +111,7 @@ class OperatingSystem
int64_t ru_nsignals; //!< signals received
int64_t ru_nvcsw; //!< voluntary context switches
int64_t ru_nivcsw; //!< involuntary "
} rusage;
};
static int openSpecialFile(std::string path, Process *process,
ThreadContext *tc);

View File

@@ -67,7 +67,7 @@ class Solaris : public OperatingSystem
/// Stat buffer. Note that we can't call it 'stat' since that
/// gets #defined to something else on some systems.
typedef struct
struct tgt_stat
{
uint64_t st_dev; //!< device
uint64_t st_ino; //!< inode
@@ -84,10 +84,10 @@ class Solaris : public OperatingSystem
int32_t st_blksize; //!< optimal I/O block size
int64_t st_blocks; //!< number of blocks allocated
char st_fstype[16];
} tgt_stat;
};
// same for stat64
typedef struct
struct tgt_stat64
{
uint64_t st_dev; //!< device
uint64_t st_ino; //!< inode
@@ -104,20 +104,20 @@ class Solaris : public OperatingSystem
int32_t st_blksize; //!< optimal I/O block size
int64_t st_blocks; //!< number of blocks allocated
char st_fstype[16];
} tgt_stat64;
};
/// Length of strings in struct utsname (plus 1 for null char).
static const int _SYS_NMLN = 257;
/// Interface struct for uname().
typedef struct utsname
struct utsname
{
char sysname[_SYS_NMLN]; //!< System name.
char nodename[_SYS_NMLN]; //!< Node name.
char release[_SYS_NMLN]; //!< OS release.
char version[_SYS_NMLN]; //!< OS version.
char machine[_SYS_NMLN]; //!< Machine type.
} utsname;
};
// for *at syscalls
static const int TGT_AT_FDCWD = -100;

View File

@@ -85,10 +85,10 @@ class BaseDelta : public DictionaryCompressor<BaseType>
* These are used as indexes to reference the pattern data. If a new
* pattern is added, it must be done before NUM_PATTERNS.
*/
typedef enum
enum PatternNumber
{
X, M, NUM_PATTERNS
} PatternNumber;
};
uint64_t getNumPatterns() const override { return NUM_PATTERNS; }

View File

@@ -69,10 +69,10 @@ class CPack : public DictionaryCompressor<uint32_t>
* These are used as indexes to reference the pattern data. If a new
* pattern is added, it must be done before NUM_PATTERNS.
*/
typedef enum
enum PatternNumber
{
ZZZZ, XXXX, MMMM, MMXX, ZZZX, MMMX, NUM_PATTERNS
} PatternNumber;
};
/**
* Convenience factory declaration. The templates must be organized by

View File

@@ -80,13 +80,13 @@ class FPC : public DictionaryCompressor<uint32_t>
* The possible patterns. If a new pattern is added, it must be done
* before NUM_PATTERNS.
*/
typedef enum
enum PatternNumber
{
ZERO_RUN, SIGN_EXTENDED_4_BITS, SIGN_EXTENDED_1_BYTE,
SIGN_EXTENDED_HALFWORD, ZERO_PADDED_HALFWORD,
SIGN_EXTENDED_TWO_HALFWORDS, REP_BYTES, UNCOMPRESSED,
NUM_PATTERNS
} PatternNumber;
};
/**
* Number of bits of the zero run size bitfield. If the size of the

View File

@@ -97,12 +97,12 @@ class FPCD : public DictionaryCompressor<uint32_t>
* These are used as indexes to reference the pattern data. If a new
* pattern is added, it must be done before NUM_PATTERNS.
*/
typedef enum
enum PatternNumber
{
ZZZZ, FFFF, MMMMPenultimate, MMMMPrevious, ZZZX, XZZZ, RRRR,
MMMXPenultimate, MMMXPrevious, ZZXX, ZXZX, FFXX, XXZZ,
MMXXPenultimate, MMXXPrevious, XXXX, NUM_PATTERNS
} PatternNumber;
};
/**
* Convenience factory declaration. The templates must be organized by

View File

@@ -65,10 +65,10 @@ class RepeatedQwords : public DictionaryCompressor<uint64_t>
* These are used as indexes to reference the pattern data. If a new
* pattern is added, it must be done before NUM_PATTERNS.
*/
typedef enum
enum PatternNumber
{
X, M, NUM_PATTERNS
} PatternNumber;
};
/**
* Convenience factory declaration. The templates must be organized by

View File

@@ -65,10 +65,10 @@ class Zero : public DictionaryCompressor<uint64_t>
* These are used as indexes to reference the pattern data. If a new
* pattern is added, it must be done before NUM_PATTERNS.
*/
typedef enum
enum PatternNumber
{
X, Z, NUM_PATTERNS
} PatternNumber;
};
/**
* Convenience factory declaration. The templates must be organized by