Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
43ff28e5
Commit
43ff28e5
authored
Nov 06, 2001
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove use of Python-2.2-specific C API routine PyObject_Call()
parent
c88dc766
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
33 deletions
+48
-33
src/Persistence/cPersistence.c
src/Persistence/cPersistence.c
+13
-8
src/Persistence/cPickleCache.c
src/Persistence/cPickleCache.c
+3
-3
src/ZODB/cPersistence.c
src/ZODB/cPersistence.c
+13
-8
src/ZODB/cPickleCache.c
src/ZODB/cPickleCache.c
+3
-3
src/persistent/cPersistence.c
src/persistent/cPersistence.c
+13
-8
src/persistent/cPickleCache.c
src/persistent/cPickleCache.c
+3
-3
No files found.
src/Persistence/cPersistence.c
View file @
43ff28e5
...
...
@@ -85,7 +85,7 @@
static
char
cPersistence_doc_string
[]
=
"Defines Persistent mixin class for persistent objects.
\n
"
"
\n
"
"$Id: cPersistence.c,v 1.4
4 2001/11/06 17:52:38
jeremy Exp $
\n
"
;
"$Id: cPersistence.c,v 1.4
5 2001/11/06 19:37:00
jeremy Exp $
\n
"
;
#include <string.h>
#include "cPersistence.h"
...
...
@@ -163,13 +163,18 @@ callmethod(PyObject *self, PyObject *name)
static
PyObject
*
callmethod1
(
PyObject
*
self
,
PyObject
*
name
,
PyObject
*
arg
)
{
if
((
self
=
PyObject_GetAttr
(
self
,
name
))
&&
(
name
=
PyTuple_New
(
1
)))
self
=
PyObject_GetAttr
(
self
,
name
);
UNLESS
(
self
)
return
NULL
;
name
=
PyTuple_New
(
1
);
UNLESS
(
name
)
{
Py_DECREF
(
self
);
return
NULL
;
}
PyTuple_SET_ITEM
(
name
,
0
,
arg
);
ASSIGN
(
self
,
PyObject_CallObject
(
self
,
name
));
ASSIGN
(
self
,
PyObject_CallObject
(
self
,
name
));
PyTuple_SET_ITEM
(
name
,
0
,
NULL
);
Py_DECREF
(
name
);
}
return
self
;
}
...
...
@@ -359,7 +364,7 @@ Per__setstate__(cPersistentObject *self, PyObject *args)
{
UNLESS_ASSIGN
(
key
,
PySequence_GetItem
(
keys
,
i
))
goto
err
;
UNLESS_ASSIGN
(
e
,
PyObject_GetItem
(
v
,
key
))
goto
err
;
UNLESS
(
-
1
!=
Py
Obje
ct_SetItem
(
__dict__
,
key
,
e
))
goto
err
;
UNLESS
(
-
1
!=
Py
Di
ct_SetItem
(
__dict__
,
key
,
e
))
goto
err
;
}
Py_XDECREF
(
key
);
...
...
@@ -755,7 +760,7 @@ void
initcPersistence
(
void
)
{
PyObject
*
m
,
*
d
,
*
s
;
char
*
rev
=
"$Revision: 1.4
4
$"
;
char
*
rev
=
"$Revision: 1.4
5
$"
;
s
=
PyString_FromString
(
"TimeStamp"
);
if
(
s
==
NULL
)
...
...
src/Persistence/cPickleCache.c
View file @
43ff28e5
...
...
@@ -85,7 +85,7 @@
static
char
cPickleCache_doc_string
[]
=
"Defines the PickleCache used by ZODB Connection objects.
\n
"
"
\n
"
"$Id: cPickleCache.c,v 1.3
4 2001/11/06 17:52:38
jeremy Exp $
\n
"
;
"$Id: cPickleCache.c,v 1.3
5 2001/11/06 19:37:00
jeremy Exp $
\n
"
;
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E))
...
...
@@ -406,7 +406,7 @@ _invalidate(ccobject *self, PyObject *key)
if
(
t
)
{
PyTuple_SET_ITEM
(
t
,
0
,
v
);
v
=
PyObject_Call
(
self
->
setklassstate
,
t
,
NULL
);
v
=
PyObject_Call
Object
(
self
->
setklassstate
,
t
);
PyTuple_SET_ITEM
(
t
,
0
,
NULL
);
Py_DECREF
(
t
);
}
...
...
@@ -727,7 +727,7 @@ void
initcPickleCache
(
void
)
{
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.3
4
$"
;
char
*
rev
=
"$Revision: 1.3
5
$"
;
Cctype
.
ob_type
=&
PyType_Type
;
...
...
src/ZODB/cPersistence.c
View file @
43ff28e5
...
...
@@ -85,7 +85,7 @@
static
char
cPersistence_doc_string
[]
=
"Defines Persistent mixin class for persistent objects.
\n
"
"
\n
"
"$Id: cPersistence.c,v 1.4
4 2001/11/06 17:52:38
jeremy Exp $
\n
"
;
"$Id: cPersistence.c,v 1.4
5 2001/11/06 19:37:00
jeremy Exp $
\n
"
;
#include <string.h>
#include "cPersistence.h"
...
...
@@ -163,13 +163,18 @@ callmethod(PyObject *self, PyObject *name)
static
PyObject
*
callmethod1
(
PyObject
*
self
,
PyObject
*
name
,
PyObject
*
arg
)
{
if
((
self
=
PyObject_GetAttr
(
self
,
name
))
&&
(
name
=
PyTuple_New
(
1
)))
self
=
PyObject_GetAttr
(
self
,
name
);
UNLESS
(
self
)
return
NULL
;
name
=
PyTuple_New
(
1
);
UNLESS
(
name
)
{
Py_DECREF
(
self
);
return
NULL
;
}
PyTuple_SET_ITEM
(
name
,
0
,
arg
);
ASSIGN
(
self
,
PyObject_CallObject
(
self
,
name
));
ASSIGN
(
self
,
PyObject_CallObject
(
self
,
name
));
PyTuple_SET_ITEM
(
name
,
0
,
NULL
);
Py_DECREF
(
name
);
}
return
self
;
}
...
...
@@ -359,7 +364,7 @@ Per__setstate__(cPersistentObject *self, PyObject *args)
{
UNLESS_ASSIGN
(
key
,
PySequence_GetItem
(
keys
,
i
))
goto
err
;
UNLESS_ASSIGN
(
e
,
PyObject_GetItem
(
v
,
key
))
goto
err
;
UNLESS
(
-
1
!=
Py
Obje
ct_SetItem
(
__dict__
,
key
,
e
))
goto
err
;
UNLESS
(
-
1
!=
Py
Di
ct_SetItem
(
__dict__
,
key
,
e
))
goto
err
;
}
Py_XDECREF
(
key
);
...
...
@@ -755,7 +760,7 @@ void
initcPersistence
(
void
)
{
PyObject
*
m
,
*
d
,
*
s
;
char
*
rev
=
"$Revision: 1.4
4
$"
;
char
*
rev
=
"$Revision: 1.4
5
$"
;
s
=
PyString_FromString
(
"TimeStamp"
);
if
(
s
==
NULL
)
...
...
src/ZODB/cPickleCache.c
View file @
43ff28e5
...
...
@@ -85,7 +85,7 @@
static
char
cPickleCache_doc_string
[]
=
"Defines the PickleCache used by ZODB Connection objects.
\n
"
"
\n
"
"$Id: cPickleCache.c,v 1.3
4 2001/11/06 17:52:38
jeremy Exp $
\n
"
;
"$Id: cPickleCache.c,v 1.3
5 2001/11/06 19:37:00
jeremy Exp $
\n
"
;
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E))
...
...
@@ -406,7 +406,7 @@ _invalidate(ccobject *self, PyObject *key)
if
(
t
)
{
PyTuple_SET_ITEM
(
t
,
0
,
v
);
v
=
PyObject_Call
(
self
->
setklassstate
,
t
,
NULL
);
v
=
PyObject_Call
Object
(
self
->
setklassstate
,
t
);
PyTuple_SET_ITEM
(
t
,
0
,
NULL
);
Py_DECREF
(
t
);
}
...
...
@@ -727,7 +727,7 @@ void
initcPickleCache
(
void
)
{
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.3
4
$"
;
char
*
rev
=
"$Revision: 1.3
5
$"
;
Cctype
.
ob_type
=&
PyType_Type
;
...
...
src/persistent/cPersistence.c
View file @
43ff28e5
...
...
@@ -85,7 +85,7 @@
static
char
cPersistence_doc_string
[]
=
"Defines Persistent mixin class for persistent objects.
\n
"
"
\n
"
"$Id: cPersistence.c,v 1.4
4 2001/11/06 17:52:38
jeremy Exp $
\n
"
;
"$Id: cPersistence.c,v 1.4
5 2001/11/06 19:37:00
jeremy Exp $
\n
"
;
#include <string.h>
#include "cPersistence.h"
...
...
@@ -163,13 +163,18 @@ callmethod(PyObject *self, PyObject *name)
static
PyObject
*
callmethod1
(
PyObject
*
self
,
PyObject
*
name
,
PyObject
*
arg
)
{
if
((
self
=
PyObject_GetAttr
(
self
,
name
))
&&
(
name
=
PyTuple_New
(
1
)))
self
=
PyObject_GetAttr
(
self
,
name
);
UNLESS
(
self
)
return
NULL
;
name
=
PyTuple_New
(
1
);
UNLESS
(
name
)
{
Py_DECREF
(
self
);
return
NULL
;
}
PyTuple_SET_ITEM
(
name
,
0
,
arg
);
ASSIGN
(
self
,
PyObject_CallObject
(
self
,
name
));
ASSIGN
(
self
,
PyObject_CallObject
(
self
,
name
));
PyTuple_SET_ITEM
(
name
,
0
,
NULL
);
Py_DECREF
(
name
);
}
return
self
;
}
...
...
@@ -359,7 +364,7 @@ Per__setstate__(cPersistentObject *self, PyObject *args)
{
UNLESS_ASSIGN
(
key
,
PySequence_GetItem
(
keys
,
i
))
goto
err
;
UNLESS_ASSIGN
(
e
,
PyObject_GetItem
(
v
,
key
))
goto
err
;
UNLESS
(
-
1
!=
Py
Obje
ct_SetItem
(
__dict__
,
key
,
e
))
goto
err
;
UNLESS
(
-
1
!=
Py
Di
ct_SetItem
(
__dict__
,
key
,
e
))
goto
err
;
}
Py_XDECREF
(
key
);
...
...
@@ -755,7 +760,7 @@ void
initcPersistence
(
void
)
{
PyObject
*
m
,
*
d
,
*
s
;
char
*
rev
=
"$Revision: 1.4
4
$"
;
char
*
rev
=
"$Revision: 1.4
5
$"
;
s
=
PyString_FromString
(
"TimeStamp"
);
if
(
s
==
NULL
)
...
...
src/persistent/cPickleCache.c
View file @
43ff28e5
...
...
@@ -85,7 +85,7 @@
static
char
cPickleCache_doc_string
[]
=
"Defines the PickleCache used by ZODB Connection objects.
\n
"
"
\n
"
"$Id: cPickleCache.c,v 1.3
4 2001/11/06 17:52:38
jeremy Exp $
\n
"
;
"$Id: cPickleCache.c,v 1.3
5 2001/11/06 19:37:00
jeremy Exp $
\n
"
;
#define ASSIGN(V,E) {PyObject *__e; __e=(E); Py_XDECREF(V); (V)=__e;}
#define UNLESS(E) if(!(E))
...
...
@@ -406,7 +406,7 @@ _invalidate(ccobject *self, PyObject *key)
if
(
t
)
{
PyTuple_SET_ITEM
(
t
,
0
,
v
);
v
=
PyObject_Call
(
self
->
setklassstate
,
t
,
NULL
);
v
=
PyObject_Call
Object
(
self
->
setklassstate
,
t
);
PyTuple_SET_ITEM
(
t
,
0
,
NULL
);
Py_DECREF
(
t
);
}
...
...
@@ -727,7 +727,7 @@ void
initcPickleCache
(
void
)
{
PyObject
*
m
,
*
d
;
char
*
rev
=
"$Revision: 1.3
4
$"
;
char
*
rev
=
"$Revision: 1.3
5
$"
;
Cctype
.
ob_type
=&
PyType_Type
;
...
...
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