@@ -212,8 +212,8 @@ typedef struct _mp_buffer_info_t {
212
212
//int ver; // ?
213
213
214
214
void * buf ; // can be NULL if len == 0
215
- mp_int_t len ; // in bytes
216
- int typecode ; // as per binary.h
215
+ mp_int_t len ; // in bytes; TODO should it be mp_uint_t?
216
+ int typecode ; // as per binary.h; TODO what is the correct type to use?
217
217
218
218
// Rationale: to load arbitrary-sized sprites directly to LCD
219
219
// Cons: a bit adhoc usecase
@@ -223,10 +223,10 @@ typedef struct _mp_buffer_info_t {
223
223
#define MP_BUFFER_WRITE (2)
224
224
#define MP_BUFFER_RW (MP_BUFFER_READ | MP_BUFFER_WRITE)
225
225
typedef struct _mp_buffer_p_t {
226
- mp_int_t (* get_buffer )(mp_obj_t obj , mp_buffer_info_t * bufinfo , int flags );
226
+ mp_int_t (* get_buffer )(mp_obj_t obj , mp_buffer_info_t * bufinfo , mp_uint_t flags );
227
227
} mp_buffer_p_t ;
228
- bool mp_get_buffer (mp_obj_t obj , mp_buffer_info_t * bufinfo , int flags );
229
- void mp_get_buffer_raise (mp_obj_t obj , mp_buffer_info_t * bufinfo , int flags );
228
+ bool mp_get_buffer (mp_obj_t obj , mp_buffer_info_t * bufinfo , mp_uint_t flags );
229
+ void mp_get_buffer_raise (mp_obj_t obj , mp_buffer_info_t * bufinfo , mp_uint_t flags );
230
230
231
231
// Stream protocol
232
232
#define MP_STREAM_ERROR (-1)
@@ -236,7 +236,7 @@ typedef struct _mp_stream_p_t {
236
236
mp_uint_t (* read )(mp_obj_t obj , void * buf , mp_uint_t size , int * errcode );
237
237
mp_uint_t (* write )(mp_obj_t obj , const void * buf , mp_uint_t size , int * errcode );
238
238
// add seek() ?
239
- int is_text : 1 ; // default is bytes, set this for text stream
239
+ mp_uint_t is_text : 1 ; // default is bytes, set this for text stream
240
240
} mp_stream_p_t ;
241
241
242
242
struct _mp_obj_type_t {
@@ -403,7 +403,7 @@ void mp_obj_print_helper(void (*print)(void *env, const char *fmt, ...), void *e
403
403
void mp_obj_print (mp_obj_t o , mp_print_kind_t kind );
404
404
void mp_obj_print_exception (mp_obj_t exc );
405
405
406
- int mp_obj_is_true (mp_obj_t arg );
406
+ bool mp_obj_is_true (mp_obj_t arg );
407
407
408
408
// TODO make these all lower case when they have proven themselves
409
409
static inline bool MP_OBJ_IS_OBJ (mp_const_obj_t o ) { return ((((mp_int_t )(o )) & 3 ) == 0 ); }
@@ -575,8 +575,8 @@ bool mp_seq_get_fast_slice_indexes(mp_uint_t len, mp_obj_t slice, mp_bound_slice
575
575
#endif
576
576
#define mp_seq_copy (dest , src , len , item_t ) memcpy(dest, src, len * sizeof(item_t))
577
577
#define mp_seq_cat (dest , src1 , len1 , src2 , len2 , item_t ) { memcpy(dest, src1, (len1) * sizeof(item_t)); memcpy(dest + (len1), src2, (len2) * sizeof(item_t)); }
578
- bool mp_seq_cmp_bytes (int op , const byte * data1 , mp_uint_t len1 , const byte * data2 , mp_uint_t len2 );
579
- bool mp_seq_cmp_objs (int op , const mp_obj_t * items1 , mp_uint_t len1 , const mp_obj_t * items2 , mp_uint_t len2 );
578
+ bool mp_seq_cmp_bytes (mp_uint_t op , const byte * data1 , mp_uint_t len1 , const byte * data2 , mp_uint_t len2 );
579
+ bool mp_seq_cmp_objs (mp_uint_t op , const mp_obj_t * items1 , mp_uint_t len1 , const mp_obj_t * items2 , mp_uint_t len2 );
580
580
mp_obj_t mp_seq_index_obj (const mp_obj_t * items , mp_uint_t len , mp_uint_t n_args , const mp_obj_t * args );
581
581
mp_obj_t mp_seq_count_obj (const mp_obj_t * items , mp_uint_t len , mp_obj_t value );
582
582
mp_obj_t mp_seq_extract_slice (mp_uint_t len , const mp_obj_t * seq , mp_bound_slice_t * indexes );
0 commit comments