diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2002-07-17 16:30:39 +0000 |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2002-07-17 16:30:39 +0000 |
commit | 938ace69a0e112424a2f426a4881d1fd1fc922d2 (patch) | |
tree | 29d42e42ec17a6ba2124b6fa36c3f00b23534413 /Modules | |
parent | Some modernization. Get rid of the redundant next() method. Always (diff) | |
download | cpython-938ace69a0e112424a2f426a4881d1fd1fc922d2.tar.gz cpython-938ace69a0e112424a2f426a4881d1fd1fc922d2.tar.bz2 cpython-938ace69a0e112424a2f426a4881d1fd1fc922d2.zip |
staticforward bites the dust.
The staticforward define was needed to support certain broken C
compilers (notably SCO ODT 3.0, perhaps early AIX as well) botched the
static keyword when it was used with a forward declaration of a static
initialized structure. Standard C allows the forward declaration with
static, and we've decided to stop catering to broken C compilers. (In
fact, we expect that the compilers are all fixed eight years later.)
I'm leaving staticforward and statichere defined in object.h as
static. This is only for backwards compatibility with C extensions
that might still use it.
XXX I haven't updated the documentation.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_sre.c | 6 | ||||
-rw-r--r-- | Modules/_ssl.c | 8 | ||||
-rw-r--r-- | Modules/_tkinter.c | 6 | ||||
-rw-r--r-- | Modules/almodule.c | 4 | ||||
-rw-r--r-- | Modules/arraymodule.c | 2 | ||||
-rw-r--r-- | Modules/bsddbmodule.c | 2 | ||||
-rw-r--r-- | Modules/cPickle.c | 4 | ||||
-rw-r--r-- | Modules/cmathmodule.c | 6 | ||||
-rw-r--r-- | Modules/dbmmodule.c | 2 | ||||
-rw-r--r-- | Modules/dlmodule.c | 2 | ||||
-rw-r--r-- | Modules/flmodule.c | 4 | ||||
-rw-r--r-- | Modules/fmmodule.c | 2 | ||||
-rw-r--r-- | Modules/gdbmmodule.c | 2 | ||||
-rw-r--r-- | Modules/linuxaudiodev.c | 2 | ||||
-rw-r--r-- | Modules/md5module.c | 2 | ||||
-rw-r--r-- | Modules/mpzmodule.c | 2 | ||||
-rw-r--r-- | Modules/parsermodule.c | 19 | ||||
-rw-r--r-- | Modules/pcremodule.c | 4 | ||||
-rw-r--r-- | Modules/pyexpat.c | 4 | ||||
-rw-r--r-- | Modules/rotormodule.c | 2 | ||||
-rw-r--r-- | Modules/selectmodule.c | 2 | ||||
-rw-r--r-- | Modules/shamodule.c | 2 | ||||
-rw-r--r-- | Modules/socketmodule.c | 2 | ||||
-rw-r--r-- | Modules/sunaudiodev.c | 4 | ||||
-rw-r--r-- | Modules/threadmodule.c | 2 | ||||
-rw-r--r-- | Modules/xreadlinesmodule.c | 2 | ||||
-rw-r--r-- | Modules/xxmodule.c | 2 | ||||
-rw-r--r-- | Modules/xxsubtype.c | 4 | ||||
-rw-r--r-- | Modules/zlibmodule.c | 4 |
29 files changed, 52 insertions, 57 deletions
diff --git a/Modules/_sre.c b/Modules/_sre.c index 839763dc722..fdc8207def3 100644 --- a/Modules/_sre.c +++ b/Modules/_sre.c @@ -1293,9 +1293,9 @@ SRE_LITERAL_TEMPLATE(SRE_CHAR* ptr, int len) /* see sre.h for object declarations */ -staticforward PyTypeObject Pattern_Type; -staticforward PyTypeObject Match_Type; -staticforward PyTypeObject Scanner_Type; +static PyTypeObject Pattern_Type; +static PyTypeObject Match_Type; +static PyTypeObject Scanner_Type; static PyObject * _compile(PyObject* self_, PyObject* args) diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 13177918018..5f5e530487e 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -61,9 +61,9 @@ typedef struct { } PySSLObject; -staticforward PyTypeObject PySSL_Type; -staticforward PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args); -staticforward PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args); +static PyTypeObject PySSL_Type; +static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args); +static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args); #define PySSLObject_Check(v) ((v)->ob_type == &PySSL_Type) @@ -354,7 +354,7 @@ static PyObject *PySSL_getattr(PySSLObject *self, char *name) return Py_FindMethod(PySSLMethods, (PyObject *)self, name); } -staticforward PyTypeObject PySSL_Type = { +static PyTypeObject PySSL_Type = { PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "socket.SSL", /*tp_name*/ diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 788177f06e8..6c75a5d1dd9 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -186,7 +186,7 @@ typedef int (*TclMacConvertEventPtr) (EventRecord *eventPtr); void Tcl_MacSetEventProc(TclMacConvertEventPtr procPtr); int TkMacConvertEvent(EventRecord *eventPtr); -staticforward int PyMacConvertEvent(EventRecord *eventPtr); +static int PyMacConvertEvent(EventRecord *eventPtr); #include <SIOUX.h> extern int SIOUXIsAppWindow(WindowPtr); @@ -199,7 +199,7 @@ extern int SIOUXIsAppWindow(WindowPtr); /**** Tkapp Object Declaration ****/ -staticforward PyTypeObject Tkapp_Type; +static PyTypeObject Tkapp_Type; typedef struct { PyObject_HEAD @@ -1515,7 +1515,7 @@ Tkapp_DeleteFileHandler(PyObject *self, PyObject *args) /**** Tktt Object (timer token) ****/ -staticforward PyTypeObject Tktt_Type; +static PyTypeObject Tktt_Type; typedef struct { PyObject_HEAD diff --git a/Modules/almodule.c b/Modules/almodule.c index 05c4bef97d2..8954528ce18 100644 --- a/Modules/almodule.c +++ b/Modules/almodule.c @@ -24,7 +24,7 @@ typedef struct { ALport port; } alpobject; -staticforward PyTypeObject Alptype; +static PyTypeObject Alptype; @@ -38,7 +38,7 @@ typedef struct { ALconfig config; } alcobject; -staticforward PyTypeObject Alctype; +static PyTypeObject Alctype; static void diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index c0e59bc0d3f..87c51cc9ca6 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -35,7 +35,7 @@ typedef struct arrayobject { struct arraydescr *ob_descr; } arrayobject; -staticforward PyTypeObject Arraytype; +static PyTypeObject Arraytype; #define array_Check(op) PyObject_TypeCheck(op, &Arraytype) #define array_CheckExact(op) ((op)->ob_type == &Arraytype) diff --git a/Modules/bsddbmodule.c b/Modules/bsddbmodule.c index 74f91335ec1..afb239039e1 100644 --- a/Modules/bsddbmodule.c +++ b/Modules/bsddbmodule.c @@ -39,7 +39,7 @@ typedef struct { #endif } bsddbobject; -staticforward PyTypeObject Bsddbtype; +static PyTypeObject Bsddbtype; #define is_bsddbobject(v) ((v)->ob_type == &Bsddbtype) #define check_bsddbobject_open(v, r) if ((v)->di_bsddb == NULL) \ diff --git a/Modules/cPickle.c b/Modules/cPickle.c index ce326830fb0..af424841ed2 100644 --- a/Modules/cPickle.c +++ b/Modules/cPickle.c @@ -288,7 +288,7 @@ typedef struct Picklerobject { #define PY_CPICKLE_FAST_LIMIT 50 #endif -staticforward PyTypeObject Picklertype; +static PyTypeObject Picklertype; typedef struct Unpicklerobject { PyObject_HEAD @@ -313,7 +313,7 @@ typedef struct Unpicklerobject { PyObject *find_class; } Unpicklerobject; -staticforward PyTypeObject Unpicklertype; +static PyTypeObject Unpicklertype; /* Forward decls that need the above structs */ static int save(Picklerobject *, PyObject *, int); diff --git a/Modules/cmathmodule.c b/Modules/cmathmodule.c index 0437368de4c..5bb08f2913a 100644 --- a/Modules/cmathmodule.c +++ b/Modules/cmathmodule.c @@ -17,9 +17,9 @@ static Py_complex c_i = {0., 1.}; static Py_complex c_halfi = {0., 0.5}; /* forward declarations */ -staticforward Py_complex c_log(Py_complex); -staticforward Py_complex c_prodi(Py_complex); -staticforward Py_complex c_sqrt(Py_complex); +static Py_complex c_log(Py_complex); +static Py_complex c_prodi(Py_complex); +static Py_complex c_sqrt(Py_complex); static Py_complex diff --git a/Modules/dbmmodule.c b/Modules/dbmmodule.c index bbc70a8427a..dde5b49df33 100644 --- a/Modules/dbmmodule.c +++ b/Modules/dbmmodule.c @@ -31,7 +31,7 @@ typedef struct { DBM *di_dbm; } dbmobject; -staticforward PyTypeObject Dbmtype; +static PyTypeObject Dbmtype; #define is_dbmobject(v) ((v)->ob_type == &Dbmtype) #define check_dbmobject_open(v) if ((v)->di_dbm == NULL) \ diff --git a/Modules/dlmodule.c b/Modules/dlmodule.c index 4606ea887f1..ea083e2ee53 100644 --- a/Modules/dlmodule.c +++ b/Modules/dlmodule.c @@ -15,7 +15,7 @@ typedef struct { PyUnivPtr *dl_handle; } dlobject; -staticforward PyTypeObject Dltype; +static PyTypeObject Dltype; static PyObject *Dlerror; diff --git a/Modules/flmodule.c b/Modules/flmodule.c index 483ce6efed3..b3e7d1f8092 100644 --- a/Modules/flmodule.c +++ b/Modules/flmodule.c @@ -29,7 +29,7 @@ typedef struct { PyObject *ob_callback_arg; } genericobject; -staticforward PyTypeObject GenericObjecttype; +static PyTypeObject GenericObjecttype; #define is_genericobject(g) ((g)->ob_type == &GenericObjecttype) @@ -1189,7 +1189,7 @@ typedef struct { FL_FORM *ob_form; } formobject; -staticforward PyTypeObject Formtype; +static PyTypeObject Formtype; #define is_formobject(v) ((v)->ob_type == &Formtype) diff --git a/Modules/fmmodule.c b/Modules/fmmodule.c index d6d753a4ab0..78a58772c2a 100644 --- a/Modules/fmmodule.c +++ b/Modules/fmmodule.c @@ -15,7 +15,7 @@ typedef struct { fmfonthandle fh_fh; } fhobject; -staticforward PyTypeObject Fhtype; +static PyTypeObject Fhtype; #define is_fhobject(v) ((v)->ob_type == &Fhtype) diff --git a/Modules/gdbmmodule.c b/Modules/gdbmmodule.c index 1da53ff2d09..6e85ed34690 100644 --- a/Modules/gdbmmodule.c +++ b/Modules/gdbmmodule.c @@ -34,7 +34,7 @@ typedef struct { GDBM_FILE di_dbm; } dbmobject; -staticforward PyTypeObject Dbmtype; +static PyTypeObject Dbmtype; #define is_dbmobject(v) ((v)->ob_type == &Dbmtype) #define check_dbmobject_open(v) if ((v)->di_dbm == NULL) \ diff --git a/Modules/linuxaudiodev.c b/Modules/linuxaudiodev.c index 7d4abc99cb7..74cfdee4f32 100644 --- a/Modules/linuxaudiodev.c +++ b/Modules/linuxaudiodev.c @@ -70,7 +70,7 @@ static struct { static int n_audio_types = sizeof(audio_types) / sizeof(audio_types[0]); -staticforward PyTypeObject Ladtype; +static PyTypeObject Ladtype; static PyObject *LinuxAudioError; diff --git a/Modules/md5module.c b/Modules/md5module.c index 045f27ffc83..b7f2c69eab3 100644 --- a/Modules/md5module.c +++ b/Modules/md5module.c @@ -17,7 +17,7 @@ typedef struct { MD5_CTX md5; /* the context holder */ } md5object; -staticforward PyTypeObject MD5type; +static PyTypeObject MD5type; #define is_md5object(v) ((v)->ob_type == &MD5type) diff --git a/Modules/mpzmodule.c b/Modules/mpzmodule.c index 0cdc84d4c1e..0cb6495642e 100644 --- a/Modules/mpzmodule.c +++ b/Modules/mpzmodule.c @@ -75,7 +75,7 @@ typedef struct { MP_INT mpz; /* the actual number */ } mpzobject; -staticforward PyTypeObject MPZtype; +static PyTypeObject MPZtype; #define is_mpzobject(v) ((v)->ob_type == &MPZtype) diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c index 854d986746f..e790352c9ff 100644 --- a/Modules/parsermodule.c +++ b/Modules/parsermodule.c @@ -157,14 +157,9 @@ typedef struct { } PyST_Object; -staticforward void -parser_free(PyST_Object *st); - -staticforward int -parser_compare(PyST_Object *left, PyST_Object *right); - -staticforward PyObject * -parser_getattr(PyObject *self, char *name); +static void parser_free(PyST_Object *st); +static int parser_compare(PyST_Object *left, PyST_Object *right); +static PyObject *parser_getattr(PyObject *self, char *name); static @@ -550,9 +545,9 @@ parser_suite(PyST_Object *self, PyObject *args, PyObject *kw) */ -staticforward node* build_node_tree(PyObject *tuple); -staticforward int validate_expr_tree(node *tree); -staticforward int validate_file_input(node *tree); +static node* build_node_tree(PyObject *tuple); +static int validate_expr_tree(node *tree); +static int validate_file_input(node *tree); /* PyObject* parser_tuple2st(PyObject* self, PyObject* args) @@ -793,7 +788,7 @@ build_node_tree(PyObject *tuple) /* * Validation routines used within the validation section: */ -staticforward int validate_terminal(node *terminal, int type, char *string); +static int validate_terminal(node *terminal, int type, char *string); #define validate_ampersand(ch) validate_terminal(ch, AMPER, "&") #define validate_circumflex(ch) validate_terminal(ch, CIRCUMFLEX, "^") diff --git a/Modules/pcremodule.c b/Modules/pcremodule.c index 6c05766c879..383dde86b25 100644 --- a/Modules/pcremodule.c +++ b/Modules/pcremodule.c @@ -24,7 +24,7 @@ typedef struct { int num_groups; } PcreObject; -staticforward PyTypeObject Pcre_Type; +static PyTypeObject Pcre_Type; #define PcreObject_Check(v) ((v)->ob_type == &Pcre_Type) #define NORMAL 0 @@ -125,7 +125,7 @@ PyPcre_getattr(PcreObject *self, char *name) } -staticforward PyTypeObject Pcre_Type = { +static PyTypeObject Pcre_Type = { PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "pcre.Pcre", /*tp_name*/ diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index 396986accb1..2d14675bba2 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -66,7 +66,7 @@ typedef struct { #define CHARACTER_DATA_BUFFER_SIZE 8192 -staticforward PyTypeObject Xmlparsetype; +static PyTypeObject Xmlparsetype; typedef void (*xmlhandlersetter)(XML_Parser *self, void *meth); typedef void* xmlhandler; @@ -79,7 +79,7 @@ struct HandlerInfo { PyObject *nameobj; }; -staticforward struct HandlerInfo handler_info[64]; +static struct HandlerInfo handler_info[64]; /* Set an integer attribute on the error object; return true on success, * false on an exception. diff --git a/Modules/rotormodule.c b/Modules/rotormodule.c index 03778329184..75f1aeb1a2f 100644 --- a/Modules/rotormodule.c +++ b/Modules/rotormodule.c @@ -78,7 +78,7 @@ typedef struct { unsigned char *advances; /* [num_rotors] */ } Rotorobj; -staticforward PyTypeObject Rotor_Type; +static PyTypeObject Rotor_Type; #define is_rotor(v) ((v)->ob_type == &Rotor_Type) diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index 73abd4f2ae2..5d9ab35b54a 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -322,7 +322,7 @@ typedef struct { struct pollfd *ufds; } pollObject; -staticforward PyTypeObject poll_Type; +static PyTypeObject poll_Type; /* Update the malloc'ed array of pollfds to match the dictionary contained within a pollObject. Return 1 on success, 0 on an error. diff --git a/Modules/shamodule.c b/Modules/shamodule.c index 94b1eff4840..14e51ea6eb5 100644 --- a/Modules/shamodule.c +++ b/Modules/shamodule.c @@ -330,7 +330,7 @@ sha_final(unsigned char digest[20], SHAobject *sha_info) * ------------------------------------------------------------------------ */ -staticforward PyTypeObject SHAtype; +static PyTypeObject SHAtype; static SHAobject * diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 3b194b3f880..5314dcfc213 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -276,7 +276,7 @@ static int taskwindow; The sock_type variable contains pointers to various functions, some of which call new_sockobject(), which uses sock_type, so there has to be a circular reference. */ -staticforward PyTypeObject sock_type; +static PyTypeObject sock_type; /* Convenience function to raise an error according to errno and return a NULL pointer from a function. */ diff --git a/Modules/sunaudiodev.c b/Modules/sunaudiodev.c index 506ee33c59a..3269c761d64 100644 --- a/Modules/sunaudiodev.c +++ b/Modules/sunaudiodev.c @@ -36,8 +36,8 @@ typedef struct { audio_info_t ai; } sadstatusobject; -staticforward PyTypeObject Sadtype; -staticforward PyTypeObject Sadstatustype; +static PyTypeObject Sadtype; +static PyTypeObject Sadstatustype; static sadstatusobject *sads_alloc(void); /* Forward */ static PyObject *SunAudioError; diff --git a/Modules/threadmodule.c b/Modules/threadmodule.c index aa9d3c9c227..b872dd02138 100644 --- a/Modules/threadmodule.c +++ b/Modules/threadmodule.c @@ -22,7 +22,7 @@ typedef struct { PyThread_type_lock lock_lock; } lockobject; -staticforward PyTypeObject Locktype; +static PyTypeObject Locktype; static lockobject * newlockobject(void) diff --git a/Modules/xreadlinesmodule.c b/Modules/xreadlinesmodule.c index 7fba5dbfeba..8c6b91f201d 100644 --- a/Modules/xreadlinesmodule.c +++ b/Modules/xreadlinesmodule.c @@ -14,7 +14,7 @@ typedef struct { int abslineno; } PyXReadlinesObject; -staticforward PyTypeObject XReadlinesObject_Type; +static PyTypeObject XReadlinesObject_Type; static void xreadlines_dealloc(PyXReadlinesObject *op) diff --git a/Modules/xxmodule.c b/Modules/xxmodule.c index b170651abb7..07f5d647b18 100644 --- a/Modules/xxmodule.c +++ b/Modules/xxmodule.c @@ -23,7 +23,7 @@ typedef struct { PyObject *x_attr; /* Attributes dictionary */ } XxoObject; -staticforward PyTypeObject Xxo_Type; +static PyTypeObject Xxo_Type; #define XxoObject_Check(v) ((v)->ob_type == &Xxo_Type) diff --git a/Modules/xxsubtype.c b/Modules/xxsubtype.c index 353f773c286..90134678d3f 100644 --- a/Modules/xxsubtype.c +++ b/Modules/xxsubtype.c @@ -79,7 +79,7 @@ static PyMethodDef spamlist_methods[] = { {NULL, NULL}, }; -staticforward PyTypeObject spamlist_type; +static PyTypeObject spamlist_type; static int spamlist_init(spamlistobject *self, PyObject *args, PyObject *kwds) @@ -179,7 +179,7 @@ static PyMethodDef spamdict_methods[] = { {NULL, NULL}, }; -staticforward PyTypeObject spamdict_type; +static PyTypeObject spamdict_type; static int spamdict_init(spamdictobject *self, PyObject *args, PyObject *kwds) diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c index 3e979a396e9..2ee4996fdc6 100644 --- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -55,8 +55,8 @@ static PyThread_type_lock zlib_lock = NULL; /* initialized on module load */ #define DEFAULTALLOC (16*1024) #define PyInit_zlib initzlib -staticforward PyTypeObject Comptype; -staticforward PyTypeObject Decomptype; +static PyTypeObject Comptype; +static PyTypeObject Decomptype; static PyObject *ZlibError; |