summaryrefslogtreecommitdiffstatshomepage
path: root/py/objtuple.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/objtuple.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/objtuple.c')
-rw-r--r--py/objtuple.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/py/objtuple.c b/py/objtuple.c
index 7221db7746..9ca777e340 100644
--- a/py/objtuple.c
+++ b/py/objtuple.c
@@ -12,7 +12,7 @@
#include "runtime.h"
#include "objtuple.h"
-static mp_obj_t mp_obj_new_tuple_iterator(mp_obj_tuple_t *tuple, int cur);
+STATIC mp_obj_t mp_obj_new_tuple_iterator(mp_obj_tuple_t *tuple, int cur);
/******************************************************************************/
/* tuple */
@@ -32,7 +32,7 @@ void tuple_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_o
print(env, ")");
}
-static mp_obj_t tuple_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp_obj_t *args) {
+STATIC mp_obj_t tuple_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) {
@@ -75,7 +75,7 @@ static mp_obj_t tuple_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const m
}
// Don't pass RT_BINARY_OP_NOT_EQUAL here
-static bool tuple_cmp_helper(int op, mp_obj_t self_in, mp_obj_t another_in) {
+STATIC bool tuple_cmp_helper(int op, mp_obj_t self_in, mp_obj_t another_in) {
assert(MP_OBJ_IS_TYPE(self_in, &tuple_type));
if (!MP_OBJ_IS_TYPE(another_in, &tuple_type)) {
return false;
@@ -86,7 +86,7 @@ static bool tuple_cmp_helper(int op, mp_obj_t self_in, mp_obj_t another_in) {
return mp_seq_cmp_objs(op, self->items, self->len, another->items, another->len);
}
-static mp_obj_t tuple_unary_op(int op, mp_obj_t self_in) {
+STATIC mp_obj_t tuple_unary_op(int op, mp_obj_t self_in) {
mp_obj_tuple_t *self = self_in;
switch (op) {
case RT_UNARY_OP_BOOL: return MP_BOOL(self->len != 0);
@@ -95,7 +95,7 @@ static mp_obj_t tuple_unary_op(int op, mp_obj_t self_in) {
}
}
-static mp_obj_t tuple_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) {
+STATIC mp_obj_t tuple_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) {
mp_obj_tuple_t *o = lhs;
switch (op) {
case RT_BINARY_OP_SUBSCR:
@@ -149,25 +149,25 @@ static mp_obj_t tuple_binary_op(int op, mp_obj_t lhs, mp_obj_t rhs) {
}
}
-static mp_obj_t tuple_getiter(mp_obj_t o_in) {
+STATIC mp_obj_t tuple_getiter(mp_obj_t o_in) {
return mp_obj_new_tuple_iterator(o_in, 0);
}
-static mp_obj_t tuple_count(mp_obj_t self_in, mp_obj_t value) {
+STATIC mp_obj_t tuple_count(mp_obj_t self_in, mp_obj_t value) {
assert(MP_OBJ_IS_TYPE(self_in, &tuple_type));
mp_obj_tuple_t *self = self_in;
return mp_seq_count_obj(self->items, self->len, value);
}
-static MP_DEFINE_CONST_FUN_OBJ_2(tuple_count_obj, tuple_count);
+STATIC MP_DEFINE_CONST_FUN_OBJ_2(tuple_count_obj, tuple_count);
-static mp_obj_t tuple_index(uint n_args, const mp_obj_t *args) {
+STATIC mp_obj_t tuple_index(uint n_args, const mp_obj_t *args) {
assert(MP_OBJ_IS_TYPE(args[0], &tuple_type));
mp_obj_tuple_t *self = args[0];
return mp_seq_index_obj(self->items, self->len, n_args, args);
}
-static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(tuple_index_obj, 2, 4, tuple_index);
+STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(tuple_index_obj, 2, 4, tuple_index);
-static const mp_method_t tuple_type_methods[] = {
+STATIC const mp_method_t tuple_type_methods[] = {
{ "count", &tuple_count_obj },
{ "index", &tuple_index_obj },
{ NULL, NULL }, // end-of-list sentinel
@@ -185,7 +185,7 @@ const mp_obj_type_t tuple_type = {
};
// the zero-length tuple
-static const mp_obj_tuple_t empty_tuple_obj = {{&tuple_type}, 0};
+STATIC const mp_obj_tuple_t empty_tuple_obj = {{&tuple_type}, 0};
const mp_obj_t mp_const_empty_tuple = (mp_obj_t)&empty_tuple_obj;
mp_obj_t mp_obj_new_tuple(uint n, const mp_obj_t *items) {
@@ -229,7 +229,7 @@ typedef struct _mp_obj_tuple_it_t {
machine_uint_t cur;
} mp_obj_tuple_it_t;
-static mp_obj_t tuple_it_iternext(mp_obj_t self_in) {
+STATIC mp_obj_t tuple_it_iternext(mp_obj_t self_in) {
mp_obj_tuple_it_t *self = self_in;
if (self->cur < self->tuple->len) {
mp_obj_t o_out = self->tuple->items[self->cur];
@@ -240,13 +240,13 @@ static mp_obj_t tuple_it_iternext(mp_obj_t self_in) {
}
}
-static const mp_obj_type_t tuple_it_type = {
+STATIC const mp_obj_type_t tuple_it_type = {
{ &mp_const_type },
"tuple_iterator",
.iternext = tuple_it_iternext,
};
-static mp_obj_t mp_obj_new_tuple_iterator(mp_obj_tuple_t *tuple, int cur) {
+STATIC mp_obj_t mp_obj_new_tuple_iterator(mp_obj_tuple_t *tuple, int cur) {
mp_obj_tuple_it_t *o = m_new_obj(mp_obj_tuple_it_t);
o->base.type = &tuple_it_type;
o->tuple = tuple;