From 5d858465b6ebdafa05f86309457848cc26913b6a Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 20 Nov 2016 10:16:47 +0200 Subject: Added the const qualifier to char* variables that refer to readonly internal UTF-8 represenatation of Unicode objects. --- Objects/moduleobject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Objects/moduleobject.c') diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index 79be51a806..701bcb1df3 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -231,7 +231,7 @@ PyModule_FromDefAndSpec2(struct PyModuleDef* def, PyObject *spec, int module_api PyObject *nameobj; PyObject *m = NULL; int has_execution_slots = 0; - char *name; + const char *name; int ret; PyModuleDef_Init(def); @@ -512,7 +512,7 @@ const char * PyModule_GetFilename(PyObject *m) { PyObject *fileobj; - char *utf8; + const char *utf8; fileobj = PyModule_GetFilenameObject(m); if (fileobj == NULL) return NULL; -- cgit v1.2.1 From 872753000c7f8c55b0da6316c9c957d909cc95e3 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 21 Nov 2016 10:25:54 +0200 Subject: Issue #28748: Private variable _Py_PackageContext is now of type "const char *" rather of "char *". --- Objects/moduleobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Objects/moduleobject.c') diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index 701bcb1df3..350f3bfe3a 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -188,7 +188,7 @@ PyModule_Create2(struct PyModuleDef* module, int module_api_version) (if the name actually matches). */ if (_Py_PackageContext != NULL) { - char *p = strrchr(_Py_PackageContext, '.'); + const char *p = strrchr(_Py_PackageContext, '.'); if (p != NULL && strcmp(module->m_name, p+1) == 0) { name = _Py_PackageContext; _Py_PackageContext = NULL; -- cgit v1.2.1