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().
diff --git a/py/objenumerate.c b/py/objenumerate.c
index 564cb1c..e7695a1 100644
--- a/py/objenumerate.c
+++ b/py/objenumerate.c
@@ -13,15 +13,11 @@
machine_int_t cur;
} mp_obj_enumerate_t;
-static mp_obj_t enumerate_getiter(mp_obj_t self_in) {
- return self_in;
-}
-
-static mp_obj_t enumerate_iternext(mp_obj_t self_in);
+STATIC mp_obj_t enumerate_iternext(mp_obj_t self_in);
/* TODO: enumerate is one of the ones that can take args or kwargs.
Sticking to args for now */
-static mp_obj_t enumerate_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t enumerate_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) {
assert(n_args > 0);
mp_obj_enumerate_t *o = m_new_obj(mp_obj_enumerate_t);
o->base.type = &enumerate_type;
@@ -35,10 +31,10 @@
"enumerate",
.make_new = enumerate_make_new,
.iternext = enumerate_iternext,
- .getiter = enumerate_getiter,
+ .getiter = mp_identity,
};
-static mp_obj_t enumerate_iternext(mp_obj_t self_in) {
+STATIC mp_obj_t enumerate_iternext(mp_obj_t self_in) {
assert(MP_OBJ_IS_TYPE(self_in, &enumerate_type));
mp_obj_enumerate_t *self = self_in;
mp_obj_t next = rt_iternext(self->iter);