summaryrefslogtreecommitdiffstatshomepage
path: root/py/objmodule.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-02-12 18:15:40 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-02-12 18:21:11 +0200
commitd5df6cd44a433d6253a61cb0f987835fbc06b2de (patch)
tree76cdea7b7fa8c6664f711314912837861b3906e4 /py/objmodule.c
parent1d1e38d91103cc9a3941a55048fc446290aca64e (diff)
downloadmicropython-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.c6
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;