Fix thinko with how bitfields were added to mp_obj_fun_native_t.

Structure is back to expected 16 bytes.
This commit is contained in:
Paul Sokolovsky 2014-02-02 17:49:01 +02:00
parent 93d004f4b0
commit 0473e2790b
1 changed files with 5 additions and 3 deletions

View File

@ -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