diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-02-21 02:04:32 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-02-21 03:27:09 +0200 |
commit | bbf0e2fe120f095ce09fcb7eb631c9fd04bd9760 (patch) | |
tree | ba40233e70d58abf4120f632a36913ed12512a42 /py/parse.h | |
parent | 1d30b116852cc94f3096125997c310cf64fb6537 (diff) | |
download | micropython-bbf0e2fe120f095ce09fcb7eb631c9fd04bd9760.tar.gz micropython-bbf0e2fe120f095ce09fcb7eb631c9fd04bd9760.zip |
parse: Note that fact that parser's small ints are different than VM small int.
Specifically, VM's small ints are 31 bit, while parser's only 28. There's already
MP_OBJ_FITS_SMALL_INT(), so, for clarity, rename MP_FIT_SMALL_INT() to
MP_PARSE_FITS_SMALL_INT().
Diffstat (limited to 'py/parse.h')
-rw-r--r-- | py/parse.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/py/parse.h b/py/parse.h index 66efd8a208..6e299ef69e 100644 --- a/py/parse.h +++ b/py/parse.h @@ -14,7 +14,8 @@ struct _mp_lexer_t; // makes sure the top 5 bits of x are all cleared (positive number) or all set (negavite number) // these macros can probably go somewhere else because they are used more than just in the parser #define MP_UINT_HIGH_5_BITS (~((~((machine_uint_t)0)) >> 5)) -#define MP_FIT_SMALL_INT(x) (((((machine_uint_t)(x)) & MP_UINT_HIGH_5_BITS) == 0) || ((((machine_uint_t)(x)) & MP_UINT_HIGH_5_BITS) == MP_UINT_HIGH_5_BITS)) +// parser's small ints are different from VM small int +#define MP_PARSE_FITS_SMALL_INT(x) (((((machine_uint_t)(x)) & MP_UINT_HIGH_5_BITS) == 0) || ((((machine_uint_t)(x)) & MP_UINT_HIGH_5_BITS) == MP_UINT_HIGH_5_BITS)) #define MP_PARSE_NODE_NULL (0) #define MP_PARSE_NODE_ID (0x1) |