Skip to content

Commit ad05091

Browse files
committed
Fix warnings about incorrect format specifiers.
1 parent 99f6357 commit ad05091

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/_backend_agg_wrapper.cpp

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

460460
if (points.dim(0) != 3 || points.dim(1) != 2) {
461461
PyErr_Format(PyExc_ValueError,
462-
"points must be a 3x2 array, got %dx%d",
462+
"points must be a 3x2 array, got %" NPY_INTP_FMT "x%" NPY_INTP_FMT,
463463
points.dim(0), points.dim(1));
464464
return NULL;
465465
}
466466

467467
if (colors.dim(0) != 3 || colors.dim(1) != 4) {
468468
PyErr_Format(PyExc_ValueError,
469-
"colors must be a 3x4 array, got %dx%d",
469+
"colors must be a 3x4 array, got %" NPY_INTP_FMT "x%" NPY_INTP_FMT,
470470
colors.dim(0), colors.dim(1));
471471
return NULL;
472472
}
@@ -500,21 +500,21 @@ PyRendererAgg_draw_gouraud_triangles(PyRendererAgg *self, PyObject *args, PyObje
500500

501501
if (points.size() != 0 && (points.dim(1) != 3 || points.dim(2) != 2)) {
502502
PyErr_Format(PyExc_ValueError,
503-
"points must be a Nx3x2 array, got %dx%dx%d",
503+
"points must be a Nx3x2 array, got %" NPY_INTP_FMT "x%" NPY_INTP_FMT "x%" NPY_INTP_FMT,
504504
points.dim(0), points.dim(1), points.dim(2));
505505
return NULL;
506506
}
507507

508508
if (colors.size() != 0 && (colors.dim(1) != 3 || colors.dim(2) != 4)) {
509509
PyErr_Format(PyExc_ValueError,
510-
"colors must be a Nx3x4 array, got %dx%dx%d",
510+
"colors must be a Nx3x4 array, got %" NPY_INTP_FMT "x%" NPY_INTP_FMT "x%" NPY_INTP_FMT,
511511
colors.dim(0), colors.dim(1), colors.dim(2));
512512
return NULL;
513513
}
514514

515515
if (points.size() != colors.size()) {
516516
PyErr_Format(PyExc_ValueError,
517-
"points and colors arrays must be the same length, got %d and %d",
517+
"points and colors arrays must be the same length, got %" NPY_INTP_FMT " and %" NPY_INTP_FMT,
518518
points.dim(0), colors.dim(0));
519519
return NULL;
520520
}

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 %d planes.",
276+
"If 3-dimensional, array must be RGBA. Got %" NPY_INTP_FMT " 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
@@ -201,7 +201,7 @@ static PyObject *Py_update_path_extents(PyObject *self, PyObject *args, PyObject
201201

202202
if (minpos.dim(0) != 2) {
203203
PyErr_Format(PyExc_ValueError,
204-
"minpos must be of length 2, got %d",
204+
"minpos must be of length 2, got %" NPY_INTP_FMT,
205205
minpos.dim(0));
206206
return NULL;
207207
}

src/py_converters.cpp

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

538538
if (points->dim(1) != 2) {
539539
PyErr_Format(PyExc_ValueError,
540-
"Points must be Nx2 array, got %dx%d",
540+
"Points must be Nx2 array, got %" NPY_INTP_FMT "x%" NPY_INTP_FMT,
541541
points->dim(0), points->dim(1));
542542
return 0;
543543
}
@@ -561,7 +561,7 @@ int convert_transforms(PyObject *obj, void *transp)
561561

562562
if (trans->dim(1) != 3 || trans->dim(2) != 3) {
563563
PyErr_Format(PyExc_ValueError,
564-
"Transforms must be Nx3x3 array, got %dx%dx%d",
564+
"Transforms must be Nx3x3 array, got %" NPY_INTP_FMT "x%" NPY_INTP_FMT "x%" NPY_INTP_FMT,
565565
trans->dim(0), trans->dim(1), trans->dim(2));
566566
return 0;
567567
}
@@ -585,7 +585,7 @@ int convert_bboxes(PyObject *obj, void *bboxp)
585585

586586
if (bbox->dim(1) != 2 || bbox->dim(2) != 2) {
587587
PyErr_Format(PyExc_ValueError,
588-
"Bbox array must be Nx2x2 array, got %dx%dx%d",
588+
"Bbox array must be Nx2x2 array, got %" NPY_INTP_FMT "x%" NPY_INTP_FMT "x%" NPY_INTP_FMT,
589589
bbox->dim(0), bbox->dim(1), bbox->dim(2));
590590
return 0;
591591
}
@@ -609,7 +609,7 @@ int convert_colors(PyObject *obj, void *colorsp)
609609

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

0 commit comments

Comments
 (0)