From f78b6df1926367b903be1891e564151f099aefc7 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 31 Mar 2014 15:59:25 +0100 Subject: [PATCH] py: Disable dump_args function call entirely when not debugging. Yes, I know, a good compiler will optimise this away, but I feel this is neater. --- py/objfun.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/py/objfun.c b/py/objfun.c index 154630afb6..3b48b570fd 100644 --- a/py/objfun.c +++ b/py/objfun.c @@ -151,15 +151,17 @@ typedef struct _mp_obj_fun_bc_t { mp_obj_t extra_args[]; // values of default args (if any), plus a slot at the end for var args and/or kw args (if it takes them) } mp_obj_fun_bc_t; -void dump_args(const mp_obj_t *a, int sz) { #if DEBUG_PRINT +STATIC void dump_args(const mp_obj_t *a, int sz) { DEBUG_printf("%p: ", a); for (int i = 0; i < sz; i++) { DEBUG_printf("%p ", a[i]); } DEBUG_printf("\n"); -#endif } +#else +#define dump_args(...) (void)0 +#endif // If it's possible to call a function without allocating new argument array, // this function returns true, together with pointers to 2 subarrays to be used