diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-02-12 18:15:40 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-02-12 18:21:11 +0200 |
commit | d5df6cd44a433d6253a61cb0f987835fbc06b2de (patch) | |
tree | 76cdea7b7fa8c6664f711314912837861b3906e4 /py/objmodule.c | |
parent | 1d1e38d91103cc9a3941a55048fc446290aca64e (diff) | |
download | micropython-d5df6cd44a433d6253a61cb0f987835fbc06b2de.tar.gz micropython-d5df6cd44a433d6253a61cb0f987835fbc06b2de.zip |
Replace global "static" -> "STATIC", to allow "analysis builds". Part 1.
Some tools do not support local/static symbols (one example is GNU ld map file).
Exposing all functions will allow to do detailed size comparisons, etc.
Also, added bunch of statics where they were missing, and replaced few identity
functions with global mp_identity().
Diffstat (limited to 'py/objmodule.c')
-rw-r--r-- | py/objmodule.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/py/objmodule.c b/py/objmodule.c index 2319999c0f..259f1191c9 100644 --- a/py/objmodule.c +++ b/py/objmodule.c @@ -17,12 +17,12 @@ typedef struct _mp_obj_module_t { mp_map_t *globals; } mp_obj_module_t; -static void module_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) { +STATIC void module_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) { mp_obj_module_t *self = self_in; print(env, "<module '%s' from '-unknown-file-'>", qstr_str(self->name)); } -static void module_load_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { +STATIC void module_load_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { mp_obj_module_t *self = self_in; mp_map_elem_t *elem = mp_map_lookup(self->globals, MP_OBJ_NEW_QSTR(attr), MP_MAP_LOOKUP); if (elem != NULL) { @@ -30,7 +30,7 @@ static void module_load_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { } } -static bool module_store_attr(mp_obj_t self_in, qstr attr, mp_obj_t value) { +STATIC bool module_store_attr(mp_obj_t self_in, qstr attr, mp_obj_t value) { mp_obj_module_t *self = self_in; // TODO CPython allows STORE_ATTR to a module, but is this the correct implementation? mp_map_lookup(self->globals, MP_OBJ_NEW_QSTR(attr), MP_MAP_LOOKUP_ADD_IF_NOT_FOUND)->value = value; |