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
nexedi
ZODB
Commits
377ef239
Commit
377ef239
authored
May 31, 2002
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BTreeItem.child: Changed decl from PyObject* to new Sized*. All else
follows from that.
parent
b8825d5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
25 deletions
+27
-25
src/BTrees/BTreeModuleTemplate.c
src/BTrees/BTreeModuleTemplate.c
+2
-2
src/BTrees/BTreeTemplate.c
src/BTrees/BTreeTemplate.c
+25
-23
No files found.
src/BTrees/BTreeModuleTemplate.c
View file @
377ef239
...
...
@@ -121,7 +121,7 @@ static void PyVar_AssignB(Bucket **v, Bucket *e) { Py_XDECREF(*v); *v=e;}
typedef
struct
BTreeItem_s
{
KEY_TYPE
key
;
PyObject
*
child
;
Sized
*
child
;
/* points to another BTree, or to a Bucket of some sort */
}
BTreeItem
;
typedef
struct
BTree_s
{
...
...
@@ -323,7 +323,7 @@ static char BTree_module_documentation[] =
"
\n
"
MASTER_ID
BTREEITEMSTEMPLATE_C
"$Id: BTreeModuleTemplate.c,v 1.2
5 2002/05/31 17:30:30
tim_one Exp $
\n
"
"$Id: BTreeModuleTemplate.c,v 1.2
6 2002/05/31 17:56:59
tim_one Exp $
\n
"
BTREETEMPLATE_C
BUCKETTEMPLATE_C
KEYMACROS_H
...
...
src/BTrees/BTreeTemplate.c
View file @
377ef239
...
...
@@ -12,7 +12,7 @@
****************************************************************************/
#define BTREETEMPLATE_C "$Id: BTreeTemplate.c,v 1.3
1 2002/05/31 17:22:40
tim_one Exp $\n"
#define BTREETEMPLATE_C "$Id: BTreeTemplate.c,v 1.3
2 2002/05/31 17:56:59
tim_one Exp $\n"
/*
** _BTree_get
...
...
@@ -144,16 +144,16 @@ BTree_clone(BTree *self)
Py_XINCREF
(
n1
->
firstbucket
);
/* Initialize our data to hold split data */
self
->
data
=
d
;
self
->
len
=
2
;
self
->
size
=
2
;
self
->
data
->
child
=
OBJECT
(
n1
);
self
->
data
=
d
;
self
->
len
=
2
;
self
->
size
=
2
;
self
->
data
->
child
=
SIZED
(
n1
);
COPY_KEY
(
self
->
data
[
1
].
key
,
n2
->
data
->
key
);
/* We take the unused reference from n2, so there's no reason to INCREF! */
/* INCREF_KEY(self->data[1].key); */
self
->
data
[
1
].
child
=
OBJECT
(
n2
);
self
->
data
[
1
].
child
=
SIZED
(
n2
);
return
0
;
...
...
@@ -179,7 +179,7 @@ static int
BTree_grow
(
BTree
*
self
,
int
index
,
int
noval
)
{
int
i
;
PyObject
*
v
,
*
e
=
0
;
Sized
*
v
,
*
e
=
0
;
BTreeItem
*
d
;
if
(
self
->
len
==
self
->
size
)
...
...
@@ -203,9 +203,10 @@ BTree_grow(BTree *self, int index, int noval)
d
=
self
->
data
+
index
;
if
(
self
->
len
)
{
v
=
d
->
child
;
v
=
d
->
child
;
/* Create a new object of the same type as the target value */
UNLESS
(
e
=
PyObject_CallObject
(
OBJECT
(
v
->
ob_type
),
NULL
))
return
-
1
;
e
=
SIZED
(
PyObject_CallObject
(
OBJECT
(
v
->
ob_type
),
NULL
));
UNLESS
(
e
)
return
-
1
;
PER_USE_OR_RETURN
(
BUCKET
(
v
),
-
1
);
...
...
@@ -257,13 +258,13 @@ BTree_grow(BTree *self, int index, int noval)
{
if
(
noval
)
{
UNLESS
(
d
->
child
=
PyObject_CallObject
(
OBJECT
(
&
SetType
),
NULL
))
return
-
1
;
d
->
child
=
SIZED
(
PyObject_CallObject
(
OBJECT
(
&
SetType
),
NULL
));
UNLESS
(
d
->
child
)
return
-
1
;
}
else
{
UNLESS
(
d
->
child
=
PyObject_CallObject
(
OBJECT
(
&
BucketType
),
NULL
))
return
-
1
;
d
->
child
=
SIZED
(
PyObject_CallObject
(
OBJECT
(
&
BucketType
),
NULL
));
UNLESS
(
d
->
child
)
return
-
1
;
}
self
->
len
=
1
;
Py_INCREF
(
d
->
child
);
...
...
@@ -284,7 +285,7 @@ BTree_lastBucket(BTree *self)
return
NULL
;
}
o
=
self
->
data
[
self
->
len
-
1
].
child
;
o
=
OBJECT
(
self
->
data
[
self
->
len
-
1
].
child
)
;
Py_INCREF
(
o
);
UNLESS
(
SameType_Check
(
self
,
o
))
return
BUCKET
(
o
);
...
...
@@ -638,7 +639,7 @@ BTree_getstate(BTree *self, PyObject *args)
PyTuple_SET_ITEM
(
r
,
l
,
o
);
l
++
;
}
o
=
self
->
data
[
i
].
child
;
o
=
OBJECT
(
self
->
data
[
i
].
child
)
;
Py_INCREF
(
o
);
PyTuple_SET_ITEM
(
r
,
l
,
o
);
l
++
;
...
...
@@ -698,23 +699,23 @@ _BTree_setstate(BTree *self, PyObject *state, int noval)
UNLESS
(
copied
)
return
-
1
;
INCREF_KEY
(
d
->
key
);
}
d
->
child
=
PyTuple_GET_ITEM
(
items
,
l
);
d
->
child
=
SIZED
(
PyTuple_GET_ITEM
(
items
,
l
)
);
if
(
PyTuple_Check
(
d
->
child
))
{
if
(
noval
)
{
UNLESS
(
d
->
child
=
PyObject_CallObject
(
OBJECT
(
&
SetType
),
NULL
))
return
-
1
;
d
->
child
=
SIZED
(
PyObject_CallObject
(
OBJECT
(
&
SetType
),
NULL
))
;
UNLESS
(
d
->
child
)
return
-
1
;
if
(
_set_setstate
(
BUCKET
(
d
->
child
),
PyTuple_GET_ITEM
(
items
,
l
))
<
0
)
return
-
1
;
}
else
{
UNLESS
(
d
->
child
=
PyObject_CallObject
(
OBJECT
(
&
BucketType
),
NULL
))
return
-
1
;
d
->
child
=
SIZED
(
PyObject_CallObject
(
OBJECT
(
&
BucketType
),
NULL
))
;
UNLESS
(
d
->
child
)
return
-
1
;
if
(
_bucket_setstate
(
BUCKET
(
d
->
child
),
PyTuple_GET_ITEM
(
items
,
l
))
<
0
)
return
-
1
;
...
...
@@ -729,7 +730,8 @@ _BTree_setstate(BTree *self, PyObject *state, int noval)
if
(
len
)
{
if
(
!
firstbucket
)
firstbucket
=
self
->
data
->
child
;
if
(
!
firstbucket
)
firstbucket
=
OBJECT
(
self
->
data
->
child
);
UNLESS
(
ExtensionClassSubclassInstance_Check
(
firstbucket
,
...
...
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