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
04b14c3e
Commit
04b14c3e
authored
Mar 21, 2001
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewrote a macro and it's calls to avoid confusing optimizing
compilers.
parent
cab66e4f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
23 deletions
+23
-23
trunk/src/BTrees/BTreeTemplate.c
trunk/src/BTrees/BTreeTemplate.c
+6
-6
trunk/src/BTrees/BucketTemplate.c
trunk/src/BTrees/BucketTemplate.c
+9
-9
trunk/src/BTrees/SetOpTemplate.c
trunk/src/BTrees/SetOpTemplate.c
+2
-2
trunk/src/BTrees/SetTemplate.c
trunk/src/BTrees/SetTemplate.c
+2
-2
trunk/src/BTrees/intkeymacros.h
trunk/src/BTrees/intkeymacros.h
+2
-2
trunk/src/BTrees/intvaluemacros.h
trunk/src/BTrees/intvaluemacros.h
+2
-2
No files found.
trunk/src/BTrees/BTreeTemplate.c
View file @
04b14c3e
...
...
@@ -83,7 +83,7 @@
****************************************************************************/
#define BTREETEMPLATE_C "$Id: BTreeTemplate.c,v 1.1
2 2001/03/20 13:52:00
jim Exp $\n"
#define BTREETEMPLATE_C "$Id: BTreeTemplate.c,v 1.1
3 2001/03/21 14:16:58
jim Exp $\n"
/*
** _BTree_get
...
...
@@ -96,7 +96,7 @@ _BTree_get(BTree *self, PyObject *keyarg, int has_key)
PyObject
*
r
;
KEY_TYPE
key
;
COPY_KEY_FROM_ARG
(
key
,
keyarg
,
&
copied
);
COPY_KEY_FROM_ARG
(
key
,
keyarg
,
copied
);
UNLESS
(
copied
)
return
NULL
;
PER_USE_OR_RETURN
(
self
,
NULL
);
...
...
@@ -409,7 +409,7 @@ _BTree_set(BTree *self, PyObject *keyarg, PyObject *value,
BTreeItem
*
d
;
KEY_TYPE
key
;
COPY_KEY_FROM_ARG
(
key
,
keyarg
,
&
copied
);
COPY_KEY_FROM_ARG
(
key
,
keyarg
,
copied
);
UNLESS
(
copied
)
return
-
1
;
PER_USE_OR_RETURN
(
self
,
-
1
);
...
...
@@ -754,7 +754,7 @@ _BTree_setstate(BTree *self, PyObject *state, int noval)
{
if
(
i
)
{
COPY_KEY_FROM_ARG
(
d
->
key
,
PyTuple_GET_ITEM
(
items
,
l
),
&
copied
);
COPY_KEY_FROM_ARG
(
d
->
key
,
PyTuple_GET_ITEM
(
items
,
l
),
copied
);
l
++
;
UNLESS
(
&
copied
)
return
-
1
;
INCREF_KEY
(
d
->
key
);
...
...
@@ -873,7 +873,7 @@ BTree_findRangeEnd(BTree *self, PyObject *keyarg, int low,
int
min
,
max
,
i
=
0
,
cmp
,
copied
=
1
;
KEY_TYPE
key
;
COPY_KEY_FROM_ARG
(
key
,
keyarg
,
&
copied
);
COPY_KEY_FROM_ARG
(
key
,
keyarg
,
copied
);
UNLESS
(
copied
)
return
-
1
;
/* We don't need to: PER_USE_OR_RETURN(self, -1);
...
...
@@ -1124,7 +1124,7 @@ BTree_byValue(BTree *self, PyObject *args)
PER_USE_OR_RETURN
(
self
,
NULL
);
UNLESS
(
PyArg_ParseTuple
(
args
,
"O"
,
&
omin
))
return
NULL
;
COPY_VALUE_FROM_ARG
(
min
,
omin
,
&
copied
);
COPY_VALUE_FROM_ARG
(
min
,
omin
,
copied
);
UNLESS
(
copied
)
return
NULL
;
UNLESS
(
r
=
PyList_New
(
0
))
goto
err
;
...
...
trunk/src/BTrees/BucketTemplate.c
View file @
04b14c3e
...
...
@@ -82,7 +82,7 @@
****************************************************************************/
#define BUCKETTEMPLATE_C "$Id: BucketTemplate.c,v 1.
9 2001/03/20 13:52:00
jim Exp $\n"
#define BUCKETTEMPLATE_C "$Id: BucketTemplate.c,v 1.
10 2001/03/21 14:16:58
jim Exp $\n"
/*
** _bucket_get
...
...
@@ -102,7 +102,7 @@ _bucket_get(Bucket *self, PyObject *keyarg, int has_key)
PyObject
*
r
;
KEY_TYPE
key
;
COPY_KEY_FROM_ARG
(
key
,
keyarg
,
&
copied
);
COPY_KEY_FROM_ARG
(
key
,
keyarg
,
copied
);
UNLESS
(
copied
)
return
NULL
;
PER_USE_OR_RETURN
(
self
,
NULL
);
...
...
@@ -194,7 +194,7 @@ _bucket_set(Bucket *self, PyObject *keyarg, PyObject *v,
int
min
,
max
,
i
,
l
,
cmp
,
copied
=
1
;
KEY_TYPE
key
;
COPY_KEY_FROM_ARG
(
key
,
keyarg
,
&
copied
);
COPY_KEY_FROM_ARG
(
key
,
keyarg
,
copied
);
UNLESS
(
copied
)
return
-
1
;
PER_USE_OR_RETURN
(
self
,
-
1
);
...
...
@@ -210,7 +210,7 @@ _bucket_set(Bucket *self, PyObject *keyarg, PyObject *v,
{
VALUE_TYPE
value
;
COPY_VALUE_FROM_ARG
(
value
,
v
,
&
copied
);
COPY_VALUE_FROM_ARG
(
value
,
v
,
copied
);
UNLESS
(
copied
)
return
-
1
;
#ifdef VALUE_SAME
...
...
@@ -295,7 +295,7 @@ _bucket_set(Bucket *self, PyObject *keyarg, PyObject *v,
UNLESS
(
noval
)
{
COPY_VALUE_FROM_ARG
(
self
->
values
[
i
],
v
,
&
copied
);
COPY_VALUE_FROM_ARG
(
self
->
values
[
i
],
v
,
copied
);
UNLESS
(
copied
)
return
-
1
;
INCREF_VALUE
(
self
->
values
[
i
]);
}
...
...
@@ -487,7 +487,7 @@ Bucket_findRangeEnd(Bucket *self, PyObject *keyarg, int low, int *offset)
Bucket
*
release
=
NULL
;
KEY_TYPE
key
;
COPY_KEY_FROM_ARG
(
key
,
keyarg
,
&
copied
);
COPY_KEY_FROM_ARG
(
key
,
keyarg
,
copied
);
UNLESS
(
copied
)
return
-
1
;
PER_USE_OR_RETURN
(
self
,
-
1
);
...
...
@@ -768,7 +768,7 @@ bucket_byValue(Bucket *self, PyObject *args)
PER_USE_OR_RETURN
(
self
,
NULL
);
UNLESS
(
PyArg_ParseTuple
(
args
,
"O"
,
&
omin
))
return
NULL
;
COPY_VALUE_FROM_ARG
(
min
,
omin
,
&
copied
);
COPY_VALUE_FROM_ARG
(
min
,
omin
,
copied
);
UNLESS
(
copied
)
return
NULL
;
for
(
i
=
0
,
l
=
0
;
i
<
self
->
len
;
i
++
)
...
...
@@ -994,9 +994,9 @@ _bucket_setstate(Bucket *self, PyObject *args)
v
=
PyTuple_GET_ITEM
(
items
,
l
);
l
++
;
COPY_KEY_FROM_ARG
(
self
->
keys
[
i
],
k
,
&
copied
);
COPY_KEY_FROM_ARG
(
self
->
keys
[
i
],
k
,
copied
);
UNLESS
(
copied
)
return
-
1
;
COPY_VALUE_FROM_ARG
(
self
->
values
[
i
],
v
,
&
copied
);
COPY_VALUE_FROM_ARG
(
self
->
values
[
i
],
v
,
copied
);
UNLESS
(
copied
)
return
-
1
;
INCREF_KEY
(
self
->
keys
[
i
]);
INCREF_VALUE
(
self
->
values
[
i
]);
...
...
trunk/src/BTrees/SetOpTemplate.c
View file @
04b14c3e
...
...
@@ -87,7 +87,7 @@
Set operations
****************************************************************************/
#define SETOPTEMPLATE_C "$Id: SetOpTemplate.c,v 1.
5 2001/03/20 13:52:00
jim Exp $\n"
#define SETOPTEMPLATE_C "$Id: SetOpTemplate.c,v 1.
6 2001/03/21 14:16:58
jim Exp $\n"
#ifdef INTSET_H
static
int
...
...
@@ -202,7 +202,7 @@ initSetIteration(SetIteration *i, PyObject *s, int w, int *merge)
Py_INCREF
(
s
);
i
->
next
=
nextKeyAsSet
;
i
->
hasValue
=
0
;
COPY_KEY_FROM_ARG
(
i
->
key
,
s
,
&
copied
);
COPY_KEY_FROM_ARG
(
i
->
key
,
s
,
copied
);
UNLESS
(
copied
)
return
-
1
;
}
#endif
...
...
trunk/src/BTrees/SetTemplate.c
View file @
04b14c3e
...
...
@@ -83,7 +83,7 @@
****************************************************************************/
#define SETTEMPLATE_C "$Id: SetTemplate.c,v 1.
9 2001/03/20 13:52:00
jim Exp $\n"
#define SETTEMPLATE_C "$Id: SetTemplate.c,v 1.
10 2001/03/21 14:16:58
jim Exp $\n"
static
PyObject
*
Set_insert
(
Bucket
*
self
,
PyObject
*
args
)
...
...
@@ -179,7 +179,7 @@ _set_setstate(Bucket *self, PyObject *args)
for
(
i
=
0
;
i
<
l
;
i
++
)
{
k
=
PyTuple_GET_ITEM
(
items
,
i
);
COPY_KEY_FROM_ARG
(
self
->
keys
[
i
],
k
,
&
copied
);
COPY_KEY_FROM_ARG
(
self
->
keys
[
i
],
k
,
copied
);
UNLESS
(
copied
)
return
-
1
;
INCREF_KEY
(
self
->
keys
[
i
]);
}
...
...
trunk/src/BTrees/intkeymacros.h
View file @
04b14c3e
#define KEYMACROS_H "$Id: intkeymacros.h,v 1.
4 2001/03/20 13:52:00
jim Exp $\n"
#define KEYMACROS_H "$Id: intkeymacros.h,v 1.
5 2001/03/21 14:16:58
jim Exp $\n"
#define KEY_TYPE int
#define KEY_CHECK PyInt_Check
...
...
@@ -11,4 +11,4 @@
#define COPY_KEY_FROM_ARG(TARGET, ARG, STATUS) \
if (PyInt_Check(ARG)) TARGET=PyInt_AsLong(ARG); else { \
PyErr_SetString(PyExc_TypeError, "expected integer key"); \
*
(STATUS)=0; }
(STATUS)=0; }
trunk/src/BTrees/intvaluemacros.h
View file @
04b14c3e
#define VALUEMACROS_H "$Id: intvaluemacros.h,v 1.
5 2001/03/20 13:52:00
jim Exp $\n"
#define VALUEMACROS_H "$Id: intvaluemacros.h,v 1.
6 2001/03/21 14:16:58
jim Exp $\n"
#define VALUE_TYPE int
#define TEST_VALUE(K, T) (((K) < (T)) ? -1 : (((K) > (T)) ? 1: 0))
...
...
@@ -13,7 +13,7 @@
#define COPY_VALUE_FROM_ARG(TARGET, ARG, STATUS) \
if (PyInt_Check(ARG)) TARGET=PyInt_AsLong(ARG); else { \
PyErr_SetString(PyExc_TypeError, "expected integer value"); \
*
(STATUS)=0; }
(STATUS)=0; }
#define NORMALIZE_VALUE(V, MIN) ((MIN) > 0) ? ((V)/=(MIN)) : 0
...
...
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