From: Barry Warsaw Date: Mon, 6 Jan 1997 22:42:50 +0000 (+0000) Subject: added PyString_GET_SIZE macro X-Git-Tag: v1.5a1~579 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=accfb849f9a92e094617de4ff42a7b61ff2f265e;p=python added PyString_GET_SIZE macro for both PyString_GET_SIZE and PyString_AS_STRING, cast first argument to a PyStringObject* --- diff --git a/Include/stringobject.h b/Include/stringobject.h index 2c3e56882f..c2565d8e41 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 }