Cleanup: add semicolon after PyObject_VAR_HEAD

clang-format doesn't expand macros,
add semicolon to prevent misleading formatting.
This commit is contained in:
2019-05-03 12:26:29 +10:00
parent b8226a3ae1
commit a01bcfa636
14 changed files with 63 additions and 37 deletions

View File

@@ -54,38 +54,45 @@ extern PyTypeObject BPy_BMIter_Type;
/* cast from _any_ bmesh type - they all have BMesh first */ /* cast from _any_ bmesh type - they all have BMesh first */
typedef struct BPy_BMGeneric { typedef struct BPy_BMGeneric {
PyObject_VAR_HEAD struct BMesh *bm; /* keep first */ PyObject_VAR_HEAD;
struct BMesh *bm; /* keep first */
} BPy_BMGeneric; } BPy_BMGeneric;
/* BPy_BMVert/BPy_BMEdge/BPy_BMFace/BPy_BMLoop can cast to this */ /* BPy_BMVert/BPy_BMEdge/BPy_BMFace/BPy_BMLoop can cast to this */
typedef struct BPy_BMElem { typedef struct BPy_BMElem {
PyObject_VAR_HEAD struct BMesh *bm; /* keep first */ PyObject_VAR_HEAD;
struct BMesh *bm; /* keep first */
struct BMElem *ele; struct BMElem *ele;
} BPy_BMElem; } BPy_BMElem;
typedef struct BPy_BMesh { typedef struct BPy_BMesh {
PyObject_VAR_HEAD struct BMesh *bm; /* keep first */ PyObject_VAR_HEAD;
struct BMesh *bm; /* keep first */
int flag; int flag;
} BPy_BMesh; } BPy_BMesh;
/* element types */ /* element types */
typedef struct BPy_BMVert { typedef struct BPy_BMVert {
PyObject_VAR_HEAD struct BMesh *bm; /* keep first */ PyObject_VAR_HEAD;
struct BMesh *bm; /* keep first */
struct BMVert *v; struct BMVert *v;
} BPy_BMVert; } BPy_BMVert;
typedef struct BPy_BMEdge { typedef struct BPy_BMEdge {
PyObject_VAR_HEAD struct BMesh *bm; /* keep first */ PyObject_VAR_HEAD;
struct BMesh *bm; /* keep first */
struct BMEdge *e; struct BMEdge *e;
} BPy_BMEdge; } BPy_BMEdge;
typedef struct BPy_BMFace { typedef struct BPy_BMFace {
PyObject_VAR_HEAD struct BMesh *bm; /* keep first */ PyObject_VAR_HEAD;
struct BMesh *bm; /* keep first */
struct BMFace *f; struct BMFace *f;
} BPy_BMFace; } BPy_BMFace;
typedef struct BPy_BMLoop { typedef struct BPy_BMLoop {
PyObject_VAR_HEAD struct BMesh *bm; /* keep first */ PyObject_VAR_HEAD;
struct BMesh *bm; /* keep first */
struct BMLoop *l; struct BMLoop *l;
} BPy_BMLoop; } BPy_BMLoop;
@@ -99,7 +106,8 @@ typedef struct BPy_BMLoop {
* - BPy_BMLoopSeq_Type * - BPy_BMLoopSeq_Type
*/ */
typedef struct BPy_BMElemSeq { typedef struct BPy_BMElemSeq {
PyObject_VAR_HEAD struct BMesh *bm; /* keep first */ PyObject_VAR_HEAD;
struct BMesh *bm; /* keep first */
/* if this is a sequence on an existing element, /* if this is a sequence on an existing element,
* loops of faces for eg. * loops of faces for eg.
@@ -115,7 +123,8 @@ typedef struct BPy_BMElemSeq {
} BPy_BMElemSeq; } BPy_BMElemSeq;
typedef struct BPy_BMIter { typedef struct BPy_BMIter {
PyObject_VAR_HEAD struct BMesh *bm; /* keep first */ PyObject_VAR_HEAD;
struct BMesh *bm; /* keep first */
BMIter iter; BMIter iter;
} BPy_BMIter; } BPy_BMIter;

View File

@@ -39,20 +39,23 @@ extern PyTypeObject BPy_BMLayerItem_Type;
/* all layers for vert/edge/face/loop */ /* all layers for vert/edge/face/loop */
typedef struct BPy_BMLayerAccess { typedef struct BPy_BMLayerAccess {
PyObject_VAR_HEAD struct BMesh *bm; /* keep first */ PyObject_VAR_HEAD;
struct BMesh *bm; /* keep first */
char htype; char htype;
} BPy_BMLayerAccess; } BPy_BMLayerAccess;
/* access different layer types deform/uv/vertexcolor */ /* access different layer types deform/uv/vertexcolor */
typedef struct BPy_BMLayerCollection { typedef struct BPy_BMLayerCollection {
PyObject_VAR_HEAD struct BMesh *bm; /* keep first */ PyObject_VAR_HEAD;
struct BMesh *bm; /* keep first */
char htype; char htype;
int type; /* customdata type - CD_XXX */ int type; /* customdata type - CD_XXX */
} BPy_BMLayerCollection; } BPy_BMLayerCollection;
/* access a specific layer directly */ /* access a specific layer directly */
typedef struct BPy_BMLayerItem { typedef struct BPy_BMLayerItem {
PyObject_VAR_HEAD struct BMesh *bm; /* keep first */ PyObject_VAR_HEAD;
struct BMesh *bm; /* keep first */
char htype; char htype;
int type; /* customdata type - CD_XXX */ int type; /* customdata type - CD_XXX */
int index; /* index of this layer type */ int index; /* index of this layer type */

View File

@@ -48,7 +48,8 @@
#define BPy_BMLoopUV_Check(v) (Py_TYPE(v) == &BPy_BMLoopUV_Type) #define BPy_BMLoopUV_Check(v) (Py_TYPE(v) == &BPy_BMLoopUV_Type)
typedef struct BPy_BMLoopUV { typedef struct BPy_BMLoopUV {
PyObject_VAR_HEAD MLoopUV *data; PyObject_VAR_HEAD;
MLoopUV *data;
} BPy_BMLoopUV; } BPy_BMLoopUV;
PyDoc_STRVAR(bpy_bmloopuv_uv_doc, PyDoc_STRVAR(bpy_bmloopuv_uv_doc,
@@ -167,7 +168,8 @@ PyObject *BPy_BMLoopUV_CreatePyObject(struct MLoopUV *mloopuv)
#define BPy_BMVertSkin_Check(v) (Py_TYPE(v) == &BPy_BMVertSkin_Type) #define BPy_BMVertSkin_Check(v) (Py_TYPE(v) == &BPy_BMVertSkin_Type)
typedef struct BPy_BMVertSkin { typedef struct BPy_BMVertSkin {
PyObject_VAR_HEAD MVertSkin *data; PyObject_VAR_HEAD;
MVertSkin *data;
} BPy_BMVertSkin; } BPy_BMVertSkin;
PyDoc_STRVAR(bpy_bmvertskin_radius_doc, PyDoc_STRVAR(bpy_bmvertskin_radius_doc,
@@ -405,7 +407,8 @@ PyObject *BPy_BMLoopColor_CreatePyObject(struct MLoopCol *data)
#define BPy_BMDeformVert_Check(v) (Py_TYPE(v) == &BPy_BMDeformVert_Type) #define BPy_BMDeformVert_Check(v) (Py_TYPE(v) == &BPy_BMDeformVert_Type)
typedef struct BPy_BMDeformVert { typedef struct BPy_BMDeformVert {
PyObject_VAR_HEAD MDeformVert *data; PyObject_VAR_HEAD;
MDeformVert *data;
} BPy_BMDeformVert; } BPy_BMDeformVert;
/* Mapping Protocols /* Mapping Protocols

View File

@@ -30,7 +30,8 @@ extern PyTypeObject BPy_BMDeformVert_Type;
#define BPy_BMLoopUV_Check(v) (Py_TYPE(v) == &BPy_BMLoopUV_Type) #define BPy_BMLoopUV_Check(v) (Py_TYPE(v) == &BPy_BMLoopUV_Type)
typedef struct BPy_BMGenericMeshData { typedef struct BPy_BMGenericMeshData {
PyObject_VAR_HEAD void *data; PyObject_VAR_HEAD;
void *data;
} BPy_BMGenericMeshData; } BPy_BMGenericMeshData;
struct MDeformVert; struct MDeformVert;

View File

@@ -33,11 +33,13 @@ extern PyTypeObject BPy_BMEditSelIter_Type;
#define BPy_BMSelectHistoryIter_Check(v) (Py_TYPE(v) == &BPy_BMEditSelIter_Type) #define BPy_BMSelectHistoryIter_Check(v) (Py_TYPE(v) == &BPy_BMEditSelIter_Type)
typedef struct BPy_BMEditSelSeq { typedef struct BPy_BMEditSelSeq {
PyObject_VAR_HEAD struct BMesh *bm; /* keep first */ PyObject_VAR_HEAD;
struct BMesh *bm; /* keep first */
} BPy_BMEditSelSeq; } BPy_BMEditSelSeq;
typedef struct BPy_BMEditSelIter { typedef struct BPy_BMEditSelIter {
PyObject_VAR_HEAD struct BMesh *bm; /* keep first */ PyObject_VAR_HEAD;
struct BMesh *bm; /* keep first */
struct BMEditSelection *ese; struct BMEditSelection *ese;
} BPy_BMEditSelIter; } BPy_BMEditSelIter;

View File

@@ -33,7 +33,8 @@ int BGL_typeSize(int type);
* For Python access to OpenGL functions requiring a pointer. * For Python access to OpenGL functions requiring a pointer.
*/ */
typedef struct _Buffer { typedef struct _Buffer {
PyObject_VAR_HEAD PyObject *parent; PyObject_VAR_HEAD;
PyObject *parent;
int type; /* GL_BYTE, GL_SHORT, GL_INT, GL_FLOAT */ int type; /* GL_BYTE, GL_SHORT, GL_INT, GL_FLOAT */
int ndimensions; int ndimensions;

View File

@@ -37,19 +37,22 @@ extern PyTypeObject BPy_IDGroup_Type;
#define BPy_IDGroup_CheckExact(v) (Py_TYPE(v) == &BPy_IDGroup_Type) #define BPy_IDGroup_CheckExact(v) (Py_TYPE(v) == &BPy_IDGroup_Type)
typedef struct BPy_IDProperty { typedef struct BPy_IDProperty {
PyObject_VAR_HEAD struct ID *id; /* can be NULL */ PyObject_VAR_HEAD;
struct IDProperty *prop; /* must be second member */ struct ID *id; /* can be NULL */
struct IDProperty *prop; /* must be second member */
struct IDProperty *parent; struct IDProperty *parent;
PyObject *data_wrap; PyObject *data_wrap;
} BPy_IDProperty; } BPy_IDProperty;
typedef struct BPy_IDArray { typedef struct BPy_IDArray {
PyObject_VAR_HEAD struct ID *id; /* can be NULL */ PyObject_VAR_HEAD;
struct IDProperty *prop; /* must be second member */ struct ID *id; /* can be NULL */
struct IDProperty *prop; /* must be second member */
} BPy_IDArray; } BPy_IDArray;
typedef struct BPy_IDGroup_Iter { typedef struct BPy_IDGroup_Iter {
PyObject_VAR_HEAD BPy_IDProperty *group; PyObject_VAR_HEAD;
BPy_IDProperty *group;
struct IDProperty *cur; struct IDProperty *cur;
int mode; int mode;
} BPy_IDGroup_Iter; } BPy_IDGroup_Iter;

View File

@@ -46,9 +46,9 @@ static PyObject *Py_ImBuf_CreatePyObject(ImBuf *ibuf);
* \{ */ * \{ */
typedef struct Py_ImBuf { typedef struct Py_ImBuf {
PyObject_VAR_HEAD PyObject_VAR_HEAD;
/* can be NULL */ /* can be NULL */
ImBuf *ibuf; ImBuf *ibuf;
} Py_ImBuf; } Py_ImBuf;
static int py_imbuf_valid_check(Py_ImBuf *self) static int py_imbuf_valid_check(Py_ImBuf *self)

View File

@@ -30,9 +30,9 @@ extern PyTypeObject BPyGPUBatch_Type;
#define BPyGPUBatch_Check(v) (Py_TYPE(v) == &BPyGPUBatch_Type) #define BPyGPUBatch_Check(v) (Py_TYPE(v) == &BPyGPUBatch_Type)
typedef struct BPyGPUBatch { typedef struct BPyGPUBatch {
PyObject_VAR_HEAD PyObject_VAR_HEAD;
/* The batch is owned, we may support thin wrapped batches later. */ /* The batch is owned, we may support thin wrapped batches later. */
struct GPUBatch *batch; struct GPUBatch *batch;
#ifdef USE_GPU_PY_REFERENCES #ifdef USE_GPU_PY_REFERENCES
/* Just to keep a user to prevent freeing buf's we're using */ /* Just to keep a user to prevent freeing buf's we're using */
PyObject *references; PyObject *references;

View File

@@ -26,7 +26,8 @@ extern PyTypeObject BPyGPUIndexBuf_Type;
#define BPyGPUIndexBuf_Check(v) (Py_TYPE(v) == &BPyGPUIndexBuf_Type) #define BPyGPUIndexBuf_Check(v) (Py_TYPE(v) == &BPyGPUIndexBuf_Type)
typedef struct BPyGPUIndexBuf { typedef struct BPyGPUIndexBuf {
PyObject_VAR_HEAD struct GPUIndexBuf *elem; PyObject_VAR_HEAD;
struct GPUIndexBuf *elem;
} BPyGPUIndexBuf; } BPyGPUIndexBuf;
PyObject *BPyGPUIndexBuf_CreatePyObject(struct GPUIndexBuf *elem); PyObject *BPyGPUIndexBuf_CreatePyObject(struct GPUIndexBuf *elem);

View File

@@ -26,7 +26,8 @@ extern PyTypeObject BPyGPUShader_Type;
#define BPyGPUShader_Check(v) (Py_TYPE(v) == &BPyGPUShader_Type) #define BPyGPUShader_Check(v) (Py_TYPE(v) == &BPyGPUShader_Type)
typedef struct BPyGPUShader { typedef struct BPyGPUShader {
PyObject_VAR_HEAD struct GPUShader *shader; PyObject_VAR_HEAD;
struct GPUShader *shader;
bool is_builtin; bool is_builtin;
} BPyGPUShader; } BPyGPUShader;

View File

@@ -28,9 +28,9 @@ extern PyTypeObject BPyGPUVertBuf_Type;
#define BPyGPUVertBuf_Check(v) (Py_TYPE(v) == &BPyGPUVertBuf_Type) #define BPyGPUVertBuf_Check(v) (Py_TYPE(v) == &BPyGPUVertBuf_Type)
typedef struct BPyGPUVertBuf { typedef struct BPyGPUVertBuf {
PyObject_VAR_HEAD PyObject_VAR_HEAD;
/* The buf is owned, we may support thin wrapped batches later. */ /* The buf is owned, we may support thin wrapped batches later. */
struct GPUVertBuf *buf; struct GPUVertBuf *buf;
} BPyGPUVertBuf; } BPyGPUVertBuf;
PyObject *BPyGPUVertBuf_CreatePyObject(struct GPUVertBuf *vbo) ATTR_NONNULL(1); PyObject *BPyGPUVertBuf_CreatePyObject(struct GPUVertBuf *vbo) ATTR_NONNULL(1);

View File

@@ -28,7 +28,8 @@ extern PyTypeObject BPyGPUVertFormat_Type;
#define BPyGPUVertFormat_Check(v) (Py_TYPE(v) == &BPyGPUVertFormat_Type) #define BPyGPUVertFormat_Check(v) (Py_TYPE(v) == &BPyGPUVertFormat_Type)
typedef struct BPyGPUVertFormat { typedef struct BPyGPUVertFormat {
PyObject_VAR_HEAD struct GPUVertFormat fmt; PyObject_VAR_HEAD;
struct GPUVertFormat fmt;
} BPyGPUVertFormat; } BPyGPUVertFormat;
PyObject *BPyGPUVertFormat_CreatePyObject(struct GPUVertFormat *fmt); PyObject *BPyGPUVertFormat_CreatePyObject(struct GPUVertFormat *fmt);

View File

@@ -53,7 +53,8 @@ enum {
#define BASE_MATH_MEMBERS(_data) \ #define BASE_MATH_MEMBERS(_data) \
/** Array of data (alias), wrapped status depends on wrapped status. */ \ /** Array of data (alias), wrapped status depends on wrapped status. */ \
PyObject_VAR_HEAD float *_data; \ PyObject_VAR_HEAD; \
float *_data; \
/** If this vector references another object, otherwise NULL, *Note* this owns its reference */ \ /** If this vector references another object, otherwise NULL, *Note* this owns its reference */ \
PyObject *cb_user; \ PyObject *cb_user; \
/** Which user funcs do we adhere to, RNA, etc */ \ /** Which user funcs do we adhere to, RNA, etc */ \