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
Kirill Smelkov
cython
Commits
d42a4d7d
Commit
d42a4d7d
authored
Mar 22, 2016
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
git+ssh://github.com/cython/cython
parents
192ac73e
e57009a3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
14 deletions
+24
-14
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+9
-6
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+2
-8
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+8
-0
Cython/Utility/Buffer.c
Cython/Utility/Buffer.c
+5
-0
No files found.
Cython/Compiler/Code.py
View file @
d42a4d7d
...
...
@@ -472,19 +472,21 @@ class UtilityCode(UtilityCodeBase):
for dependency in self.requires:
output.use_utility_code(dependency)
if self.proto:
output[self.proto_block].put_or_include(
self.format_code(self.proto),
'
%
s_proto
' % self.name)
writer = output[self.proto_block]
writer.putln("/* %s.proto */" % self.name)
writer.put_or_include(
self.format_code(self.proto), '
%
s_proto
' % self.name)
if self.impl:
impl = self.format_code(self.wrap_c_strings(self.impl))
is_specialised1, impl = self.inject_string_constants(impl, output)
is_specialised2, impl = self.inject_unbound_methods(impl, output)
writer = output['
utility_code_def
']
writer.putln("/* %s */" % self.name);
if not (is_specialised1 or is_specialised2):
# no module specific adaptations => can be reused
output['
utility_code_def
'].put_or_include(
impl, '
%
s_impl
' % self.name)
writer.put_or_include(impl, '
%
s_impl
' % self.name)
else:
output['
utility_code_def
']
.put(impl)
writer
.put(impl)
if self.init:
writer = output['
init_globals
']
writer.putln("/* %s.init */" % self.name)
...
...
@@ -496,6 +498,7 @@ class UtilityCode(UtilityCodeBase):
writer.putln()
if self.cleanup and Options.generate_cleanup_code:
writer = output['
cleanup_globals
']
writer.putln("/* %s.cleanup */" % self.name)
if isinstance(self.cleanup, basestring):
writer.put_or_include(
self.format_code(self.cleanup),
...
...
Cython/Compiler/ModuleNode.py
View file @
d42a4d7d
...
...
@@ -2051,14 +2051,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
PyrexTypes
.
typecast
(
entry
.
type
,
py_object_type
,
"o"
)))
elif
entry
.
type
.
create_from_py_utility_code
(
env
):
# if available, utility code was already created in self.prepare_utility_code()
rhs
=
"%s(o)"
%
entry
.
type
.
from_py_function
if
entry
.
type
.
is_enum
:
rhs
=
PyrexTypes
.
typecast
(
entry
.
type
,
PyrexTypes
.
c_long_type
,
rhs
)
code
.
putln
(
"%s = %s; if (%s) %s;"
%
(
entry
.
cname
,
rhs
,
entry
.
type
.
error_condition
(
entry
.
cname
),
code
.
error_goto
(
entry
.
pos
)))
code
.
putln
(
entry
.
type
.
from_py_call_code
(
'o'
,
entry
.
cname
,
entry
.
pos
,
code
))
else
:
code
.
putln
(
'PyErr_Format(PyExc_TypeError, "Cannot convert Python object %s to %s");'
%
(
name
,
entry
.
type
))
...
...
Cython/Compiler/PyrexTypes.py
View file @
d42a4d7d
...
...
@@ -830,6 +830,14 @@ class MemoryViewSliceType(PyrexType):
self
.
from_py_function
=
funcname
return
True
def
from_py_call_code
(
self
,
source_code
,
result_code
,
error_pos
,
code
,
from_py_function
=
None
,
error_condition
=
None
):
return
'%s = %s(%s); %s'
%
(
result_code
,
from_py_function
or
self
.
from_py_function
,
source_code
,
code
.
error_goto_if
(
error_condition
or
self
.
error_condition
(
result_code
),
error_pos
))
def
create_to_py_utility_code
(
self
,
env
):
self
.
_dtype_to_py_func
,
self
.
_dtype_from_py_func
=
self
.
dtype_object_conversion_funcs
(
env
)
return
True
...
...
Cython/Utility/Buffer.c
View file @
d42a4d7d
...
...
@@ -159,6 +159,11 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) {
static
CYTHON_INLINE
int
__Pyx_GetBufferAndValidate
(
Py_buffer
*
buf
,
PyObject
*
obj
,
__Pyx_TypeInfo
*
dtype
,
int
flags
,
int
nd
,
int
cast
,
__Pyx_BufFmt_StackElem
*
stack
);
static
CYTHON_INLINE
void
__Pyx_SafeReleaseBuffer
(
Py_buffer
*
info
);
static
const
char
*
__Pyx_BufFmt_CheckString
(
__Pyx_BufFmt_Context
*
ctx
,
const
char
*
ts
);
static
void
__Pyx_BufFmt_Init
(
__Pyx_BufFmt_Context
*
ctx
,
__Pyx_BufFmt_StackElem
*
stack
,
__Pyx_TypeInfo
*
type
);
// PROTO
/////////////// BufferFormatCheck ///////////////
static
CYTHON_INLINE
int
__Pyx_IsLittleEndian
(
void
)
{
...
...
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