diff options
author | Anthony Baxter <anthonybaxter@gmail.com> | 2006-04-11 05:39:14 (GMT) |
---|---|---|
committer | Anthony Baxter <anthonybaxter@gmail.com> | 2006-04-11 05:39:14 (GMT) |
commit | 114900298ea26e5e25edd5d05f24648dcd5ea95b (patch) | |
tree | 9db37abbea9f0bd5dc1332f6f710de5e521e3c2c /Parser/myreadline.c | |
parent | 319c47fcdb3b8196cc580c4fab409b0ee58119fe (diff) | |
download | cpython-114900298ea26e5e25edd5d05f24648dcd5ea95b.zip cpython-114900298ea26e5e25edd5d05f24648dcd5ea95b.tar.gz cpython-114900298ea26e5e25edd5d05f24648dcd5ea95b.tar.bz2 |
Fix the code in Parser/ to also compile with C++. This was mostly casts for
malloc/realloc type functions, as well as renaming one variable called 'new'
in tokensizer.c. Still lots more to be done, going to be checking in one
chunk at a time or the patch will be massively huge. Still compiles ok with
gcc.
Diffstat (limited to 'Parser/myreadline.c')
-rw-r--r-- | Parser/myreadline.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Parser/myreadline.c b/Parser/myreadline.c index 630997b..7b27ea2 100644 --- a/Parser/myreadline.c +++ b/Parser/myreadline.c @@ -111,7 +111,7 @@ PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char *prompt) size_t n; char *p; n = 100; - if ((p = PyObject_MALLOC(n)) == NULL) + if ((p = (char *)PyObject_MALLOC(n)) == NULL) return NULL; fflush(sys_stdout); #ifndef RISCOS @@ -141,7 +141,7 @@ PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char *prompt) n = strlen(p); while (n > 0 && p[n-1] != '\n') { size_t incr = n+2; - p = PyObject_REALLOC(p, n + incr); + p = (char *)PyObject_REALLOC(p, n + incr); if (p == NULL) return NULL; if (incr > INT_MAX) { @@ -151,7 +151,7 @@ PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char *prompt) break; n += strlen(p+n); } - return PyObject_REALLOC(p, n+1); + return (char *)PyObject_REALLOC(p, n+1); } |