mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 20:20:14 +01:00
4
py/obj.h
4
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).
|
||||
|
||||
Reference in New Issue
Block a user