diff --git a/bsputil/bsputil.cc b/bsputil/bsputil.cc index d4637ef0..ff1fbbe0 100644 --- a/bsputil/bsputil.cc +++ b/bsputil/bsputil.cc @@ -38,13 +38,13 @@ #include /* FIXME - share header with qbsp, etc. */ -typedef struct { +struct wadinfo_t { char identification[4]; // should be WAD2 int32_t numlumps; int32_t infotableofs; -} wadinfo_t; +}; -typedef struct { +struct lumpinfo_t { int32_t filepos; int32_t disksize; int32_t size; // uncompressed @@ -52,7 +52,7 @@ typedef struct { char compression; char pad1, pad2; char name[16]; // must be null terminated -} lumpinfo_t; +}; static void ExportWad(FILE *wadfile, mbsp_t *bsp) diff --git a/common/bspfile.cc b/common/bspfile.cc index b55d4273..35e882bc 100644 --- a/common/bspfile.cc +++ b/common/bspfile.cc @@ -501,7 +501,7 @@ BSPVersionSupported(int32_t ident, int32_t version, const bspversion_t **out_ver * ========================================================================= */ -typedef enum { TO_DISK, TO_CPU } swaptype_t; +enum swaptype_t : bool { TO_DISK, TO_CPU }; static void SwapBSPVertexes(int numvertexes, dvertex_t *verticies) @@ -3906,7 +3906,7 @@ LoadBSPFile(char *filename, bspdata_t *bspdata) /* ========================================================================= */ -typedef struct { +struct bspfile_t { const bspversion_t *version; // which one is used depends on version @@ -3916,7 +3916,7 @@ typedef struct { }; FILE *file; -} bspfile_t; +}; static void AddLump(bspfile_t *bspfile, int lumpnum, const void *data, int count) diff --git a/common/cmdlib.cc b/common/cmdlib.cc index 5e99061e..dc8527ef 100644 --- a/common/cmdlib.cc +++ b/common/cmdlib.cc @@ -588,16 +588,17 @@ SafeWrite(FILE *f, const void *buffer, int count) Error("File write failure"); } -typedef struct { - char magic[4]; - unsigned int tableofs; - unsigned int numfiles; -} pakheader_t; -typedef struct { - char name[56]; - unsigned int offset; - unsigned int length; -} pakfile_t; +struct pakheader_t { + char magic[4]; + unsigned int tableofs; + unsigned int numfiles; +}; + +struct pakfile_t { + char name[56]; + unsigned int offset; + unsigned int length; +}; /* * ============== diff --git a/include/common/bspfile.hh b/include/common/bspfile.hh index 0705330f..ad31b1c9 100644 --- a/include/common/bspfile.hh +++ b/include/common/bspfile.hh @@ -62,10 +62,10 @@ #define Q2_BSPVERSION 38 #define Q2_QBISMIDENT (('P'<<24)+('S'<<16)+('B'<<8)+'Q') -typedef struct { +struct lump_t { int32_t fileofs; int32_t filelen; -} lump_t; +}; #define LUMP_ENTITIES 0 #define LUMP_PLANES 1 @@ -106,15 +106,16 @@ typedef struct { #define Q2_LUMP_AREAPORTALS 18 #define Q2_HEADER_LUMPS 19 -typedef struct { +struct bspx_header_t { char id[4]; //'BSPX' uint32_t numlumps; -} bspx_header_t; -typedef struct { +}; + +struct bspx_lump_t { char lumpname[24]; uint32_t fileofs; uint32_t filelen; -} bspx_lump_t; +}; typedef struct { const char *name; diff --git a/include/qbsp/brush.hh b/include/qbsp/brush.hh index 02aed889..f19bf88c 100644 --- a/include/qbsp/brush.hh +++ b/include/qbsp/brush.hh @@ -24,13 +24,13 @@ #include -typedef struct brush_s { +struct brush_t { struct brush_s *next; vec3_t mins, maxs; face_t *faces; contentflags_t contents; /* BSP contents */ short lmshift; /* lightmap scaling (qu/lightmap pixel), passed to the light util */ -} brush_t; +}; class mapbrush_t;