Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
0473e279
Commit
0473e279
authored
Feb 02, 2014
by
Paul Sokolovsky
Browse files
Fix thinko with how bitfields were added to mp_obj_fun_native_t.
Structure is back to expected 16 bytes.
parent
93d004f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/obj.h
View file @
0473e279
...
...
@@ -54,7 +54,7 @@ typedef struct _mp_obj_base_t mp_obj_base_t;
#define MP_DECLARE_CONST_FUN_OBJ(obj_name) extern const mp_obj_fun_native_t obj_name
#define MP_DEFINE_CONST_FUN_OBJ_VOID_PTR(obj_name, is_kw, n_args_min, n_args_max, fun_name) const mp_obj_fun_native_t obj_name = {{&fun_native_type}, is_kw, n_args_min, n_args_max, (void *)fun_name}
#define MP_DEFINE_CONST_FUN_OBJ_VOID_PTR(obj_name, is_kw, n_args_min, n_args_max, fun_name) const mp_obj_fun_native_t obj_name = {{&fun_native_type},
{
is_kw, n_args_min
}
, n_args_max, (void *)fun_name}
#define MP_DEFINE_CONST_FUN_OBJ_0(obj_name, fun_name) MP_DEFINE_CONST_FUN_OBJ_VOID_PTR(obj_name, false, 0, 0, (mp_fun_0_t)fun_name)
#define MP_DEFINE_CONST_FUN_OBJ_1(obj_name, fun_name) MP_DEFINE_CONST_FUN_OBJ_VOID_PTR(obj_name, false, 1, 1, (mp_fun_1_t)fun_name)
#define MP_DEFINE_CONST_FUN_OBJ_2(obj_name, fun_name) MP_DEFINE_CONST_FUN_OBJ_VOID_PTR(obj_name, false, 2, 2, (mp_fun_2_t)fun_name)
...
...
@@ -354,8 +354,10 @@ mp_obj_t mp_obj_new_bytearray_by_ref(uint n, void *items);
// functions
typedef
struct
_mp_obj_fun_native_t
{
// need this so we can define const objects (to go in ROM)
mp_obj_base_t
base
;
bool
is_kw
:
1
;
machine_uint_t
n_args_min
:
(
sizeof
(
machine_uint_t
)
-
1
);
// inclusive
struct
{
bool
is_kw
:
1
;
machine_uint_t
n_args_min
:
(
8
*
sizeof
(
machine_uint_t
)
-
1
);
// inclusive
};
machine_uint_t
n_args_max
;
// inclusive
void
*
fun
;
// TODO add mp_map_t *globals
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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