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

Skip to content

Commit 5266fea

Browse files
committed
Merge pull request #6189 from jenshnielsen/revertclangcleanup
Revert part of #6052
2 parents d7c478b + dca5e99 commit 5266fea

File tree

5 files changed

+11
-16
lines changed

5 files changed

+11
-16
lines changed

setupext.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -898,11 +898,6 @@ def add_flags(self, ext):
898898
ext.define_macros.append(('NPY_NO_DEPRECATED_API',
899899
'NPY_1_7_API_VERSION'))
900900

901-
# Allow the numpy NPY_INTP_FMT macro to be used in C++.
902-
# On gcc this translates to PRIdPTR which needs
903-
# __STDC_FORMAT_MACROS to be usable in c++
904-
ext.define_macros.append(('__STDC_FORMAT_MACROS', 1))
905-
906901
def get_setup_requires(self):
907902
return ['numpy>=1.6']
908903

src/_backend_agg_wrapper.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -449,14 +449,14 @@ PyRendererAgg_draw_gouraud_triangle(PyRendererAgg *self, PyObject *args, PyObjec
449449

450450
if (points.dim(0) != 3 || points.dim(1) != 2) {
451451
PyErr_Format(PyExc_ValueError,
452-
"points must be a 3x2 array, got %"NPY_INTP_FMT"x%"NPY_INTP_FMT,
452+
"points must be a 3x2 array, got %dx%d",
453453
points.dim(0), points.dim(1));
454454
return NULL;
455455
}
456456

457457
if (colors.dim(0) != 3 || colors.dim(1) != 4) {
458458
PyErr_Format(PyExc_ValueError,
459-
"colors must be a 3x4 array, got %"NPY_INTP_FMT"x%"NPY_INTP_FMT,
459+
"colors must be a 3x4 array, got %dx%d",
460460
colors.dim(0), colors.dim(1));
461461
return NULL;
462462
}
@@ -490,21 +490,21 @@ PyRendererAgg_draw_gouraud_triangles(PyRendererAgg *self, PyObject *args, PyObje
490490

491491
if (points.size() != 0 && (points.dim(1) != 3 || points.dim(2) != 2)) {
492492
PyErr_Format(PyExc_ValueError,
493-
"points must be a Nx3x2 array, got %"NPY_INTP_FMT"x%"NPY_INTP_FMT"x%"NPY_INTP_FMT,
493+
"points must be a Nx3x2 array, got %dx%dx%d",
494494
points.dim(0), points.dim(1), points.dim(2));
495495
return NULL;
496496
}
497497

498498
if (colors.size() != 0 && (colors.dim(1) != 3 || colors.dim(2) != 4)) {
499499
PyErr_Format(PyExc_ValueError,
500-
"colors must be a Nx3x4 array, got %"NPY_INTP_FMT"x%"NPY_INTP_FMT"x%"NPY_INTP_FMT,
500+
"colors must be a Nx3x4 array, got %dx%dx%d",
501501
colors.dim(0), colors.dim(1), colors.dim(2));
502502
return NULL;
503503
}
504504

505505
if (points.size() != colors.size()) {
506506
PyErr_Format(PyExc_ValueError,
507-
"points and colors arrays must be the same length, got %"NPY_INTP_FMT" and %"NPY_INTP_FMT,
507+
"points and colors arrays must be the same length, got %d and %d",
508508
points.dim(0), colors.dim(0));
509509
return NULL;
510510
}

src/_image_wrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ image_resample(PyObject *self, PyObject* args, PyObject *kwargs)
273273
} else {
274274
PyErr_Format(
275275
PyExc_ValueError,
276-
"If 3-dimensional, array must be RGBA. Got %" NPY_INTP_FMT " planes.",
276+
"If 3-dimensional, array must be RGBA. Got %d planes.",
277277
PyArray_DIM(input_array, 2));
278278
goto error;
279279
}

src/_path_wrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ static PyObject *Py_update_path_extents(PyObject *self, PyObject *args, PyObject
214214

215215
if (minpos.dim(0) != 2) {
216216
PyErr_Format(PyExc_ValueError,
217-
"minpos must be of length 2, got %"NPY_INTP_FMT,
217+
"minpos must be of length 2, got %d",
218218
minpos.dim(0));
219219
return NULL;
220220
}

src/py_converters.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ int convert_points(PyObject *obj, void *pointsp)
535535

536536
if (points->dim(1) != 2) {
537537
PyErr_Format(PyExc_ValueError,
538-
"Points must be Nx2 array, got %"NPY_INTP_FMT"x%"NPY_INTP_FMT,
538+
"Points must be Nx2 array, got %dx%d",
539539
points->dim(0), points->dim(1));
540540
return 0;
541541
}
@@ -559,7 +559,7 @@ int convert_transforms(PyObject *obj, void *transp)
559559

560560
if (trans->dim(1) != 3 || trans->dim(2) != 3) {
561561
PyErr_Format(PyExc_ValueError,
562-
"Transforms must be Nx3x3 array, got %"NPY_INTP_FMT"x%"NPY_INTP_FMT"x%"NPY_INTP_FMT,
562+
"Transforms must be Nx3x3 array, got %dx%dx%d",
563563
trans->dim(0), trans->dim(1), trans->dim(2));
564564
return 0;
565565
}
@@ -583,7 +583,7 @@ int convert_bboxes(PyObject *obj, void *bboxp)
583583

584584
if (bbox->dim(1) != 2 || bbox->dim(2) != 2) {
585585
PyErr_Format(PyExc_ValueError,
586-
"Bbox array must be Nx2x2 array, got %"NPY_INTP_FMT"x%"NPY_INTP_FMT"x%"NPY_INTP_FMT,
586+
"Bbox array must be Nx2x2 array, got %dx%dx%d",
587587
bbox->dim(0), bbox->dim(1), bbox->dim(2));
588588
return 0;
589589
}
@@ -607,7 +607,7 @@ int convert_colors(PyObject *obj, void *colorsp)
607607

608608
if (colors->dim(1) != 4) {
609609
PyErr_Format(PyExc_ValueError,
610-
"Colors array must be Nx4 array, got %"NPY_INTP_FMT"x%"NPY_INTP_FMT,
610+
"Colors array must be Nx4 array, got %dx%d",
611611
colors->dim(0), colors->dim(1));
612612
return 0;
613613
}

0 commit comments

Comments
 (0)