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
Gwenaël Samain
cython
Commits
a6610e7a
Commit
a6610e7a
authored
Sep 23, 2012
by
Mark Florisson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/cgroth/cython
into _no_strides
parents
9330be0f
f73335a7
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 @
a6610e7a
...
...
@@ -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