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
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
Nicolas Wavrant
ZODB
Commits
0ffa6aa9
Commit
0ffa6aa9
authored
May 08, 2011
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reindented.
parent
55ed9237
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
139 additions
and
139 deletions
+139
-139
src/BTrees/MergeTemplate.c
src/BTrees/MergeTemplate.c
+23
-23
src/BTrees/SetOpTemplate.c
src/BTrees/SetOpTemplate.c
+116
-116
No files found.
src/BTrees/MergeTemplate.c
View file @
0ffa6aa9
...
...
@@ -10,27 +10,27 @@
WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
FOR A PARTICULAR PURPOSE
****************************************************************************/
****************************************************************************/
#define MERGETEMPLATE_C "$Id$\n"
/****************************************************************************
Set operations
****************************************************************************/
****************************************************************************/
static
int
merge_output
(
Bucket
*
r
,
SetIteration
*
i
,
int
mapping
)
{
if
(
r
->
len
>=
r
->
size
&&
Bucket_grow
(
r
,
-
1
,
!
mapping
)
<
0
)
return
-
1
;
COPY_KEY
(
r
->
keys
[
r
->
len
],
i
->
key
);
INCREF_KEY
(
r
->
keys
[
r
->
len
]);
if
(
mapping
)
{
COPY_VALUE
(
r
->
values
[
r
->
len
],
i
->
value
);
INCREF_VALUE
(
r
->
values
[
r
->
len
]);
}
r
->
len
++
;
return
0
;
if
(
r
->
len
>=
r
->
size
&&
Bucket_grow
(
r
,
-
1
,
!
mapping
)
<
0
)
return
-
1
;
COPY_KEY
(
r
->
keys
[
r
->
len
],
i
->
key
);
INCREF_KEY
(
r
->
keys
[
r
->
len
]);
if
(
mapping
)
{
COPY_VALUE
(
r
->
values
[
r
->
len
],
i
->
value
);
INCREF_VALUE
(
r
->
values
[
r
->
len
]);
}
r
->
len
++
;
return
0
;
}
/* The "reason" argument is a little integer giving "a reason" for the
...
...
@@ -45,7 +45,7 @@ merge_error(int p1, int p2, int p3, int reason)
UNLESS
(
r
=
Py_BuildValue
(
"iiii"
,
p1
,
p2
,
p3
,
reason
))
r
=
Py_None
;
if
(
ConflictError
==
NULL
)
{
ConflictError
=
PyExc_ValueError
;
Py_INCREF
(
ConflictError
);
Py_INCREF
(
ConflictError
);
}
PyErr_SetObject
(
ConflictError
,
r
);
if
(
r
!=
Py_None
)
...
...
@@ -101,28 +101,28 @@ bucket_merge(Bucket *s1, Bucket *s2, Bucket *s3)
}
if
(
initSetIteration
(
&
i1
,
OBJECT
(
s1
),
1
)
<
0
)
goto
err
;
goto
err
;
if
(
initSetIteration
(
&
i2
,
OBJECT
(
s2
),
1
)
<
0
)
goto
err
;
goto
err
;
if
(
initSetIteration
(
&
i3
,
OBJECT
(
s3
),
1
)
<
0
)
goto
err
;
goto
err
;
mapping
=
i1
.
usesValue
|
i2
.
usesValue
|
i3
.
usesValue
;
set
=
!
mapping
;
if
(
mapping
)
r
=
(
Bucket
*
)
PyObject_CallObject
((
PyObject
*
)
&
BucketType
,
NULL
);
r
=
(
Bucket
*
)
PyObject_CallObject
((
PyObject
*
)
&
BucketType
,
NULL
);
else
r
=
(
Bucket
*
)
PyObject_CallObject
((
PyObject
*
)
&
SetType
,
NULL
);
r
=
(
Bucket
*
)
PyObject_CallObject
((
PyObject
*
)
&
SetType
,
NULL
);
if
(
r
==
NULL
)
goto
err
;
goto
err
;
if
(
i1
.
next
(
&
i1
)
<
0
)
goto
err
;
goto
err
;
if
(
i2
.
next
(
&
i2
)
<
0
)
goto
err
;
goto
err
;
if
(
i3
.
next
(
&
i3
)
<
0
)
goto
err
;
goto
err
;
/* Consult zodb/btrees/interfaces.py for the meaning of the last
* argument passed to merge_error().
...
...
@@ -233,7 +233,7 @@ bucket_merge(Bucket *s1, Bucket *s2, Bucket *s3)
}
else
{
/* 1<2 and 1<3: both deleted 1.key */
merge_error
(
i1
.
position
,
i2
.
position
,
i3
.
position
,
5
);
merge_error
(
i1
.
position
,
i2
.
position
,
i3
.
position
,
5
);
goto
err
;
}
}
...
...
src/BTrees/SetOpTemplate.c
View file @
0ffa6aa9
This diff is collapsed.
Click to expand it.
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