summaryrefslogtreecommitdiffstatshomepage
path: root/py/obj.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-01-16 17:47:07 +0000
committerDamien George <damien.p.george@gmail.com>2015-01-16 17:47:07 +0000
commit963a5a3e82ded7ee75adae72ae7cb14796fa150e (patch)
tree78402c85b98c1c8f1889d7af7dc6f4828a8f55a5 /py/obj.h
parentf12ea7c7ed1ef97ee48c4356dbbc808cc2bdee4a (diff)
downloadmicropython-963a5a3e82ded7ee75adae72ae7cb14796fa150e.tar.gz
micropython-963a5a3e82ded7ee75adae72ae7cb14796fa150e.zip
py, unix: Allow to compile with -Wsign-compare.
See issue #699.
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 6caf50d842..0424048599 100644
--- a/py/obj.h
+++ b/py/obj.h
@@ -86,7 +86,7 @@ typedef struct _mp_obj_base_t mp_obj_base_t;
#define MP_OBJ_SMALL_INT_VALUE(o) (((mp_int_t)(o)) >> 1)
#define MP_OBJ_NEW_SMALL_INT(small_int) ((mp_obj_t)((((mp_int_t)(small_int)) << 1) | 1))
-#define MP_OBJ_QSTR_VALUE(o) (((mp_int_t)(o)) >> 2)
+#define MP_OBJ_QSTR_VALUE(o) (((mp_uint_t)(o)) >> 2)
#define MP_OBJ_NEW_QSTR(qst) ((mp_obj_t)((((mp_uint_t)(qst)) << 2) | 2))
// These macros are used to declare and define constant function objects
@@ -247,7 +247,7 @@ bool mp_get_buffer(mp_obj_t obj, mp_buffer_info_t *bufinfo, mp_uint_t flags);
void mp_get_buffer_raise(mp_obj_t obj, mp_buffer_info_t *bufinfo, mp_uint_t flags);
// Stream protocol
-#define MP_STREAM_ERROR (-1)
+#define MP_STREAM_ERROR ((mp_uint_t)-1)
typedef struct _mp_stream_p_t {
// On error, functions should return MP_STREAM_ERROR and fill in *errcode (values
// are implementation-dependent, but will be exposed to user, e.g. via exception).