Skip to content

Commit 02bd7f9

Browse files
committed
improve conversion from str to char*, avoid deprecation warnings during
build svn path=/branches/v0_91_maint/; revision=5050
1 parent 91f3c4f commit 02bd7f9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/_backend_agg.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -2269,7 +2269,7 @@ RendererAgg::write_rgba(const Py::Tuple& args) {
22692269
throw Py::TypeError("Object does not appear to be a 8-bit string path or a Python file-like object");
22702270
}
22712271

2272-
PyObject_CallFunction(write_method, "s#", pixBuffer, NUMBYTES);
2272+
PyObject_CallFunction(write_method, (char *)"s#", pixBuffer, NUMBYTES);
22732273

22742274
Py_XDECREF(write_method);
22752275
}
@@ -2282,7 +2282,7 @@ static void write_png_data(png_structp png_ptr, png_bytep data, png_size_t lengt
22822282
PyObject* write_method = PyObject_GetAttrString(py_file_obj, "write");
22832283
PyObject* result = NULL;
22842284
if (write_method)
2285-
result = PyObject_CallFunction(write_method, "s#", data, length);
2285+
result = PyObject_CallFunction(write_method, (char *)"s#", data, length);
22862286
Py_XDECREF(write_method);
22872287
Py_XDECREF(result);
22882288
}
@@ -2292,7 +2292,7 @@ static void flush_png_data(png_structp png_ptr) {
22922292
PyObject* flush_method = PyObject_GetAttrString(py_file_obj, "flush");
22932293
PyObject* result = NULL;
22942294
if (flush_method)
2295-
result = PyObject_CallFunction(flush_method, "");
2295+
result = PyObject_CallFunction(flush_method, (char *)"");
22962296
Py_XDECREF(flush_method);
22972297
Py_XDECREF(result);
22982298
}

0 commit comments

Comments
 (0)