py: Convert some macros to inline functions (in obj.h).

Also convert mp_obj_is_integer to an inline function.

Overall this decreased code size (at least on 32-bit x86 machine).
This commit is contained in:
Damien George
2014-04-11 11:16:53 +00:00
parent e22d76e73b
commit a5c82a8187
2 changed files with 23 additions and 17 deletions

View File

@@ -99,11 +99,6 @@ int mp_obj_is_true(mp_obj_t arg) {
}
}
// returns true if o_in is bool, small int, or long int
bool mp_obj_is_integer(mp_obj_t o_in) {
return MP_OBJ_IS_INT(o_in) || MP_OBJ_IS_TYPE(o_in, &mp_type_bool);
}
bool mp_obj_is_callable(mp_obj_t o_in) {
return mp_obj_get_type(o_in)->call != NULL;
}