summaryrefslogtreecommitdiff
path: root/py/parse.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-05-28 14:51:12 +0100
committerDamien George <damien.p.george@gmail.com>2014-05-28 14:51:12 +0100
commitd1e355ea8e2a5a17ee126f5c3d173b2e6f33e460 (patch)
treed5ba59452f72a9dcc31fc6cdcf0ad8c08c8713b2 /py/parse.h
parent813ed3bda6818bd8dd15ee5e3c673a24321e740b (diff)
py: Fix check of small-int overflow when parsing ints.
Also unifies use of SMALL_INT_FITS macro across parser and runtime.
Diffstat (limited to 'py/parse.h')
-rw-r--r--py/parse.h7
1 files changed, 0 insertions, 7 deletions
diff --git a/py/parse.h b/py/parse.h
index 43c74e73b..6950139e7 100644
--- a/py/parse.h
+++ b/py/parse.h
@@ -37,13 +37,6 @@ struct _mp_lexer_t;
// - xx...x10010: a string of bytes; bits 5 and above are the qstr holding the value
// - xx...x10110: a token; bits 5 and above are mp_token_kind_t
-// TODO: these can now be unified with MP_OBJ_FITS_SMALL_INT(x)
-// makes sure the top 2 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_2_BITS (~((~((machine_uint_t)0)) >> 2))
-// parser's small ints are different from VM small int
-#define MP_PARSE_FITS_SMALL_INT(x) (((((machine_uint_t)(x)) & MP_UINT_HIGH_2_BITS) == 0) || ((((machine_uint_t)(x)) & MP_UINT_HIGH_2_BITS) == MP_UINT_HIGH_2_BITS))
-
#define MP_PARSE_NODE_NULL (0)
#define MP_PARSE_NODE_SMALL_INT (0x1)
#define MP_PARSE_NODE_ID (0x02)