summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1997-01-06 22:42:50 (GMT)
committerBarry Warsaw <barry@python.org>1997-01-06 22:42:50 (GMT)
commitaccfb849f9a92e094617de4ff42a7b61ff2f265e (patch)
tree2a223855cbea3bef3a6d8ef43737e85390ba40d4 /Include
parent1f2bd07aedaf656da01fea898753881f71c3c45d (diff)
downloadcpython-accfb849f9a92e094617de4ff42a7b61ff2f265e.zip
cpython-accfb849f9a92e094617de4ff42a7b61ff2f265e.tar.gz
cpython-accfb849f9a92e094617de4ff42a7b61ff2f265e.tar.bz2
added PyString_GET_SIZE macro
for both PyString_GET_SIZE and PyString_AS_STRING, cast first argument to a PyStringObject*
Diffstat (limited to 'Include')
-rw-r--r--Include/stringobject.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Include/stringobject.h b/Include/stringobject.h
index 2c3e568..c2565d8 100644
--- a/Include/stringobject.h
+++ b/Include/stringobject.h
@@ -79,7 +79,8 @@ extern int _PyString_Resize Py_PROTO((PyObject **, int));
extern PyObject *PyString_Format Py_PROTO((PyObject *, PyObject *));
/* Macro, trading safety for speed */
-#define PyString_AS_STRING(op) ((op)->ob_sval)
+#define PyString_AS_STRING(op) (((PyStringObject *)(op))->ob_sval)
+#define PyString_GET_SIZE(op) (((PyStringObject *)(op))->ob_size)
#ifdef __cplusplus
}