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
47fc3143
Commit
47fc3143
authored
Apr 03, 2001
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
numerous changes to prevent gcc warnings
parent
3cad3d48
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
63 additions
and
48 deletions
+63
-48
src/BTrees/BTreeModuleTemplate.c
src/BTrees/BTreeModuleTemplate.c
+3
-3
src/BTrees/BTreeTemplate.c
src/BTrees/BTreeTemplate.c
+38
-28
src/BTrees/BucketTemplate.c
src/BTrees/BucketTemplate.c
+8
-7
src/BTrees/MergeTemplate.c
src/BTrees/MergeTemplate.c
+6
-5
src/BTrees/SetOpTemplate.c
src/BTrees/SetOpTemplate.c
+4
-1
src/BTrees/intkeymacros.h
src/BTrees/intkeymacros.h
+2
-2
src/BTrees/intvaluemacros.h
src/BTrees/intvaluemacros.h
+2
-2
No files found.
src/BTrees/BTreeModuleTemplate.c
View file @
47fc3143
...
...
@@ -340,7 +340,7 @@ static char BTree_module_documentation[] =
"
\n
"
MASTER_ID
BTREEITEMSTEMPLATE_C
"$Id: BTreeModuleTemplate.c,v 1.1
0 2001/04/02 16:56:09 jeremy
Exp $
\n
"
"$Id: BTreeModuleTemplate.c,v 1.1
1 2001/04/03 15:02:17 jim
Exp $
\n
"
BTREETEMPLATE_C
BUCKETTEMPLATE_C
KEYMACROS_H
...
...
@@ -366,7 +366,7 @@ INITMODULE (void)
return
;
#ifdef PERSISTENT
if
(
cPersistenceCAPI
=
PyCObject_Import
(
"cPersistence"
,
"CAPI"
))
if
(
(
cPersistenceCAPI
=
PyCObject_Import
(
"cPersistence"
,
"CAPI"
)
))
{
BucketType
.
methods
.
link
=
cPersistenceCAPI
->
methods
;
BucketType
.
tp_getattro
=
cPersistenceCAPI
->
getattro
;
...
...
@@ -409,7 +409,7 @@ INITMODULE (void)
d
=
PyModule_GetDict
(
m
);
PyDict_SetItemString
(
d
,
"__version__"
,
PyString_FromString
(
"$Revision: 1.1
0
$"
));
PyString_FromString
(
"$Revision: 1.1
1
$"
));
PyExtensionClass_Export
(
d
,
MOD_NAME_PREFIX
"Bucket"
,
BucketType
);
PyExtensionClass_Export
(
d
,
MOD_NAME_PREFIX
"BTree"
,
BTreeType
);
...
...
src/BTrees/BTreeTemplate.c
View file @
47fc3143
...
...
@@ -83,7 +83,7 @@
****************************************************************************/
#define BTREETEMPLATE_C "$Id: BTreeTemplate.c,v 1.1
5 2001/04/02 16:57:40 jeremy
Exp $\n"
#define BTREETEMPLATE_C "$Id: BTreeTemplate.c,v 1.1
6 2001/04/03 15:02:17 jim
Exp $\n"
/*
** _BTree_get
...
...
@@ -505,36 +505,43 @@ _BTree_set(BTree *self, PyObject *keyarg, PyObject *value,
}
self
->
len
--
;
Py_DECREF
(
d
->
value
);
if
(
min
)
DECREF_KEY
(
d
->
key
);
if
(
min
)
{
DECREF_KEY
(
d
->
key
);
}
if
(
min
<
self
->
len
)
memmove
(
d
,
d
+
1
,
(
self
->
len
-
min
)
*
sizeof
(
BTreeItem
));
if
(
!
min
)
if
(
self
->
len
)
{
/* We just deleted our first child, so we need to
adjust our first bucket. */
if
(
SameType_Check
(
self
,
self
->
data
->
value
))
{
UNLESS
(
PER_USE
(
BTREE
(
self
->
data
->
value
)))
goto
err
;
ASSIGNB
(
self
->
firstbucket
,
BTREE
(
self
->
data
->
value
)
->
firstbucket
);
Py_XINCREF
(
self
->
firstbucket
);
PER_ALLOW_DEACTIVATION
(
BTREE
(
self
->
data
->
value
));
PER_ACCESSED
(
BTREE
(
self
->
data
->
value
));
}
else
{
ASSIGNB
(
self
->
firstbucket
,
BUCKET
(
self
->
data
->
value
));
Py_INCREF
(
self
->
firstbucket
);
}
/* We can toss our first key now */
DECREF_KEY
(
self
->
data
->
key
);
}
else
{
Py_XDECREF
(
self
->
firstbucket
);
self
->
firstbucket
=
0
;
}
{
if
(
self
->
len
)
{
/* We just deleted our first child, so we need to
adjust our first bucket. */
if
(
SameType_Check
(
self
,
self
->
data
->
value
))
{
UNLESS
(
PER_USE
(
BTREE
(
self
->
data
->
value
)))
goto
err
;
ASSIGNB
(
self
->
firstbucket
,
BTREE
(
self
->
data
->
value
)
->
firstbucket
);
Py_XINCREF
(
self
->
firstbucket
);
PER_ALLOW_DEACTIVATION
(
BTREE
(
self
->
data
->
value
));
PER_ACCESSED
(
BTREE
(
self
->
data
->
value
));
}
else
{
ASSIGNB
(
self
->
firstbucket
,
BUCKET
(
self
->
data
->
value
));
Py_INCREF
(
self
->
firstbucket
);
}
/* We can toss our first key now */
DECREF_KEY
(
self
->
data
->
key
);
}
else
{
Py_XDECREF
(
self
->
firstbucket
);
self
->
firstbucket
=
0
;
}
}
changed
=
1
;
}
}
...
...
@@ -612,7 +619,10 @@ _BTree_clear(BTree *self)
for
(
l
=
self
->
len
,
i
=
0
;
i
<
l
;
i
++
)
{
if
(
i
)
DECREF_KEY
(
self
->
data
[
i
].
key
);
if
(
i
)
{
DECREF_KEY
(
self
->
data
[
i
].
key
);
}
Py_DECREF
(
self
->
data
[
i
].
value
);
}
self
->
len
=
0
;
...
...
src/BTrees/BucketTemplate.c
View file @
47fc3143
...
...
@@ -82,7 +82,7 @@
****************************************************************************/
#define BUCKETTEMPLATE_C "$Id: BucketTemplate.c,v 1.1
3 2001/04/02 16:57:40 jeremy
Exp $\n"
#define BUCKETTEMPLATE_C "$Id: BucketTemplate.c,v 1.1
4 2001/04/03 15:02:17 jim
Exp $\n"
/*
** _bucket_get
...
...
@@ -566,8 +566,6 @@ Bucket_maxminKey(Bucket *self, PyObject *args, int min)
empty:
PyErr_SetString
(
PyExc_ValueError
,
"empty bucket"
);
err:
PER_ALLOW_DEACTIVATION
(
self
);
PER_ACCESSED
(
self
);
return
NULL
;
...
...
@@ -834,7 +832,10 @@ _bucket_clear(Bucket *self)
for
(
i
=
self
->
len
;
--
i
>=
0
;
)
{
DECREF_KEY
(
self
->
keys
[
i
]);
if
(
self
->
values
)
DECREF_VALUE
(
self
->
values
[
i
]);
if
(
self
->
values
)
{
DECREF_VALUE
(
self
->
values
[
i
]);
}
}
self
->
len
=
0
;
if
(
self
->
values
)
...
...
@@ -1072,12 +1073,12 @@ _bucket__p_resolveConflict(PyObject *ob_type, PyObject *s[3])
for
(
i
=
0
;
i
<
3
;
i
++
)
{
if
(
b
[
i
]
=
(
Bucket
*
)
PyObject_CallObject
(
OBJECT
(
ob_type
),
NULL
))
if
(
(
b
[
i
]
=
(
Bucket
*
)
PyObject_CallObject
(
OBJECT
(
ob_type
),
NULL
)
))
{
if
(
s
[
i
]
==
Py_None
)
/* None is equivalent to empty, for BTrees */
if
(
(
s
[
i
]
==
Py_None
)
)
/* None is equivalent to empty, for BTrees */
continue
;
ASSIGN
(
r
,
PyObject_GetAttr
(
OBJECT
(
b
[
i
]),
__setstate___str
));
if
(
a
=
PyTuple_New
(
1
))
if
(
(
a
=
PyTuple_New
(
1
)
))
{
if
(
r
)
{
...
...
src/BTrees/MergeTemplate.c
View file @
47fc3143
...
...
@@ -83,7 +83,7 @@
****************************************************************************/
#define MERGETEMPLATE_C "$Id: MergeTemplate.c,v 1.
4 2001/04/02 16:57:40 jeremy
Exp $\n"
#define MERGETEMPLATE_C "$Id: MergeTemplate.c,v 1.
5 2001/04/03 15:02:17 jim
Exp $\n"
/****************************************************************************
Set operations
...
...
@@ -111,7 +111,10 @@ merge_error(int p1, int p2, int p3, int reason)
UNLESS
(
r
=
Py_BuildValue
(
"iiii"
,
p1
,
p2
,
p3
,
reason
))
r
=
Py_None
;
PyErr_SetObject
(
PyExc_ValueError
,
r
);
if
(
r
!=
Py_None
)
Py_DECREF
(
r
);
if
(
r
!=
Py_None
)
{
Py_DECREF
(
r
);
}
return
NULL
;
}
...
...
@@ -330,9 +333,7 @@ bucket_merge(Bucket *s1, Bucket *s2, Bucket *s3)
return
s
;
invalid_set_operation:
PyErr_SetString
(
PyExc_TypeError
,
"invalid set operation"
);
err:
err:
Py_XDECREF
(
i1
.
set
);
Py_XDECREF
(
i2
.
set
);
Py_XDECREF
(
i3
.
set
);
...
...
src/BTrees/SetOpTemplate.c
View file @
47fc3143
...
...
@@ -87,7 +87,7 @@
Set operations
****************************************************************************/
#define SETOPTEMPLATE_C "$Id: SetOpTemplate.c,v 1.
6 2001/03/21 14:16:58
jim Exp $\n"
#define SETOPTEMPLATE_C "$Id: SetOpTemplate.c,v 1.
7 2001/04/03 15:02:17
jim Exp $\n"
#ifdef INTSET_H
static
int
...
...
@@ -357,8 +357,11 @@ set_operation(PyObject *s1, PyObject *s2,
return
OBJECT
(
r
);
#ifndef MERGE_DEFAULT
invalid_set_operation:
PyErr_SetString
(
PyExc_TypeError
,
"invalid set operation"
);
#endif
err:
Py_XDECREF
(
i1
.
set
);
Py_XDECREF
(
i2
.
set
);
...
...
src/BTrees/intkeymacros.h
View file @
47fc3143
#define KEYMACROS_H "$Id: intkeymacros.h,v 1.
5 2001/03/21 14:16:58
jim Exp $\n"
#define KEYMACROS_H "$Id: intkeymacros.h,v 1.
6 2001/04/03 15:02:17
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;
(TARGET)=0;
}
src/BTrees/intvaluemacros.h
View file @
47fc3143
#define VALUEMACROS_H "$Id: intvaluemacros.h,v 1.
6 2001/03/21 14:16:58
jim Exp $\n"
#define VALUEMACROS_H "$Id: intvaluemacros.h,v 1.
7 2001/04/03 15:02:17
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;
(TARGET)=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