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
bf1aa4e4
Commit
bf1aa4e4
authored
Sep 19, 2012
by
Christoph Groth
Committed by
Mark Florisson
Sep 25, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make memoryviews work when strides is NULL
parent
5d121036
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
Cython/Utility/MemoryView_C.c
Cython/Utility/MemoryView_C.c
+12
-7
No files found.
Cython/Utility/MemoryView_C.c
View file @
bf1aa4e4
...
...
@@ -207,12 +207,6 @@ static int __Pyx_ValidateAndInit_memviewslice(
goto
fail
;
}
if
(
!
buf
->
strides
)
{
PyErr_SetString
(
PyExc_ValueError
,
"buffer does not supply strides necessary for memoryview."
);
goto
fail
;
}
for
(
i
=
0
;
i
<
ndim
;
i
++
)
{
spec
=
axes_specs
[
i
];
...
...
@@ -320,8 +314,19 @@ __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
goto
fail
;
}
if
(
buf
->
strides
)
{
for
(
i
=
0
;
i
<
ndim
;
i
++
)
{
memviewslice
->
strides
[
i
]
=
buf
->
strides
[
i
];
}
}
else
{
Py_ssize_t
stride
=
buf
->
itemsize
;
for
(
i
=
ndim
-
1
;
i
>=
0
;
i
--
)
{
memviewslice
->
strides
[
i
]
=
stride
;
stride
*=
buf
->
shape
[
i
];
}
}
for
(
i
=
0
;
i
<
ndim
;
i
++
)
{
memviewslice
->
strides
[
i
]
=
buf
->
strides
[
i
];
memviewslice
->
shape
[
i
]
=
buf
->
shape
[
i
];
if
(
buf
->
suboffsets
)
{
memviewslice
->
suboffsets
[
i
]
=
buf
->
suboffsets
[
i
];
...
...
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