Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyodide
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
pyodide
Commits
e3f93470
Commit
e3f93470
authored
Dec 27, 2018
by
Michael Droettboom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use HW_ERROR instead of -1
parent
d4c92a5d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/python2js_buffer.c
src/python2js_buffer.c
+6
-6
No files found.
src/python2js_buffer.c
View file @
e3f93470
...
@@ -324,7 +324,7 @@ _python2js_buffer_to_typed_array(Py_buffer* buff)
...
@@ -324,7 +324,7 @@ _python2js_buffer_to_typed_array(Py_buffer* buff)
case
'>'
:
case
'>'
:
case
'!'
:
case
'!'
:
// This path can't handle byte-swapping
// This path can't handle byte-swapping
return
-
1
;
return
HW_ERROR
;
case
'='
:
case
'='
:
case
'<'
:
case
'<'
:
case
'@'
:
case
'@'
:
...
@@ -342,7 +342,7 @@ _python2js_buffer_to_typed_array(Py_buffer* buff)
...
@@ -342,7 +342,7 @@ _python2js_buffer_to_typed_array(Py_buffer* buff)
case
'B'
:
case
'B'
:
return
hiwire_uint8array
((
int
)
buff
->
buf
,
buff
->
len
);
return
hiwire_uint8array
((
int
)
buff
->
buf
,
buff
->
len
);
case
'?'
:
case
'?'
:
return
-
1
;
return
HW_ERROR
;
case
'h'
:
case
'h'
:
return
hiwire_int16array
((
int
)
buff
->
buf
,
buff
->
len
);
return
hiwire_int16array
((
int
)
buff
->
buf
,
buff
->
len
);
case
'H'
:
case
'H'
:
...
@@ -357,13 +357,13 @@ _python2js_buffer_to_typed_array(Py_buffer* buff)
...
@@ -357,13 +357,13 @@ _python2js_buffer_to_typed_array(Py_buffer* buff)
return
hiwire_uint32array
((
int
)
buff
->
buf
,
buff
->
len
);
return
hiwire_uint32array
((
int
)
buff
->
buf
,
buff
->
len
);
case
'q'
:
case
'q'
:
case
'Q'
:
case
'Q'
:
return
-
1
;
return
HW_ERROR
;
case
'f'
:
case
'f'
:
return
hiwire_float32array
((
int
)
buff
->
buf
,
buff
->
len
);
return
hiwire_float32array
((
int
)
buff
->
buf
,
buff
->
len
);
case
'd'
:
case
'd'
:
return
hiwire_float64array
((
int
)
buff
->
buf
,
buff
->
len
);
return
hiwire_float64array
((
int
)
buff
->
buf
,
buff
->
len
);
default:
default:
return
-
1
;
return
HW_ERROR
;
}
}
}
}
...
@@ -467,11 +467,11 @@ _python2js_buffer(PyObject* x)
...
@@ -467,11 +467,11 @@ _python2js_buffer(PyObject* x)
if
(
shareable
!=
NOT_SHAREABLE
)
{
if
(
shareable
!=
NOT_SHAREABLE
)
{
int
idarr
=
_python2js_buffer_to_typed_array
(
buff
);
int
idarr
=
_python2js_buffer_to_typed_array
(
buff
);
if
(
idarr
==
-
1
)
{
if
(
idarr
==
HW_ERROR
)
{
PyErr_SetString
(
PyErr_SetString
(
PyExc_TypeError
,
PyExc_TypeError
,
"Internal error: Invalid type to convert to array buffer."
);
"Internal error: Invalid type to convert to array buffer."
);
return
-
1
;
return
HW_ERROR
;
}
}
result
=
result
=
...
...
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