Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
0473e279
Commit
0473e279
authored
Feb 2, 2014
by
Paul Sokolovsky
Browse files
Options
Downloads
Patches
Plain Diff
Fix thinko with how bitfields were added to mp_obj_fun_native_t.
Structure is back to expected 16 bytes.
parent
93d004f4
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
py/obj.h
+5
-3
5 additions, 3 deletions
py/obj.h
with
5 additions
and
3 deletions
py/obj.h
+
5
−
3
View file @
0473e279
...
@@ -54,7 +54,7 @@ typedef struct _mp_obj_base_t mp_obj_base_t;
...
@@ -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_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_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_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)
#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);
...
@@ -354,8 +354,10 @@ mp_obj_t mp_obj_new_bytearray_by_ref(uint n, void *items);
// functions
// functions
typedef
struct
_mp_obj_fun_native_t
{
// need this so we can define const objects (to go in ROM)
typedef
struct
_mp_obj_fun_native_t
{
// need this so we can define const objects (to go in ROM)
mp_obj_base_t
base
;
mp_obj_base_t
base
;
struct
{
bool
is_kw
:
1
;
bool
is_kw
:
1
;
machine_uint_t
n_args_min
:
(
sizeof
(
machine_uint_t
)
-
1
);
// inclusive
machine_uint_t
n_args_min
:
(
8
*
sizeof
(
machine_uint_t
)
-
1
);
// inclusive
};
machine_uint_t
n_args_max
;
// inclusive
machine_uint_t
n_args_max
;
// inclusive
void
*
fun
;
void
*
fun
;
// TODO add mp_map_t *globals
// TODO add mp_map_t *globals
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment