8000 Merge pull request #5285 from mdboom/compiler-warnings · matplotlib/matplotlib@b7c76c5 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b7c76c5

Browse files
committed
Merge pull request #5285 from mdboom/compiler-warnings
Fix some compiler warnings
1 parent f03a5b3 commit b7c76c5

9 files changed

+27
-63
lines changed

lib/matplotlib/delaunay/VoronoiDiagramGenerator.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -766,9 +766,8 @@ void VoronoiDiagramGenerator::out_vertex(struct Site *v)
766766

767767
void VoronoiDiagramGenerator::out_site(struct Site *s)
768768
{
769-
if(!triangulate & plot & !debug)
769+
if(!triangulate && plot && !debug)
770770
circle (s->coord.x, s->coord.y, cradius);
771-
772771
}
773772

774773

@@ -932,7 +931,10 @@ bool VoronoiDiagramGenerator::voronoi(int triangulate)
932931

933932
if(!retval)
934933
return false;
935-
934+
935+
newintstar.x = 0;
936+
newintstar.y = 0;
937+
936938
newsite = nextone();
937939
while(1)
938940
{

lib/matplotlib/tri/_tri_wrapper.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -478,20 +478,12 @@ static PyTypeObject* PyTrapezoidMapTriFinder_init_type(PyObject* m, PyTypeObject
478478

479479
extern "C" {
480480

481-
struct module_state
482-
{
483-
/* The Sun compiler can't handle empty structs */
484-
#if defined(__SUNPRO_C) || defined(_MSC_VER)
485-
int _dummy;
486-
#endif
487-
};
488-
489481
#if PY3K
490482
static struct PyModuleDef moduledef = {
491483
PyModuleDef_HEAD_INIT,
492484
"_tri",
493485
NULL,
494-
sizeof(struct module_state),
486+
0,
495487
NULL,
496488
NULL,
497489
NULL,

src/_backend_agg_wrapper.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -725,17 +725,12 @@ static PyTypeObject *PyRendererAgg_init_type(PyObject *m, PyTypeObject *type)
725725

726726
extern "C" {
727727

728-
struct module_state
729-
{
730-
int _dummy;
731-
};
732-
733728
#if PY3K
734729
static struct PyModuleDef moduledef = {
735730
PyModuleDef_HEAD_INIT,
736731
"_backend_agg",
737732
NULL,
738-
sizeof(struct module_state),
733+
0,
739734
NULL,
740735
NULL,
741736
NULL,

src/_contour_wrapper.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,20 +138,12 @@ static PyTypeObject* PyQuadContourGenerator_init_type(PyObject* m, PyTypeObject*
138138

139139
extern "C" {
140140

141-
struct module_state
142-
{
143-
/* The Sun compiler can't handle empty structs */
144-
#if defined(__SUNPRO_C) || defined(_MSC_VER)
145-
int _dummy;
146-
#endif
147-
};
148-
149141
#if PY3K
150142
static struct PyModuleDef moduledef = {
151143
PyModuleDef_HEAD_INIT,
152144
"_contour",
153145
NULL,
154-
sizeof(struct module_state),
146+
0,
155147
NULL,
156148
NULL,
157149
NULL,

src/_gtkagg.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,12 @@ static PyMethodDef module_methods[] = {
108108

109109
extern "C" {
110110

111-
struct module_state
112-
{
113-
int _dummy;
114-
};
115-
116111
#if PY3K
117112
static struct PyModuleDef moduledef = {
118113
PyModuleDef_HEAD_INIT,
119114
"_gtkagg",
120115
NULL,
121-
sizeof(struct module_state),
116+
0,
122117
module_methods,
123118
NULL,
124119
NULL,

src/_image_wrapper.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -728,17 +728,12 @@ static PyMethodDef module_functions[] = {
728728

729729
extern "C" {
730730

731-
struct module_state
732-
{
733-
int _dummy;
734-
};
735-
736731
#if PY3K
737732
static struct PyModuleDef moduledef = {
738733
PyModuleDef_HEAD_INIT,
739734
"_image",
740735
NULL,
741-
sizeof(struct module_state),
736+
0,
742737
module_functions,
743738
NULL,
744739
NULL,

src/_path_wrapper.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static PyObject *Py_points_in_path(PyObject *self, PyObject *args, PyObject *kwd
7979
return NULL;
8080
}
8181

82-
npy_intp dims[] = { points.size() };
82+
npy_intp dims[] = { (npy_intp)points.size() };
8383
numpy::array_view<bool, 1> results(dims);
8484

8585
CALL_CPP("points_in_path", (points_in_path(points, r, path, trans, results)));
@@ -138,7 +138,7 @@ static PyObject *Py_points_on_path(PyObject *self, PyObject *args, PyObject *kwd
138138
return NULL;
139139
}
140140

141-
npy_intp dims[] = { points.size() };
141+
npy_intp dims[] = { (npy_intp)points.size() };
142142
numpy::array_view<bool, 1> results(dims);
143143

144144
CALL_CPP("points_on_path", (points_on_path(points, r, path, trans, results)));
@@ -437,15 +437,15 @@ static PyObject *Py_affine_transform(PyObject *self, PyObject *args, PyObject *k
437437

438438
try {
439439
numpy::array_view<double, 2> vertices(vertices_obj);
440-
npy_intp dims[] = { vertices.size(), 2 };
440+
npy_intp dims[] = { (npy_intp)vertices.size(), 2 };
441441
numpy::array_view<double, 2> result(dims);
442442
CALL_CPP("affine_transform", (affine_transform_2d(vertices, trans, result)));
443443
return result.pyobj();
444444
} catch (py::exception) {
445445
PyErr_Clear();
446446
try {
447447
numpy::array_view<double, 1> vertices(vertices_obj);
448-
npy_intp dims[] = { vertices.size() };
448+
npy_intp dims[] = { (npy_intp)vertices.size() };
449449
numpy::array_view<double, 1> result(dims);
450450
CALL_CPP("affine_transform", (affine_transform_1d(vertices, trans, result)));
451451
return result.pyobj();
@@ -730,17 +730,12 @@ extern "C" {
730730
{NULL}
731731
};
732732

733-
struct module_state
734-
{
735-
int _dummy;
736-
};
737-
738733
#if PY3K
739734
static struct PyModuleDef moduledef = {
740735
PyModuleDef_HEAD_INIT,
741736
"_path",
742737
NULL,
743-
sizeof(struct module_state),
738+
0,
744739
module_functions,
745740
NULL,
746741
NULL,

src/_png.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -520,17 +520,12 @@ static PyMethodDef module_methods[] = {
520520

521521
extern "C" {
522522

523-
struct module_state
524-
{
525-
int _dummy;
526-
};
527-
528523
#if PY3K
529524
static struct PyModuleDef moduledef = {
530525
PyModuleDef_HEAD_INIT,
531526
"_png",
532527
NULL,
533-
sizeof(struct module_state),
528+
0,
534529
module_methods,
535530
NULL,
536531
NULL,

src/ft2font_wrapper.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,15 +1640,18 @@ static PyTypeObject *PyFT2Font_init_type(PyObject *m, PyTypeObject *type)
16401640

16411641
extern "C" {
16421642

1643-
struct module_state
1644-
{
1645-
int _dummy;
1646-
};
1647-
16481643
#if PY3K
1649-
static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, "ft2font", NULL,
1650-
sizeof(struct module_state), NULL, NULL,
1651-
NULL, NULL, NULL };
1644+
static struct PyModuleDef moduledef = {
1645+
PyModuleDef_HEAD_INIT,
1646+
"ft2font",
1647+
NULL,
1648+
0,
1649+
NULL,
1650+
NULL,
1651+
NULL,
1652+
NULL,
1653+
NULL
1654+
};
16521655

16531656
#define INITERROR return NULL
16541657

0 commit comments

Comments
 (0)
0