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/objbool.c b/py/objbool.c
index 3a3ac3e..fb38bdf 100644
--- a/py/objbool.c
+++ b/py/objbool.c
@@ -14,7 +14,7 @@
bool value;
} mp_obj_bool_t;
-static void bool_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {
+STATIC void bool_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {
mp_obj_bool_t *self = self_in;
if (self->value) {
print(env, "True");
@@ -23,7 +23,7 @@
}
}
-static mp_obj_t bool_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t bool_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) {
// TODO check n_kw == 0
switch (n_args) {
@@ -33,7 +33,7 @@
}
}
-static mp_obj_t bool_unary_op(int op, mp_obj_t o_in) {
+STATIC mp_obj_t bool_unary_op(int op, mp_obj_t o_in) {
machine_int_t value = ((mp_obj_bool_t*)o_in)->value;
switch (op) {
case RT_UNARY_OP_BOOL: return o_in;
@@ -53,8 +53,8 @@
.unary_op = bool_unary_op,
};
-static const mp_obj_bool_t false_obj = {{&bool_type}, false};
-static const mp_obj_bool_t true_obj = {{&bool_type}, true};
+STATIC const mp_obj_bool_t false_obj = {{&bool_type}, false};
+STATIC const mp_obj_bool_t true_obj = {{&bool_type}, true};
const mp_obj_t mp_const_false = (mp_obj_t)&false_obj;
const mp_obj_t mp_const_true = (mp_obj_t)&true_obj;