Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 062beb6

Browse files
anntzertacaswell
authored andcommitted
Remove semicolon after PyObject_HEAD. (#8925)
MNT: c++ cleanup See https://docs.python.org/3/extending/newtypes.html#the-basics: > Note that there is no semicolon after the PyObject_HEAD macro; one is included in the macro definition. Be wary of adding one by accident; it’s easy to do from habit, and your compiler might not complain, but someone else’s probably will! Also move a FT2Font *x; declaration to its own line (that was the original motivation).
1 parent a5c2e20 commit 062beb6

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

lib/matplotlib/tri/_tri_wrapper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
typedef struct
99
{
10-
PyObject_HEAD;
10+
PyObject_HEAD
1111
Triangulation* ptr;
1212
} PyTriangulation;
1313

@@ -216,7 +216,7 @@ static PyTypeObject* PyTriangulation_init_type(PyObject* m, PyTypeObject* type)
216216

217217
typedef struct
218218
{
219-
PyObject_HEAD;
219+
PyObject_HEAD
220220
TriContourGenerator* ptr;
221221
PyTriangulation* py_triangulation;
222222
} PyTriContourGenerator;
@@ -351,7 +351,7 @@ static PyTypeObject* PyTriContourGenerator_init_type(PyObject* m, PyTypeObject*
351351

352352
typedef struct
353353
{
354-
PyObject_HEAD;
354+
PyObject_HEAD
355355
TrapezoidMapTriFinder* ptr;
356356
PyTriangulation* py_triangulation;
357357
} PyTrapezoidMapTriFinder;

src/_backend_agg_wrapper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
typedef struct
66
{
7-
PyObject_HEAD;
7+
PyObject_HEAD
88
RendererAgg *x;
99
Py_ssize_t shape[3];
1010
Py_ssize_t strides[3];
@@ -13,7 +13,7 @@ typedef struct
1313

1414
typedef struct
1515
{
16-
PyObject_HEAD;
16+
PyObject_HEAD
1717
BufferRegion *x;
1818
Py_ssize_t shape[3];
1919
Py_ssize_t strides[3];

src/_contour_wrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
typedef struct
88
{
9-
PyObject_HEAD;
9+
PyObject_HEAD
1010
QuadContourGenerator* ptr;
1111
} PyQuadContourGenerator;
1212

src/_tkagg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
typedef struct
2828
{
29-
PyObject_HEAD;
29+
PyObject_HEAD
3030
Tcl_Interp *interp;
3131
} TkappObject;
3232

src/ft2font_wrapper.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static PyObject *convert_xys_to_array(std::vector<double> &xys)
2626

2727
typedef struct
2828
{
29-
PyObject_HEAD;
29+
PyObject_HEAD
3030
FT2Image *x;
3131
Py_ssize_t shape[2];
3232
Py_ssize_t strides[2];
@@ -229,7 +229,7 @@ static PyTypeObject *PyFT2Image_init_type(PyObject *m, PyTypeObject *type)
229229

230230
typedef struct
231231
{
232-
PyObject_HEAD;
232+
PyObject_HEAD
233233
size_t glyphInd;
234234
long width;
235235
long height;
@@ -323,7 +323,8 @@ static PyTypeObject *PyGlyph_init_type(PyObject *m, PyTypeObject *type)
323323

324324
typedef struct
325325
{
326-
PyObject_HEAD FT2Font *x;
326+
PyObject_HEAD
327+
FT2Font *x;
327328
PyObject *fname;
328329
PyObject *py_file;
329330
FILE *fp;

0 commit comments

Comments
 (0)