Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
128358b9
Commit
128358b9
authored
Feb 19, 2001
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
silence compiler warnings
(2 remain)
parent
1affceb7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
84 additions
and
70 deletions
+84
-70
lib/Components/ExtensionClass/Acquisition.c
lib/Components/ExtensionClass/Acquisition.c
+13
-13
lib/Components/ExtensionClass/ExtensionClass.c
lib/Components/ExtensionClass/ExtensionClass.c
+14
-12
lib/Components/ExtensionClass/Record.c
lib/Components/ExtensionClass/Record.c
+15
-10
lib/Components/ExtensionClass/src/Acquisition.c
lib/Components/ExtensionClass/src/Acquisition.c
+13
-13
lib/Components/ExtensionClass/src/ExtensionClass.c
lib/Components/ExtensionClass/src/ExtensionClass.c
+14
-12
lib/Components/ExtensionClass/src/Record.c
lib/Components/ExtensionClass/src/Record.c
+15
-10
No files found.
lib/Components/ExtensionClass/Acquisition.c
View file @
128358b9
...
...
@@ -33,7 +33,7 @@
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
$Id: Acquisition.c,v 1.4
6 2001/01/16 15:39:41 jim
Exp $
$Id: Acquisition.c,v 1.4
7 2001/02/19 19:16:07 jeremy
Exp $
If you have questions regarding this software,
contact:
...
...
@@ -118,11 +118,11 @@ CallMethodO(PyObject *self, PyObject *name,
{
if
(
!
args
&&
PyErr_Occurred
())
return
NULL
;
UNLESS
(
name
=
PyObject_GetAttr
(
self
,
name
))
{
if
(
args
)
Py_DECREF
(
args
);
if
(
args
)
{
Py_DECREF
(
args
);
}
return
NULL
;
}
ASSIGN
(
name
,
PyEval_CallObjectWithKeywords
(
name
,
args
,
kw
));
if
(
args
)
Py_DECREF
(
args
);
if
(
args
)
{
Py_DECREF
(
args
);
}
return
name
;
}
...
...
@@ -298,7 +298,7 @@ Wrapper_special(Wrapper *self, char *name, PyObject *oname)
case
'c'
:
if
(
strcmp
(
name
,
"chain"
)
==
0
)
{
if
(
r
=
PyList_New
(
0
))
if
(
(
r
=
PyList_New
(
0
)))
while
(
1
)
{
if
(
PyList_Append
(
r
,
OBJECT
(
self
))
>=
0
)
...
...
@@ -398,7 +398,7 @@ Wrapper_findattr(Wrapper *self, PyObject *oname,
if
(
PyString_Check
(
oname
))
name
=
PyString_AS_STRING
(
oname
);
if
(
*
name
==
'a'
&&
name
[
1
]
==
'q'
&&
name
[
2
]
==
'_'
)
if
(
r
=
Wrapper_special
(
self
,
name
+
3
,
oname
))
if
(
(
r
=
Wrapper_special
(
self
,
name
+
3
,
oname
)
))
{
if
(
filter
)
switch
(
apply_filter
(
filter
,
OBJECT
(
self
),
oname
,
r
,
extra
,
orig
))
...
...
@@ -425,7 +425,7 @@ Wrapper_findattr(Wrapper *self, PyObject *oname,
{
if
(
isWrapper
(
self
->
obj
))
{
if
(
r
=
Wrapper_findattr
(
WRAPPER
(
self
->
obj
),
if
(
(
r
=
Wrapper_findattr
(
WRAPPER
(
self
->
obj
),
oname
,
filter
,
extra
,
orig
,
1
,
/* Search object container if explicit,
...
...
@@ -433,8 +433,7 @@ Wrapper_findattr(Wrapper *self, PyObject *oname,
explicit
||
self
->
obj
->
ob_type
==
(
PyTypeObject
*
)
&
Wrappertype
,
explicit
,
containment
))
explicit
,
containment
)))
{
if
(
PyECMethod_Check
(
r
)
&&
PyECMethod_Self
(
r
)
==
self
->
obj
)
ASSIGN
(
r
,
PyECMethod_New
(
r
,
OBJECT
(
self
)));
...
...
@@ -525,12 +524,12 @@ Wrapper_acquire(Wrapper *self, PyObject *oname,
}
else
{
if
((
r
=
PyObject_GetAttr
(
self
->
container
,
oname
)))
if
((
r
=
PyObject_GetAttr
(
self
->
container
,
oname
)))
{
if
(
r
==
Acquired
)
{
Py_DECREF
(
r
);
}
else
else
{
if
(
filter
)
switch
(
apply_filter
(
filter
,
self
->
container
,
oname
,
r
,
extra
,
orig
))
...
...
@@ -546,6 +545,8 @@ Wrapper_acquire(Wrapper *self, PyObject *oname,
if
(
has__of__
(
r
))
ASSIGN
(
r
,
__of__
(
r
,
OBJECT
(
self
)));
return
r
;
}
}
}
}
}
...
...
@@ -566,7 +567,6 @@ Wrapper_getattro(Wrapper *self, PyObject *oname)
static
PyObject
*
Xaq_getattro
(
Wrapper
*
self
,
PyObject
*
oname
)
{
PyObject
*
r
,
*
v
,
*
tb
;
char
*
name
=
""
;
/* Special case backward-compatible acquire method. */
...
...
@@ -1425,7 +1425,7 @@ void
initAcquisition
()
{
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.4
6
$"
;
char
*
rev
=
"$Revision: 1.4
7
$"
;
PURE_MIXIN_CLASS
(
Acquirer
,
"Base class for objects that implicitly"
" acquire attributes from containers
\n
"
...
...
@@ -1444,7 +1444,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.4
6 2001/01/16 15:39:41 jim
Exp $
\n
"
,
"$Id: Acquisition.c,v 1.4
7 2001/02/19 19:16:07 jeremy
Exp $
\n
"
,
OBJECT
(
NULL
),
PYTHON_API_VERSION
);
d
=
PyModule_GetDict
(
m
);
...
...
lib/Components/ExtensionClass/ExtensionClass.c
View file @
128358b9
...
...
@@ -33,7 +33,7 @@
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
$Id: ExtensionClass.c,v 1.4
3 2001/01/25 21:29:15 jim
Exp $
$Id: ExtensionClass.c,v 1.4
4 2001/02/19 19:16:07 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.4
3 2001/01/25 21:29:15 jim
Exp $
\n
"
"$Id: ExtensionClass.c,v 1.4
4 2001/02/19 19:16:07 jeremy
Exp $
\n
"
;
#include <stdio.h>
...
...
@@ -184,7 +184,7 @@ CallMethodO(PyObject *self, PyObject *name,
if
(
!
args
&&
PyErr_Occurred
())
return
NULL
;
UNLESS
(
name
=
PyObject_GetAttr
(
self
,
name
))
return
NULL
;
ASSIGN
(
name
,
PyEval_CallObjectWithKeywords
(
name
,
args
,
kw
));
if
(
args
)
Py_DECREF
(
args
);
if
(
args
)
{
Py_DECREF
(
args
);
}
return
name
;
}
...
...
@@ -607,11 +607,12 @@ CMethod_getattro(CMethod *self, PyObject *oname)
{
ASSIGN
(
r
,
PyObject_GetAttr
(
r
,
oname
));
if
(
r
)
if
(
r
)
{
if
(
UnboundCMethod_Check
(
r
))
ASSIGN
(
r
,
(
PyObject
*
)
bindCMethod
((
CMethod
*
)
r
,
self
->
self
));
else
if
(
UnboundPMethod_Check
(
r
))
ASSIGN
(
r
,
bindPMethod
((
PMethod
*
)
r
,
self
->
self
));
}
}
Py_DECREF
(
oname
);
return
r
;
...
...
@@ -921,11 +922,12 @@ PMethod_getattro(PMethod *self, PyObject *oname)
{
ASSIGN
(
r
,
PyObject_GetAttr
(
r
,
oname
));
if
(
r
)
if
(
r
)
{
if
(
UnboundCMethod_Check
(
r
))
ASSIGN
(
r
,
(
PyObject
*
)
bindCMethod
((
CMethod
*
)
r
,
self
->
self
));
else
if
(
UnboundPMethod_Check
(
r
))
ASSIGN
(
r
,
bindPMethod
((
PMethod
*
)
r
,
self
->
self
));
}
}
Py_DECREF
(
oname
);
return
r
;
...
...
@@ -1080,7 +1082,6 @@ static PyObject *
delsetattr_by_name
(
PyObject
*
self
,
PyObject
*
args
,
PyTypeObject
*
ob_type
)
{
char
*
name
;
PyObject
*
v
;
UNLESS
(
PyArg_ParseTuple
(
args
,
"s"
,
&
name
))
return
NULL
;
UNLESS
(
-
1
!=
ob_type
->
tp_setattr
(
self
,
name
,
NULL
))
return
NULL
;
Py_INCREF
(
Py_None
);
...
...
@@ -1110,7 +1111,6 @@ static PyObject *
delsetattro_by_name
(
PyObject
*
self
,
PyObject
*
args
,
PyTypeObject
*
ob_type
)
{
PyObject
*
name
;
PyObject
*
v
;
UNLESS
(
PyArg_ParseTuple
(
args
,
"O"
,
&
name
))
return
NULL
;
UNLESS
(
-
1
!=
ob_type
->
tp_setattro
(
self
,
name
,
NULL
))
return
NULL
;
Py_INCREF
(
Py_None
);
...
...
@@ -1661,7 +1661,9 @@ CCL_dealloc(PyExtensionClass *self)
Py_DECREF
(
self
->
bases
);
}
if
(((
PyExtensionClass
*
)
self
->
ob_type
)
!=
self
)
Py_XDECREF
(
self
->
ob_type
);
if
(((
PyExtensionClass
*
)
self
->
ob_type
)
!=
self
)
{
Py_XDECREF
(
self
->
ob_type
);
}
PyMem_DEL
(
self
);
}
...
...
@@ -3066,7 +3068,9 @@ subclass_dealloc(PyObject *self)
return
;
/* we added a reference; don't delete now */
}
if
(
HasInstDict
(
self
))
Py_XDECREF
(
INSTANCE_DICT
(
self
));
if
(
HasInstDict
(
self
))
{
Py_XDECREF
(
INSTANCE_DICT
(
self
));
}
/* See if there was a dealloc handler in a (C) base class.
If there was, then it deallocates the object and we
...
...
@@ -3340,8 +3344,6 @@ subclass__init__(PyExtensionClass *self, PyObject *args)
That means that we simply copy the base class
get/setattr.
*/
PyObject
*
r
;
copy_member
(
tp_getattr
);
copy_member
(
tp_getattro
);
copy_member
(
tp_setattr
);
...
...
@@ -3528,7 +3530,7 @@ void
initExtensionClass
()
{
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.4
3
$"
;
char
*
rev
=
"$Revision: 1.4
4
$"
;
PURE_MIXIN_CLASS
(
Base
,
"Minimalbase class for Extension Classes"
,
NULL
);
PMethodType
.
ob_type
=&
PyType_Type
;
...
...
lib/Components/ExtensionClass/Record.c
View file @
128358b9
...
...
@@ -84,7 +84,7 @@
****************************************************************************/
static
char
Record_module_documentation
[]
=
""
"
\n
$Id: Record.c,v 1.
9 2000/04/21 14:17:23 tseaver
Exp $"
"
\n
$Id: Record.c,v 1.
10 2001/02/19 19:16:07 jeremy
Exp $"
;
#ifdef PERSISTENCE
...
...
@@ -151,7 +151,7 @@ Record___setstate__(Record *self, PyObject *args)
UNLESS
(
PyArg_ParseTuple
(
args
,
"|OO"
,
&
state
,
&
parent
))
return
NULL
;
if
(
state
)
if
(
state
)
{
if
(
PyDict_Check
(
state
))
{
PyObject
*
k
,
*
v
;
...
...
@@ -170,6 +170,7 @@ Record___setstate__(Record *self, PyObject *args)
UNLESS
(
*
d
)
return
NULL
;
}
}
}
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -262,11 +263,11 @@ Record_getattr(Record *self, PyObject *name)
if
((
l
=
Record_init
(
self
))
<
0
)
return
NULL
;
if
(
io
=
Py_FindAttr
((
PyObject
*
)
self
,
name
))
return
io
;
if
((
io
=
Py_FindAttr
((
PyObject
*
)
self
,
name
)
))
return
io
;
PyErr_Clear
();
if
(
io
=
PyObject_GetItem
(
self
->
schema
,
name
))
if
(
(
io
=
PyObject_GetItem
(
self
->
schema
,
name
)
))
{
UNLESS
(
PyInt_Check
(
io
))
{
...
...
@@ -296,7 +297,7 @@ Record_setattr(Record *self, PyObject *name, PyObject *v)
PyObject
*
io
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
-
1
;
if
(
io
=
PyObject_GetItem
(
self
->
schema
,
name
))
if
(
(
io
=
PyObject_GetItem
(
self
->
schema
,
name
)
))
{
UNLESS
(
PyInt_Check
(
io
))
{
...
...
@@ -350,7 +351,7 @@ Record_compare(Record *v, Record *w)
if
(
*
dv
)
if
(
*
dw
)
{
if
(
c
=
PyObject_Compare
(
*
dv
,
*
dw
))
return
c
;
if
(
(
c
=
PyObject_Compare
(
*
dv
,
*
dw
)
))
return
c
;
}
else
return
1
;
else
if
(
*
dw
)
return
-
1
;
...
...
@@ -474,7 +475,7 @@ Record_subscript(Record *self, PyObject *key)
return
Record_item
(
self
,
i
);
}
if
(
io
=
PyObject_GetItem
(
self
->
schema
,
key
))
if
(
(
io
=
PyObject_GetItem
(
self
->
schema
,
key
)
))
{
UNLESS
(
PyInt_Check
(
io
))
{
...
...
@@ -493,7 +494,7 @@ Record_subscript(Record *self, PyObject *key)
}
PyErr_Clear
();
if
(
io
=
PyObject_GetAttr
(
OBJECT
(
self
),
key
))
return
io
;
if
(
(
io
=
PyObject_GetAttr
(
OBJECT
(
self
),
key
)
))
return
io
;
PyErr_SetObject
(
PyExc_KeyError
,
key
);
return
NULL
;
...
...
@@ -514,7 +515,7 @@ Record_ass_sub(Record *self, PyObject *key, PyObject *v)
return
Record_ass_item
(
self
,
i
,
v
);
}
if
(
io
=
PyObject_GetItem
(
self
->
schema
,
key
))
if
(
(
io
=
PyObject_GetItem
(
self
->
schema
,
key
)
))
{
UNLESS
(
PyInt_Check
(
io
))
{
...
...
@@ -592,7 +593,7 @@ void
initRecord
()
{
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.
9
$"
;
char
*
rev
=
"$Revision: 1.
10
$"
;
UNLESS
(
py___record_schema__
=
PyString_FromString
(
"__record_schema__"
))
return
;
...
...
@@ -631,6 +632,10 @@ initRecord()
Revision Log:
$Log: Record.c,v $
Revision 1.10 2001/02/19 19:16:07 jeremy
silence compiler warnings
(2 remain)
Revision 1.9 2000/04/21 14:17:23 tseaver
Collector #1012: Guarantee null-terminated buffer in Record_init() so Record_compare doesn't UMR
...
...
lib/Components/ExtensionClass/src/Acquisition.c
View file @
128358b9
...
...
@@ -33,7 +33,7 @@
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
$Id: Acquisition.c,v 1.4
6 2001/01/16 15:39:41 jim
Exp $
$Id: Acquisition.c,v 1.4
7 2001/02/19 19:16:07 jeremy
Exp $
If you have questions regarding this software,
contact:
...
...
@@ -118,11 +118,11 @@ CallMethodO(PyObject *self, PyObject *name,
{
if
(
!
args
&&
PyErr_Occurred
())
return
NULL
;
UNLESS
(
name
=
PyObject_GetAttr
(
self
,
name
))
{
if
(
args
)
Py_DECREF
(
args
);
if
(
args
)
{
Py_DECREF
(
args
);
}
return
NULL
;
}
ASSIGN
(
name
,
PyEval_CallObjectWithKeywords
(
name
,
args
,
kw
));
if
(
args
)
Py_DECREF
(
args
);
if
(
args
)
{
Py_DECREF
(
args
);
}
return
name
;
}
...
...
@@ -298,7 +298,7 @@ Wrapper_special(Wrapper *self, char *name, PyObject *oname)
case
'c'
:
if
(
strcmp
(
name
,
"chain"
)
==
0
)
{
if
(
r
=
PyList_New
(
0
))
if
(
(
r
=
PyList_New
(
0
)))
while
(
1
)
{
if
(
PyList_Append
(
r
,
OBJECT
(
self
))
>=
0
)
...
...
@@ -398,7 +398,7 @@ Wrapper_findattr(Wrapper *self, PyObject *oname,
if
(
PyString_Check
(
oname
))
name
=
PyString_AS_STRING
(
oname
);
if
(
*
name
==
'a'
&&
name
[
1
]
==
'q'
&&
name
[
2
]
==
'_'
)
if
(
r
=
Wrapper_special
(
self
,
name
+
3
,
oname
))
if
(
(
r
=
Wrapper_special
(
self
,
name
+
3
,
oname
)
))
{
if
(
filter
)
switch
(
apply_filter
(
filter
,
OBJECT
(
self
),
oname
,
r
,
extra
,
orig
))
...
...
@@ -425,7 +425,7 @@ Wrapper_findattr(Wrapper *self, PyObject *oname,
{
if
(
isWrapper
(
self
->
obj
))
{
if
(
r
=
Wrapper_findattr
(
WRAPPER
(
self
->
obj
),
if
(
(
r
=
Wrapper_findattr
(
WRAPPER
(
self
->
obj
),
oname
,
filter
,
extra
,
orig
,
1
,
/* Search object container if explicit,
...
...
@@ -433,8 +433,7 @@ Wrapper_findattr(Wrapper *self, PyObject *oname,
explicit
||
self
->
obj
->
ob_type
==
(
PyTypeObject
*
)
&
Wrappertype
,
explicit
,
containment
))
explicit
,
containment
)))
{
if
(
PyECMethod_Check
(
r
)
&&
PyECMethod_Self
(
r
)
==
self
->
obj
)
ASSIGN
(
r
,
PyECMethod_New
(
r
,
OBJECT
(
self
)));
...
...
@@ -525,12 +524,12 @@ Wrapper_acquire(Wrapper *self, PyObject *oname,
}
else
{
if
((
r
=
PyObject_GetAttr
(
self
->
container
,
oname
)))
if
((
r
=
PyObject_GetAttr
(
self
->
container
,
oname
)))
{
if
(
r
==
Acquired
)
{
Py_DECREF
(
r
);
}
else
else
{
if
(
filter
)
switch
(
apply_filter
(
filter
,
self
->
container
,
oname
,
r
,
extra
,
orig
))
...
...
@@ -546,6 +545,8 @@ Wrapper_acquire(Wrapper *self, PyObject *oname,
if
(
has__of__
(
r
))
ASSIGN
(
r
,
__of__
(
r
,
OBJECT
(
self
)));
return
r
;
}
}
}
}
}
...
...
@@ -566,7 +567,6 @@ Wrapper_getattro(Wrapper *self, PyObject *oname)
static
PyObject
*
Xaq_getattro
(
Wrapper
*
self
,
PyObject
*
oname
)
{
PyObject
*
r
,
*
v
,
*
tb
;
char
*
name
=
""
;
/* Special case backward-compatible acquire method. */
...
...
@@ -1425,7 +1425,7 @@ void
initAcquisition
()
{
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.4
6
$"
;
char
*
rev
=
"$Revision: 1.4
7
$"
;
PURE_MIXIN_CLASS
(
Acquirer
,
"Base class for objects that implicitly"
" acquire attributes from containers
\n
"
...
...
@@ -1444,7 +1444,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.4
6 2001/01/16 15:39:41 jim
Exp $
\n
"
,
"$Id: Acquisition.c,v 1.4
7 2001/02/19 19:16:07 jeremy
Exp $
\n
"
,
OBJECT
(
NULL
),
PYTHON_API_VERSION
);
d
=
PyModule_GetDict
(
m
);
...
...
lib/Components/ExtensionClass/src/ExtensionClass.c
View file @
128358b9
...
...
@@ -33,7 +33,7 @@
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
$Id: ExtensionClass.c,v 1.4
3 2001/01/25 21:29:15 jim
Exp $
$Id: ExtensionClass.c,v 1.4
4 2001/02/19 19:16:07 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.4
3 2001/01/25 21:29:15 jim
Exp $
\n
"
"$Id: ExtensionClass.c,v 1.4
4 2001/02/19 19:16:07 jeremy
Exp $
\n
"
;
#include <stdio.h>
...
...
@@ -184,7 +184,7 @@ CallMethodO(PyObject *self, PyObject *name,
if
(
!
args
&&
PyErr_Occurred
())
return
NULL
;
UNLESS
(
name
=
PyObject_GetAttr
(
self
,
name
))
return
NULL
;
ASSIGN
(
name
,
PyEval_CallObjectWithKeywords
(
name
,
args
,
kw
));
if
(
args
)
Py_DECREF
(
args
);
if
(
args
)
{
Py_DECREF
(
args
);
}
return
name
;
}
...
...
@@ -607,11 +607,12 @@ CMethod_getattro(CMethod *self, PyObject *oname)
{
ASSIGN
(
r
,
PyObject_GetAttr
(
r
,
oname
));
if
(
r
)
if
(
r
)
{
if
(
UnboundCMethod_Check
(
r
))
ASSIGN
(
r
,
(
PyObject
*
)
bindCMethod
((
CMethod
*
)
r
,
self
->
self
));
else
if
(
UnboundPMethod_Check
(
r
))
ASSIGN
(
r
,
bindPMethod
((
PMethod
*
)
r
,
self
->
self
));
}
}
Py_DECREF
(
oname
);
return
r
;
...
...
@@ -921,11 +922,12 @@ PMethod_getattro(PMethod *self, PyObject *oname)
{
ASSIGN
(
r
,
PyObject_GetAttr
(
r
,
oname
));
if
(
r
)
if
(
r
)
{
if
(
UnboundCMethod_Check
(
r
))
ASSIGN
(
r
,
(
PyObject
*
)
bindCMethod
((
CMethod
*
)
r
,
self
->
self
));
else
if
(
UnboundPMethod_Check
(
r
))
ASSIGN
(
r
,
bindPMethod
((
PMethod
*
)
r
,
self
->
self
));
}
}
Py_DECREF
(
oname
);
return
r
;
...
...
@@ -1080,7 +1082,6 @@ static PyObject *
delsetattr_by_name
(
PyObject
*
self
,
PyObject
*
args
,
PyTypeObject
*
ob_type
)
{
char
*
name
;
PyObject
*
v
;
UNLESS
(
PyArg_ParseTuple
(
args
,
"s"
,
&
name
))
return
NULL
;
UNLESS
(
-
1
!=
ob_type
->
tp_setattr
(
self
,
name
,
NULL
))
return
NULL
;
Py_INCREF
(
Py_None
);
...
...
@@ -1110,7 +1111,6 @@ static PyObject *
delsetattro_by_name
(
PyObject
*
self
,
PyObject
*
args
,
PyTypeObject
*
ob_type
)
{
PyObject
*
name
;
PyObject
*
v
;
UNLESS
(
PyArg_ParseTuple
(
args
,
"O"
,
&
name
))
return
NULL
;
UNLESS
(
-
1
!=
ob_type
->
tp_setattro
(
self
,
name
,
NULL
))
return
NULL
;
Py_INCREF
(
Py_None
);
...
...
@@ -1661,7 +1661,9 @@ CCL_dealloc(PyExtensionClass *self)
Py_DECREF
(
self
->
bases
);
}
if
(((
PyExtensionClass
*
)
self
->
ob_type
)
!=
self
)
Py_XDECREF
(
self
->
ob_type
);
if
(((
PyExtensionClass
*
)
self
->
ob_type
)
!=
self
)
{
Py_XDECREF
(
self
->
ob_type
);
}
PyMem_DEL
(
self
);
}
...
...
@@ -3066,7 +3068,9 @@ subclass_dealloc(PyObject *self)
return
;
/* we added a reference; don't delete now */
}
if
(
HasInstDict
(
self
))
Py_XDECREF
(
INSTANCE_DICT
(
self
));
if
(
HasInstDict
(
self
))
{
Py_XDECREF
(
INSTANCE_DICT
(
self
));
}
/* See if there was a dealloc handler in a (C) base class.
If there was, then it deallocates the object and we
...
...
@@ -3340,8 +3344,6 @@ subclass__init__(PyExtensionClass *self, PyObject *args)
That means that we simply copy the base class
get/setattr.
*/
PyObject
*
r
;
copy_member
(
tp_getattr
);
copy_member
(
tp_getattro
);
copy_member
(
tp_setattr
);
...
...
@@ -3528,7 +3530,7 @@ void
initExtensionClass
()
{
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.4
3
$"
;
char
*
rev
=
"$Revision: 1.4
4
$"
;
PURE_MIXIN_CLASS
(
Base
,
"Minimalbase class for Extension Classes"
,
NULL
);
PMethodType
.
ob_type
=&
PyType_Type
;
...
...
lib/Components/ExtensionClass/src/Record.c
View file @
128358b9
...
...
@@ -84,7 +84,7 @@
****************************************************************************/
static
char
Record_module_documentation
[]
=
""
"
\n
$Id: Record.c,v 1.
9 2000/04/21 14:17:23 tseaver
Exp $"
"
\n
$Id: Record.c,v 1.
10 2001/02/19 19:16:07 jeremy
Exp $"
;
#ifdef PERSISTENCE
...
...
@@ -151,7 +151,7 @@ Record___setstate__(Record *self, PyObject *args)
UNLESS
(
PyArg_ParseTuple
(
args
,
"|OO"
,
&
state
,
&
parent
))
return
NULL
;
if
(
state
)
if
(
state
)
{
if
(
PyDict_Check
(
state
))
{
PyObject
*
k
,
*
v
;
...
...
@@ -170,6 +170,7 @@ Record___setstate__(Record *self, PyObject *args)
UNLESS
(
*
d
)
return
NULL
;
}
}
}
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
@@ -262,11 +263,11 @@ Record_getattr(Record *self, PyObject *name)
if
((
l
=
Record_init
(
self
))
<
0
)
return
NULL
;
if
(
io
=
Py_FindAttr
((
PyObject
*
)
self
,
name
))
return
io
;
if
((
io
=
Py_FindAttr
((
PyObject
*
)
self
,
name
)
))
return
io
;
PyErr_Clear
();
if
(
io
=
PyObject_GetItem
(
self
->
schema
,
name
))
if
(
(
io
=
PyObject_GetItem
(
self
->
schema
,
name
)
))
{
UNLESS
(
PyInt_Check
(
io
))
{
...
...
@@ -296,7 +297,7 @@ Record_setattr(Record *self, PyObject *name, PyObject *v)
PyObject
*
io
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
-
1
;
if
(
io
=
PyObject_GetItem
(
self
->
schema
,
name
))
if
(
(
io
=
PyObject_GetItem
(
self
->
schema
,
name
)
))
{
UNLESS
(
PyInt_Check
(
io
))
{
...
...
@@ -350,7 +351,7 @@ Record_compare(Record *v, Record *w)
if
(
*
dv
)
if
(
*
dw
)
{
if
(
c
=
PyObject_Compare
(
*
dv
,
*
dw
))
return
c
;
if
(
(
c
=
PyObject_Compare
(
*
dv
,
*
dw
)
))
return
c
;
}
else
return
1
;
else
if
(
*
dw
)
return
-
1
;
...
...
@@ -474,7 +475,7 @@ Record_subscript(Record *self, PyObject *key)
return
Record_item
(
self
,
i
);
}
if
(
io
=
PyObject_GetItem
(
self
->
schema
,
key
))
if
(
(
io
=
PyObject_GetItem
(
self
->
schema
,
key
)
))
{
UNLESS
(
PyInt_Check
(
io
))
{
...
...
@@ -493,7 +494,7 @@ Record_subscript(Record *self, PyObject *key)
}
PyErr_Clear
();
if
(
io
=
PyObject_GetAttr
(
OBJECT
(
self
),
key
))
return
io
;
if
(
(
io
=
PyObject_GetAttr
(
OBJECT
(
self
),
key
)
))
return
io
;
PyErr_SetObject
(
PyExc_KeyError
,
key
);
return
NULL
;
...
...
@@ -514,7 +515,7 @@ Record_ass_sub(Record *self, PyObject *key, PyObject *v)
return
Record_ass_item
(
self
,
i
,
v
);
}
if
(
io
=
PyObject_GetItem
(
self
->
schema
,
key
))
if
(
(
io
=
PyObject_GetItem
(
self
->
schema
,
key
)
))
{
UNLESS
(
PyInt_Check
(
io
))
{
...
...
@@ -592,7 +593,7 @@ void
initRecord
()
{
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.
9
$"
;
char
*
rev
=
"$Revision: 1.
10
$"
;
UNLESS
(
py___record_schema__
=
PyString_FromString
(
"__record_schema__"
))
return
;
...
...
@@ -631,6 +632,10 @@ initRecord()
Revision Log:
$Log: Record.c,v $
Revision 1.10 2001/02/19 19:16:07 jeremy
silence compiler warnings
(2 remain)
Revision 1.9 2000/04/21 14:17:23 tseaver
Collector #1012: Guarantee null-terminated buffer in Record_init() so Record_compare doesn't UMR
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment