Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Boxiang Sun
cython
Commits
5941a5b7
Commit
5941a5b7
authored
Oct 30, 2012
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cpython.array declaration order.
parent
2fdc8d3b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+7
-0
Cython/Utility/arrayarray.h
Cython/Utility/arrayarray.h
+7
-4
No files found.
Cython/Compiler/ModuleNode.py
View file @
5941a5b7
...
@@ -479,6 +479,13 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -479,6 +479,13 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
typecode
=
globalstate
[
'type_declarations'
]
typecode
=
globalstate
[
'type_declarations'
]
typecode
.
putln
(
""
)
typecode
.
putln
(
""
)
typecode
.
putln
(
"/*--- Type declarations ---*/"
)
typecode
.
putln
(
"/*--- Type declarations ---*/"
)
# This is to work around the fact that array.h isn't part of the C-API,
# but we need to declare it earlier than utility code.
if
'cpython.array'
in
[
m
.
qualified_name
for
m
in
modules
]:
typecode
.
putln
(
'#ifndef _ARRAYARRAY_H'
)
typecode
.
putln
(
'struct arrayobject;'
)
typecode
.
putln
(
'typedef struct arrayobject arrayobject;'
)
typecode
.
putln
(
'#endif'
)
vtab_list
,
vtabslot_list
=
self
.
sort_type_hierarchy
(
modules
,
env
)
vtab_list
,
vtabslot_list
=
self
.
sort_type_hierarchy
(
modules
,
env
)
self
.
generate_type_definitions
(
self
.
generate_type_definitions
(
env
,
modules
,
vtab_list
,
vtabslot_list
,
typecode
)
env
,
modules
,
vtab_list
,
vtabslot_list
,
typecode
)
...
...
Cython/Utility/arrayarray.h
View file @
5941a5b7
...
@@ -13,7 +13,11 @@
...
@@ -13,7 +13,11 @@
#ifndef _ARRAYARRAY_H
#ifndef _ARRAYARRAY_H
#define _ARRAYARRAY_H
#define _ARRAYARRAY_H
struct
arrayobject
;
/* Forward */
// These two forward declarations are explicitly handled in the type
// declaration code, as including them here is too late for cython-defined
// types to use them.
// struct arrayobject;
// typedef struct arrayobject arrayobject;
// All possible arraydescr values are defined in the vector "descriptors"
// All possible arraydescr values are defined in the vector "descriptors"
// below. That's defined later because the appropriate get and set
// below. That's defined later because the appropriate get and set
...
@@ -29,7 +33,7 @@ typedef struct arraydescr {
...
@@ -29,7 +33,7 @@ typedef struct arraydescr {
}
arraydescr
;
}
arraydescr
;
typedef
struct
arrayobject
{
struct
arrayobject
{
PyObject_HEAD
PyObject_HEAD
Py_ssize_t
ob_size
;
Py_ssize_t
ob_size
;
union
{
union
{
...
@@ -54,8 +58,7 @@ typedef struct arrayobject {
...
@@ -54,8 +58,7 @@ typedef struct arrayobject {
#if PY_VERSION_HEX >= 0x03000000
#if PY_VERSION_HEX >= 0x03000000
int
ob_exports
;
/* Number of exported buffers */
int
ob_exports
;
/* Number of exported buffers */
#endif
#endif
}
arrayobject
;
};
#ifndef NO_NEWARRAY_INLINE
#ifndef NO_NEWARRAY_INLINE
// fast creation of a new array
// fast creation of a new array
...
...
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