aboutsummaryrefslogtreecommitdiff
path: root/py/runtime0.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-02-02 23:16:05 +0000
committerDamien George <damien.p.george@gmail.com>2016-02-02 23:16:05 +0000
commit5f3e005b6791634b104fa6385c8a9bf5ed1af164 (patch)
treec4e5b55cf2056c4b01e1b86ae3820e7e47dde11e /py/runtime0.h
parent086d98cbde2dffe43c2879d15d2c419a1250008e (diff)
py: Extend native type-sig to use 4 bits, so uint is separate to ptr.
Before this patch, the native types for uint and ptr/ptr8/ptr16/ptr32 all overlapped and it was possible to make a mistake in casting. Now, these types are all separate and any coding mistakes will be raised as runtime errors.
Diffstat (limited to 'py/runtime0.h')
-rw-r--r--py/runtime0.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/py/runtime0.h b/py/runtime0.h
index 6417cfd03..8d62403a7 100644
--- a/py/runtime0.h
+++ b/py/runtime0.h
@@ -37,6 +37,10 @@
#define MP_NATIVE_TYPE_BOOL (0x01)
#define MP_NATIVE_TYPE_INT (0x02)
#define MP_NATIVE_TYPE_UINT (0x03)
+#define MP_NATIVE_TYPE_PTR (0x04)
+#define MP_NATIVE_TYPE_PTR8 (0x05)
+#define MP_NATIVE_TYPE_PTR16 (0x06)
+#define MP_NATIVE_TYPE_PTR32 (0x07)
typedef enum {
MP_UNARY_OP_BOOL, // __bool__