summaryrefslogtreecommitdiffstatshomepage
path: root/py/objcomplex.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/objcomplex.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/objcomplex.c')
-rw-r--r--py/objcomplex.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/py/objcomplex.c b/py/objcomplex.c
index 5b4df0da66..952bce126b 100644
--- a/py/objcomplex.c
+++ b/py/objcomplex.c
@@ -21,7 +21,7 @@ typedef struct _mp_obj_complex_t {
mp_obj_t mp_obj_new_complex(mp_float_t real, mp_float_t imag);
-void complex_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t o_in, mp_print_kind_t kind) {
+STATIC void complex_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t o_in, mp_print_kind_t kind) {
mp_obj_complex_t *o = o_in;
if (o->real == 0) {
print(env, "%.8gj", (double) o->imag);
@@ -30,7 +30,7 @@ void complex_print(void (*print)(void *env, const char *fmt, ...), void *env, mp
}
}
-static mp_obj_t complex_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t complex_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) {
@@ -70,7 +70,7 @@ static mp_obj_t complex_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const
}
}
-static mp_obj_t complex_unary_op(int op, mp_obj_t o_in) {
+STATIC mp_obj_t complex_unary_op(int op, mp_obj_t o_in) {
mp_obj_complex_t *o = o_in;
switch (op) {
case RT_UNARY_OP_BOOL: return MP_BOOL(o->real != 0 || o->imag != 0);
@@ -80,7 +80,7 @@ static mp_obj_t complex_unary_op(int op, mp_obj_t o_in) {
}
}
-static mp_obj_t complex_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) {
+STATIC mp_obj_t complex_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in) {
mp_obj_complex_t *lhs = lhs_in;
return mp_obj_complex_binary_op(op, lhs->real, lhs->imag, rhs_in);
}