summaryrefslogtreecommitdiffstats
path: root/Objects/setobject.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-04-11 09:04:12 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-04-11 09:04:12 (GMT)
commit72d206776d34bcc38abbf16aa93c2d25ebec4df9 (patch)
treeb88b17cdf6d890bbefebe7736147b590ac00a8b4 /Objects/setobject.c
parent9eec489c4a021d181bc7ccc37921543114b69988 (diff)
downloadcpython-72d206776d34bcc38abbf16aa93c2d25ebec4df9.zip
cpython-72d206776d34bcc38abbf16aa93c2d25ebec4df9.tar.gz
cpython-72d206776d34bcc38abbf16aa93c2d25ebec4df9.tar.bz2
Remove "static forward" declaration. Move constructors
after the type objects.
Diffstat (limited to 'Objects/setobject.c')
-rw-r--r--Objects/setobject.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c
index 1a28724..edc43df 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -3,7 +3,7 @@
Written and maintained by Raymond D. Hettinger <python@rcn.com>
Derived from Lib/sets.py and Objects/dictobject.c.
- Copyright (c) 2003-5 Python Software Foundation.
+ Copyright (c) 2003-6 Python Software Foundation.
All rights reserved.
*/
@@ -719,8 +719,6 @@ set_nohash(PyObject *self)
/***** Set iterator type ***********************************************/
-static PyTypeObject PySetIter_Type; /* Forward */
-
typedef struct {
PyObject_HEAD
PySetObject *si_set; /* Set to NULL when iterator is exhausted */
@@ -729,20 +727,6 @@ typedef struct {
long len;
} setiterobject;
-static PyObject *
-set_iter(PySetObject *so)
-{
- setiterobject *si = PyObject_New(setiterobject, &PySetIter_Type);
- if (si == NULL)
- return NULL;
- Py_INCREF(so);
- si->si_set = so;
- si->si_used = so->used;
- si->si_pos = 0;
- si->len = so->used;
- return (PyObject *)si;
-}
-
static void
setiter_dealloc(setiterobject *si)
{
@@ -838,6 +822,20 @@ static PyTypeObject PySetIter_Type = {
0,
};
+static PyObject *
+set_iter(PySetObject *so)
+{
+ setiterobject *si = PyObject_New(setiterobject, &PySetIter_Type);
+ if (si == NULL)
+ return NULL;
+ Py_INCREF(so);
+ si->si_set = so;
+ si->si_used = so->used;
+ si->si_pos = 0;
+ si->len = so->used;
+ return (PyObject *)si;
+}
+
static int
set_update_internal(PySetObject *so, PyObject *other)
{