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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
c7688853
Commit
c7688853
authored
Apr 28, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix char comparison for byteorder field in numpy.pxd
parent
a5d5f19e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Cython/Includes/numpy.pxd
Cython/Includes/numpy.pxd
+4
-4
No files found.
Cython/Includes/numpy.pxd
View file @
c7688853
...
@@ -251,8 +251,8 @@ cdef extern from "numpy/arrayobject.h":
...
@@ -251,8 +251,8 @@ cdef extern from "numpy/arrayobject.h":
if
not
hasfields
:
if
not
hasfields
:
t
=
descr
.
type_num
t
=
descr
.
type_num
if
((
descr
.
byteorder
==
'>'
and
little_endian
)
or
if
((
descr
.
byteorder
==
c
'>'
and
little_endian
)
or
(
descr
.
byteorder
==
'<'
and
not
little_endian
)):
(
descr
.
byteorder
==
c
'<'
and
not
little_endian
)):
raise
ValueError
(
u"Non-native byte order not supported"
)
raise
ValueError
(
u"Non-native byte order not supported"
)
if
t
==
NPY_BYTE
:
f
=
"b"
if
t
==
NPY_BYTE
:
f
=
"b"
elif
t
==
NPY_UBYTE
:
f
=
"B"
elif
t
==
NPY_UBYTE
:
f
=
"B"
...
@@ -797,8 +797,8 @@ cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset
...
@@ -797,8 +797,8 @@ cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset
if
(
end
-
f
)
-
(
new_offset
-
offset
[
0
])
<
15
:
if
(
end
-
f
)
-
(
new_offset
-
offset
[
0
])
<
15
:
raise
RuntimeError
(
u"Format string allocated too short, see comment in numpy.pxd"
)
raise
RuntimeError
(
u"Format string allocated too short, see comment in numpy.pxd"
)
if
((
child
.
byteorder
==
'>'
and
little_endian
)
or
if
((
child
.
byteorder
==
c
'>'
and
little_endian
)
or
(
child
.
byteorder
==
'<'
and
not
little_endian
)):
(
child
.
byteorder
==
c
'<'
and
not
little_endian
)):
raise
ValueError
(
u"Non-native byte order not supported"
)
raise
ValueError
(
u"Non-native byte order not supported"
)
# One could encode it in the format string and have Cython
# One could encode it in the format string and have Cython
# complain instead, BUT: < and > in format strings also imply
# complain instead, BUT: < and > in format strings also imply
...
...
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