Commit 0b900229 authored by Jeremy Hylton's avatar Jeremy Hylton

gcc -Wall cleanup

    - make function decls prototypes
    - remove unreferenced functions
parent 464858e1
......@@ -33,7 +33,7 @@
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
$Id: Acquisition.c,v 1.50 2001/03/27 03:36:30 brian Exp $
$Id: Acquisition.c,v 1.51 2001/03/28 14:06:50 jeremy Exp $
If you have questions regarding this software,
contact:
......@@ -70,7 +70,7 @@ static PyObject *py__add__, *py__sub__, *py__mul__, *py__div__,
static PyObject *Acquired=0;
static void
init_py_names()
init_py_names(void)
{
#define INIT_PY_NAME(N) py ## N = PyString_FromString(#N)
INIT_PY_NAME(__add__);
......@@ -1424,10 +1424,10 @@ static struct PyMethodDef methods[] = {
};
void
initAcquisition()
initAcquisition(void)
{
PyObject *m, *d;
char *rev="$Revision: 1.50 $";
char *rev="$Revision: 1.51 $";
PURE_MIXIN_CLASS(Acquirer,
"Base class for objects that implicitly"
" acquire attributes from containers\n"
......@@ -1446,7 +1446,7 @@ initAcquisition()
/* Create the module and add the functions */
m = Py_InitModule4("Acquisition", methods,
"Provide base classes for acquiring objects\n\n"
"$Id: Acquisition.c,v 1.50 2001/03/27 03:36:30 brian Exp $\n",
"$Id: Acquisition.c,v 1.51 2001/03/28 14:06:50 jeremy Exp $\n",
OBJECT(NULL),PYTHON_API_VERSION);
d = PyModule_GetDict(m);
......
......@@ -33,7 +33,7 @@
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
$Id: ExtensionClass.c,v 1.45 2001/03/27 21:09:40 jeremy Exp $
$Id: ExtensionClass.c,v 1.46 2001/03/28 14:06:50 jeremy Exp $
If you have questions regarding this software,
contact:
......@@ -54,7 +54,7 @@ static char ExtensionClass_module_documentation[] =
" - They provide access to unbound methods,\n"
" - They can be called to create instances.\n"
"\n"
"$Id: ExtensionClass.c,v 1.45 2001/03/27 21:09:40 jeremy Exp $\n"
"$Id: ExtensionClass.c,v 1.46 2001/03/28 14:06:50 jeremy Exp $\n"
;
#include <stdio.h>
......@@ -622,24 +622,6 @@ CMethod_getattro(CMethod *self, PyObject *oname)
return NULL;
}
static int
CMethod_setattro(CMethod *self, PyObject *oname, PyObject *v)
{
int r;
if (self->self && ! PyEval_GetRestricted()) /* Psuedo attributes */
{
UNLESS(oname=Py_BuildValue("sO", self->name, oname)) return -1;
UNLESS_ASSIGN(oname,PyString_Format(concat_fmt, oname)) return -1;
r=PyObject_SetAttr(self->self, oname, v);
Py_DECREF(oname);
return r;
}
PyErr_SetObject(PyExc_AttributeError, oname);
return -1;
}
static PyTypeObject CMethodType = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
......@@ -660,7 +642,7 @@ static PyTypeObject CMethodType = {
(ternaryfunc)CMethod_call, /*tp_call*/
(reprfunc)0, /*tp_str*/
(getattrofunc)CMethod_getattro, /* tp_getattro */
(setattrofunc)0 /*CMethod_setattro*/, /* tp_setattro */
(setattrofunc)0, /* tp_setattro */
/* Space for future expansion */
0L,0L,
......@@ -940,42 +922,6 @@ PMethod_getattro(PMethod *self, PyObject *oname)
return PyObject_GetAttr(self->meth, oname);
}
static int
PMethod_setattro(PMethod *self, PyObject *oname, PyObject *v)
{
int r;
PyObject *spam;
if (self->meth)
{
if ((spam=PyObject_GetAttr(self->meth, oname)))
{
Py_DECREF(spam);
PyErr_SetString(PyExc_TypeError,
"Attempt to overwrite shared method attribute");
return -1;
}
else PyErr_Clear();
if (self->self && ! PyEval_GetRestricted()) /* Psuedo attrs */
{
PyObject *myname;
UNLESS(myname=PyObject_GetAttr(self->meth, py__name__)) return -1;
oname=Py_BuildValue("OO", myname, oname);
Py_DECREF(myname);
UNLESS(oname) return -1;
UNLESS_ASSIGN(oname,PyString_Format(concat_fmt, oname)) return -1;
r=PyObject_SetAttr(self->self, oname, v);
Py_DECREF(oname);
return r;
}
}
PyErr_SetObject(PyExc_AttributeError, oname);
return -1;
}
static PyTypeObject PMethodType = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
......@@ -996,7 +942,7 @@ static PyTypeObject PMethodType = {
(ternaryfunc)PMethod_call, /*tp_call*/
(reprfunc)0, /*tp_str*/
(getattrofunc)PMethod_getattro, /*tp_getattro*/
(setattrofunc)0 /*PMethod_setattro*/, /* tp_setattro */
(setattrofunc)0, /* tp_setattro */
/* Space for future expansion */
0L,0L,
......@@ -3530,7 +3476,7 @@ void
initExtensionClass(void)
{
PyObject *m, *d;
char *rev="$Revision: 1.45 $";
char *rev="$Revision: 1.46 $";
PURE_MIXIN_CLASS(Base, "Minimalbase class for Extension Classes", NULL);
PMethodType.ob_type=&PyType_Type;
......
......@@ -33,7 +33,7 @@
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
$Id: MethodObject.c,v 1.5 1998/11/17 19:50:20 jim Exp $
$Id: MethodObject.c,v 1.6 2001/03/28 14:06:51 jeremy Exp $
If you have questions regarding this software,
contact:
......@@ -64,10 +64,10 @@ struct PyMethodDef Method_methods[] = {
static struct PyMethodDef methods[] = {{NULL, NULL}};
void
initMethodObject()
initMethodObject(void)
{
PyObject *m, *d;
char *rev="$Revision: 1.5 $";
char *rev="$Revision: 1.6 $";
PURE_MIXIN_CLASS(Method,
"Base class for objects that want to be treated as methods\n"
"\n"
......@@ -83,7 +83,7 @@ initMethodObject()
/* Create the module and add the functions */
m = Py_InitModule4("MethodObject", methods,
"Method-object mix-in class module\n\n"
"$Id: MethodObject.c,v 1.5 1998/11/17 19:50:20 jim Exp $\n",
"$Id: MethodObject.c,v 1.6 2001/03/28 14:06:51 jeremy Exp $\n",
(PyObject*)NULL,PYTHON_API_VERSION);
d = PyModule_GetDict(m);
......
......@@ -33,7 +33,7 @@
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
$Id: Missing.c,v 1.10 1999/08/25 20:15:29 jim Exp $
$Id: Missing.c,v 1.11 2001/03/28 14:06:51 jeremy Exp $
If you have questions regarding this software,
contact:
......@@ -47,7 +47,7 @@
static char Missing_module_documentation[] =
""
"\n$Id: Missing.c,v 1.10 1999/08/25 20:15:29 jim Exp $"
"\n$Id: Missing.c,v 1.11 2001/03/28 14:06:51 jeremy Exp $"
;
#include <string.h>
......@@ -301,10 +301,10 @@ static struct PyMethodDef Module_Level__methods[] = {
};
void
initMissing()
initMissing(void)
{
PyObject *m, *d;
char *rev="$Revision: 1.10 $";
char *rev="$Revision: 1.11 $";
if(! ((vname=PyString_FromString("V"))
&& (Missing_dot_Value=PyString_FromString("Missing.Value"))
......@@ -340,6 +340,11 @@ initMissing()
Revision Log:
$Log: Missing.c,v $
Revision 1.11 2001/03/28 14:06:51 jeremy
gcc -Wall cleanup
- make function decls prototypes
- remove unreferenced functions
Revision 1.10 1999/08/25 20:15:29 jim
Made getattr a bit pickler to prevent getting attributes like "%f5.3".
......
......@@ -33,7 +33,7 @@
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
$Id: MultiMapping.c,v 1.8 1999/06/10 20:10:46 jim Exp $
$Id: MultiMapping.c,v 1.9 2001/03/28 14:06:51 jeremy Exp $
If you have questions regarding this software,
contact:
......@@ -231,16 +231,16 @@ static struct PyMethodDef MultiMapping_methods[] = {
};
void
initMultiMapping()
initMultiMapping(void)
{
PyObject *m, *d;
char *rev="$Revision: 1.8 $";
char *rev="$Revision: 1.9 $";
m = Py_InitModule4(
"MultiMapping", MultiMapping_methods,
"MultiMapping -- Wrap multiple mapping objects for lookup"
"\n\n"
"$Id: MultiMapping.c,v 1.8 1999/06/10 20:10:46 jim Exp $\n",
"$Id: MultiMapping.c,v 1.9 2001/03/28 14:06:51 jeremy Exp $\n",
(PyObject*)NULL,PYTHON_API_VERSION);
d = PyModule_GetDict(m);
PyExtensionClass_Export(d,"MultiMapping",MMtype);
......
......@@ -33,7 +33,7 @@
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
$Id: Sync.c,v 1.2 1998/11/17 20:22:34 jim Exp $
$Id: Sync.c,v 1.3 2001/03/28 14:06:51 jeremy Exp $
If you have questions regarding this software,
contact:
......@@ -47,13 +47,11 @@
static char Sync_module_documentation[] =
""
"\n$Id: Sync.c,v 1.2 1998/11/17 20:22:34 jim Exp $"
"\n$Id: Sync.c,v 1.3 2001/03/28 14:06:51 jeremy Exp $"
;
#include "ExtensionClass.h"
static PyObject *ErrorObject;
/* ----------------------------------------------------- */
static void PyVar_Assign(PyObject **v, PyObject *e) { Py_XDECREF(*v); *v=e;}
......@@ -113,10 +111,10 @@ static struct PyMethodDef Module_Level__methods[] = {
};
void
initSync()
initSync(void)
{
PyObject *m, *d;
char *rev="$Revision: 1.2 $";
char *rev="$Revision: 1.3 $";
PURE_MIXIN_CLASS(
Synchronized,
"Mix-in class that provides synchonization of method calls\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment