Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
50c83f0a
Commit
50c83f0a
authored
May 08, 2011
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reindented.
parent
b08f8e50
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 @
50c83f0a
...
@@ -10,27 +10,27 @@
...
@@ -10,27 +10,27 @@
WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
FOR A PARTICULAR PURPOSE
FOR A PARTICULAR PURPOSE
****************************************************************************/
****************************************************************************/
#define MERGETEMPLATE_C "$Id$\n"
#define MERGETEMPLATE_C "$Id$\n"
/****************************************************************************
/****************************************************************************
Set operations
Set operations
****************************************************************************/
****************************************************************************/
static
int
static
int
merge_output
(
Bucket
*
r
,
SetIteration
*
i
,
int
mapping
)
merge_output
(
Bucket
*
r
,
SetIteration
*
i
,
int
mapping
)
{
{
if
(
r
->
len
>=
r
->
size
&&
Bucket_grow
(
r
,
-
1
,
!
mapping
)
<
0
)
if
(
r
->
len
>=
r
->
size
&&
Bucket_grow
(
r
,
-
1
,
!
mapping
)
<
0
)
return
-
1
;
return
-
1
;
COPY_KEY
(
r
->
keys
[
r
->
len
],
i
->
key
);
COPY_KEY
(
r
->
keys
[
r
->
len
],
i
->
key
);
INCREF_KEY
(
r
->
keys
[
r
->
len
]);
INCREF_KEY
(
r
->
keys
[
r
->
len
]);
if
(
mapping
)
{
if
(
mapping
)
{
COPY_VALUE
(
r
->
values
[
r
->
len
],
i
->
value
);
COPY_VALUE
(
r
->
values
[
r
->
len
],
i
->
value
);
INCREF_VALUE
(
r
->
values
[
r
->
len
]);
INCREF_VALUE
(
r
->
values
[
r
->
len
]);
}
}
r
->
len
++
;
r
->
len
++
;
return
0
;
return
0
;
}
}
/* The "reason" argument is a little integer giving "a reason" for the
/* 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)
...
@@ -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
;
UNLESS
(
r
=
Py_BuildValue
(
"iiii"
,
p1
,
p2
,
p3
,
reason
))
r
=
Py_None
;
if
(
ConflictError
==
NULL
)
{
if
(
ConflictError
==
NULL
)
{
ConflictError
=
PyExc_ValueError
;
ConflictError
=
PyExc_ValueError
;
Py_INCREF
(
ConflictError
);
Py_INCREF
(
ConflictError
);
}
}
PyErr_SetObject
(
ConflictError
,
r
);
PyErr_SetObject
(
ConflictError
,
r
);
if
(
r
!=
Py_None
)
if
(
r
!=
Py_None
)
...
@@ -101,28 +101,28 @@ bucket_merge(Bucket *s1, Bucket *s2, Bucket *s3)
...
@@ -101,28 +101,28 @@ bucket_merge(Bucket *s1, Bucket *s2, Bucket *s3)
}
}
if
(
initSetIteration
(
&
i1
,
OBJECT
(
s1
),
1
)
<
0
)
if
(
initSetIteration
(
&
i1
,
OBJECT
(
s1
),
1
)
<
0
)
goto
err
;
goto
err
;
if
(
initSetIteration
(
&
i2
,
OBJECT
(
s2
),
1
)
<
0
)
if
(
initSetIteration
(
&
i2
,
OBJECT
(
s2
),
1
)
<
0
)
goto
err
;
goto
err
;
if
(
initSetIteration
(
&
i3
,
OBJECT
(
s3
),
1
)
<
0
)
if
(
initSetIteration
(
&
i3
,
OBJECT
(
s3
),
1
)
<
0
)
goto
err
;
goto
err
;
mapping
=
i1
.
usesValue
|
i2
.
usesValue
|
i3
.
usesValue
;
mapping
=
i1
.
usesValue
|
i2
.
usesValue
|
i3
.
usesValue
;
set
=
!
mapping
;
set
=
!
mapping
;
if
(
mapping
)
if
(
mapping
)
r
=
(
Bucket
*
)
PyObject_CallObject
((
PyObject
*
)
&
BucketType
,
NULL
);
r
=
(
Bucket
*
)
PyObject_CallObject
((
PyObject
*
)
&
BucketType
,
NULL
);
else
else
r
=
(
Bucket
*
)
PyObject_CallObject
((
PyObject
*
)
&
SetType
,
NULL
);
r
=
(
Bucket
*
)
PyObject_CallObject
((
PyObject
*
)
&
SetType
,
NULL
);
if
(
r
==
NULL
)
if
(
r
==
NULL
)
goto
err
;
goto
err
;
if
(
i1
.
next
(
&
i1
)
<
0
)
if
(
i1
.
next
(
&
i1
)
<
0
)
goto
err
;
goto
err
;
if
(
i2
.
next
(
&
i2
)
<
0
)
if
(
i2
.
next
(
&
i2
)
<
0
)
goto
err
;
goto
err
;
if
(
i3
.
next
(
&
i3
)
<
0
)
if
(
i3
.
next
(
&
i3
)
<
0
)
goto
err
;
goto
err
;
/* Consult zodb/btrees/interfaces.py for the meaning of the last
/* Consult zodb/btrees/interfaces.py for the meaning of the last
* argument passed to merge_error().
* argument passed to merge_error().
...
@@ -233,7 +233,7 @@ bucket_merge(Bucket *s1, Bucket *s2, Bucket *s3)
...
@@ -233,7 +233,7 @@ bucket_merge(Bucket *s1, Bucket *s2, Bucket *s3)
}
}
else
else
{
/* 1<2 and 1<3: both deleted 1.key */
{
/* 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
;
goto
err
;
}
}
}
}
...
...
src/BTrees/SetOpTemplate.c
View file @
50c83f0a
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