mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 20:50:14 +01:00
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.
This commit is contained in:
@@ -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__
|
||||
|
||||
Reference in New Issue
Block a user