summaryrefslogtreecommitdiffstatshomepage
path: root/py/objfun.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-03-31 15:59:25 +0100
committerDamien George <damien.p.george@gmail.com>2014-03-31 15:59:25 +0100
commitf78b6df1926367b903be1891e564151f099aefc7 (patch)
treef1505175b9ee03c1d3b12404076fa86725cdefe3 /py/objfun.c
parente337f1ef5efda000f0517b3d5e7aec5ba4ed8b55 (diff)
downloadmicropython-f78b6df1926367b903be1891e564151f099aefc7.tar.gz
micropython-f78b6df1926367b903be1891e564151f099aefc7.zip
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.
Diffstat (limited to 'py/objfun.c')
-rw-r--r--py/objfun.c6
1 files 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