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
d6d492cf
Commit
d6d492cf
authored
May 16, 2012
by
Gregor Thalhammer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes bug in memoryview validation code for C contiguous buffers.
parent
ae453c85
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
Cython/Utility/MemoryView_C.c
Cython/Utility/MemoryView_C.c
+4
-3
No files found.
Cython/Utility/MemoryView_C.c
View file @
d6d492cf
...
...
@@ -163,7 +163,7 @@ static int __Pyx_ValidateAndInit_memviewslice(
struct
__pyx_memoryview_obj
*
memview
,
*
new_memview
;
__Pyx_RefNannyDeclarations
Py_buffer
*
buf
;
int
stride
,
i
,
spec
=
0
,
retval
=
-
1
;
int
i
,
spec
=
0
,
retval
=
-
1
;
__Pyx_BufFmt_Context
ctx
;
int
from_memoryview
=
__pyx_memoryview_check
(
original_obj
);
...
...
@@ -261,7 +261,7 @@ static int __Pyx_ValidateAndInit_memviewslice(
}
if
(
c_or_f_flag
&
__Pyx_IS_F_CONTIG
)
{
stride
=
1
;
Py_ssize_t
stride
=
1
;
for
(
i
=
0
;
i
<
ndim
;
i
++
)
{
if
(
stride
*
buf
->
itemsize
!=
buf
->
strides
[
i
])
{
PyErr_SetString
(
PyExc_ValueError
,
...
...
@@ -270,7 +270,8 @@ static int __Pyx_ValidateAndInit_memviewslice(
}
stride
=
stride
*
buf
->
shape
[
i
];
}
}
else
if
(
c_or_f_flag
&
__Pyx_IS_F_CONTIG
)
{
}
else
if
(
c_or_f_flag
&
__Pyx_IS_C_CONTIG
)
{
Py_ssize_t
stride
=
1
;
for
(
i
=
ndim
-
1
;
i
>-
1
;
i
--
)
{
if
(
stride
*
buf
->
itemsize
!=
buf
->
strides
[
i
])
{
PyErr_SetString
(
PyExc_ValueError
,
...
...
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