summaryrefslogtreecommitdiff
path: root/Objects/setobject.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-04-11 09:04:12 +0000
committerMartin v. Löwis <martin@v.loewis.de>2006-04-11 09:04:12 +0000
commit57e44e8bce555c25fafab7059167a227306edc0c (patch)
tree242d1a42b10e2f29a73d7cb64c6706df24d9891f /Objects/setobject.c
parentf7f24a733f0f5e502075a6b171a301a1fd50b049 (diff)
downloadcpython-57e44e8bce555c25fafab7059167a227306edc0c.tar.gz
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 1a287240fa..edc43df574 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)
{