]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Cruft cleanup: Removed the unused last_is_sticky argument from the internal
authorTim Peters <tim.peters@gmail.com>
Mon, 28 May 2001 22:30:08 +0000 (22:30 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 28 May 2001 22:30:08 +0000 (22:30 +0000)
_PyTuple_Resize().

Include/tupleobject.h
Misc/NEWS
Modules/_tkinter.c
Objects/abstract.c
Objects/tupleobject.c
Python/bltinmodule.c

index 9a614846ff61be98805dff18d73347e6f5d40b04..bf208547d49d87e2c882d2a5f61dcf3a3f4dd69d 100644 (file)
@@ -33,7 +33,7 @@ extern DL_IMPORT(int) PyTuple_Size(PyObject *);
 extern DL_IMPORT(PyObject *) PyTuple_GetItem(PyObject *, int);
 extern DL_IMPORT(int) PyTuple_SetItem(PyObject *, int, PyObject *);
 extern DL_IMPORT(PyObject *) PyTuple_GetSlice(PyObject *, int, int);
-extern DL_IMPORT(int) _PyTuple_Resize(PyObject **, int, int);
+extern DL_IMPORT(int) _PyTuple_Resize(PyObject **, int);
 
 /* Macro, trading safety for speed */
 #define PyTuple_GET_ITEM(op, i) (((PyTupleObject *)(op))->ob_item[i])
index b9601175855c87aa573e84b86fd38c0874c67800..be58d95fea1bf2d64587c22797555d2eb11d3379 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -155,6 +155,12 @@ New platforms
 - Python should compile and run out of the box using the Borland C
   compiler (under Windows), thanks to Stephen Hansen.
 
+C API
+
+- Removed the unused last_is_sticky argument from the internal
+  _PyTuple_Resize().  If this affects you, you were cheating.
+
+
 What's New in Python 2.1 (final)?
 =================================
 
index 86b5c220e319dc796bd1590b828b33bac2faa6bf..ceac18bbb8fb67e286015b23ef736108ac7cd453 100644 (file)
@@ -1851,7 +1851,7 @@ _bump(FlattenContext* context, int size)
 
        context->maxsize = maxsize;
 
-       return _PyTuple_Resize(&context->tuple, maxsize, 0) >= 0;
+       return _PyTuple_Resize(&context->tuple, maxsize) >= 0;
 }
 
 static int
@@ -1935,7 +1935,7 @@ Tkinter_Flatten(PyObject* self, PyObject* args)
        if (!_flatten1(&context, item,0))
                return NULL;
 
-       if (_PyTuple_Resize(&context.tuple, context.size, 0))
+       if (_PyTuple_Resize(&context.tuple, context.size))
                return NULL;
 
        return context.tuple;
index c1d7789747819f76a42dc9a7fcef73b82cbf2091..63fe7d51225177da639b0f20c3345e2308113f0c 100644 (file)
@@ -1220,7 +1220,7 @@ PySequence_Tuple(PyObject *v)
                                n += 10;
                        else
                                n += 100;
-                       if (_PyTuple_Resize(&result, n, 0) != 0) {
+                       if (_PyTuple_Resize(&result, n) != 0) {
                                Py_DECREF(item);
                                goto Fail;
                        }
@@ -1230,7 +1230,7 @@ PySequence_Tuple(PyObject *v)
 
        /* Cut tuple back if guess was too large. */
        if (j < n &&
-           _PyTuple_Resize(&result, j, 0) != 0)
+           _PyTuple_Resize(&result, j) != 0)
                goto Fail;
 
        Py_DECREF(it);
index 16e0b12666f81e06d047fac59f63162ba6e4938d..94f1859b8c3183c46a6a9d4c54e2fa81c80d7923 100644 (file)
@@ -488,11 +488,10 @@ PyTypeObject PyTuple_Type = {
    is only one module referencing the object.  You can also think of it
    as creating a new tuple object and destroying the old one, only more
    efficiently.  In any case, don't use this if the tuple may already be
-   known to some other part of the code.  The last_is_sticky is not used
-   and must always be false. */
+   known to some other part of the code. */
 
 int
-_PyTuple_Resize(PyObject **pv, int newsize, int last_is_sticky)
+_PyTuple_Resize(PyObject **pv, int newsize)
 {
        register PyTupleObject *v;
        register PyTupleObject *sv;
@@ -500,7 +499,7 @@ _PyTuple_Resize(PyObject **pv, int newsize, int last_is_sticky)
        int sizediff;
 
        v = (PyTupleObject *) *pv;
-       if (v == NULL || !PyTuple_Check(v) || last_is_sticky ||
+       if (v == NULL || !PyTuple_Check(v) ||
            (v->ob_size != 0 && v->ob_refcnt != 1)) {
                *pv = 0;
                Py_XDECREF(v);
index 78e2f370b8978628d3624d669dd98089b40fc145..1e9868af14fd03d680fe39f01e42b86f141cf6ab 100644 (file)
@@ -2329,7 +2329,7 @@ filtertuple(PyObject *func, PyObject *tuple)
                }
        }
 
-       if (_PyTuple_Resize(&result, j, 0) < 0)
+       if (_PyTuple_Resize(&result, j) < 0)
                return NULL;
 
        return result;