summaryrefslogtreecommitdiff
path: root/py/obj.h
diff options
context:
space:
mode:
Diffstat (limited to 'py/obj.h')
-rw-r--r--py/obj.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/obj.h b/py/obj.h
index cb9a6cc45..8a0a25670 100644
--- a/py/obj.h
+++ b/py/obj.h
@@ -313,12 +313,12 @@ typedef union _mp_rom_obj_t {
// Cast mp_obj_t to object pointer
#ifndef MP_OBJ_TO_PTR
-#define MP_OBJ_TO_PTR(o) ((void *)o)
+#define MP_OBJ_TO_PTR(o) ((void *)(o))
#endif
// Cast object pointer to mp_obj_t
#ifndef MP_OBJ_FROM_PTR
-#define MP_OBJ_FROM_PTR(p) ((mp_obj_t)p)
+#define MP_OBJ_FROM_PTR(p) ((mp_obj_t)(p))
#endif
// Macros to create objects that are stored in ROM.