Commit ff8dd3f4 authored by Damien George's avatar Damien George
Browse files

py, unix: Allow to compile with -Wunused-parameter.

See issue #699.
parent 50912e7f
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#if MICROPY_PY_UBINASCII #if MICROPY_PY_UBINASCII
STATIC mp_obj_t mod_binascii_hexlify(mp_uint_t n_args, const mp_obj_t *args) { STATIC mp_obj_t mod_binascii_hexlify(mp_uint_t n_args, const mp_obj_t *args) {
(void)n_args;
mp_buffer_info_t bufinfo; mp_buffer_info_t bufinfo;
mp_get_buffer_raise(args[0], &bufinfo, MP_BUFFER_READ); mp_get_buffer_raise(args[0], &bufinfo, MP_BUFFER_READ);
......
...@@ -122,6 +122,7 @@ STATIC NORETURN void syntax_error(void) { ...@@ -122,6 +122,7 @@ STATIC NORETURN void syntax_error(void) {
} }
STATIC mp_obj_t uctypes_struct_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { STATIC mp_obj_t uctypes_struct_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) {
(void)n_kw;
if (n_args < 2 || n_args > 3) { if (n_args < 2 || n_args > 3) {
syntax_error(); syntax_error();
} }
...@@ -137,6 +138,7 @@ STATIC mp_obj_t uctypes_struct_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_u ...@@ -137,6 +138,7 @@ STATIC mp_obj_t uctypes_struct_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_u
} }
STATIC void uctypes_struct_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) { STATIC void uctypes_struct_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {
(void)kind;
mp_obj_uctypes_struct_t *self = self_in; mp_obj_uctypes_struct_t *self = self_in;
const char *typen = "unk"; const char *typen = "unk";
if (MP_OBJ_IS_TYPE(self->desc, &mp_type_dict)) { if (MP_OBJ_IS_TYPE(self->desc, &mp_type_dict)) {
......
...@@ -71,6 +71,7 @@ STATIC mp_obj_t hash_digest(mp_obj_t self_in) { ...@@ -71,6 +71,7 @@ STATIC mp_obj_t hash_digest(mp_obj_t self_in) {
MP_DEFINE_CONST_FUN_OBJ_1(hash_digest_obj, hash_digest); MP_DEFINE_CONST_FUN_OBJ_1(hash_digest_obj, hash_digest);
STATIC mp_obj_t hash_hexdigest(mp_obj_t self_in) { STATIC mp_obj_t hash_hexdigest(mp_obj_t self_in) {
(void)self_in;
mp_not_implemented(""); mp_not_implemented("");
#if 0 #if 0
mp_obj_hash_t *self = self_in; mp_obj_hash_t *self = self_in;
......
...@@ -52,6 +52,7 @@ typedef struct _mp_obj_match_t { ...@@ -52,6 +52,7 @@ typedef struct _mp_obj_match_t {
STATIC void match_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) { STATIC void match_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {
(void)kind;
mp_obj_match_t *self = self_in; mp_obj_match_t *self = self_in;
print(env, "<match num=%d @%p>", self->num_matches); print(env, "<match num=%d @%p>", self->num_matches);
} }
...@@ -82,11 +83,13 @@ STATIC const mp_obj_type_t match_type = { ...@@ -82,11 +83,13 @@ STATIC const mp_obj_type_t match_type = {
}; };
STATIC void re_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) { STATIC void re_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {
(void)kind;
mp_obj_re_t *self = self_in; mp_obj_re_t *self = self_in;
print(env, "<re %p>", self); print(env, "<re %p>", self);
} }
STATIC mp_obj_t re_exec(bool is_anchored, uint n_args, const mp_obj_t *args) { STATIC mp_obj_t re_exec(bool is_anchored, uint n_args, const mp_obj_t *args) {
(void)n_args;
mp_obj_re_t *self = args[0]; mp_obj_re_t *self = args[0];
Subject subj; Subject subj;
mp_uint_t len; mp_uint_t len;
...@@ -192,6 +195,7 @@ STATIC mp_obj_t mod_re_compile(uint n_args, const mp_obj_t *args) { ...@@ -192,6 +195,7 @@ STATIC mp_obj_t mod_re_compile(uint n_args, const mp_obj_t *args) {
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_re_compile_obj, 1, 2, mod_re_compile); MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_re_compile_obj, 1, 2, mod_re_compile);
STATIC mp_obj_t mod_re_exec(bool is_anchored, uint n_args, const mp_obj_t *args) { STATIC mp_obj_t mod_re_exec(bool is_anchored, uint n_args, const mp_obj_t *args) {
(void)n_args;
mp_obj_re_t *self = mod_re_compile(1, args); mp_obj_re_t *self = mod_re_compile(1, args);
const mp_obj_t args2[] = {self, args[1]}; const mp_obj_t args2[] = {self, args[1]};
......
...@@ -55,6 +55,7 @@ STATIC int mod_uzlib_grow_buf(TINF_DATA *d, unsigned alloc_req) { ...@@ -55,6 +55,7 @@ STATIC int mod_uzlib_grow_buf(TINF_DATA *d, unsigned alloc_req) {
} }
STATIC mp_obj_t mod_uzlib_decompress(mp_uint_t n_args, const mp_obj_t *args) { STATIC mp_obj_t mod_uzlib_decompress(mp_uint_t n_args, const mp_obj_t *args) {
(void)n_args;
mp_obj_t data = args[0]; mp_obj_t data = args[0];
mp_buffer_info_t bufinfo; mp_buffer_info_t bufinfo;
mp_get_buffer_raise(data, &bufinfo, MP_BUFFER_READ); mp_get_buffer_raise(data, &bufinfo, MP_BUFFER_READ);
......
...@@ -145,6 +145,7 @@ void asm_x86_start_pass(asm_x86_t *as, mp_uint_t pass) { ...@@ -145,6 +145,7 @@ void asm_x86_start_pass(asm_x86_t *as, mp_uint_t pass) {
} }
void asm_x86_end_pass(asm_x86_t *as) { void asm_x86_end_pass(asm_x86_t *as) {
(void)as;
} }
// all functions must go through this one to emit bytes // all functions must go through this one to emit bytes
......
...@@ -75,6 +75,8 @@ STATIC mp_obj_t code_execute(mp_obj_code_t *self, mp_obj_t globals, mp_obj_t loc ...@@ -75,6 +75,8 @@ STATIC mp_obj_t code_execute(mp_obj_code_t *self, mp_obj_t globals, mp_obj_t loc
} }
STATIC mp_obj_t mp_builtin_compile(mp_uint_t n_args, const mp_obj_t *args) { STATIC mp_obj_t mp_builtin_compile(mp_uint_t n_args, const mp_obj_t *args) {
(void)n_args;
// get the source // get the source
mp_uint_t str_len; mp_uint_t str_len;
const char *str = mp_obj_str_get_data(args[0], &str_len); const char *str = mp_obj_str_get_data(args[0], &str_len);
......
...@@ -3210,6 +3210,9 @@ STATIC void check_for_doc_string(compiler_t *comp, mp_parse_node_t pn) { ...@@ -3210,6 +3210,9 @@ STATIC void check_for_doc_string(compiler_t *comp, mp_parse_node_t pn) {
EMIT_ARG(store_id, MP_QSTR___doc__); EMIT_ARG(store_id, MP_QSTR___doc__);
} }
} }
#else
(void)comp;
(void)pn;
#endif #endif
} }
...@@ -3514,7 +3517,7 @@ STATIC void compile_scope_inline_asm(compiler_t *comp, scope_t *scope, pass_kind ...@@ -3514,7 +3517,7 @@ STATIC void compile_scope_inline_asm(compiler_t *comp, scope_t *scope, pass_kind
} }
#endif #endif
STATIC void compile_scope_compute_things(compiler_t *comp, scope_t *scope) { STATIC void scope_compute_things(scope_t *scope) {
#if !MICROPY_EMIT_CPYTHON #if !MICROPY_EMIT_CPYTHON
// in Micro Python we put the *x parameter after all other parameters (except **y) // in Micro Python we put the *x parameter after all other parameters (except **y)
if (scope->scope_flags & MP_SCOPE_FLAG_VARARGS) { if (scope->scope_flags & MP_SCOPE_FLAG_VARARGS) {
...@@ -3678,7 +3681,7 @@ mp_obj_t mp_compile(mp_parse_node_t pn, qstr source_file, uint emit_opt, bool is ...@@ -3678,7 +3681,7 @@ mp_obj_t mp_compile(mp_parse_node_t pn, qstr source_file, uint emit_opt, bool is
// compute some things related to scope and identifiers // compute some things related to scope and identifiers
for (scope_t *s = comp->scope_head; s != NULL && comp->compile_error == MP_OBJ_NULL; s = s->next) { for (scope_t *s = comp->scope_head; s != NULL && comp->compile_error == MP_OBJ_NULL; s = s->next) {
compile_scope_compute_things(comp, s); scope_compute_things(s);
} }
// finish with pass 1 // finish with pass 1
......
...@@ -268,6 +268,10 @@ STATIC void emit_write_bytecode_byte_signed_label(emit_t* emit, byte b1, mp_uint ...@@ -268,6 +268,10 @@ STATIC void emit_write_bytecode_byte_signed_label(emit_t* emit, byte b1, mp_uint
} }
STATIC void emit_bc_set_native_type(emit_t *emit, mp_uint_t op, mp_uint_t arg1, qstr arg2) { STATIC void emit_bc_set_native_type(emit_t *emit, mp_uint_t op, mp_uint_t arg1, qstr arg2) {
(void)emit;
(void)op;
(void)arg1;
(void)arg2;
} }
STATIC void emit_bc_start_pass(emit_t *emit, pass_kind_t pass, scope_t *scope) { STATIC void emit_bc_start_pass(emit_t *emit, pass_kind_t pass, scope_t *scope) {
...@@ -499,6 +503,7 @@ STATIC void emit_bc_load_null(emit_t *emit) { ...@@ -499,6 +503,7 @@ STATIC void emit_bc_load_null(emit_t *emit) {
}; };
STATIC void emit_bc_load_fast(emit_t *emit, qstr qst, mp_uint_t local_num) { STATIC void emit_bc_load_fast(emit_t *emit, qstr qst, mp_uint_t local_num) {
(void)qst;
assert(local_num >= 0); assert(local_num >= 0);
emit_bc_pre(emit, 1); emit_bc_pre(emit, 1);
if (local_num <= 15) { if (local_num <= 15) {
...@@ -509,11 +514,13 @@ STATIC void emit_bc_load_fast(emit_t *emit, qstr qst, mp_uint_t local_num) { ...@@ -509,11 +514,13 @@ STATIC void emit_bc_load_fast(emit_t *emit, qstr qst, mp_uint_t local_num) {
} }
STATIC void emit_bc_load_deref(emit_t *emit, qstr qst, mp_uint_t local_num) { STATIC void emit_bc_load_deref(emit_t *emit, qstr qst, mp_uint_t local_num) {
(void)qst;
emit_bc_pre(emit, 1); emit_bc_pre(emit, 1);
emit_write_bytecode_byte_uint(emit, MP_BC_LOAD_DEREF, local_num); emit_write_bytecode_byte_uint(emit, MP_BC_LOAD_DEREF, local_num);
} }
STATIC void emit_bc_load_name(emit_t *emit, qstr qst) { STATIC void emit_bc_load_name(emit_t *emit, qstr qst) {
(void)qst;
emit_bc_pre(emit, 1); emit_bc_pre(emit, 1);
emit_write_bytecode_byte_qstr(emit, MP_BC_LOAD_NAME, qst); emit_write_bytecode_byte_qstr(emit, MP_BC_LOAD_NAME, qst);
if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) { if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) {
...@@ -522,6 +529,7 @@ STATIC void emit_bc_load_name(emit_t *emit, qstr qst) { ...@@ -522,6 +529,7 @@ STATIC void emit_bc_load_name(emit_t *emit, qstr qst) {
} }
STATIC void emit_bc_load_global(emit_t *emit, qstr qst) { STATIC void emit_bc_load_global(emit_t *emit, qstr qst) {
(void)qst;
emit_bc_pre(emit, 1); emit_bc_pre(emit, 1);
emit_write_bytecode_byte_qstr(emit, MP_BC_LOAD_GLOBAL, qst); emit_write_bytecode_byte_qstr(emit, MP_BC_LOAD_GLOBAL, qst);
if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) { if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) {
...@@ -553,6 +561,7 @@ STATIC void emit_bc_load_subscr(emit_t *emit) { ...@@ -553,6 +561,7 @@ STATIC void emit_bc_load_subscr(emit_t *emit) {
} }
STATIC void emit_bc_store_fast(emit_t *emit, qstr qst, mp_uint_t local_num) { STATIC void emit_bc_store_fast(emit_t *emit, qstr qst, mp_uint_t local_num) {
(void)qst;
assert(local_num >= 0); assert(local_num >= 0);
emit_bc_pre(emit, -1); emit_bc_pre(emit, -1);
if (local_num <= 15) { if (local_num <= 15) {
...@@ -563,6 +572,7 @@ STATIC void emit_bc_store_fast(emit_t *emit, qstr qst, mp_uint_t local_num) { ...@@ -563,6 +572,7 @@ STATIC void emit_bc_store_fast(emit_t *emit, qstr qst, mp_uint_t local_num) {
} }
STATIC void emit_bc_store_deref(emit_t *emit, qstr qst, mp_uint_t local_num) { STATIC void emit_bc_store_deref(emit_t *emit, qstr qst, mp_uint_t local_num) {
(void)qst;
emit_bc_pre(emit, -1); emit_bc_pre(emit, -1);
emit_write_bytecode_byte_uint(emit, MP_BC_STORE_DEREF, local_num); emit_write_bytecode_byte_uint(emit, MP_BC_STORE_DEREF, local_num);
} }
...@@ -591,10 +601,12 @@ STATIC void emit_bc_store_subscr(emit_t *emit) { ...@@ -591,10 +601,12 @@ STATIC void emit_bc_store_subscr(emit_t *emit) {
} }
STATIC void emit_bc_delete_fast(emit_t *emit, qstr qst, mp_uint_t local_num) { STATIC void emit_bc_delete_fast(emit_t *emit, qstr qst, mp_uint_t local_num) {
(void)qst;
emit_write_bytecode_byte_uint(emit, MP_BC_DELETE_FAST, local_num); emit_write_bytecode_byte_uint(emit, MP_BC_DELETE_FAST, local_num);
} }
STATIC void emit_bc_delete_deref(emit_t *emit, qstr qst, mp_uint_t local_num) { STATIC void emit_bc_delete_deref(emit_t *emit, qstr qst, mp_uint_t local_num) {
(void)qst;
emit_write_bytecode_byte_uint(emit, MP_BC_DELETE_DEREF, local_num); emit_write_bytecode_byte_uint(emit, MP_BC_DELETE_DEREF, local_num);
} }
......
...@@ -92,6 +92,8 @@ void mp_emit_glue_assign_native(mp_raw_code_t *rc, mp_raw_code_kind_t kind, void ...@@ -92,6 +92,8 @@ void mp_emit_glue_assign_native(mp_raw_code_t *rc, mp_raw_code_kind_t kind, void
fwrite(fun_data, fun_len, 1, fp_write_code); fwrite(fun_data, fun_len, 1, fp_write_code);
fclose(fp_write_code); fclose(fp_write_code);
#endif #endif
#else
(void)fun_len;
#endif #endif
} }
#endif #endif
......
...@@ -740,6 +740,8 @@ STATIC void emit_native_adjust_stack_size(emit_t *emit, mp_int_t delta) { ...@@ -740,6 +740,8 @@ STATIC void emit_native_adjust_stack_size(emit_t *emit, mp_int_t delta) {
} }
STATIC void emit_native_set_source_line(emit_t *emit, mp_uint_t source_line) { STATIC void emit_native_set_source_line(emit_t *emit, mp_uint_t source_line) {
(void)emit;
(void)source_line;
} }
/* /*
...@@ -905,6 +907,7 @@ STATIC void emit_pre_pop_reg_reg_reg(emit_t *emit, vtype_kind_t *vtypea, int reg ...@@ -905,6 +907,7 @@ STATIC void emit_pre_pop_reg_reg_reg(emit_t *emit, vtype_kind_t *vtypea, int reg
} }
STATIC void emit_post(emit_t *emit) { STATIC void emit_post(emit_t *emit) {
(void)emit;
} }
STATIC void emit_post_top_set_vtype(emit_t *emit, vtype_kind_t new_vtype) { STATIC void emit_post_top_set_vtype(emit_t *emit, vtype_kind_t new_vtype) {
...@@ -1247,6 +1250,9 @@ STATIC void emit_native_load_fast(emit_t *emit, qstr qst, mp_uint_t local_num) { ...@@ -1247,6 +1250,9 @@ STATIC void emit_native_load_fast(emit_t *emit, qstr qst, mp_uint_t local_num) {
STATIC void emit_native_load_deref(emit_t *emit, qstr qst, mp_uint_t local_num) { STATIC void emit_native_load_deref(emit_t *emit, qstr qst, mp_uint_t local_num) {
// not implemented // not implemented
// in principle could support this quite easily (ldr r0, [r0, #0]) and then get closed over variables! // in principle could support this quite easily (ldr r0, [r0, #0]) and then get closed over variables!
(void)emit;
(void)qst;
(void)local_num;
assert(0); assert(0);
} }
...@@ -1465,6 +1471,9 @@ STATIC void emit_native_store_fast(emit_t *emit, qstr qst, mp_uint_t local_num) ...@@ -1465,6 +1471,9 @@ STATIC void emit_native_store_fast(emit_t *emit, qstr qst, mp_uint_t local_num)
STATIC void emit_native_store_deref(emit_t *emit, qstr qst, mp_uint_t local_num) { STATIC void emit_native_store_deref(emit_t *emit, qstr qst, mp_uint_t local_num) {
// not implemented // not implemented
(void)emit;
(void)qst;
(void)local_num;
assert(0); assert(0);
} }
...@@ -1634,10 +1643,16 @@ STATIC void emit_native_delete_fast(emit_t *emit, qstr qst, mp_uint_t local_num) ...@@ -1634,10 +1643,16 @@ STATIC void emit_native_delete_fast(emit_t *emit, qstr qst, mp_uint_t local_num)
// local is automatically deleted for exception block "as" var, and the message // local is automatically deleted for exception block "as" var, and the message
// breaks tests. // breaks tests.
//mp_emitter_warning(emit->pass, "Native codegeneration doesn't support deleting local"); //mp_emitter_warning(emit->pass, "Native codegeneration doesn't support deleting local");
(void)emit;
(void)qst;
(void)local_num;
} }
STATIC void emit_native_delete_deref(emit_t *emit, qstr qst, mp_uint_t local_num) { STATIC void emit_native_delete_deref(emit_t *emit, qstr qst, mp_uint_t local_num) {
// TODO implement me! // TODO implement me!
(void)emit;
(void)qst;
(void)local_num;
} }
STATIC void emit_native_delete_name(emit_t *emit, qstr qst) { STATIC void emit_native_delete_name(emit_t *emit, qstr qst) {
...@@ -1711,7 +1726,7 @@ STATIC void emit_native_jump(emit_t *emit, mp_uint_t label) { ...@@ -1711,7 +1726,7 @@ STATIC void emit_native_jump(emit_t *emit, mp_uint_t label) {
emit_post(emit); emit_post(emit);
} }
STATIC void emit_native_jump_helper(emit_t *emit, mp_uint_t label, bool pop) { STATIC void emit_native_jump_helper(emit_t *emit, bool pop) {
vtype_kind_t vtype = peek_vtype(emit, 0); vtype_kind_t vtype = peek_vtype(emit, 0);
switch (vtype) { switch (vtype) {
case VTYPE_PYOBJ: case VTYPE_PYOBJ:
...@@ -1744,21 +1759,21 @@ STATIC void emit_native_jump_helper(emit_t *emit, mp_uint_t label, bool pop) { ...@@ -1744,21 +1759,21 @@ STATIC void emit_native_jump_helper(emit_t *emit, mp_uint_t label, bool pop) {
STATIC void emit_native_pop_jump_if_true(emit_t *emit, mp_uint_t label) { STATIC void emit_native_pop_jump_if_true(emit_t *emit, mp_uint_t label) {
DEBUG_printf("pop_jump_if_true(label=" UINT_FMT ")\n", label); DEBUG_printf("pop_jump_if_true(label=" UINT_FMT ")\n", label);
emit_native_jump_helper(emit, label, true); emit_native_jump_helper(emit, true);
ASM_JUMP_IF_REG_NONZERO(emit->as, REG_RET, label); ASM_JUMP_IF_REG_NONZERO(emit->as, REG_RET, label);
emit_post(emit); emit_post(emit);
} }
STATIC void emit_native_pop_jump_if_false(emit_t *emit, mp_uint_t label) { STATIC void emit_native_pop_jump_if_false(emit_t *emit, mp_uint_t label) {
DEBUG_printf("pop_jump_if_false(label=" UINT_FMT ")\n", label); DEBUG_printf("pop_jump_if_false(label=" UINT_FMT ")\n", label);
emit_native_jump_helper(emit, label, true); emit_native_jump_helper(emit, true);
ASM_JUMP_IF_REG_ZERO(emit->as, REG_RET, label); ASM_JUMP_IF_REG_ZERO(emit->as, REG_RET, label);
emit_post(emit); emit_post(emit);
} }
STATIC void emit_native_jump_if_true_or_pop(emit_t *emit, mp_uint_t label) { STATIC void emit_native_jump_if_true_or_pop(emit_t *emit, mp_uint_t label) {
DEBUG_printf("jump_if_true_or_pop(label=" UINT_FMT ")\n", label); DEBUG_printf("jump_if_true_or_pop(label=" UINT_FMT ")\n", label);
emit_native_jump_helper(emit, label, false); emit_native_jump_helper(emit, false);
ASM_JUMP_IF_REG_NONZERO(emit->as, REG_RET, label); ASM_JUMP_IF_REG_NONZERO(emit->as, REG_RET, label);
adjust_stack(emit, -1); adjust_stack(emit, -1);
emit_post(emit); emit_post(emit);
...@@ -1766,26 +1781,31 @@ STATIC void emit_native_jump_if_true_or_pop(emit_t *emit, mp_uint_t label) { ...@@ -1766,26 +1781,31 @@ STATIC void emit_native_jump_if_true_or_pop(emit_t *emit, mp_uint_t label) {
STATIC void emit_native_jump_if_false_or_pop(emit_t *emit, mp_uint_t label) { STATIC void emit_native_jump_if_false_or_pop(emit_t *emit, mp_uint_t label) {
DEBUG_printf("jump_if_false_or_pop(label=" UINT_FMT ")\n", label); DEBUG_printf("jump_if_false_or_pop(label=" UINT_FMT ")\n", label);
emit_native_jump_helper(emit, label, false); emit_native_jump_helper(emit, false);
ASM_JUMP_IF_REG_ZERO(emit->as, REG_RET, label); ASM_JUMP_IF_REG_ZERO(emit->as, REG_RET, label);
adjust_stack(emit, -1); adjust_stack(emit, -1);
emit_post(emit); emit_post(emit);
} }
STATIC void emit_native_break_loop(emit_t *emit, mp_uint_t label, mp_uint_t except_depth) { STATIC void emit_native_break_loop(emit_t *emit, mp_uint_t label, mp_uint_t except_depth) {
(void)except_depth;
emit_native_jump(emit, label & ~MP_EMIT_BREAK_FROM_FOR); // TODO properly emit_native_jump(emit, label & ~MP_EMIT_BREAK_FROM_FOR); // TODO properly
} }
STATIC void emit_native_continue_loop(emit_t *emit, mp_uint_t label, mp_uint_t except_depth) { STATIC void emit_native_continue_loop(emit_t *emit, mp_uint_t label, mp_uint_t except_depth) {
(void)except_depth;
emit_native_jump(emit, label); // TODO properly emit_native_jump(emit, label); // TODO properly
} }
STATIC void emit_native_setup_with(emit_t *emit, mp_uint_t label) { STATIC void emit_native_setup_with(emit_t *emit, mp_uint_t label) {
// not supported, or could be with runtime call // not supported, or could be with runtime call
(void)emit;
(void)label;
assert(0); assert(0);
} }
STATIC void emit_native_with_cleanup(emit_t *emit) { STATIC void emit_native_with_cleanup(emit_t *emit) {
(void)emit;
assert(0); assert(0);
} }
...@@ -1845,6 +1865,7 @@ STATIC void emit_native_pop_block(emit_t *emit) { ...@@ -1845,6 +1865,7 @@ STATIC void emit_native_pop_block(emit_t *emit) {
} }
STATIC void emit_native_pop_except(emit_t *emit) { STATIC void emit_native_pop_except(emit_t *emit) {
(void)emit;
/* /*
emit_native_pre(emit); emit_native_pre(emit);
emit_call(emit, MP_F_NLR_POP); emit_call(emit, MP_F_NLR_POP);
...@@ -2139,6 +2160,11 @@ STATIC void emit_native_make_function(emit_t *emit, scope_t *scope, mp_uint_t n_ ...@@ -2139,6 +2160,11 @@ STATIC void emit_native_make_function(emit_t *emit, scope_t *scope, mp_uint_t n_
} }
STATIC void emit_native_make_closure(emit_t *emit, scope_t *scope, mp_uint_t n_closed_over, mp_uint_t n_pos_defaults, mp_uint_t n_kw_defaults) { STATIC void emit_native_make_closure(emit_t *emit, scope_t *scope, mp_uint_t n_closed_over, mp_uint_t n_pos_defaults, mp_uint_t n_kw_defaults) {
(void)emit;
(void)scope;
(void)n_closed_over;
(void)n_pos_defaults;
(void)n_kw_defaults;
assert(0); assert(0);
} }
...@@ -2238,10 +2264,12 @@ STATIC void emit_native_raise_varargs(emit_t *emit, mp_uint_t n_args) { ...@@ -2238,10 +2264,12 @@ STATIC void emit_native_raise_varargs(emit_t *emit, mp_uint_t n_args) {
STATIC void emit_native_yield_value(emit_t *emit) { STATIC void emit_native_yield_value(emit_t *emit) {
// not supported (for now) // not supported (for now)
(void)emit;
assert(0); assert(0);
} }
STATIC void emit_native_yield_from(emit_t *emit) { STATIC void emit_native_yield_from(emit_t *emit) {
// not supported (for now) // not supported (for now)
(void)emit;
assert(0); assert(0);
} }
......
...@@ -42,6 +42,7 @@ void emit_pass1_free(emit_t *emit) { ...@@ -42,6 +42,7 @@ void emit_pass1_free(emit_t *emit) {
} }
STATIC void emit_pass1_dummy(emit_t *emit) { STATIC void emit_pass1_dummy(emit_t *emit) {
(void)emit;
} }
STATIC void emit_pass1_start_pass(emit_t *emit, pass_kind_t pass, scope_t *scope) { STATIC void emit_pass1_start_pass(emit_t *emit, pass_kind_t pass, scope_t *scope) {
...@@ -50,9 +51,11 @@ STATIC void emit_pass1_start_pass(emit_t *emit, pass_kind_t pass, scope_t *scope ...@@ -50,9 +51,11 @@ STATIC void emit_pass1_start_pass(emit_t *emit, pass_kind_t pass, scope_t *scope
} }
STATIC void emit_pass1_end_pass(emit_t *emit) { STATIC void emit_pass1_end_pass(emit_t *emit) {
(void)emit;
} }
STATIC bool emit_pass1_last_emit_was_return_value(emit_t *emit) { STATIC bool emit_pass1_last_emit_was_return_value(emit_t *emit) {
(void)emit;
return false; return false;
} }
......
...@@ -54,6 +54,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(mp_micropython_mem_peak_obj, mp_micropython_mem ...@@ -54,6 +54,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(mp_micropython_mem_peak_obj, mp_micropython_mem
#endif #endif
mp_obj_t mp_micropython_mem_info(mp_uint_t n_args, const mp_obj_t *args) { mp_obj_t mp_micropython_mem_info(mp_uint_t n_args, const mp_obj_t *args) {
(void)args;
#if MICROPY_MEM_STATS #if MICROPY_MEM_STATS
printf("mem: total=" UINT_FMT ", current=" UINT_FMT ", peak=" UINT_FMT "\n", printf("mem: total=" UINT_FMT ", current=" UINT_FMT ", peak=" UINT_FMT "\n",
m_get_total_bytes_allocated(), m_get_current_bytes_allocated(), m_get_peak_bytes_allocated()); m_get_total_bytes_allocated(), m_get_current_bytes_allocated(), m_get_peak_bytes_allocated());
...@@ -69,6 +70,8 @@ mp_obj_t mp_micropython_mem_info(mp_uint_t n_args, const mp_obj_t *args) { ...@@ -69,6 +70,8 @@ mp_obj_t mp_micropython_mem_info(mp_uint_t n_args, const mp_obj_t *args) {
// arg given means dump gc allocation table // arg given means dump gc allocation table
gc_dump_alloc_table(); gc_dump_alloc_table();
} }
#else
(void)n_args;
#endif #endif
return mp_const_none; return mp_const_none;
} }
......
...@@ -198,10 +198,10 @@ STATIC mp_uint_t mpn_sub(mpz_dig_t *idig, const mpz_dig_t *jdig, mp_uint_t jlen, ...@@ -198,10 +198,10 @@ STATIC mp_uint_t mpn_sub(mpz_dig_t *idig, const mpz_dig_t *jdig, mp_uint_t jlen,
/* computes i = j & k /* computes i = j & k
returns number of digits in i returns number of digits in i
assumes enough memory in i; assumes normalised j, k; assumes jlen >= klen assumes enough memory in i; assumes normalised j, k; assumes jlen >= klen (jlen argument not needed)
can have i, j, k pointing to same memory can have i, j, k pointing to same memory
*/ */