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
37d13c94
Commit
37d13c94
authored
May 16, 2012
by
Mark
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #122 from geggo/master
fixes typo in memory view validation code
parents
ae453c85
d6d492cf
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 @
37d13c94
...
@@ -163,7 +163,7 @@ static int __Pyx_ValidateAndInit_memviewslice(
...
@@ -163,7 +163,7 @@ static int __Pyx_ValidateAndInit_memviewslice(
struct
__pyx_memoryview_obj
*
memview
,
*
new_memview
;
struct
__pyx_memoryview_obj
*
memview
,
*
new_memview
;
__Pyx_RefNannyDeclarations
__Pyx_RefNannyDeclarations
Py_buffer
*
buf
;
Py_buffer
*
buf
;
int
stride
,
i
,
spec
=
0
,
retval
=
-
1
;
int
i
,
spec
=
0
,
retval
=
-
1
;
__Pyx_BufFmt_Context
ctx
;
__Pyx_BufFmt_Context
ctx
;
int
from_memoryview
=
__pyx_memoryview_check
(
original_obj
);
int
from_memoryview
=
__pyx_memoryview_check
(
original_obj
);
...
@@ -261,7 +261,7 @@ static int __Pyx_ValidateAndInit_memviewslice(
...
@@ -261,7 +261,7 @@ static int __Pyx_ValidateAndInit_memviewslice(
}
}
if
(
c_or_f_flag
&
__Pyx_IS_F_CONTIG
)
{
if
(
c_or_f_flag
&
__Pyx_IS_F_CONTIG
)
{
stride
=
1
;
Py_ssize_t
stride
=
1
;
for
(
i
=
0
;
i
<
ndim
;
i
++
)
{
for
(
i
=
0
;
i
<
ndim
;
i
++
)
{
if
(
stride
*
buf
->
itemsize
!=
buf
->
strides
[
i
])
{
if
(
stride
*
buf
->
itemsize
!=
buf
->
strides
[
i
])
{
PyErr_SetString
(
PyExc_ValueError
,
PyErr_SetString
(
PyExc_ValueError
,
...
@@ -270,7 +270,8 @@ static int __Pyx_ValidateAndInit_memviewslice(
...
@@ -270,7 +270,8 @@ static int __Pyx_ValidateAndInit_memviewslice(
}
}
stride
=
stride
*
buf
->
shape
[
i
];
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
--
)
{
for
(
i
=
ndim
-
1
;
i
>-
1
;
i
--
)
{
if
(
stride
*
buf
->
itemsize
!=
buf
->
strides
[
i
])
{
if
(
stride
*
buf
->
itemsize
!=
buf
->
strides
[
i
])
{
PyErr_SetString
(
PyExc_ValueError
,
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