Skip to content

Commit d67ff81

Browse files
Don't convert PyUnicode_AsUTF8 result to non-const
1 parent 99f6ba3 commit d67ff81

16 files changed

Lines changed: 22 additions & 22 deletions

src/interface/preamble.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public:
234234
PyObject* py_str = PyObject_Str(value);
235235
if (py_str == NULL)
236236
return NULL;
237-
char* c_str = PyUnicode_AsUTF8(py_str);
237+
const char* c_str = PyUnicode_AsUTF8(py_str);
238238
Py_DECREF(py_str);
239239
return __setitem__(key, c_str);
240240
}

src/swig_0.26/easyaccess_wrap.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3657,7 +3657,7 @@ friend class ExifDataIterator;
36573657
PyObject* py_str = PyObject_Str(value);
36583658
if (py_str == NULL)
36593659
return NULL;
3660-
char* c_str = PyUnicode_AsUTF8(py_str);
3660+
const char* c_str = PyUnicode_AsUTF8(py_str);
36613661
Py_DECREF(py_str);
36623662
return __setitem__(key, c_str);
36633663
}

src/swig_0.26/exif_wrap.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3710,7 +3710,7 @@ friend class ExifDataIterator;
37103710
PyObject* py_str = PyObject_Str(value);
37113711
if (py_str == NULL)
37123712
return NULL;
3713-
char* c_str = PyUnicode_AsUTF8(py_str);
3713+
const char* c_str = PyUnicode_AsUTF8(py_str);
37143714
Py_DECREF(py_str);
37153715
return __setitem__(key, c_str);
37163716
}

src/swig_0.26/image_wrap.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3734,7 +3734,7 @@ friend class ExifDataIterator;
37343734
PyObject* py_str = PyObject_Str(value);
37353735
if (py_str == NULL)
37363736
return NULL;
3737-
char* c_str = PyUnicode_AsUTF8(py_str);
3737+
const char* c_str = PyUnicode_AsUTF8(py_str);
37383738
Py_DECREF(py_str);
37393739
return __setitem__(key, c_str);
37403740
}
@@ -4751,7 +4751,7 @@ friend class IptcDataIterator;
47514751
PyObject* py_str = PyObject_Str(value);
47524752
if (py_str == NULL)
47534753
return NULL;
4754-
char* c_str = PyUnicode_AsUTF8(py_str);
4754+
const char* c_str = PyUnicode_AsUTF8(py_str);
47554755
Py_DECREF(py_str);
47564756
return __setitem__(key, c_str);
47574757
}
@@ -4985,7 +4985,7 @@ friend class XmpDataIterator;
49854985
PyObject* py_str = PyObject_Str(value);
49864986
if (py_str == NULL)
49874987
return NULL;
4988-
char* c_str = PyUnicode_AsUTF8(py_str);
4988+
const char* c_str = PyUnicode_AsUTF8(py_str);
49894989
Py_DECREF(py_str);
49904990
return __setitem__(key, c_str);
49914991
}

src/swig_0.26/iptc_wrap.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3714,7 +3714,7 @@ friend class IptcDataIterator;
37143714
PyObject* py_str = PyObject_Str(value);
37153715
if (py_str == NULL)
37163716
return NULL;
3717-
char* c_str = PyUnicode_AsUTF8(py_str);
3717+
const char* c_str = PyUnicode_AsUTF8(py_str);
37183718
Py_DECREF(py_str);
37193719
return __setitem__(key, c_str);
37203720
}

src/swig_0.26/xmp_wrap.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3718,7 +3718,7 @@ friend class XmpDataIterator;
37183718
PyObject* py_str = PyObject_Str(value);
37193719
if (py_str == NULL)
37203720
return NULL;
3721-
char* c_str = PyUnicode_AsUTF8(py_str);
3721+
const char* c_str = PyUnicode_AsUTF8(py_str);
37223722
Py_DECREF(py_str);
37233723
return __setitem__(key, c_str);
37243724
}

src/swig_0.27.0/easyaccess_wrap.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3657,7 +3657,7 @@ friend class ExifDataIterator;
36573657
PyObject* py_str = PyObject_Str(value);
36583658
if (py_str == NULL)
36593659
return NULL;
3660-
char* c_str = PyUnicode_AsUTF8(py_str);
3660+
const char* c_str = PyUnicode_AsUTF8(py_str);
36613661
Py_DECREF(py_str);
36623662
return __setitem__(key, c_str);
36633663
}

src/swig_0.27.0/exif_wrap.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3710,7 +3710,7 @@ friend class ExifDataIterator;
37103710
PyObject* py_str = PyObject_Str(value);
37113711
if (py_str == NULL)
37123712
return NULL;
3713-
char* c_str = PyUnicode_AsUTF8(py_str);
3713+
const char* c_str = PyUnicode_AsUTF8(py_str);
37143714
Py_DECREF(py_str);
37153715
return __setitem__(key, c_str);
37163716
}

src/swig_0.27.0/image_wrap.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3734,7 +3734,7 @@ friend class ExifDataIterator;
37343734
PyObject* py_str = PyObject_Str(value);
37353735
if (py_str == NULL)
37363736
return NULL;
3737-
char* c_str = PyUnicode_AsUTF8(py_str);
3737+
const char* c_str = PyUnicode_AsUTF8(py_str);
37383738
Py_DECREF(py_str);
37393739
return __setitem__(key, c_str);
37403740
}
@@ -4751,7 +4751,7 @@ friend class IptcDataIterator;
47514751
PyObject* py_str = PyObject_Str(value);
47524752
if (py_str == NULL)
47534753
return NULL;
4754-
char* c_str = PyUnicode_AsUTF8(py_str);
4754+
const char* c_str = PyUnicode_AsUTF8(py_str);
47554755
Py_DECREF(py_str);
47564756
return __setitem__(key, c_str);
47574757
}
@@ -4985,7 +4985,7 @@ friend class XmpDataIterator;
49854985
PyObject* py_str = PyObject_Str(value);
49864986
if (py_str == NULL)
49874987
return NULL;
4988-
char* c_str = PyUnicode_AsUTF8(py_str);
4988+
const char* c_str = PyUnicode_AsUTF8(py_str);
49894989
Py_DECREF(py_str);
49904990
return __setitem__(key, c_str);
49914991
}

src/swig_0.27.0/iptc_wrap.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3714,7 +3714,7 @@ friend class IptcDataIterator;
37143714
PyObject* py_str = PyObject_Str(value);
37153715
if (py_str == NULL)
37163716
return NULL;
3717-
char* c_str = PyUnicode_AsUTF8(py_str);
3717+
const char* c_str = PyUnicode_AsUTF8(py_str);
37183718
Py_DECREF(py_str);
37193719
return __setitem__(key, c_str);
37203720
}

0 commit comments

Comments
 (0)