]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
addet SETTUPLEITEM and added cast to GETTUPLEITEM
authorGuido van Rossum <guido@python.org>
Thu, 9 Mar 1995 12:10:16 +0000 (12:10 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 9 Mar 1995 12:10:16 +0000 (12:10 +0000)
Include/rename2.h
Include/tupleobject.h

index aeeb1b98deef9309af2883d3785b8841ea8fd579..5283ccfa5b98fd8d5cffc33f6ffc5506e95ebfb3 100644 (file)
@@ -253,6 +253,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #define newdictobject PyDict_New
 #define gettupleitem PyTuple_GetItem
 #define GETTUPLEITEM PyTuple_GET_ITEM
+#define SETTUPLEITEM PyTuple_SET_ITEM
 #define gettuplesize PyTuple_Size
 #define gettupleslice PyTuple_GetSlice
 #define newtupleobject PyTuple_New
index da7689169df6467347f4e5f014cf2fda46f2b1f1..992c77085ba5a2cea33b0e0b471cfcc6288df23f 100644 (file)
@@ -61,7 +61,10 @@ extern PyObject *PyTuple_GetSlice Py_PROTO((PyObject *, int, int));
 extern int _PyTuple_Resize Py_PROTO((PyObject **, int, int));
 
 /* Macro, trading safety for speed */
-#define PyTuple_GET_ITEM(op, i) ((op)->ob_item[i])
+#define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i])
+
+/* Macro, *only* to be used to fill in brand new tuples */
+#define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v)
 
 #ifdef __cplusplus
 }