Index: Python/errors.c =================================================================== --- Python/errors.c (revision 75468) +++ Python/errors.c (working copy) @@ -555,7 +555,7 @@ PyObject * -PyErr_NewException(char *name, PyObject *base, PyObject *dict) +PyErr_NewException(const char *name, PyObject *base, PyObject *dict) { char *dot; PyObject *modulename = NULL; Index: Python/mystrtoul.c =================================================================== --- Python/mystrtoul.c (revision 75468) +++ Python/mystrtoul.c (working copy) @@ -92,7 +92,7 @@ ** exceptions - we don't check for them. */ unsigned long -PyOS_strtoul(register char *str, char **ptr, int base) +PyOS_strtoul(register const char *str, char **ptr, int base) { register unsigned long result = 0; /* return value of the function */ register int c; /* current input character */ @@ -111,7 +111,7 @@ /* there must be at least one digit after 0x */ if (_PyLong_DigitValue[Py_CHARMASK(str[1])] >= 16) { if (ptr) - *ptr = str; + *ptr = (char *)str; return 0; } ++str; @@ -120,7 +120,7 @@ /* there must be at least one digit after 0o */ if (_PyLong_DigitValue[Py_CHARMASK(str[1])] >= 8) { if (ptr) - *ptr = str; + *ptr = (char *)str; return 0; } ++str; @@ -129,7 +129,7 @@ /* there must be at least one digit after 0b */ if (_PyLong_DigitValue[Py_CHARMASK(str[1])] >= 2) { if (ptr) - *ptr = str; + *ptr = (char *)str; return 0; } ++str; @@ -149,7 +149,7 @@ /* there must be at least one digit after 0b */ if (_PyLong_DigitValue[Py_CHARMASK(str[1])] >= 2) { if (ptr) - *ptr = str; + *ptr = (char *)str; return 0; } ++str; @@ -164,7 +164,7 @@ /* there must be at least one digit after 0o */ if (_PyLong_DigitValue[Py_CHARMASK(str[1])] >= 8) { if (ptr) - *ptr = str; + *ptr = (char *)str; return 0; } ++str; @@ -179,7 +179,7 @@ /* there must be at least one digit after 0x */ if (_PyLong_DigitValue[Py_CHARMASK(str[1])] >= 16) { if (ptr) - *ptr = str; + *ptr = (char *)str; return 0; } ++str; @@ -191,7 +191,7 @@ /* catch silly bases */ if (base < 2 || base > 36) { if (ptr) - *ptr = str; + *ptr = (char *)str; return 0; } @@ -233,7 +233,7 @@ /* set pointer to point to the last character scanned */ if (ptr) - *ptr = str; + *ptr = (char *)str; return result; @@ -242,7 +242,7 @@ /* spool through remaining digit characters */ while (_PyLong_DigitValue[Py_CHARMASK(*str)] < base) ++str; - *ptr = str; + *ptr = (char *)str; } errno = ERANGE; return (unsigned long)-1; @@ -254,7 +254,7 @@ #define PY_ABS_LONG_MIN (0-(unsigned long)LONG_MIN) long -PyOS_strtol(char *str, char **ptr, int base) +PyOS_strtol(const char *str, char **ptr, int base) { long result; unsigned long uresult; Index: Python/import.c =================================================================== --- Python/import.c (revision 75468) +++ Python/import.c (working copy) @@ -635,13 +635,13 @@ * example. */ PyObject * -PyImport_ExecCodeModule(char *name, PyObject *co) +PyImport_ExecCodeModule(const char *name, PyObject *co) { return PyImport_ExecCodeModuleEx(name, co, (char *)NULL); } PyObject * -PyImport_ExecCodeModuleEx(char *name, PyObject *co, char *pathname) +PyImport_ExecCodeModuleEx(const char *name, PyObject *co, char *pathname) { PyObject *modules = PyImport_GetModuleDict(); PyObject *m, *d, *v; @@ -2098,7 +2098,7 @@ static PyObject *get_parent(PyObject *globals, char *buf, Py_ssize_t *p_buflen, int level); static PyObject *load_next(PyObject *mod, PyObject *altmod, - char **p_name, char *buf, Py_ssize_t *p_buflen); + const char **p_name, char *buf, Py_ssize_t *p_buflen); static int mark_miss(char *name); static int ensure_fromlist(PyObject *mod, PyObject *fromlist, char *buf, Py_ssize_t buflen, int recursive); @@ -2107,7 +2107,7 @@ /* The Magnum Opus of dotted-name import :-) */ static PyObject * -import_module_level(char *name, PyObject *globals, PyObject *locals, +import_module_level(const char *name, PyObject *globals, PyObject *locals, PyObject *fromlist, int level) { char buf[MAXPATHLEN+1]; @@ -2174,7 +2174,7 @@ } PyObject * -PyImport_ImportModuleLevel(char *name, PyObject *globals, PyObject *locals, +PyImport_ImportModuleLevel(const char *name, PyObject *globals, PyObject *locals, PyObject *fromlist, int level) { PyObject *result; @@ -2363,10 +2363,10 @@ /* altmod is either None or same as mod */ static PyObject * -load_next(PyObject *mod, PyObject *altmod, char **p_name, char *buf, +load_next(PyObject *mod, PyObject *altmod, const char **p_name, char *buf, Py_ssize_t *p_buflen) { - char *name = *p_name; + const char *name = *p_name; char *dot = strchr(name, '.'); size_t len; char *p; Index: Python/sysmodule.c =================================================================== --- Python/sysmodule.c (revision 75468) +++ Python/sysmodule.c (working copy) @@ -47,7 +47,7 @@ #endif PyObject * -PySys_GetObject(char *name) +PySys_GetObject(const char *name) { PyThreadState *tstate = PyThreadState_GET(); PyObject *sd = tstate->interp->sysdict; @@ -57,7 +57,7 @@ } FILE * -PySys_GetFile(char *name, FILE *def) +PySys_GetFile(const char *name, FILE *def) { FILE *fp = NULL; PyObject *v = PySys_GetObject(name); @@ -69,7 +69,7 @@ } int -PySys_SetObject(char *name, PyObject *v) +PySys_SetObject(const char *name, PyObject *v) { PyThreadState *tstate = PyThreadState_GET(); PyObject *sd = tstate->interp->sysdict; @@ -972,7 +972,7 @@ } void -PySys_AddWarnOption(char *s) +PySys_AddWarnOption(const char *s) { PyObject *str; @@ -1505,10 +1505,10 @@ } static PyObject * -makepathobject(char *path, int delim) +makepathobject(const char *path, int delim) { int i, n; - char *p; + const char *p; PyObject *v, *w; n = 1; @@ -1538,7 +1538,7 @@ } void -PySys_SetPath(char *path) +PySys_SetPath(const char *path) { PyObject *v; if ((v = makepathobject(path, DELIM)) == NULL) Index: Include/stringobject.h =================================================================== --- Include/stringobject.h (revision 75468) +++ Include/stringobject.h (working copy) @@ -201,7 +201,7 @@ /* Format the object based on the format_spec, as defined in PEP 3101 (Advanced String Formatting). */ PyAPI_FUNC(PyObject *) _PyBytes_FormatAdvanced(PyObject *obj, - char *format_spec, + const char *format_spec, Py_ssize_t format_spec_len); #ifdef __cplusplus Index: Include/complexobject.h =================================================================== --- Include/complexobject.h (revision 75468) +++ Include/complexobject.h (working copy) @@ -57,7 +57,7 @@ /* Format the object based on the format_spec, as defined in PEP 3101 (Advanced String Formatting). */ PyAPI_FUNC(PyObject *) _PyComplex_FormatAdvanced(PyObject *obj, - char *format_spec, + const char *format_spec, Py_ssize_t format_spec_len); #ifdef __cplusplus Index: Include/unicodeobject.h =================================================================== --- Include/unicodeobject.h (revision 75468) +++ Include/unicodeobject.h (working copy) @@ -559,7 +559,7 @@ /* Format the object based on the format_spec, as defined in PEP 3101 (Advanced String Formatting). */ PyAPI_FUNC(PyObject *) _PyUnicode_FormatAdvanced(PyObject *obj, - Py_UNICODE *format_spec, + const Py_UNICODE *format_spec, Py_ssize_t format_spec_len); /* --- wchar_t support for platforms which support it --------------------- */ @@ -1128,7 +1128,7 @@ */ PyAPI_FUNC(int) PyUnicode_EncodeDecimal( - Py_UNICODE *s, /* Unicode buffer */ + const Py_UNICODE *s, /* Unicode buffer */ Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ char *output, /* Output buffer; must have size >= length */ const char *errors /* error handling */ Index: Include/intobject.h =================================================================== --- Include/intobject.h (revision 75468) +++ Include/intobject.h (working copy) @@ -31,9 +31,9 @@ PyType_FastSubclass((op)->ob_type, Py_TPFLAGS_INT_SUBCLASS) #define PyInt_CheckExact(op) ((op)->ob_type == &PyInt_Type) -PyAPI_FUNC(PyObject *) PyInt_FromString(char*, char**, int); +PyAPI_FUNC(PyObject *) PyInt_FromString(const char*, char**, int); #ifdef Py_USING_UNICODE -PyAPI_FUNC(PyObject *) PyInt_FromUnicode(Py_UNICODE*, Py_ssize_t, int); +PyAPI_FUNC(PyObject *) PyInt_FromUnicode(const Py_UNICODE*, Py_ssize_t, int); #endif PyAPI_FUNC(PyObject *) PyInt_FromLong(long); PyAPI_FUNC(PyObject *) PyInt_FromSize_t(size_t); @@ -56,8 +56,8 @@ * into the main Python shared library/DLL. Guido thinks I'm weird for * building it this way. :-) [cjh] */ -PyAPI_FUNC(unsigned long) PyOS_strtoul(char *, char **, int); -PyAPI_FUNC(long) PyOS_strtol(char *, char **, int); +PyAPI_FUNC(unsigned long) PyOS_strtoul(const char *, char **, int); +PyAPI_FUNC(long) PyOS_strtol(const char *, char **, int); /* free list api */ PyAPI_FUNC(int) PyInt_ClearFreeList(void); @@ -71,7 +71,7 @@ /* Format the object based on the format_spec, as defined in PEP 3101 (Advanced String Formatting). */ PyAPI_FUNC(PyObject *) _PyInt_FormatAdvanced(PyObject *obj, - char *format_spec, + const char *format_spec, Py_ssize_t format_spec_len); #ifdef __cplusplus Index: Include/cobject.h =================================================================== --- Include/cobject.h (revision 75468) +++ Include/cobject.h (working copy) @@ -43,7 +43,7 @@ PyAPI_FUNC(void *) PyCObject_GetDesc(PyObject *); /* Import a pointer to a C object from a module using a PyCObject. */ -PyAPI_FUNC(void *) PyCObject_Import(char *module_name, char *cobject_name); +PyAPI_FUNC(void *) PyCObject_Import(const char *module_name, const char *cobject_name); /* Modify a C object. Fails (==0) if object has a destructor. */ PyAPI_FUNC(int) PyCObject_SetVoidPtr(PyObject *self, void *cobj); Index: Include/floatobject.h =================================================================== --- Include/floatobject.h (revision 75468) +++ Include/floatobject.h (working copy) @@ -124,7 +124,7 @@ /* Format the object based on the format_spec, as defined in PEP 3101 (Advanced String Formatting). */ PyAPI_FUNC(PyObject *) _PyFloat_FormatAdvanced(PyObject *obj, - char *format_spec, + const char *format_spec, Py_ssize_t format_spec_len); #ifdef __cplusplus Index: Include/abstract.h =================================================================== --- Include/abstract.h (revision 75468) +++ Include/abstract.h (working copy) @@ -143,7 +143,7 @@ /* Implemented elsewhere: - int PyObject_HasAttrString(PyObject *o, char *attr_name); + int PyObject_HasAttrString(PyObject *o, const char *attr_name); Returns 1 if o has the attribute attr_name, and 0 otherwise. This is equivalent to the Python expression: @@ -155,7 +155,7 @@ /* Implemented elsewhere: - PyObject* PyObject_GetAttrString(PyObject *o, char *attr_name); + PyObject* PyObject_GetAttrString(PyObject *o, const char *attr_name); Retrieve an attributed named attr_name form object o. Returns the attribute value on success, or NULL on failure. @@ -188,7 +188,7 @@ /* Implemented elsewhere: - int PyObject_SetAttrString(PyObject *o, char *attr_name, PyObject *v); + int PyObject_SetAttrString(PyObject *o, const char *attr_name, PyObject *v); Set the value of the attribute named attr_name, for object o, to the value, v. Returns -1 on failure. This is @@ -208,7 +208,7 @@ /* implemented as a macro: - int PyObject_DelAttrString(PyObject *o, char *attr_name); + int PyObject_DelAttrString(PyObject *o, const char *attr_name); Delete attribute named attr_name, for object o. Returns -1 on failure. This is the equivalent of the Python @@ -324,7 +324,7 @@ */ PyAPI_FUNC(PyObject *) PyObject_CallFunction(PyObject *callable_object, - char *format, ...); + const char *format, ...); /* Call a callable Python object, callable_object, with a @@ -337,8 +337,8 @@ */ - PyAPI_FUNC(PyObject *) PyObject_CallMethod(PyObject *o, char *m, - char *format, ...); + PyAPI_FUNC(PyObject *) PyObject_CallMethod(PyObject *o, const char *m, + const char *format, ...); /* Call the method named m of object o with a variable number of @@ -350,10 +350,10 @@ */ PyAPI_FUNC(PyObject *) _PyObject_CallFunction_SizeT(PyObject *callable, - char *format, ...); + const char *format, ...); PyAPI_FUNC(PyObject *) _PyObject_CallMethod_SizeT(PyObject *o, - char *name, - char *format, ...); + const char *name, + const char *format, ...); PyAPI_FUNC(PyObject *) PyObject_CallFunctionObjArgs(PyObject *callable, ...); @@ -458,7 +458,7 @@ statement: o[key]=v. */ - PyAPI_FUNC(int) PyObject_DelItemString(PyObject *o, char *key); + PyAPI_FUNC(int) PyObject_DelItemString(PyObject *o, const char *key); /* Remove the mapping for object, key, from the object *o. @@ -1282,7 +1282,7 @@ /* implemented as a macro: - int PyMapping_DelItemString(PyObject *o, char *key); + int PyMapping_DelItemString(PyObject *o, const char *key); Remove the mapping for object, key, from the object *o. Returns -1 on failure. This is equivalent to @@ -1300,7 +1300,7 @@ */ #define PyMapping_DelItem(O,K) PyObject_DelItem((O),(K)) - PyAPI_FUNC(int) PyMapping_HasKeyString(PyObject *o, char *key); + PyAPI_FUNC(int) PyMapping_HasKeyString(PyObject *o, const char *key); /* On success, return 1 if the mapping object has the key, key, @@ -1353,7 +1353,7 @@ */ #define PyMapping_Items(O) PyObject_CallMethod(O,"items",NULL) - PyAPI_FUNC(PyObject *) PyMapping_GetItemString(PyObject *o, char *key); + PyAPI_FUNC(PyObject *) PyMapping_GetItemString(PyObject *o, const char *key); /* Return element of o corresponding to the object, key, or NULL @@ -1361,7 +1361,7 @@ o[key]. */ - PyAPI_FUNC(int) PyMapping_SetItemString(PyObject *o, char *key, + PyAPI_FUNC(int) PyMapping_SetItemString(PyObject *o, const char *key, PyObject *value); /* Index: Include/import.h =================================================================== --- Include/import.h (revision 75468) +++ Include/import.h (working copy) @@ -8,14 +8,14 @@ #endif PyAPI_FUNC(long) PyImport_GetMagicNumber(void); -PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule(char *name, PyObject *co); +PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule(const char *name, PyObject *co); PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleEx( - char *name, PyObject *co, char *pathname); + const char *name, PyObject *co, char *pathname); PyAPI_FUNC(PyObject *) PyImport_GetModuleDict(void); PyAPI_FUNC(PyObject *) PyImport_AddModule(const char *name); PyAPI_FUNC(PyObject *) PyImport_ImportModule(const char *name); PyAPI_FUNC(PyObject *) PyImport_ImportModuleNoBlock(const char *); -PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel(char *name, +PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel(const char *name, PyObject *globals, PyObject *locals, PyObject *fromlist, int level); #define PyImport_ImportModuleEx(n, g, l, f) \ Index: Include/descrobject.h =================================================================== --- Include/descrobject.h (revision 75468) +++ Include/descrobject.h (working copy) @@ -9,10 +9,10 @@ typedef int (*setter)(PyObject *, PyObject *, void *); typedef struct PyGetSetDef { - char *name; + const char *name; getter get; setter set; - char *doc; + const char *doc; void *closure; } PyGetSetDef; @@ -23,11 +23,11 @@ void *wrapped, PyObject *kwds); struct wrapperbase { - char *name; + const char *name; int offset; void *function; wrapperfunc wrapper; - char *doc; + const char *doc; int flags; PyObject *name_strobj; }; Index: Include/fileobject.h =================================================================== --- Include/fileobject.h (revision 75468) +++ Include/fileobject.h (working copy) @@ -35,11 +35,11 @@ #define PyFile_Check(op) PyObject_TypeCheck(op, &PyFile_Type) #define PyFile_CheckExact(op) (Py_TYPE(op) == &PyFile_Type) -PyAPI_FUNC(PyObject *) PyFile_FromString(char *, char *); +PyAPI_FUNC(PyObject *) PyFile_FromString(const char *, const char *); PyAPI_FUNC(void) PyFile_SetBufSize(PyObject *, int); PyAPI_FUNC(int) PyFile_SetEncoding(PyObject *, const char *); -PyAPI_FUNC(int) PyFile_SetEncodingAndErrors(PyObject *, const char *, char *errors); -PyAPI_FUNC(PyObject *) PyFile_FromFile(FILE *, char *, char *, +PyAPI_FUNC(int) PyFile_SetEncodingAndErrors(PyObject *, const char *, const char *errors); +PyAPI_FUNC(PyObject *) PyFile_FromFile(FILE *, const char *, const char *, int (*)(FILE *)); PyAPI_FUNC(FILE *) PyFile_AsFile(PyObject *); PyAPI_FUNC(void) PyFile_IncUseCount(PyFileObject *); Index: Include/modsupport.h =================================================================== --- Include/modsupport.h (revision 75468) +++ Include/modsupport.h (working copy) @@ -119,7 +119,7 @@ int apiver); #define Py_InitModule(name, methods) \ - Py_InitModule4(name, methods, (char *)NULL, (PyObject *)NULL, \ + Py_InitModule4(name, methods, (const char *)NULL, (PyObject *)NULL, \ PYTHON_API_VERSION) #define Py_InitModule3(name, methods, doc) \ Index: Include/sysmodule.h =================================================================== --- Include/sysmodule.h (revision 75468) +++ Include/sysmodule.h (working copy) @@ -7,11 +7,11 @@ extern "C" { #endif -PyAPI_FUNC(PyObject *) PySys_GetObject(char *); -PyAPI_FUNC(int) PySys_SetObject(char *, PyObject *); -PyAPI_FUNC(FILE *) PySys_GetFile(char *, FILE *); +PyAPI_FUNC(PyObject *) PySys_GetObject(const char *); +PyAPI_FUNC(int) PySys_SetObject(const char *, PyObject *); +PyAPI_FUNC(FILE *) PySys_GetFile(const char *, FILE *); PyAPI_FUNC(void) PySys_SetArgv(int, char **); -PyAPI_FUNC(void) PySys_SetPath(char *); +PyAPI_FUNC(void) PySys_SetPath(const char *); PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...) Py_GCC_ATTRIBUTE((format(printf, 1, 2))); @@ -22,7 +22,7 @@ PyAPI_DATA(int) _PySys_CheckInterval; PyAPI_FUNC(void) PySys_ResetWarnOptions(void); -PyAPI_FUNC(void) PySys_AddWarnOption(char *); +PyAPI_FUNC(void) PySys_AddWarnOption(const char *); PyAPI_FUNC(int) PySys_HasWarnOptions(void); #ifdef __cplusplus Index: Include/pyerrors.h =================================================================== --- Include/pyerrors.h (revision 75468) +++ Include/pyerrors.h (working copy) @@ -220,7 +220,7 @@ #define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__) /* Function to create a new exception */ -PyAPI_FUNC(PyObject *) PyErr_NewException(char *name, PyObject *base, +PyAPI_FUNC(PyObject *) PyErr_NewException(const char *name, PyObject *base, PyObject *dict); PyAPI_FUNC(void) PyErr_WriteUnraisable(PyObject *); Index: Include/longobject.h =================================================================== --- Include/longobject.h (revision 75468) +++ Include/longobject.h (working copy) @@ -52,9 +52,9 @@ PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *); #endif /* HAVE_LONG_LONG */ -PyAPI_FUNC(PyObject *) PyLong_FromString(char *, char **, int); +PyAPI_FUNC(PyObject *) PyLong_FromString(const char *, char **, int); #ifdef Py_USING_UNICODE -PyAPI_FUNC(PyObject *) PyLong_FromUnicode(Py_UNICODE*, Py_ssize_t, int); +PyAPI_FUNC(PyObject *) PyLong_FromUnicode(const Py_UNICODE*, Py_ssize_t, int); #endif /* _PyLong_Sign. Return 0 if v is 0, -1 if v < 0, +1 if v > 0. @@ -123,7 +123,7 @@ /* Format the object based on the format_spec, as defined in PEP 3101 (Advanced String Formatting). */ PyAPI_FUNC(PyObject *) _PyLong_FormatAdvanced(PyObject *obj, - char *format_spec, + const char *format_spec, Py_ssize_t format_spec_len); #ifdef __cplusplus Index: Objects/abstract.c =================================================================== --- Objects/abstract.c (revision 75468) +++ Objects/abstract.c (working copy) @@ -224,7 +224,7 @@ } int -PyObject_DelItemString(PyObject *o, char *key) +PyObject_DelItemString(PyObject *o, const char *key) { PyObject *okey; int ret; @@ -2425,7 +2425,7 @@ #define PyMapping_Length PyMapping_Size PyObject * -PyMapping_GetItemString(PyObject *o, char *key) +PyMapping_GetItemString(PyObject *o, const char *key) { PyObject *okey, *r; @@ -2441,7 +2441,7 @@ } int -PyMapping_SetItemString(PyObject *o, char *key, PyObject *value) +PyMapping_SetItemString(PyObject *o, const char *key, PyObject *value) { PyObject *okey; int r; @@ -2460,7 +2460,7 @@ } int -PyMapping_HasKeyString(PyObject *o, char *key) +PyMapping_HasKeyString(PyObject *o, const char *key) { PyObject *v; @@ -2546,7 +2546,7 @@ } PyObject * -PyObject_CallFunction(PyObject *callable, char *format, ...) +PyObject_CallFunction(PyObject *callable, const char *format, ...) { va_list va; PyObject *args; @@ -2566,7 +2566,7 @@ } PyObject * -_PyObject_CallFunction_SizeT(PyObject *callable, char *format, ...) +_PyObject_CallFunction_SizeT(PyObject *callable, const char *format, ...) { va_list va; PyObject *args; @@ -2586,7 +2586,7 @@ } PyObject * -PyObject_CallMethod(PyObject *o, char *name, char *format, ...) +PyObject_CallMethod(PyObject *o, const char *name, const char *format, ...) { va_list va; PyObject *args; @@ -2625,7 +2625,7 @@ } PyObject * -_PyObject_CallMethod_SizeT(PyObject *o, char *name, char *format, ...) +_PyObject_CallMethod_SizeT(PyObject *o, const char *name, const char *format, ...) { va_list va; PyObject *args; Index: Objects/unicodeobject.c =================================================================== --- Objects/unicodeobject.c (revision 75468) +++ Objects/unicodeobject.c (working copy) @@ -5113,12 +5113,12 @@ /* --- Decimal Encoder ---------------------------------------------------- */ -int PyUnicode_EncodeDecimal(Py_UNICODE *s, +int PyUnicode_EncodeDecimal(const Py_UNICODE *s, Py_ssize_t length, char *output, const char *errors) { - Py_UNICODE *p, *end; + const Py_UNICODE *p, *end; PyObject *errorHandler = NULL; PyObject *exc = NULL; const char *encoding = "decimal"; @@ -5141,8 +5141,8 @@ Py_ssize_t repsize; Py_ssize_t newpos; Py_UNICODE *uni2; - Py_UNICODE *collstart; - Py_UNICODE *collend; + const Py_UNICODE *collstart; + const Py_UNICODE *collend; if (Py_UNICODE_ISSPACE(ch)) { *output++ = ' '; Index: Objects/intobject.c =================================================================== --- Objects/intobject.c (revision 75468) +++ Objects/intobject.c (working copy) @@ -339,7 +339,7 @@ #endif PyObject * -PyInt_FromString(char *s, char **pend, int base) +PyInt_FromString(const char *s, char **pend, int base) { char *end; long x; @@ -391,7 +391,7 @@ #ifdef Py_USING_UNICODE PyObject * -PyInt_FromUnicode(Py_UNICODE *s, Py_ssize_t length, int base) +PyInt_FromUnicode(const Py_UNICODE *s, Py_ssize_t length, int base) { PyObject *result; char *buffer = (char *)PyMem_MALLOC(length+1); Index: Objects/descrobject.c =================================================================== --- Objects/descrobject.c (revision 75468) +++ Objects/descrobject.c (working copy) @@ -945,7 +945,7 @@ static PyObject * wrapper_name(wrapperobject *wp) { - char *s = wp->descr->d_base->name; + const char *s = wp->descr->d_base->name; return PyString_FromString(s); } @@ -953,7 +953,7 @@ static PyObject * wrapper_doc(wrapperobject *wp) { - char *s = wp->descr->d_base->doc; + const char *s = wp->descr->d_base->doc; if (s == NULL) { Py_INCREF(Py_None); Index: Objects/fileobject.c =================================================================== --- Objects/fileobject.c (revision 75468) +++ Objects/fileobject.c (working copy) @@ -138,7 +138,7 @@ static PyObject * -fill_file_fields(PyFileObject *f, FILE *fp, PyObject *name, char *mode, +fill_file_fields(PyFileObject *f, FILE *fp, PyObject *name, const char *mode, int (*close)(FILE *)) { assert(name != NULL); @@ -309,7 +309,7 @@ } static PyObject * -open_the_file(PyFileObject *f, char *name, char *mode) +open_the_file(PyFileObject *f, const char *name, const char *mode) { char *newmode; assert(f != NULL); @@ -453,7 +453,7 @@ } PyObject * -PyFile_FromFile(FILE *fp, char *name, char *mode, int (*close)(FILE *)) +PyFile_FromFile(FILE *fp, const char *name, const char *mode, int (*close)(FILE *)) { PyFileObject *f = (PyFileObject *)PyFile_Type.tp_new(&PyFile_Type, NULL, NULL); @@ -471,7 +471,7 @@ } PyObject * -PyFile_FromString(char *name, char *mode) +PyFile_FromString(const char *name, const char *mode) { extern int fclose(FILE *); PyFileObject *f; @@ -535,7 +535,7 @@ } int -PyFile_SetEncodingAndErrors(PyObject *f, const char *enc, char* errors) +PyFile_SetEncodingAndErrors(PyObject *f, const char *enc, const char* errors) { PyFileObject *file = (PyFileObject*)f; PyObject *str, *oerrors; Index: Objects/cobject.c =================================================================== --- Objects/cobject.c (revision 75468) +++ Objects/cobject.c (working copy) @@ -77,7 +77,7 @@ } void * -PyCObject_Import(char *module_name, char *name) +PyCObject_Import(const char *module_name, const char *name) { PyObject *m, *c; void *r = NULL; Index: Objects/stringlib/string_format.h =================================================================== --- Objects/stringlib/string_format.h (revision 75468) +++ Objects/stringlib/string_format.h (working copy) @@ -561,7 +561,7 @@ int ok = 0; PyObject *result = NULL; PyObject *format_spec_object = NULL; - PyObject *(*formatter)(PyObject *, STRINGLIB_CHAR *, Py_ssize_t) = NULL; + PyObject *(*formatter)(PyObject *, const STRINGLIB_CHAR *, Py_ssize_t) = NULL; STRINGLIB_CHAR* format_spec_start = format_spec->ptr ? format_spec->ptr : NULL; Py_ssize_t format_spec_len = format_spec->ptr ? Index: Objects/stringlib/formatter.h =================================================================== --- Objects/stringlib/formatter.h (revision 75468) +++ Objects/stringlib/formatter.h (working copy) @@ -70,7 +70,7 @@ returns -1 on error. */ static int -get_integer(STRINGLIB_CHAR **ptr, STRINGLIB_CHAR *end, +get_integer(const STRINGLIB_CHAR **ptr, const STRINGLIB_CHAR *end, Py_ssize_t *result) { Py_ssize_t accumulator, digitval, oldaccumulator; @@ -148,13 +148,13 @@ if failure, sets the exception */ static int -parse_internal_render_format_spec(STRINGLIB_CHAR *format_spec, +parse_internal_render_format_spec(const STRINGLIB_CHAR *format_spec, Py_ssize_t format_spec_len, InternalFormatSpec *format, char default_type) { - STRINGLIB_CHAR *ptr = format_spec; - STRINGLIB_CHAR *end = format_spec + format_spec_len; + const STRINGLIB_CHAR *ptr = format_spec; + const STRINGLIB_CHAR *end = format_spec + format_spec_len; /* end-ptr is used throughout this code to specify the length of the input string */ @@ -1271,7 +1271,7 @@ /************************************************************************/ PyObject * FORMAT_STRING(PyObject *obj, - STRINGLIB_CHAR *format_spec, + const STRINGLIB_CHAR *format_spec, Py_ssize_t format_spec_len) { InternalFormatSpec format; @@ -1308,7 +1308,7 @@ #if defined FORMAT_LONG || defined FORMAT_INT static PyObject* format_int_or_long(PyObject* obj, - STRINGLIB_CHAR *format_spec, + const STRINGLIB_CHAR *format_spec, Py_ssize_t format_spec_len, IntOrLongToString tostring) { @@ -1389,7 +1389,7 @@ PyObject * FORMAT_LONG(PyObject *obj, - STRINGLIB_CHAR *format_spec, + const STRINGLIB_CHAR *format_spec, Py_ssize_t format_spec_len) { return format_int_or_long(obj, format_spec, format_spec_len, @@ -1410,7 +1410,7 @@ PyObject * FORMAT_INT(PyObject *obj, - STRINGLIB_CHAR *format_spec, + const STRINGLIB_CHAR *format_spec, Py_ssize_t format_spec_len) { return format_int_or_long(obj, format_spec, format_spec_len, @@ -1421,7 +1421,7 @@ #ifdef FORMAT_FLOAT PyObject * FORMAT_FLOAT(PyObject *obj, - STRINGLIB_CHAR *format_spec, + const STRINGLIB_CHAR *format_spec, Py_ssize_t format_spec_len) { PyObject *result = NULL; @@ -1469,7 +1469,7 @@ #ifdef FORMAT_COMPLEX PyObject * FORMAT_COMPLEX(PyObject *obj, - STRINGLIB_CHAR *format_spec, + const STRINGLIB_CHAR *format_spec, Py_ssize_t format_spec_len) { PyObject *result = NULL; Index: Objects/longobject.c =================================================================== --- Objects/longobject.c (revision 75468) +++ Objects/longobject.c (working copy) @@ -1685,10 +1685,10 @@ * string characters. */ static PyLongObject * -long_from_binary_base(char **str, int base) +long_from_binary_base(const char **str, int base) { - char *p = *str; - char *start = p; + const char *p = *str; + const char *start = p; int bits_per_char; Py_ssize_t n; PyLongObject *z; @@ -1745,10 +1745,10 @@ } PyObject * -PyLong_FromString(char *str, char **pend, int base) +PyLong_FromString(const char *str, char **pend, int base) { int sign = 1; - char *start, *orig_str = str; + const char *start, *orig_str = str; PyLongObject *z; PyObject *strobj, *strrepr; Py_ssize_t slen; @@ -1887,7 +1887,7 @@ int convwidth; twodigits convmultmax, convmult; digit *pz, *pzstop; - char* scan; + const char *scan; static double log_base_PyLong_BASE[37] = {0.0e0,}; static int convwidth_base[37] = {0,}; @@ -2004,7 +2004,7 @@ if (*str != '\0') goto onError; if (pend) - *pend = str; + *pend = (char *)str; return (PyObject *) z; onError: @@ -2026,7 +2026,7 @@ #ifdef Py_USING_UNICODE PyObject * -PyLong_FromUnicode(Py_UNICODE *u, Py_ssize_t length, int base) +PyLong_FromUnicode(const Py_UNICODE *u, Py_ssize_t length, int base) { PyObject *result; char *buffer = (char *)PyMem_MALLOC(length+1); Index: Modules/readline.c =================================================================== --- Modules/readline.c (revision 75468) +++ Modules/readline.c (working copy) @@ -36,9 +36,9 @@ rl_completion_matches((x), ((rl_compentry_func_t *)(y))) #else #if defined(_RL_FUNCTION_TYPEDEF) -extern char **completion_matches(char *, rl_compentry_func_t *); +extern char **completion_matches(const char *, rl_compentry_func_t *); #else -extern char **completion_matches(char *, CPFunction *); +extern char **completion_matches(const char *, CPFunction *); #endif #endif @@ -799,7 +799,7 @@ * before calling the normal completer */ static char ** -flex_complete(char *text, int start, int end) +flex_complete(const char *text, int start, int end) { Py_XDECREF(begidx); Py_XDECREF(endidx);