Get rid of anonymous struct typedefs

We are using C++14 where there is no reason for this and is banned in C++20 under P1766R1. MSVC generates a warning under C++14 as a reminder.
This commit is contained in:
Marek Roszko 2021-07-01 18:28:41 -04:00
parent d7271c9281
commit eff75b630f
13 changed files with 38 additions and 38 deletions

View File

@ -35,27 +35,27 @@
#include <vector> #include <vector>
typedef struct struct POLYSEGMENT
{ {
SFVEC2F m_Start; SFVEC2F m_Start;
float m_inv_JY_minus_IY = 0.0; float m_inv_JY_minus_IY = 0.0;
float m_JX_minus_IX = 0.0; float m_JX_minus_IX = 0.0;
} POLYSEGMENT; };
typedef struct struct SEG_NORMALS
{ {
SFVEC2F m_Start; SFVEC2F m_Start;
SFVEC2F m_End; SFVEC2F m_End;
} SEG_NORMALS; };
typedef struct struct SEGMENT_WITH_NORMALS
{ {
SFVEC2F m_Start; SFVEC2F m_Start;
SFVEC2F m_Precalc_slope; SFVEC2F m_Precalc_slope;
SEG_NORMALS m_Normals; SEG_NORMALS m_Normals;
} SEGMENT_WITH_NORMALS; };
typedef std::vector< POLYSEGMENT > SEGMENTS; typedef std::vector< POLYSEGMENT > SEGMENTS;
@ -75,11 +75,11 @@ typedef std::vector< SEGMENT_WITH_NORMALS > SEGMENTS_WIDTH_NORMALS;
* It can contain multiple closed polygons and holes and us used to test if points are inside. * It can contain multiple closed polygons and holes and us used to test if points are inside.
* A point will be inside the polygon if it is not inside a hole and it is inside an outer polygon. * A point will be inside the polygon if it is not inside a hole and it is inside an outer polygon.
*/ */
typedef struct struct OUTERS_AND_HOLES
{ {
std::vector<SEGMENTS> m_Outers; std::vector<SEGMENTS> m_Outers;
std::vector<SEGMENTS> m_Holes; std::vector<SEGMENTS> m_Holes;
} OUTERS_AND_HOLES; };
/** /**

View File

@ -75,12 +75,12 @@ enum class IMAGE_FILTER
}; };
/// 5x5 Filter struct parameters /// 5x5 Filter struct parameters
typedef struct struct S_FILTER
{ {
signed char kernel[5][5]; signed char kernel[5][5];
unsigned int div; unsigned int div;
unsigned char offset; unsigned char offset;
} S_FILTER; };
/** /**

View File

@ -60,14 +60,14 @@ class LIB_TEXT;
class wxXmlNode; class wxXmlNode;
typedef struct EAGLE_LIBRARY struct EAGLE_LIBRARY
{ {
wxString name; wxString name;
boost::ptr_map<wxString, LIB_SYMBOL> KiCadSymbols; boost::ptr_map<wxString, LIB_SYMBOL> KiCadSymbols;
std::unordered_map<wxString, wxXmlNode*> SymbolNodes; std::unordered_map<wxString, wxXmlNode*> SymbolNodes;
std::unordered_map<wxString, int> GateUnit; std::unordered_map<wxString, int> GateUnit;
std::unordered_map<wxString, wxString> package; std::unordered_map<wxString, wxString> package;
} EAGLE_LIBRARY; };
typedef boost::ptr_map<wxString, EPART> EPART_LIST; typedef boost::ptr_map<wxString, EPART> EPART_LIST;
@ -250,14 +250,14 @@ private:
std::vector<VECTOR2I> m_wireIntersections; std::vector<VECTOR2I> m_wireIntersections;
///< Wires and labels of a single connection (segment in Eagle nomenclature) ///< Wires and labels of a single connection (segment in Eagle nomenclature)
typedef struct SEG_DESC_STRUCT struct SEG_DESC
{ {
///< Test if a particular label is attached to any of the stored segments ///< Test if a particular label is attached to any of the stored segments
const SEG* LabelAttached( const SCH_TEXT* aLabel ) const; const SEG* LabelAttached( const SCH_TEXT* aLabel ) const;
std::vector<SCH_TEXT*> labels; std::vector<SCH_TEXT*> labels;
std::vector<SEG> segs; std::vector<SEG> segs;
} SEG_DESC; };
///< Segments representing wires for intersection checking ///< Segments representing wires for intersection checking
std::vector<SEG_DESC> m_segments; std::vector<SEG_DESC> m_segments;

View File

@ -59,11 +59,11 @@ public:
long GetFilePointer( const wxString& aFilePath, const unsigned char** aDest ); long GetFilePointer( const wxString& aFilePath, const unsigned char** aDest );
private: private:
typedef struct struct FILE_INFO
{ {
size_t offset; size_t offset;
size_t length; size_t length;
} FILE_INFO; };
/// Cache of file info for a given file path /// Cache of file info for a given file path
std::unordered_map<wxString, FILE_INFO> m_fileInfoCache; std::unordered_map<wxString, FILE_INFO> m_fileInfoCache;

View File

@ -118,12 +118,12 @@ protected:
} }
typedef uint32_t* BitmapPtr; typedef uint32_t* BitmapPtr;
typedef struct struct CAIRO_BUFFER
{ {
cairo_t* context; ///< Main texture handle cairo_t* context; ///< Main texture handle
cairo_surface_t* surface; ///< Point to which an image from texture is attached cairo_surface_t* surface; ///< Point to which an image from texture is attached
BitmapPtr bitmap; ///< Pixel storage BitmapPtr bitmap; ///< Pixel storage
} CAIRO_BUFFER; };
unsigned int m_current; ///< Currently used buffer handle unsigned int m_current; ///< Currently used buffer handle
typedef std::deque<CAIRO_BUFFER> CAIRO_BUFFERS; typedef std::deque<CAIRO_BUFFER> CAIRO_BUFFERS;

View File

@ -310,7 +310,7 @@ protected:
}; };
/// Type definition for an graphics group element /// Type definition for an graphics group element
typedef struct struct GROUP_ELEMENT
{ {
GRAPHICS_COMMAND m_Command; ///< Command to execute GRAPHICS_COMMAND m_Command; ///< Command to execute
union { union {
@ -319,7 +319,7 @@ protected:
int IntArg = 0; ///< An int argument int IntArg = 0; ///< An int argument
} m_Argument; } m_Argument;
cairo_path_t* m_CairoPath = nullptr; ///< Pointer to a Cairo path cairo_path_t* m_CairoPath = nullptr; ///< Pointer to a Cairo path
} GROUP_ELEMENT; };
typedef std::deque<GROUP_ELEMENT> GROUP; ///< A graphic group type definition typedef std::deque<GROUP_ELEMENT> GROUP; ///< A graphic group type definition

View File

@ -112,12 +112,12 @@ protected:
} }
// Buffers are simply textures storing a result of certain target rendering. // Buffers are simply textures storing a result of certain target rendering.
typedef struct struct OPENGL_BUFFER
{ {
VECTOR2U dimensions; VECTOR2U dimensions;
GLuint textureTarget; ///< Main texture handle GLuint textureTarget; ///< Main texture handle
GLuint attachmentPoint; ///< Point to which an image from texture is attached GLuint attachmentPoint; ///< Point to which an image from texture is attached
} OPENGL_BUFFER; };
bool m_initialized; ///< Initialization status flag bool m_initialized; ///< Initialization status flag
unsigned int m_curBuffer; ///< Currently used buffer handle unsigned int m_curBuffer; ///< Currently used buffer handle

View File

@ -279,14 +279,14 @@ public:
} }
///< Parameters passed to the GLU tesselator ///< Parameters passed to the GLU tesselator
typedef struct struct TessParams
{ {
/// Manager used for storing new vertices /// Manager used for storing new vertices
VERTEX_MANAGER* vboManager; VERTEX_MANAGER* vboManager;
/// Intersect points, that have to be freed after tessellation /// Intersect points, that have to be freed after tessellation
std::deque< boost::shared_array<GLdouble> >& intersectPoints; std::deque< boost::shared_array<GLdouble> >& intersectPoints;
} TessParams; };
private: private:
/// Super class definition /// Super class definition

View File

@ -34,7 +34,7 @@
#include "plugins/3dapi/xv3d_types.h" #include "plugins/3dapi/xv3d_types.h"
typedef struct struct SMATERIAL
{ {
SFVEC3F m_Ambient; // SFVEC3F m_Ambient; //
SFVEC3F m_Diffuse; ///< Default diffuse color if m_Color is NULL SFVEC3F m_Diffuse; ///< Default diffuse color if m_Color is NULL
@ -54,7 +54,7 @@ typedef struct
wxString m_Displacement; // disp wxString m_Displacement; // disp
wxString m_Alpha; // map_d wxString m_Alpha; // map_d
};*/ };*/
} SMATERIAL; };
/// Per-vertex normal/color/texcoors structure. /// Per-vertex normal/color/texcoors structure.
@ -73,7 +73,7 @@ typedef struct
/// To convert this units to pcbunits, use the conversion facto UNITS3D_TO_UNITSPCB /// To convert this units to pcbunits, use the conversion facto UNITS3D_TO_UNITSPCB
/// ///
/// m_Normals, m_Color and m_Texcoords are between 0.0f and 1.0f /// m_Normals, m_Color and m_Texcoords are between 0.0f and 1.0f
typedef struct struct SMESH
{ {
unsigned int m_VertexSize; ///< Number of vertex in the arrays unsigned int m_VertexSize; ///< Number of vertex in the arrays
SFVEC3F *m_Positions; ///< Vertex position array SFVEC3F *m_Positions; ///< Vertex position array
@ -83,17 +83,17 @@ typedef struct
unsigned int m_FaceIdxSize; ///< Number of elements of the m_FaceIdx array unsigned int m_FaceIdxSize; ///< Number of elements of the m_FaceIdx array
unsigned int *m_FaceIdx; ///< Triangle Face Indexes unsigned int *m_FaceIdx; ///< Triangle Face Indexes
unsigned int m_MaterialIdx; ///< Material Index to be used in this mesh (must be < m_MaterialsSize ) unsigned int m_MaterialIdx; ///< Material Index to be used in this mesh (must be < m_MaterialsSize )
} SMESH; };
/// Store the a model based on meshes and materials /// Store the a model based on meshes and materials
typedef struct struct S3DMODEL
{ {
unsigned int m_MeshesSize; ///< Number of meshes in the array unsigned int m_MeshesSize; ///< Number of meshes in the array
SMESH *m_Meshes; ///< The meshes list of this model SMESH *m_Meshes; ///< The meshes list of this model
unsigned int m_MaterialsSize; ///< Number of materials in the material array unsigned int m_MaterialsSize; ///< Number of materials in the material array
SMATERIAL *m_Materials; ///< The materials list of this model SMATERIAL *m_Materials; ///< The materials list of this model
} S3DMODEL; };
#endif // C3DMODEL_H #endif // C3DMODEL_H

View File

@ -183,7 +183,7 @@ public:
* SHAPE_POLY_SET object: the polygon index, the contour index relative to the polygon and * SHAPE_POLY_SET object: the polygon index, the contour index relative to the polygon and
* the vertex index relative the contour. * the vertex index relative the contour.
*/ */
typedef struct VERTEX_INDEX struct VERTEX_INDEX
{ {
int m_polygon; /*!< m_polygon is the index of the polygon. */ int m_polygon; /*!< m_polygon is the index of the polygon. */
int m_contour; /*!< m_contour is the index of the contour relative to the polygon. */ int m_contour; /*!< m_contour is the index of the contour relative to the polygon. */
@ -195,7 +195,7 @@ public:
m_vertex(-1) m_vertex(-1)
{ {
} }
} VERTEX_INDEX; };
/** /**
* Base class for iterating over all vertices in a given SHAPE_POLY_SET. * Base class for iterating over all vertices in a given SHAPE_POLY_SET.

View File

@ -367,13 +367,13 @@ private:
// We don't want to rely on group declarations being last in the file, so // We don't want to rely on group declarations being last in the file, so
// we store info about the group declarations here during parsing and then resolve // we store info about the group declarations here during parsing and then resolve
// them into BOARD_ITEM* after we've parsed the rest of the file. // them into BOARD_ITEM* after we've parsed the rest of the file.
typedef struct struct GROUP_INFO
{ {
BOARD_ITEM* parent; BOARD_ITEM* parent;
wxString name; wxString name;
KIID uuid; KIID uuid;
std::vector<KIID> memberUuids; std::vector<KIID> memberUuids;
} GROUP_INFO; };
std::vector<GROUP_INFO> m_groupInfos; std::vector<GROUP_INFO> m_groupInfos;
}; };

View File

@ -53,7 +53,7 @@ enum TTEXT_JUSTIFY
Right Right
}; };
typedef struct _TTEXTVALUE struct TTEXTVALUE
{ {
wxString text; wxString text;
int textPositionX, textPositionY, int textPositionX, textPositionY,
@ -64,7 +64,7 @@ typedef struct _TTEXTVALUE
bool isBold; bool isBold;
bool isItalic; bool isItalic;
bool isTrueType; bool isTrueType;
} TTEXTVALUE; };
extern wxString GetWord( wxString* aStr ); extern wxString GetWord( wxString* aStr );
extern XNODE* FindPinMap( XNODE* aNode ); extern XNODE* FindPinMap( XNODE* aNode );

View File

@ -41,12 +41,12 @@ enum LAYER_TYPE_T
LAYER_TYPE_PLANE LAYER_TYPE_PLANE
}; };
typedef struct _TLAYER struct TLAYER
{ {
PCB_LAYER_ID KiCadLayer; PCB_LAYER_ID KiCadLayer;
LAYER_TYPE_T layerType; LAYER_TYPE_T layerType;
wxString netNameRef; wxString netNameRef;
} TLAYER; };
namespace PCAD2KICAD namespace PCAD2KICAD
{ {