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
Kirill Smelkov
cython
Commits
3c218baf
Commit
3c218baf
authored
6 years ago
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use explicit integer division in generated Cython utility code.
parent
22ddeca8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Cython/Utility/MemoryView.pyx
Cython/Utility/MemoryView.pyx
+4
-4
No files found.
Cython/Utility/MemoryView.pyx
View file @
3c218baf
...
...
@@ -177,7 +177,7 @@ cdef class array:
if
self
.
dtype_is_object
:
p
=
<
PyObject
**>
self
.
data
for
i
in
range
(
self
.
len
/
itemsize
):
for
i
in
range
(
self
.
len
/
/
itemsize
):
p
[
i
]
=
Py_None
Py_INCREF
(
Py_None
)
...
...
@@ -866,7 +866,7 @@ cdef int slice_memviewslice(
if
not
have_step
:
step
=
1
# len = ceil( (stop - start) / step )
# len = ceil( (stop - start) /
/
step )
with
cython
.
cdivision
(
True
):
new_shape
=
(
stop
-
start
)
//
step
...
...
@@ -910,7 +910,7 @@ cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
cdef
char
*
resultp
if
view
.
ndim
==
0
:
shape
=
view
.
len
/
itemsize
shape
=
view
.
len
/
/
itemsize
stride
=
itemsize
else
:
shape
=
view
.
shape
[
dim
]
...
...
@@ -944,7 +944,7 @@ cdef int transpose_memslice({{memviewslice_name}} *memslice) nogil except 0:
# reverse strides and shape
cdef
int
i
,
j
for
i
in
range
(
ndim
/
2
):
for
i
in
range
(
ndim
/
/
2
):
j
=
ndim
-
1
-
i
strides
[
i
],
strides
[
j
]
=
strides
[
j
],
strides
[
i
]
shape
[
i
],
shape
[
j
]
=
shape
[
j
],
shape
[
i
]
...
...
This diff is collapsed.
Click to expand it.
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