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
beb90546
Commit
beb90546
authored
Jan 22, 2012
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Intialize object item pointer properly & C++ compat
parent
59c8151f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
11 deletions
+21
-11
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+11
-4
Cython/Compiler/MemoryView.py
Cython/Compiler/MemoryView.py
+2
-2
Cython/Utility/MemoryView.pyx
Cython/Utility/MemoryView.pyx
+8
-5
No files found.
Cython/Compiler/ExprNodes.py
View file @
beb90546
...
...
@@ -12,6 +12,7 @@ cython.declare(error=object, warning=object, warn_once=object, InternalError=obj
Builtin
=
object
,
Symtab
=
object
,
Utils
=
object
,
find_coercion_error
=
object
,
debug_disposal_code
=
object
,
debug_temp_alloc
=
object
,
debug_coercion
=
object
)
import
sys
import
operator
from
Errors
import
error
,
warning
,
warn_once
,
InternalError
,
CompileError
...
...
@@ -3078,6 +3079,12 @@ class IndexNode(ExprNode):
buffer_entry
=
self
.
buffer_entry
()
have_gil
=
not
self
.
in_nogil_context
if
sys
.
version_info
<
(
3
,):
def
next_
(
it
):
return
it
.
next
()
else
:
next_
=
next
have_slices
=
False
it
=
iter
(
self
.
indices
)
for
index
in
self
.
original_indices
:
...
...
@@ -3085,13 +3092,13 @@ class IndexNode(ExprNode):
have_slices
=
have_slices
or
is_slice
if
is_slice
:
if
not
index
.
start
.
is_none
:
index
.
start
=
it
.
next
(
)
index
.
start
=
next_
(
it
)
if
not
index
.
stop
.
is_none
:
index
.
stop
=
it
.
next
(
)
index
.
stop
=
next_
(
it
)
if
not
index
.
step
.
is_none
:
index
.
step
=
it
.
next
(
)
index
.
step
=
next_
(
it
)
else
:
it
.
next
(
)
next_
(
it
)
assert
not
list
(
it
)
...
...
Cython/Compiler/MemoryView.py
View file @
beb90546
...
...
@@ -510,8 +510,8 @@ class ContigSliceIter(SliceIter):
for
i
in
range
(
self
.
ndim
))
code
.
putln
(
"Py_ssize_t __pyx_temp_extent = %s;"
%
total_size
)
code
.
putln
(
"Py_ssize_t __pyx_temp_idx;"
)
code
.
putln
(
"%s *__pyx_temp_pointer =
%s.data;"
%
(
type_decl
,
self
.
slice_temp
))
code
.
putln
(
"%s *__pyx_temp_pointer =
(%s *) %s.data;"
%
(
type_decl
,
type_decl
,
self
.
slice_temp
))
code
.
putln
(
"for (__pyx_temp_idx = 0; "
"__pyx_temp_idx < __pyx_temp_extent; "
"__pyx_temp_idx++) {"
)
...
...
Cython/Utility/MemoryView.pyx
View file @
beb90546
...
...
@@ -407,11 +407,14 @@ cdef class memoryview(object):
else
:
item
=
<
void
*>
array
try
:
self
.
assign_item_from_object
(
<
char
*>
item
,
value
)
except
:
free
(
tmp
)
raise
if
self
.
dtype_is_object
:
(
<
PyObject
**>
item
)[
0
]
=
<
PyObject
*>
value
else
:
try
:
self
.
assign_item_from_object
(
<
char
*>
item
,
value
)
except
:
free
(
tmp
)
raise
# It would be easy to support indirect dimensions, but it's easier
# to disallow :)
...
...
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