From c679227e31245b0e8dec74a1f7cc77710541d985 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sat, 19 Oct 2013 21:03:34 +0300 Subject: Issue #1772673: The type of `char*` arguments now changed to `const char*`. --- Python/mystrtoul.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'Python/mystrtoul.c') diff --git a/Python/mystrtoul.c b/Python/mystrtoul.c index 725f07c9fe..98429d4b42 100644 --- a/Python/mystrtoul.c +++ b/Python/mystrtoul.c @@ -92,7 +92,7 @@ static int digitlimit[] = { ** exceptions - we don't check for them. */ unsigned long -PyOS_strtoul(char *str, char **ptr, int base) +PyOS_strtoul(const char *str, char **ptr, int base) { unsigned long result = 0; /* return value of the function */ int c; /* current input character */ @@ -111,7 +111,7 @@ PyOS_strtoul(char *str, char **ptr, int base) /* 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 @@ PyOS_strtoul(char *str, char **ptr, int base) /* 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 @@ PyOS_strtoul(char *str, char **ptr, int base) /* 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; @@ -141,7 +141,7 @@ PyOS_strtoul(char *str, char **ptr, int base) while (Py_ISSPACE(Py_CHARMASK(*str))) ++str; if (ptr) - *ptr = str; + *ptr = (char *)str; return 0; } } @@ -157,7 +157,7 @@ PyOS_strtoul(char *str, char **ptr, int base) /* 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; @@ -171,7 +171,7 @@ PyOS_strtoul(char *str, char **ptr, int base) /* 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; @@ -185,7 +185,7 @@ PyOS_strtoul(char *str, char **ptr, int base) /* 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; @@ -197,7 +197,7 @@ PyOS_strtoul(char *str, char **ptr, int base) /* catch silly bases */ if (base < 2 || base > 36) { if (ptr) - *ptr = str; + *ptr = (char *)str; return 0; } @@ -239,7 +239,7 @@ PyOS_strtoul(char *str, char **ptr, int base) /* set pointer to point to the last character scanned */ if (ptr) - *ptr = str; + *ptr = (char *)str; return result; @@ -248,7 +248,7 @@ overflowed: /* spool through remaining digit characters */ while (_PyLong_DigitValue[Py_CHARMASK(*str)] < base) ++str; - *ptr = str; + *ptr = (char *)str; } errno = ERANGE; return (unsigned long)-1; @@ -260,7 +260,7 @@ overflowed: #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; -- cgit v1.2.1