--- Python-2.5/Include/intobject.h.orig 2008-01-22 13:23:55.000000000 -0500 +++ Python-2.5/Include/intobject.h 2008-01-22 14:01:08.000000000 -0500 @@ -28,11 +28,11 @@ PyAPI_DATA(PyTypeObject) PyInt_Type; #define PyInt_Check(op) PyObject_TypeCheck(op, &PyInt_Type) #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); #endif PyAPI_FUNC(PyObject *) PyInt_FromLong(long); PyAPI_FUNC(PyObject *) PyInt_FromSize_t(size_t); @@ -53,12 +53,12 @@ * are necessary for systems that need the magic of PyAPI_FUNC and that want * to have stropmodule as a dynamically loaded module instead of building it * 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); #ifdef __cplusplus } #endif #endif /* !Py_INTOBJECT_H */ --- Python-2.5/Include/longobject.h.orig 2008-01-22 13:37:39.000000000 -0500 +++ Python-2.5/Include/longobject.h 2008-01-22 14:01:25.000000000 -0500 @@ -45,11 +45,11 @@ PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLong(PyObject *); PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLong(PyObject *); 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); #endif /* _PyLong_Sign. Return 0 if v is 0, -1 if v < 0, +1 if v > 0. --- Python-2.5/Doc/api/concrete.tex.orig 2008-01-22 14:34:52.000000000 -0500 +++ Python-2.5/Doc/api/concrete.tex 2008-01-22 14:35:20.000000000 -0500 @@ -132,11 +132,11 @@ Return true if \var{o} is of type \cdata{PyInt_Type}, but not a subtype of \cdata{PyInt_Type}. \versionadded{2.2} \end{cfuncdesc} -\begin{cfuncdesc}{PyObject*}{PyInt_FromString}{char *str, char **pend, +\begin{cfuncdesc}{PyObject*}{PyInt_FromString}{const char *str, char **pend, int base} Return a new \ctype{PyIntObject} or \ctype{PyLongObject} based on the string value in \var{str}, which is interpreted according to the radix in \var{base}. If \var{pend} is non-\NULL{}, \code{*\var{pend}} will point to the first character in \var{str} which follows the representation of the @@ -301,11 +301,11 @@ \begin{cfuncdesc}{PyObject*}{PyLong_FromDouble}{double v} Return a new \ctype{PyLongObject} object from the integer part of \var{v}, or \NULL{} on failure. \end{cfuncdesc} -\begin{cfuncdesc}{PyObject*}{PyLong_FromString}{char *str, char **pend, +\begin{cfuncdesc}{PyObject*}{PyLong_FromString}{const char *str, char **pend, int base} Return a new \ctype{PyLongObject} based on the string value in \var{str}, which is interpreted according to the radix in \var{base}. If \var{pend} is non-\NULL{}, \code{*\var{pend}} will point to the first character in \var{str} which follows the --- Python-2.5/Objects/intobject.c.orig 2008-01-22 13:27:38.000000000 -0500 +++ Python-2.5/Objects/intobject.c 2008-01-22 14:23:36.000000000 -0500 @@ -334,13 +334,13 @@ return val; } #endif PyObject * -PyInt_FromString(char *s, char **pend, int base) +PyInt_FromString(const char *s, char **pend, int base) { - char *end; + const char *end; long x; Py_ssize_t slen; PyObject *sobj, *srepr; if ((base != 0 && base < 2) || base > 36) { @@ -351,16 +351,16 @@ while (*s && isspace(Py_CHARMASK(*s))) s++; errno = 0; if (base == 0 && s[0] == '0') { - x = (long) PyOS_strtoul(s, &end, base); + x = (long) PyOS_strtoul(s, (char **)&end, base); if (x < 0) return PyLong_FromString(s, pend, base); } else - x = PyOS_strtol(s, &end, base); + x = PyOS_strtol(s, (char **)&end, base); if (end == s || !isalnum(Py_CHARMASK(end[-1]))) goto bad; while (*end && isspace(Py_CHARMASK(*end))) end++; if (*end != '\0') { @@ -380,11 +380,11 @@ return NULL; } else if (errno != 0) return PyLong_FromString(s, pend, base); if (pend) - *pend = end; + *pend = (char *)end; return PyInt_FromLong(x); } #ifdef Py_USING_UNICODE PyObject * --- Python-2.5/Objects/longobject.c.orig 2008-01-22 13:38:38.000000000 -0500 +++ Python-2.5/Objects/longobject.c 2008-01-22 14:24:25.000000000 -0500 @@ -1341,14 +1341,14 @@ * non-digit (which may be *str!). A normalized long is returned. * The point to this routine is that it takes time linear in the number of * 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; twodigits accum; int bits_in_accum; @@ -1402,14 +1402,14 @@ *pdigit++ = 0; return long_normalize(z); } 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; if ((base != 0 && base < 2) || base > 36) { @@ -1531,11 +1531,11 @@ Py_ssize_t size_z; int i; int convwidth; twodigits convmultmax, convmult; digit *pz, *pzstop; - char* scan; + const char* scan; static double log_base_BASE[37] = {0.0e0,}; static int convwidth_base[37] = {0,}; static twodigits convmultmax_base[37] = {0,}; @@ -1648,11 +1648,11 @@ while (*str && isspace(Py_CHARMASK(*str))) str++; if (*str != '\0') goto onError; if (pend) - *pend = str; + *pend = (char *)str; return (PyObject *) z; onError: Py_XDECREF(z); slen = strlen(orig_str) < 200 ? strlen(orig_str) : 200; --- Python-2.5/Python/mystrtoul.c.orig 2008-01-22 13:34:55.000000000 -0500 +++ Python-2.5/Python/mystrtoul.c 2008-01-22 14:06:12.000000000 -0500 @@ -98,11 +98,11 @@ ** the end of the scan. ** Errors due to bad pointers will probably result in ** 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 */ register int ovlimit; /* required digits to overflow */ @@ -136,11 +136,11 @@ } /* catch silly bases */ if (base < 2 || base > 36) { if (ptr) - *ptr = str; + *ptr = (char *)str; return 0; } /* skip leading zeroes */ while (*str == '0') @@ -178,20 +178,20 @@ --ovlimit; } /* set pointer to point to the last character scanned */ if (ptr) - *ptr = str; + *ptr = (char *)str; return result; overflowed: if (ptr) { /* spool through remaining digit characters */ while (_PyLong_DigitValue[Py_CHARMASK(*str)] < base) ++str; - *ptr = str; + *ptr = (char *)str; } errno = ERANGE; return (unsigned long)-1; } @@ -202,11 +202,11 @@ * pattern for the largest postive signed long is LONG_MAX, and for * the smallest negative signed long is LONG_MAX + 1. */ long -PyOS_strtol(char *str, char **ptr, int base) +PyOS_strtol(const char *str, char **ptr, int base) { long result; unsigned long uresult; char sign;