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
...
@@ -56,6 +56,11 @@ Features Added
Bugs Fixed
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
- LP #397861: exporting $PYTHON in generated 'zopectl' for fixing import issue
with "bin/zopectl adduser"
with "bin/zopectl adduser"
...
...
src/AccessControl/cAccessControl.c
View file @
5ed30dcd
...
@@ -54,6 +54,17 @@
...
@@ -54,6 +54,17 @@
#include <stdio.h>
#include <stdio.h>
#include <stdlib.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
static
void
PyVar_Assign
(
PyObject
**
v
,
PyObject
*
e
)
PyVar_Assign
(
PyObject
**
v
,
PyObject
*
e
)
...
@@ -349,9 +360,9 @@ static void PermissionRole_dealloc(PermissionRole *self);
...
@@ -349,9 +360,9 @@ static void PermissionRole_dealloc(PermissionRole *self);
static
PyObject
*
PermissionRole_getattro
(
PermissionRole
*
self
,
PyObject
*
name
);
static
PyObject
*
PermissionRole_getattro
(
PermissionRole
*
self
,
PyObject
*
name
);
static
PyObject
*
imPermissionRole_of
(
imPermissionRole
*
self
,
PyObject
*
parent
);
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
,
static
PyObject
*
imPermissionRole_get
(
imPermissionRole
*
self
,
in
t
item
);
Py_ssize_
t
item
);
static
void
imPermissionRole_dealloc
(
imPermissionRole
*
self
);
static
void
imPermissionRole_dealloc
(
imPermissionRole
*
self
);
static
PyObject
*
rolesForPermissionOn
(
PyObject
*
self
,
PyObject
*
args
);
static
PyObject
*
rolesForPermissionOn
(
PyObject
*
self
,
PyObject
*
args
);
...
@@ -593,16 +604,16 @@ static PyMethodDef imPermissionRole_methods[] = {
...
@@ -593,16 +604,16 @@ static PyMethodDef imPermissionRole_methods[] = {
};
};
static
PySequenceMethods
imSequenceMethods
=
{
static
PySequenceMethods
imSequenceMethods
=
{
(
inquiry
)
imPermissionRole_length
,
/* sq_length */
(
lenfunc
)
imPermissionRole_length
,
/* sq_length */
(
binaryfunc
)
NULL
,
/* sq_concat */
(
binaryfunc
)
NULL
,
/* sq_concat */
(
int
argfunc
)
NULL
,
/* sq_repeat */
(
ssize
argfunc
)
NULL
,
/* sq_repeat */
(
int
argfunc
)
imPermissionRole_get
,
/* sq_item */
(
ssize
argfunc
)
imPermissionRole_get
,
/* sq_item */
(
intint
argfunc
)
NULL
,
/* sq_slice */
(
ssizessize
argfunc
)
NULL
,
/* sq_slice */
(
int
objargproc
)
NULL
,
/* sq_ass_item */
(
ssize
objargproc
)
NULL
,
/* sq_ass_item */
(
intint
objargproc
)
NULL
,
/* sq_ass_slice */
(
ssizessize
objargproc
)
NULL
,
/* sq_ass_slice */
(
objobjproc
)
NULL
,
/* sq_contains */
(
objobjproc
)
NULL
,
/* sq_contains */
(
binaryfunc
)
NULL
,
/* sq_inplace_concat */
(
binaryfunc
)
NULL
,
/* sq_inplace_concat */
(
int
argfunc
)
NULL
/* sq_inplace_repeat */
(
ssize
argfunc
)
NULL
/* sq_inplace_repeat */
};
};
static
PyExtensionClass
imPermissionRoleType
=
{
static
PyExtensionClass
imPermissionRoleType
=
{
...
@@ -1613,9 +1624,9 @@ imPermissionRole_of(imPermissionRole *self, PyObject *value) {
...
@@ -1613,9 +1624,9 @@ imPermissionRole_of(imPermissionRole *self, PyObject *value) {
/*
/*
** imPermissionRole_length
** 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
*
v
;
PyObject
*
pa
;
PyObject
*
pa
;
...
@@ -1654,7 +1665,7 @@ static int imPermissionRole_length(imPermissionRole *self) {
...
@@ -1654,7 +1665,7 @@ static int imPermissionRole_length(imPermissionRole *self) {
*/
*/
static
PyObject
*
imPermissionRole_get
(
imPermissionRole
*
self
,
static
PyObject
*
imPermissionRole_get
(
imPermissionRole
*
self
,
in
t
item
)
{
Py_ssize_
t
item
)
{
PyObject
*
v
;
PyObject
*
v
;
PyObject
*
pa
;
PyObject
*
pa
;
...
...
src/Record/_Record.c
View file @
5ed30dcd
...
@@ -21,6 +21,17 @@ static char Record_module_documentation[] =
...
@@ -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
;}
static
void
PyVar_Assign
(
PyObject
**
v
,
PyObject
*
e
)
{
Py_XDECREF
(
*
v
);
*
v
=
e
;}
#define ASSIGN(V,E) PyVar_Assign(&(V),(E))
#define ASSIGN(V,E) PyVar_Assign(&(V),(E))
#define UNLESS(E) if(!(E))
#define UNLESS(E) if(!(E))
...
@@ -41,10 +52,10 @@ staticforward PyExtensionClass RecordType;
...
@@ -41,10 +52,10 @@ staticforward PyExtensionClass RecordType;
/* ---------------------------------------------------------------- */
/* ---------------------------------------------------------------- */
static
in
t
static
Py_ssize_
t
Record_init
(
Record
*
self
)
Record_init
(
Record
*
self
)
{
{
in
t
l
;
Py_ssize_
t
l
;
UNLESS
(
self
->
schema
)
UNLESS
(
self
->
schema
)
UNLESS
(
self
->
schema
=
PyObject_GetAttr
(
OBJECT
(
self
->
ob_type
),
UNLESS
(
self
->
schema
=
PyObject_GetAttr
(
OBJECT
(
self
->
ob_type
),
...
@@ -67,7 +78,7 @@ static PyObject *
...
@@ -67,7 +78,7 @@ static PyObject *
Record___setstate__
(
Record
*
self
,
PyObject
*
args
)
Record___setstate__
(
Record
*
self
,
PyObject
*
args
)
{
{
PyObject
*
state
=
0
,
*
parent
,
**
d
;
PyObject
*
state
=
0
,
*
parent
,
**
d
;
in
t
l
,
ls
,
i
;
Py_ssize_
t
l
,
ls
,
i
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
NULL
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
NULL
;
...
@@ -102,7 +113,7 @@ static PyObject *
...
@@ -102,7 +113,7 @@ static PyObject *
Record___getstate__
(
Record
*
self
,
PyObject
*
args
)
Record___getstate__
(
Record
*
self
,
PyObject
*
args
)
{
{
PyObject
*
r
,
**
d
,
*
v
;
PyObject
*
r
,
**
d
,
*
v
;
in
t
i
,
l
;
Py_ssize_
t
i
,
l
;
UNLESS
(
self
->
data
)
return
PyTuple_New
(
0
);
UNLESS
(
self
->
data
)
return
PyTuple_New
(
0
);
...
@@ -162,7 +173,7 @@ Record_dealloc(Record *self)
...
@@ -162,7 +173,7 @@ Record_dealloc(Record *self)
static
PyObject
*
static
PyObject
*
Record_getattr
(
Record
*
self
,
PyObject
*
name
)
Record_getattr
(
Record
*
self
,
PyObject
*
name
)
{
{
in
t
l
,
i
;
Py_ssize_
t
l
,
i
;
PyObject
*
io
;
PyObject
*
io
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
NULL
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
NULL
;
...
@@ -197,7 +208,7 @@ Record_getattr(Record *self, PyObject *name)
...
@@ -197,7 +208,7 @@ Record_getattr(Record *self, PyObject *name)
static
int
static
int
Record_setattr
(
Record
*
self
,
PyObject
*
name
,
PyObject
*
v
)
Record_setattr
(
Record
*
self
,
PyObject
*
name
,
PyObject
*
v
)
{
{
in
t
l
,
i
;
Py_ssize_
t
l
,
i
;
PyObject
*
io
;
PyObject
*
io
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
-
1
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
-
1
;
...
@@ -225,7 +236,8 @@ Record_setattr(Record *self, PyObject *name, PyObject *v)
...
@@ -225,7 +236,8 @@ Record_setattr(Record *self, PyObject *name, PyObject *v)
static
int
static
int
Record_compare
(
Record
*
v
,
Record
*
w
)
Record_compare
(
Record
*
v
,
Record
*
w
)
{
{
int
lv
,
lw
,
i
,
c
;
Py_ssize_t
lv
,
lw
,
i
;
int
c
;
PyObject
**
dv
,
**
dw
;
PyObject
**
dv
,
**
dw
;
if
((
lv
=
Record_init
(
v
))
<
0
)
return
-
1
;
if
((
lv
=
Record_init
(
v
))
<
0
)
return
-
1
;
...
@@ -258,7 +270,7 @@ Record_concat(Record *self, PyObject *bb)
...
@@ -258,7 +270,7 @@ Record_concat(Record *self, PyObject *bb)
}
}
static
PyObject
*
static
PyObject
*
Record_repeat
(
Record
*
self
,
in
t
n
)
Record_repeat
(
Record
*
self
,
Py_ssize_
t
n
)
{
{
PyErr_SetString
(
PyExc_TypeError
,
PyErr_SetString
(
PyExc_TypeError
,
"Record objects do not support repetition"
);
"Record objects do not support repetition"
);
...
@@ -280,10 +292,10 @@ IndexError(int i)
...
@@ -280,10 +292,10 @@ IndexError(int i)
}
}
static
PyObject
*
static
PyObject
*
Record_item
(
Record
*
self
,
in
t
i
)
Record_item
(
Record
*
self
,
Py_ssize_
t
i
)
{
{
PyObject
*
o
;
PyObject
*
o
;
in
t
l
;
Py_ssize_
t
l
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
NULL
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
NULL
;
if
(
i
<
0
||
i
>=
l
)
return
IndexError
(
i
);
if
(
i
<
0
||
i
>=
l
)
return
IndexError
(
i
);
...
@@ -296,7 +308,7 @@ Record_item(Record *self, int i)
...
@@ -296,7 +308,7 @@ Record_item(Record *self, int i)
}
}
static
PyObject
*
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
,
PyErr_SetString
(
PyExc_TypeError
,
"Record objects do not support slicing"
);
"Record objects do not support slicing"
);
...
@@ -304,9 +316,9 @@ Record_slice(Record *self, int ilow, int ihigh)
...
@@ -304,9 +316,9 @@ Record_slice(Record *self, int ilow, int ihigh)
}
}
static
int
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
((
l
=
Record_init
(
self
))
<
0
)
return
-
1
;
if
(
i
<
0
||
i
>=
l
)
if
(
i
<
0
||
i
>=
l
)
...
@@ -335,13 +347,13 @@ Record_ass_slice(Record *self, int ilow, int ihigh, PyObject *v)
...
@@ -335,13 +347,13 @@ Record_ass_slice(Record *self, int ilow, int ihigh, PyObject *v)
}
}
static
PySequenceMethods
Record_as_sequence
=
{
static
PySequenceMethods
Record_as_sequence
=
{
(
inquiry
)
Record_init
,
/*sq_length*/
(
lenfunc
)
Record_init
,
/*sq_length*/
(
binaryfunc
)
Record_concat
,
/*sq_concat*/
(
binaryfunc
)
Record_concat
,
/*sq_concat*/
(
int
argfunc
)
Record_repeat
,
/*sq_repeat*/
(
ssize
argfunc
)
Record_repeat
,
/*sq_repeat*/
(
int
argfunc
)
Record_item
,
/*sq_item*/
(
ssize
argfunc
)
Record_item
,
/*sq_item*/
(
intint
argfunc
)
Record_slice
,
/*sq_slice*/
(
ssizessize
argfunc
)
Record_slice
,
/*sq_slice*/
(
int
objargproc
)
Record_ass_item
,
/*sq_ass_item*/
(
ssize
objargproc
)
Record_ass_item
,
/*sq_ass_item*/
(
intint
objargproc
)
Record_ass_slice
,
/*sq_ass_slice*/
(
ssizessize
objargproc
)
Record_ass_slice
,
/*sq_ass_slice*/
};
};
/* -------------------------------------------------------------- */
/* -------------------------------------------------------------- */
...
@@ -349,7 +361,7 @@ static PySequenceMethods Record_as_sequence = {
...
@@ -349,7 +361,7 @@ static PySequenceMethods Record_as_sequence = {
static
PyObject
*
static
PyObject
*
Record_subscript
(
Record
*
self
,
PyObject
*
key
)
Record_subscript
(
Record
*
self
,
PyObject
*
key
)
{
{
in
t
i
,
l
;
Py_ssize_
t
i
,
l
;
PyObject
*
io
;
PyObject
*
io
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
NULL
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
NULL
;
...
@@ -389,7 +401,7 @@ Record_subscript(Record *self, PyObject *key)
...
@@ -389,7 +401,7 @@ Record_subscript(Record *self, PyObject *key)
static
int
static
int
Record_ass_sub
(
Record
*
self
,
PyObject
*
key
,
PyObject
*
v
)
Record_ass_sub
(
Record
*
self
,
PyObject
*
key
,
PyObject
*
v
)
{
{
in
t
i
,
l
;
Py_ssize_
t
i
,
l
;
PyObject
*
io
;
PyObject
*
io
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
-
1
;
if
((
l
=
Record_init
(
self
))
<
0
)
return
-
1
;
...
@@ -422,7 +434,7 @@ Record_ass_sub(Record *self, PyObject *key, PyObject *v)
...
@@ -422,7 +434,7 @@ Record_ass_sub(Record *self, PyObject *key, PyObject *v)
}
}
static
PyMappingMethods
Record_as_mapping
=
{
static
PyMappingMethods
Record_as_mapping
=
{
(
inquiry
)
Record_init
,
/*mp_length*/
(
lenfunc
)
Record_init
,
/*mp_length*/
(
binaryfunc
)
Record_subscript
,
/*mp_subscript*/
(
binaryfunc
)
Record_subscript
,
/*mp_subscript*/
(
objobjargproc
)
Record_ass_sub
,
/*mp_ass_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