Permalink
Browse files

py: Be more specific with MP_DECLARE_CONST_FUN_OBJ macros.

In order to have more fine-grained control over how builtin functions are
constructed, the MP_DECLARE_CONST_FUN_OBJ macros are made more specific,
with suffix of _0, _1, _2, _3, _VAR, _VAR_BETEEN or _KW.  These names now
match the MP_DEFINE_CONST_FUN_OBJ macros.
  • Loading branch information...
1 parent 5d0735b commit 4ebdb1f2b217410cdc1cee0e0c0da8fceb7627f2 @dpgeorge dpgeorge committed Oct 18, 2016
@@ -61,7 +61,6 @@ typedef long mp_off_t;
#define MP_PLAT_PRINT_STRN(str, len) (void)0
// extra built in names to add to the global namespace
-extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj;
#define MICROPY_PORT_BUILTINS \
{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
@@ -30,6 +30,6 @@
void rng_init0 (void);
uint32_t rng_get (void);
-MP_DECLARE_CONST_FUN_OBJ(machine_rng_get_obj);
+MP_DECLARE_CONST_FUN_OBJ_0(machine_rng_get_obj);
#endif // __RANDOM_H
View
@@ -1,3 +1,3 @@
#include "py/obj.h"
-MP_DECLARE_CONST_FUN_OBJ(dht_readinto_obj);
+MP_DECLARE_CONST_FUN_OBJ_2(dht_readinto_obj);
View
@@ -13,7 +13,7 @@ extern const mp_obj_type_t pyb_spi_type;
extern const mp_obj_type_t pyb_hspi_type;
extern const mp_obj_type_t machine_spi_type;
-MP_DECLARE_CONST_FUN_OBJ(pyb_info_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(pyb_info_obj);
typedef struct _pyb_pin_obj_t {
mp_obj_base_t base;
@@ -57,6 +57,6 @@ typedef struct _fs_user_mount_t {
fs_user_mount_t *fatfs_mount_mkfs(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args, bool mkfs);
mp_obj_t fatfs_umount(mp_obj_t bdev_or_path_in);
-MP_DECLARE_CONST_FUN_OBJ(fsuser_mount_obj);
-MP_DECLARE_CONST_FUN_OBJ(fsuser_umount_obj);
-MP_DECLARE_CONST_FUN_OBJ(fsuser_mkfs_obj);
+MP_DECLARE_CONST_FUN_OBJ_KW(fsuser_mount_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(fsuser_umount_obj);
+MP_DECLARE_CONST_FUN_OBJ_KW(fsuser_mkfs_obj);
@@ -32,6 +32,6 @@
mp_uint_t machine_time_pulse_us(mp_hal_pin_obj_t pin, int pulse_level, mp_uint_t timeout_us);
-MP_DECLARE_CONST_FUN_OBJ(machine_time_pulse_us_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(machine_time_pulse_us_obj);
#endif // __MICROPY_INCLUDED_EXTMOD_MACHINE_PULSE_H__
@@ -47,9 +47,9 @@ typedef struct _mp_machine_soft_spi_obj_t {
void mp_machine_soft_spi_transfer(mp_obj_base_t *self, size_t len, const uint8_t *src, uint8_t *dest);
-MP_DECLARE_CONST_FUN_OBJ(mp_machine_spi_read_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_machine_spi_readinto_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_machine_spi_write_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_machine_spi_write_readinto_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_machine_spi_read_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_machine_spi_readinto_obj);
+MP_DECLARE_CONST_FUN_OBJ_2(mp_machine_spi_write_obj);
+MP_DECLARE_CONST_FUN_OBJ_3(mp_machine_spi_write_readinto_obj);
#endif // MICROPY_INCLUDED_EXTMOD_MACHINE_SPI_H
View
@@ -30,7 +30,7 @@
#include <stddef.h>
#include "py/runtime.h"
-MP_DECLARE_CONST_FUN_OBJ(mp_uos_dupterm_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_uos_dupterm_obj);
#if MICROPY_PY_OS_DUPTERM
void mp_uos_dupterm_tx_strn(const char *str, size_t len);
View
@@ -33,10 +33,10 @@ extern mp_obj_t mod_binascii_a2b_base64(mp_obj_t data);
extern mp_obj_t mod_binascii_b2a_base64(mp_obj_t data);
extern mp_obj_t mod_binascii_crc32(size_t n_args, const mp_obj_t *args);
-MP_DECLARE_CONST_FUN_OBJ(mod_binascii_hexlify_obj);
-MP_DECLARE_CONST_FUN_OBJ(mod_binascii_unhexlify_obj);
-MP_DECLARE_CONST_FUN_OBJ(mod_binascii_a2b_base64_obj);
-MP_DECLARE_CONST_FUN_OBJ(mod_binascii_b2a_base64_obj);
-MP_DECLARE_CONST_FUN_OBJ(mod_binascii_crc32_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mod_binascii_hexlify_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mod_binascii_unhexlify_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mod_binascii_a2b_base64_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mod_binascii_b2a_base64_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mod_binascii_crc32_obj);
#endif /* MICROPY_EXTMOD_MODUBINASCII */
View
@@ -27,10 +27,10 @@
#include "py/obj.h"
-MP_DECLARE_CONST_FUN_OBJ(mp_utime_sleep_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_utime_sleep_ms_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_utime_sleep_us_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_utime_ticks_ms_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_utime_ticks_us_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_utime_ticks_cpu_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_utime_ticks_diff_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_utime_sleep_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_utime_sleep_ms_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_utime_sleep_us_obj);
+MP_DECLARE_CONST_FUN_OBJ_0(mp_utime_ticks_ms_obj);
+MP_DECLARE_CONST_FUN_OBJ_0(mp_utime_ticks_us_obj);
+MP_DECLARE_CONST_FUN_OBJ_0(mp_utime_ticks_cpu_obj);
+MP_DECLARE_CONST_FUN_OBJ_2(mp_utime_ticks_diff_obj);
@@ -27,6 +27,6 @@
extern const byte fresult_to_errno_table[20];
mp_obj_t fatfs_builtin_open(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwargs);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_open_obj);
+MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_open_obj);
mp_obj_t fat_vfs_listdir(const char *path, bool is_str_type);
View
@@ -49,6 +49,6 @@ void pyexec_event_repl_init(void);
int pyexec_event_repl_process_char(int c);
extern uint8_t pyexec_repl_active;
-MP_DECLARE_CONST_FUN_OBJ(pyb_set_repl_info_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(pyb_set_repl_info_obj);
#endif // __MICROPY_INCLUDED_LIB_UTILS_PYEXEC_H__
@@ -70,7 +70,6 @@ typedef long mp_off_t;
#define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len)
// extra built in names to add to the global namespace
-extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj;
#define MICROPY_PORT_BUILTINS \
{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
@@ -88,7 +88,6 @@ typedef int mp_off_t;
#define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len)
// extra builtin names to add to the global namespace
-extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj;
#define MICROPY_PORT_BUILTINS \
{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
View
@@ -32,56 +32,55 @@ mp_obj_t mp_builtin___import__(size_t n_args, const mp_obj_t *args);
mp_obj_t mp_builtin_open(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs);
mp_obj_t mp_micropython_mem_info(size_t n_args, const mp_obj_t *args);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin___build_class___obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin___import___obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin___repl_print___obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_abs_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_all_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_any_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_bin_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_callable_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_compile_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_chr_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_dir_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_divmod_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_eval_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_exec_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_execfile_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_getattr_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_setattr_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_globals_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_hasattr_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_hash_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_hex_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_id_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_isinstance_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_issubclass_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_iter_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_len_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_list_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_locals_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_max_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_min_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_next_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_oct_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_ord_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_pow_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_print_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_repr_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_round_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_sorted_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_sum_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR(mp_builtin___build_class___obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin___import___obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin___repl_print___obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_abs_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_all_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_any_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_bin_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_callable_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_compile_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_chr_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_dir_obj);
+MP_DECLARE_CONST_FUN_OBJ_2(mp_builtin_divmod_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_eval_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_exec_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_execfile_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_getattr_obj);
+MP_DECLARE_CONST_FUN_OBJ_3(mp_builtin_setattr_obj);
+MP_DECLARE_CONST_FUN_OBJ_0(mp_builtin_globals_obj);
+MP_DECLARE_CONST_FUN_OBJ_2(mp_builtin_hasattr_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_hash_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_hex_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_id_obj);
+MP_DECLARE_CONST_FUN_OBJ_2(mp_builtin_isinstance_obj);
+MP_DECLARE_CONST_FUN_OBJ_2(mp_builtin_issubclass_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_iter_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_len_obj);
+MP_DECLARE_CONST_FUN_OBJ_0(mp_builtin_locals_obj);
+MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_max_obj);
+MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_min_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_next_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_oct_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_ord_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_pow_obj);
+MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_print_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_builtin_repr_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_round_obj);
+MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_sorted_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_sum_obj);
// Defined by a port, but declared here for simplicity
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_help_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_input_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_builtin_open_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_help_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_input_obj);
+MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_open_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_namedtuple_obj);
+MP_DECLARE_CONST_FUN_OBJ_2(mp_namedtuple_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_op_contains_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_op_getitem_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_op_setitem_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_op_delitem_obj);
+MP_DECLARE_CONST_FUN_OBJ_2(mp_op_contains_obj);
+MP_DECLARE_CONST_FUN_OBJ_2(mp_op_getitem_obj);
+MP_DECLARE_CONST_FUN_OBJ_3(mp_op_setitem_obj);
+MP_DECLARE_CONST_FUN_OBJ_2(mp_op_delitem_obj);
extern const mp_obj_module_t mp_module___main__;
extern const mp_obj_module_t mp_module_builtins;
@@ -116,7 +115,4 @@ extern const mp_obj_module_t mp_module_webrepl;
extern const mp_obj_module_t mp_module_framebuf;
extern const mp_obj_module_t mp_module_btree;
-// extmod functions
-MP_DECLARE_CONST_FUN_OBJ(pyb_mount_obj);
-
#endif // __MICROPY_INCLUDED_PY_BUILTIN_H__
View
@@ -270,7 +270,13 @@ static inline bool mp_obj_is_integer(mp_const_obj_t o) { return MP_OBJ_IS_INT(o)
// These macros are used to declare and define constant function objects
// You can put "static" in front of the definitions to make them local
-#define MP_DECLARE_CONST_FUN_OBJ(obj_name) extern const mp_obj_fun_builtin_t obj_name
+#define MP_DECLARE_CONST_FUN_OBJ_0(obj_name) extern const mp_obj_fun_builtin_t obj_name
+#define MP_DECLARE_CONST_FUN_OBJ_1(obj_name) extern const mp_obj_fun_builtin_t obj_name
+#define MP_DECLARE_CONST_FUN_OBJ_2(obj_name) extern const mp_obj_fun_builtin_t obj_name
+#define MP_DECLARE_CONST_FUN_OBJ_3(obj_name) extern const mp_obj_fun_builtin_t obj_name
+#define MP_DECLARE_CONST_FUN_OBJ_VAR(obj_name) extern const mp_obj_fun_builtin_t obj_name
+#define MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(obj_name) extern const mp_obj_fun_builtin_t obj_name
+#define MP_DECLARE_CONST_FUN_OBJ_KW(obj_name) extern const mp_obj_fun_builtin_t obj_name
#define MP_DEFINE_CONST_FUN_OBJ_0(obj_name, fun_name) \
const mp_obj_fun_builtin_t obj_name = \
@@ -760,7 +766,7 @@ qstr mp_obj_fun_get_name(mp_const_obj_t fun);
qstr mp_obj_code_get_name(const byte *code_info);
mp_obj_t mp_identity(mp_obj_t self);
-MP_DECLARE_CONST_FUN_OBJ(mp_identity_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_identity_obj);
// module
typedef struct _mp_obj_module_t {
View
@@ -74,32 +74,32 @@ const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, s
mp_obj_t index, bool is_slice);
const byte *find_subbytes(const byte *haystack, mp_uint_t hlen, const byte *needle, mp_uint_t nlen, mp_int_t direction);
-MP_DECLARE_CONST_FUN_OBJ(str_encode_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_find_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_rfind_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_index_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_rindex_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_join_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_split_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_splitlines_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_rsplit_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_startswith_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_endswith_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_strip_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_lstrip_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_rstrip_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_format_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_replace_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_count_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_partition_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_rpartition_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_center_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_lower_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_upper_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_isspace_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_isalpha_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_isdigit_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_isupper_obj);
-MP_DECLARE_CONST_FUN_OBJ(str_islower_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_encode_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_find_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_rfind_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_index_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_rindex_obj);
+MP_DECLARE_CONST_FUN_OBJ_2(str_join_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_split_obj);
+MP_DECLARE_CONST_FUN_OBJ_KW(str_splitlines_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_rsplit_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_startswith_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_endswith_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_strip_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_lstrip_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_rstrip_obj);
+MP_DECLARE_CONST_FUN_OBJ_KW(str_format_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_replace_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_count_obj);
+MP_DECLARE_CONST_FUN_OBJ_2(str_partition_obj);
+MP_DECLARE_CONST_FUN_OBJ_2(str_rpartition_obj);
+MP_DECLARE_CONST_FUN_OBJ_2(str_center_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(str_lower_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(str_upper_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(str_isspace_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(str_isalpha_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(str_isdigit_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(str_isupper_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(str_islower_obj);
#endif // __MICROPY_INCLUDED_PY_OBJSTR_H__
View
@@ -48,18 +48,18 @@ struct mp_stream_seek_t {
int whence;
};
-MP_DECLARE_CONST_FUN_OBJ(mp_stream_read_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_stream_read1_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_stream_readinto_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_stream_readall_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_stream_unbuffered_readline_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_stream_unbuffered_readlines_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_stream_write_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_stream_write1_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_stream_seek_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_stream_tell_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_stream_flush_obj);
-MP_DECLARE_CONST_FUN_OBJ(mp_stream_ioctl_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_stream_read_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_stream_read1_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_stream_readinto_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_stream_readall_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_stream_unbuffered_readline_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_stream_unbuffered_readlines_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_stream_write_obj);
+MP_DECLARE_CONST_FUN_OBJ_2(mp_stream_write1_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_stream_seek_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_stream_tell_obj);
+MP_DECLARE_CONST_FUN_OBJ_1(mp_stream_flush_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_stream_ioctl_obj);
// these are for mp_get_stream_raise and can be or'd together
#define MP_STREAM_OP_READ (1)
@@ -53,7 +53,6 @@ typedef long mp_off_t;
#define MP_PLAT_PRINT_STRN(str, len) write(1, str, len)
// extra built in names to add to the global namespace
-extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj;
#define MICROPY_PORT_BUILTINS \
{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
View
@@ -70,10 +70,10 @@ static inline void restore_irq_pri(uint32_t basepri) {
#endif
-MP_DECLARE_CONST_FUN_OBJ(pyb_wfi_obj);
-MP_DECLARE_CONST_FUN_OBJ(pyb_disable_irq_obj);
-MP_DECLARE_CONST_FUN_OBJ(pyb_enable_irq_obj);
-MP_DECLARE_CONST_FUN_OBJ(pyb_irq_stats_obj);
+MP_DECLARE_CONST_FUN_OBJ_0(pyb_wfi_obj);
+MP_DECLARE_CONST_FUN_OBJ_0(pyb_disable_irq_obj);
+MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(pyb_enable_irq_obj);
+MP_DECLARE_CONST_FUN_OBJ_0(pyb_irq_stats_obj);
// IRQ priority definitions.
//
Oops, something went wrong.

0 comments on commit 4ebdb1f

Please sign in to comment.