Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Kirill Smelkov
Zope
Commits
5ed30dcd
Commit
5ed30dcd
authored
Aug 02, 2009
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made C extensions work for 64-bit Python 2.5.x / 2.6.x.
parent
09cea559
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
34 deletions
+62
-34
doc/CHANGES.rst
doc/CHANGES.rst
+5
-0
src/AccessControl/cAccessControl.c
src/AccessControl/cAccessControl.c
+23
-12
src/Record/_Record.c
src/Record/_Record.c
+34
-22
No files found.
doc/CHANGES.rst
View file @
5ed30dcd
...
...
@@ -56,6 +56,11 @@ Features Added
Bugs Fixed
++++++++++
- Made C extensions work for 64-bit Python 2.5.x / 2.6.x.
- Unfutzed test failures due to use of naive timezones with ``datetime``
instances.
- LP #397861: exporting $PYTHON in generated 'zopectl' for fixing import issue
with "bin/zopectl adduser"
...
...
src/AccessControl/cAccessControl.c
View file @
5ed30dcd
...
...
@@ -54,6 +54,17 @@
#include <stdio.h>
#include <stdlib.h>
#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
typedef
int
Py_ssize_t
;
typedef
Py_ssize_t
(
*
lenfunc
)(
PyObject
*
);
typedef
PyObject
*
(
*
ssizeargfunc
)(
PyObject
*
,
Py_ssize_t
);
typedef
PyObject
*
(
*
ssizessizeargfunc
)(
PyObject
*
,
Py_ssize_t
,
Py_ssize_t
);
typedef
int
(
*
ssizeobjargproc
)(
PyObject
*
,
Py_ssize_t
,
PyObject
*
);
typedef
int
(
*
ssizessizeobjargproc
)(
PyObject
*
,
Py_ssize_t
,
Py_ssize_t
,
PyObject
*
);
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#endif
static
void
PyVar_Assign
(
PyObject
**
v
,
PyObject
*
e
)
...
...
@@ -349,9 +360,9 @@ static void PermissionRole_dealloc(PermissionRole *self);
static
PyObject
*
PermissionRole_getattro
(
PermissionRole
*
self
,
PyObject
*
name
);
static
PyObject
*
imPermissionRole_of
(
imPermissionRole
*
self
,
PyObject
*
parent
);
static
in
t
imPermissionRole_length
(
imPermissionRole
*
self
);
static
Py_ssize_
t
imPermissionRole_length
(
imPermissionRole
*
self
);
static
PyObject
*
imPermissionRole_get
(
imPermissionRole
*
self
,
in
t
item
);
Py_ssize_
t
item
);
static
void
imPermissionRole_dealloc
(
imPermissionRole
*
self
);
static
PyObject
*
rolesForPermissionOn
(
PyObject
*
self
,
PyObject
*
args
);
...
...
@@ -593,16 +604,16 @@ static PyMethodDef imPermissionRole_methods[] = {
};
static
PySequenceMethods
imSequenceMethods
=
{
(
inquiry
)
imPermissionRole_length
,
/* sq_length */
(
lenfunc
)
imPermissionRole_length
,
/* sq_length */
(
binaryfunc
)
NULL
,
/* sq_concat */
(
int
argfunc
)
NULL
,
/* sq_repeat */
(
int
argfunc
)
imPermissionRole_get
,
/* sq_item */
(
intint
argfunc
)
NULL
,
/* sq_slice */
(
int
objargproc
)
NULL
,
/* sq_ass_item */
(
intint
objargproc
)
NULL
,
/* sq_ass_slice */
(
ssize
argfunc
)
NULL
,
/* sq_repeat */
(
ssize
argfunc
)
imPermissionRole_get
,
/* sq_item */
(
ssizessize
argfunc
)
NULL
,
/* sq_slice */
(
ssize
objargproc
)
NULL
,
/* sq_ass_item */
(
ssizessize
objargproc
)
NULL
,
/* sq_ass_slice */
(
objobjproc
)
NULL
,
/* sq_contains */
(
binaryfunc
)
NULL
,
/* sq_inplace_concat */
(
int
argfunc
)
NULL
/* sq_inplace_repeat */
(
ssize
argfunc
)
NULL
/* sq_inplace_repeat */
};
static
PyExtensionClass
imPermissionRoleType
=
{
...
...
@@ -1613,9 +1624,9 @@ imPermissionRole_of(imPermissionRole *self, PyObject *value) {
/*
** imPermissionRole_length
*/
static
in
t
imPermissionRole_length
(
imPermissionRole
*
self
)
{
static
Py_ssize_
t
imPermissionRole_length
(
imPermissionRole
*
self
)
{
in
t
l
;
Py_ssize_
t
l
;
PyObject
*
v
;
PyObject
*
pa
;
...
...
@@ -1654,7 +1665,7 @@ static int imPermissionRole_length(imPermissionRole *self) {
*/
static
PyObject
*
imPermissionRole_get
(
imPermissionRole
*
self
,
in
t
item
)
{
Py_ssize_
t
item
)
{
PyObject
*
v
;
PyObject
*
pa
;
...
...
src/Record/_Record.c
View file @
5ed30dcd
...
...
@@ -21,6 +21,17 @@ static char Record_module_documentation[] =
/* ----------------------------------------------------- */
#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
typedef
int
Py_ssize_t
;
typedef
Py_ssize_t
(
*
lenfunc
)(
PyObject
*
);
typedef
PyObject
*
(
*
ssizeargfunc
)(
PyObject
*
,
Py_ssize_t
);
typedef
PyObject
*
(
*
ssizessizeargfunc
)(
PyObject
*
,
Py_ssize_t
,
Py_ssize_t
);
typedef
int
(
*
ssizeobjargproc
)(
PyObject
*
,
Py_ssize_t
,
PyObject
*
);
typedef
int
(
*
ssizessizeobjargproc
)(
PyObject
*
,
Py_ssize_t
,
Py_ssize_t
,
PyObject
*
);
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#endif
static
void
PyVar_Assign
(
PyObject
**
v
,
PyObject
*
e
)
{
Py_XDECREF
(
*
v
);
*
v
=
e
;}
#define ASSIGN(V,E) PyVar_Assign(&(V),(E))
#define UNLESS(E) if(!(E))
...
...
@@ -41,10 +52,10 @@ staticforward PyExtensionClass RecordType;
/* ---------------------------------------------------------------- */
static
in
t
static
Py_ssize_
t
Record_init
(
Record
*
self
)
{
in
t
l
;
Py_ssize_
t
l
;
UNLESS
(
self
->
schema
)
UNLESS
(
self
->
schema
=
PyObject_GetAttr
(
OBJECT
(
self
->
ob_type
),
...
...
@@ -67,7 +78,7 @@ static PyObject *
Record___setstate__
(
Record
*
self
,
PyObject
*
args
)
{
PyObject
*
state
=
0
,
*
parent
,
**
d
;
in
t
l
,
ls
,
i
;
Py_ssize_
t
l
,
ls
,
i
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
NULL
;
...
...
@@ -102,7 +113,7 @@ static PyObject *
Record___getstate__
(
Record
*
self
,
PyObject
*
args
)
{
PyObject
*
r
,
**
d
,
*
v
;
in
t
i
,
l
;
Py_ssize_
t
i
,
l
;
UNLESS
(
self
->
data
)
return
PyTuple_New
(
0
);
...
...
@@ -162,7 +173,7 @@ Record_dealloc(Record *self)
static
PyObject
*
Record_getattr
(
Record
*
self
,
PyObject
*
name
)
{
in
t
l
,
i
;
Py_ssize_
t
l
,
i
;
PyObject
*
io
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
NULL
;
...
...
@@ -197,7 +208,7 @@ Record_getattr(Record *self, PyObject *name)
static
int
Record_setattr
(
Record
*
self
,
PyObject
*
name
,
PyObject
*
v
)
{
in
t
l
,
i
;
Py_ssize_
t
l
,
i
;
PyObject
*
io
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
-
1
;
...
...
@@ -225,7 +236,8 @@ Record_setattr(Record *self, PyObject *name, PyObject *v)
static
int
Record_compare
(
Record
*
v
,
Record
*
w
)
{
int
lv
,
lw
,
i
,
c
;
Py_ssize_t
lv
,
lw
,
i
;
int
c
;
PyObject
**
dv
,
**
dw
;
if
((
lv
=
Record_init
(
v
))
<
0
)
return
-
1
;
...
...
@@ -258,7 +270,7 @@ Record_concat(Record *self, PyObject *bb)
}
static
PyObject
*
Record_repeat
(
Record
*
self
,
in
t
n
)
Record_repeat
(
Record
*
self
,
Py_ssize_
t
n
)
{
PyErr_SetString
(
PyExc_TypeError
,
"Record objects do not support repetition"
);
...
...
@@ -280,10 +292,10 @@ IndexError(int i)
}
static
PyObject
*
Record_item
(
Record
*
self
,
in
t
i
)
Record_item
(
Record
*
self
,
Py_ssize_
t
i
)
{
PyObject
*
o
;
in
t
l
;
Py_ssize_
t
l
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
NULL
;
if
(
i
<
0
||
i
>=
l
)
return
IndexError
(
i
);
...
...
@@ -296,7 +308,7 @@ Record_item(Record *self, int i)
}
static
PyObject
*
Record_slice
(
Record
*
self
,
int
ilow
,
in
t
ihigh
)
Record_slice
(
Record
*
self
,
Py_ssize_t
ilow
,
Py_ssize_
t
ihigh
)
{
PyErr_SetString
(
PyExc_TypeError
,
"Record objects do not support slicing"
);
...
...
@@ -304,9 +316,9 @@ Record_slice(Record *self, int ilow, int ihigh)
}
static
int
Record_ass_item
(
Record
*
self
,
in
t
i
,
PyObject
*
v
)
Record_ass_item
(
Record
*
self
,
Py_ssize_
t
i
,
PyObject
*
v
)
{
in
t
l
;
Py_ssize_
t
l
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
-
1
;
if
(
i
<
0
||
i
>=
l
)
...
...
@@ -335,13 +347,13 @@ Record_ass_slice(Record *self, int ilow, int ihigh, PyObject *v)
}
static
PySequenceMethods
Record_as_sequence
=
{
(
inquiry
)
Record_init
,
/*sq_length*/
(
lenfunc
)
Record_init
,
/*sq_length*/
(
binaryfunc
)
Record_concat
,
/*sq_concat*/
(
int
argfunc
)
Record_repeat
,
/*sq_repeat*/
(
int
argfunc
)
Record_item
,
/*sq_item*/
(
intint
argfunc
)
Record_slice
,
/*sq_slice*/
(
int
objargproc
)
Record_ass_item
,
/*sq_ass_item*/
(
intint
objargproc
)
Record_ass_slice
,
/*sq_ass_slice*/
(
ssize
argfunc
)
Record_repeat
,
/*sq_repeat*/
(
ssize
argfunc
)
Record_item
,
/*sq_item*/
(
ssizessize
argfunc
)
Record_slice
,
/*sq_slice*/
(
ssize
objargproc
)
Record_ass_item
,
/*sq_ass_item*/
(
ssizessize
objargproc
)
Record_ass_slice
,
/*sq_ass_slice*/
};
/* -------------------------------------------------------------- */
...
...
@@ -349,7 +361,7 @@ static PySequenceMethods Record_as_sequence = {
static
PyObject
*
Record_subscript
(
Record
*
self
,
PyObject
*
key
)
{
in
t
i
,
l
;
Py_ssize_
t
i
,
l
;
PyObject
*
io
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
NULL
;
...
...
@@ -389,7 +401,7 @@ Record_subscript(Record *self, PyObject *key)
static
int
Record_ass_sub
(
Record
*
self
,
PyObject
*
key
,
PyObject
*
v
)
{
in
t
i
,
l
;
Py_ssize_
t
i
,
l
;
PyObject
*
io
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
-
1
;
...
...
@@ -422,7 +434,7 @@ Record_ass_sub(Record *self, PyObject *key, PyObject *v)
}
static
PyMappingMethods
Record_as_mapping
=
{
(
inquiry
)
Record_init
,
/*mp_length*/
(
lenfunc
)
Record_init
,
/*mp_length*/
(
binaryfunc
)
Record_subscript
,
/*mp_subscript*/
(
objobjargproc
)
Record_ass_sub
,
/*mp_ass_subscript*/
};
...
...
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