diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-09-20 00:36:26 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-09-20 00:36:51 +0300 |
commit | 6196aa45edcf74b596f1f6963e6af5ac33c18c5c (patch) | |
tree | ebb92fa78b7a691561b648a38ce1cb53ccbc5b55 /unix | |
parent | 15018291b2d0e2320ec8f46970816eaad1bb012b (diff) |
unix/modjni: jvalue2py: Handle boolean.
Diffstat (limited to 'unix')
-rw-r--r-- | unix/modjni.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/unix/modjni.c b/unix/modjni.c index 701794256..7d2c9e450 100644 --- a/unix/modjni.c +++ b/unix/modjni.c @@ -242,9 +242,12 @@ STATIC bool py2jvalue(const char **jtypesig, mp_obj_t arg, jvalue *out) { // it. #define MATCH(s, static) (!strncmp(s, static, sizeof(static) - 1)) STATIC mp_obj_t jvalue2py(const char *jtypesig, jobject arg) { + const char *org_jtype = jtypesig; mp_obj_t ret; if (arg == NULL || MATCH(jtypesig, "void")) { return mp_const_none; + } else if (MATCH(jtypesig, "boolean")) { + return mp_obj_new_bool((bool)arg); } else if (MATCH(jtypesig, "int")) { return mp_obj_new_int((mp_int_t)arg); } else if (MATCH(jtypesig, "java.lang.String")) { @@ -269,7 +272,7 @@ ret_string:; } } - printf("Unknown return type: %s\n", jtypesig); + printf("Unknown return type: %s\n", org_jtype); return MP_OBJ_NULL; } |