diff options
-rw-r--r-- | Modules/stropmodule.c | 2 | ||||
-rw-r--r-- | Objects/classobject.c | 10 | ||||
-rw-r--r-- | Objects/frameobject.c | 4 | ||||
-rw-r--r-- | Objects/stringobject.c | 9 | ||||
-rw-r--r-- | Parser/tokenizer.c | 4 | ||||
-rw-r--r-- | Python/import.c | 4 | ||||
-rw-r--r-- | Python/traceback.c | 2 |
7 files changed, 19 insertions, 16 deletions
diff --git a/Modules/stropmodule.c b/Modules/stropmodule.c index cffef3a..2f671b6 100644 --- a/Modules/stropmodule.c +++ b/Modules/stropmodule.c @@ -942,7 +942,7 @@ strop_translate(PyObject *self, PyObject *args) } table = table1; - inlen = PyString_Size(input_obj); + inlen = PyString_GET_SIZE(input_obj); result = PyString_FromStringAndSize((char *)NULL, inlen); if (result == NULL) return NULL; diff --git a/Objects/classobject.c b/Objects/classobject.c index 037252d..f3e636a 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -388,15 +388,15 @@ class_str(PyClassObject *op) Py_INCREF(name); return name; } - m = PyString_Size(mod); - n = PyString_Size(name); + m = PyString_GET_SIZE(mod); + n = PyString_GET_SIZE(name); res = PyString_FromStringAndSize((char *)NULL, m+1+n); if (res != NULL) { - char *s = PyString_AsString(res); - memcpy(s, PyString_AsString(mod), m); + char *s = PyString_AS_STRING(res); + memcpy(s, PyString_AS_STRING(mod), m); s += m; *s++ = '.'; - memcpy(s, PyString_AsString(name), n); + memcpy(s, PyString_AS_STRING(name), n); } return res; } diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 6e3f297..8aa3377 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -749,7 +749,7 @@ PyFrame_FastToLocals(PyFrameObject *f) return; PyErr_Fetch(&error_type, &error_value, &error_traceback); fast = f->f_localsplus; - j = PyTuple_Size(map); + j = PyTuple_GET_SIZE(map); if (j > f->f_nlocals) j = f->f_nlocals; if (f->f_nlocals) @@ -787,7 +787,7 @@ PyFrame_LocalsToFast(PyFrameObject *f, int clear) return; PyErr_Fetch(&error_type, &error_value, &error_traceback); fast = f->f_localsplus; - j = PyTuple_Size(map); + j = PyTuple_GET_SIZE(map); if (j > f->f_nlocals) j = f->f_nlocals; if (f->f_nlocals) diff --git a/Objects/stringobject.c b/Objects/stringobject.c index d23c973..e3a0197 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -569,8 +569,9 @@ PyObject *PyString_DecodeEscape(const char *s, if (!w) goto failed; /* Append bytes to output buffer. */ - r = PyString_AsString(w); - rn = PyString_Size(w); + assert(PyString_Check(w)); + r = PyString_AS_STRING(w); + rn = PyString_GET_SIZE(w); memcpy(p, r, rn); p += rn; Py_DECREF(w); @@ -2314,12 +2315,12 @@ string_translate(PyStringObject *self, PyObject *args) } table = table1; - inlen = PyString_Size(input_obj); + inlen = PyString_GET_SIZE(input_obj); result = PyString_FromStringAndSize((char *)NULL, inlen); if (result == NULL) return NULL; output_start = output = PyString_AsString(result); - input = PyString_AsString(input_obj); + input = PyString_AS_STRING(input_obj); if (dellen == 0) { /* If no deletions are required, use faster code */ diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 3c82588..b0d9b80 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -711,7 +711,9 @@ tok_stdin_decode(struct tok_state *tok, char **inp) if (utf8 == NULL) goto error_clear; - converted = new_string(PyString_AsString(utf8), PyString_Size(utf8)); + assert(PyString_Check(utf8)); + converted = new_string(PyString_AS_STRING(utf8), + PyString_GET_SIZE(utf8)); Py_DECREF(utf8); if (converted == NULL) goto error_nomem; diff --git a/Python/import.c b/Python/import.c index 73051a2..e58dbd5 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1216,12 +1216,12 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf, #endif if (!PyString_Check(v)) continue; - len = PyString_Size(v); + len = PyString_GET_SIZE(v); if (len + 2 + namelen + MAXSUFFIXSIZE >= buflen) { Py_XDECREF(copy); continue; /* Too long */ } - strcpy(buf, PyString_AsString(v)); + strcpy(buf, PyString_AS_STRING(v)); if (strlen(buf) != len) { Py_XDECREF(copy); continue; /* v contains '\0' */ diff --git a/Python/traceback.c b/Python/traceback.c index 6c11cf5..567f23d 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -165,7 +165,7 @@ tb_displayline(PyObject *f, char *filename, int lineno, char *name) } if (PyString_Check(v)) { size_t len; - len = PyString_Size(v); + len = PyString_GET_SIZE(v); if (len + 1 + taillen >= MAXPATHLEN) continue; /* Too long */ strcpy(namebuf, PyString_AsString(v)); |