Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
b230a86d
Commit
b230a86d
authored
Sep 15, 2015
by
Paul Sokolovsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unix/modjni: Return any object type value as a jobject.
parent
51673321
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
unix/modjni.c
unix/modjni.c
+13
-5
No files found.
unix/modjni.c
View file @
b230a86d
...
...
@@ -237,14 +237,22 @@ ret_string:;
ret
=
mp_obj_new_str
(
s
,
strlen
(
s
),
false
);
JJ
(
ReleaseStringUTFChars
,
arg
,
s
);
return
ret
;
}
else
if
(
MATCH
(
jtypesig
,
"java.lang.Object"
))
{
if
(
JJ
(
IsInstanceOf
,
arg
,
String_class
))
{
goto
ret_string
;
}
else
{
return
new_jobject
(
arg
);
}
else
{
while
(
*
jtypesig
!=
' '
&&
*
jtypesig
)
{
if
(
*
jtypesig
==
'.'
)
{
// Non-primitive, object type
if
(
JJ
(
IsInstanceOf
,
arg
,
String_class
))
{
goto
ret_string
;
}
else
{
return
new_jobject
(
arg
);
}
}
jtypesig
++
;
}
}
printf
(
"Unknown return type: %s
\n
"
,
jtypesig
);
return
MP_OBJ_NULL
;
}
...
...
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