is_primitive = False
arr_len = None
+ mapped_type = []
+ java_type_plural = None
if fn_arg.startswith("void"):
java_ty = "void"
c_ty = "void"
fn_arg = fn_arg[4:].strip()
is_primitive = True
elif fn_arg.startswith("uint8_t"):
- java_ty = "byte"
+ mapped_type = consts.c_type_map['uint8_t']
+ java_ty = mapped_type[0]
c_ty = "int8_t"
fn_ty_arg = "B"
fn_arg = fn_arg[7:].strip()
is_primitive = True
elif fn_arg.startswith("uint16_t"):
- java_ty = "short"
+ mapped_type = consts.c_type_map['uint16_t']
+ java_ty = mapped_type[0]
c_ty = "jshort"
fn_ty_arg = "S"
fn_arg = fn_arg[8:].strip()
is_primitive = True
elif fn_arg.startswith("uint32_t"):
- java_ty = "int"
+ mapped_type = consts.c_type_map['uint32_t']
+ java_ty = mapped_type[0]
c_ty = "int32_t"
fn_ty_arg = "I"
fn_arg = fn_arg[8:].strip()
is_primitive = True
elif fn_arg.startswith("uint64_t") or fn_arg.startswith("uintptr_t"):
# TODO: uintptr_t is arch-dependent :(
- java_ty = "long"
+ mapped_type = consts.c_type_map['long']
+ java_ty = mapped_type[0]
c_ty = "int64_t"
fn_ty_arg = "J"
if fn_arg.startswith("uint64_t"):
if var_is_arr is not None or ret_arr_len is not None:
assert(not take_by_ptr)
assert(not is_ptr)
- java_ty = java_ty + "[]"
+ # is there a special case for plurals?
+ if len(mapped_type) == 2:
+ java_ty = mapped_type[1]
+ else:
+ java_ty = java_ty + "[]"
c_ty = c_ty + "Array"
if var_is_arr is not None:
if var_is_arr.group(1) == "":