@@ -171,13 +171,13 @@ static void pairheap_test(size_t nops, int *ops) {
171
171
if (mp_pairheap_is_empty (pairheap_lt , heap )) {
172
172
mp_printf (& mp_plat_print , " -" );
173
173
} else {
174
- mp_printf (& mp_plat_print , " %d" , mp_pairheap_peek (pairheap_lt , heap ) - & node [0 ]);
174
+ mp_printf (& mp_plat_print , " %d" , ( int )( mp_pairheap_peek (pairheap_lt , heap ) - & node [0 ]) );
175
175
;
176
176
}
177
177
}
178
178
mp_printf (& mp_plat_print , "\npop all:" );
179
179
while (!mp_pairheap_is_empty (pairheap_lt , heap )) {
180
- mp_printf (& mp_plat_print , " %d" , mp_pairheap_peek (pairheap_lt , heap ) - & node [0 ]);
180
+ mp_printf (& mp_plat_print , " %d" , ( int )( mp_pairheap_peek (pairheap_lt , heap ) - & node [0 ]) );
181
181
;
182
182
heap = mp_pairheap_pop (pairheap_lt , heap );
183
183
}
@@ -274,7 +274,7 @@ static mp_obj_t extra_coverage(void) {
274
274
mp_printf (& mp_plat_print , "%p\n" , gc_realloc (p , 0 , false));
275
275
276
276
// calling gc_nbytes with a non-heap pointer
277
- mp_printf (& mp_plat_print , "%p \n" , gc_nbytes (NULL ));
277
+ mp_printf (& mp_plat_print , "%d \n" , ( int ) gc_nbytes (NULL ));
278
278
}
279
279
280
280
// GC initialisation and allocation stress test, to check the logic behind ALLOC_TABLE_GAP_BYTE
@@ -335,7 +335,7 @@ static mp_obj_t extra_coverage(void) {
335
335
}
336
336
ptrs [i ][j ] = j ;
337
337
}
338
- mp_printf (& mp_plat_print , "%d %d\n" , i , all_zero );
338
+ mp_printf (& mp_plat_print , "%d %d\n" , ( int ) i , ( int ) all_zero );
339
339
340
340
// hide the pointer from the GC and collect
341
341
ptrs [i ] = FLIP_POINTER (ptrs [i ]);
@@ -351,7 +351,7 @@ static mp_obj_t extra_coverage(void) {
351
351
break ;
352
352
}
353
353
}
354
- mp_printf (& mp_plat_print , "%d %d\n" , i , correct_contents );
354
+ mp_printf (& mp_plat_print , "%d %d\n" , ( int ) i , ( int ) correct_contents );
355
355
}
356
356
357
357
// free the memory blocks
@@ -449,7 +449,7 @@ static mp_obj_t extra_coverage(void) {
449
449
// create a bytearray via mp_obj_new_bytearray
450
450
mp_buffer_info_t bufinfo ;
451
451
mp_get_buffer_raise (mp_obj_new_bytearray (4 , "data" ), & bufinfo , MP_BUFFER_RW );
452
- mp_printf (& mp_plat_print , "%.*s\n" , bufinfo .len , bufinfo .buf );
452
+ mp_printf (& mp_plat_print , "%.*s\n" , ( int ) bufinfo .len , bufinfo .buf );
453
453
}
454
454
455
455
// mpz
@@ -516,11 +516,11 @@ static mp_obj_t extra_coverage(void) {
516
516
517
517
// hash the zero mpz integer
518
518
mpz_set_from_int (& mpz , 0 );
519
- mp_printf (& mp_plat_print , "%d\n" , mpz_hash (& mpz ));
519
+ mp_printf (& mp_plat_print , "%d\n" , ( int ) mpz_hash (& mpz ));
520
520
521
521
// convert the mpz zero integer to int
522
522
mp_printf (& mp_plat_print , "%d\n" , mpz_as_int_checked (& mpz , & value_signed ));
523
- mp_printf (& mp_plat_print , "%d\n" , value_signed );
523
+ mp_printf (& mp_plat_print , "%d\n" , ( int ) value_signed );
524
524
525
525
// mpz_set_from_float with 0 as argument
526
526
mpz_set_from_float (& mpz , 0 );
@@ -562,7 +562,7 @@ static mp_obj_t extra_coverage(void) {
562
562
mp_call_function_2_protected (MP_OBJ_FROM_PTR (& mp_builtin_divmod_obj ), mp_obj_new_str_from_cstr ("abc" ), mp_obj_new_str_from_cstr ("abc" ));
563
563
564
564
// mp_obj_int_get_checked with mp_obj_int_t that has a value that is a small integer
565
- mp_printf (& mp_plat_print , "%d\n" , mp_obj_int_get_checked (MP_OBJ_FROM_PTR (mp_obj_int_new_mpz ())));
565
+ mp_printf (& mp_plat_print , "%d\n" , ( int ) mp_obj_int_get_checked (MP_OBJ_FROM_PTR (mp_obj_int_new_mpz ())));
566
566
567
567
// mp_obj_int_get_uint_checked with non-negative small-int
568
568
mp_printf (& mp_plat_print , "%d\n" , (int )mp_obj_int_get_uint_checked (MP_OBJ_NEW_SMALL_INT (1 )));
@@ -674,7 +674,7 @@ static mp_obj_t extra_coverage(void) {
674
674
#endif
675
675
676
676
mp_vm_return_kind_t ret = mp_execute_bytecode (code_state , MP_OBJ_NULL );
677
- mp_printf (& mp_plat_print , "%d %d\n" , ret , mp_obj_get_type (code_state -> state [0 ]) == & mp_type_NotImplementedError );
677
+ mp_printf (& mp_plat_print , "%d %d\n" , ( int ) ret , mp_obj_get_type (code_state -> state [0 ]) == & mp_type_NotImplementedError );
678
678
}
679
679
680
680
// scheduler
@@ -754,36 +754,36 @@ static mp_obj_t extra_coverage(void) {
754
754
mp_printf (& mp_plat_print , "# ringbuf\n" );
755
755
756
756
// Single-byte put/get with empty ringbuf.
757
- mp_printf (& mp_plat_print , "%d %d\n" , ringbuf_free (& ringbuf ), ringbuf_avail (& ringbuf ));
757
+ mp_printf (& mp_plat_print , "%d %d\n" , ( int ) ringbuf_free (& ringbuf ), ( int ) ringbuf_avail (& ringbuf ));
758
758
ringbuf_put (& ringbuf , 22 );
759
- mp_printf (& mp_plat_print , "%d %d\n" , ringbuf_free (& ringbuf ), ringbuf_avail (& ringbuf ));
759
+ mp_printf (& mp_plat_print , "%d %d\n" , ( int ) ringbuf_free (& ringbuf ), ( int ) ringbuf_avail (& ringbuf ));
760
760
mp_printf (& mp_plat_print , "%d\n" , ringbuf_get (& ringbuf ));
761
- mp_printf (& mp_plat_print , "%d %d\n" , ringbuf_free (& ringbuf ), ringbuf_avail (& ringbuf ));
761
+ mp_printf (& mp_plat_print , "%d %d\n" , ( int ) ringbuf_free (& ringbuf ), ( int ) ringbuf_avail (& ringbuf ));
762
762
763
763
// Two-byte put/get with empty ringbuf.
764
764
ringbuf_put16 (& ringbuf , 0xaa55 );
765
- mp_printf (& mp_plat_print , "%d %d\n" , ringbuf_free (& ringbuf ), ringbuf_avail (& ringbuf ));
765
+ mp_printf (& mp_plat_print , "%d %d\n" , ( int ) ringbuf_free (& ringbuf ), ( int ) ringbuf_avail (& ringbuf ));
766
766
mp_printf (& mp_plat_print , "%04x\n" , ringbuf_get16 (& ringbuf ));
767
- mp_printf (& mp_plat_print , "%d %d\n" , ringbuf_free (& ringbuf ), ringbuf_avail (& ringbuf ));
767
+ mp_printf (& mp_plat_print , "%d %d\n" , ( int ) ringbuf_free (& ringbuf ), ( int ) ringbuf_avail (& ringbuf ));
768
768
769
769
// Two-byte put with full ringbuf.
770
770
for (int i = 0 ; i < 99 ; ++ i ) {
771
771
ringbuf_put (& ringbuf , i );
772
772
}
773
- mp_printf (& mp_plat_print , "%d %d\n" , ringbuf_free (& ringbuf ), ringbuf_avail (& ringbuf ));
773
+ mp_printf (& mp_plat_print , "%d %d\n" , ( int ) ringbuf_free (& ringbuf ), ( int ) ringbuf_avail (& ringbuf ));
774
774
mp_printf (& mp_plat_print , "%d\n" , ringbuf_put16 (& ringbuf , 0x11bb ));
775
775
// Two-byte put with one byte free.
776
776
ringbuf_get (& ringbuf );
777
- mp_printf (& mp_plat_print , "%d %d\n" , ringbuf_free (& ringbuf ), ringbuf_avail (& ringbuf ));
777
+ mp_printf (& mp_plat_print , "%d %d\n" , ( int ) ringbuf_free (& ringbuf ), ( int ) ringbuf_avail (& ringbuf ));
778
778
mp_printf (& mp_plat_print , "%d\n" , ringbuf_put16 (& ringbuf , 0x3377 ));
779
779
ringbuf_get (& ringbuf );
780
- mp_printf (& mp_plat_print , "%d %d\n" , ringbuf_free (& ringbuf ), ringbuf_avail (& ringbuf ));
780
+ mp_printf (& mp_plat_print , "%d %d\n" , ( int ) ringbuf_free (& ringbuf ), ( int ) ringbuf_avail (& ringbuf ));
781
781
mp_printf (& mp_plat_print , "%d\n" , ringbuf_put16 (& ringbuf , 0xcc99 ));
782
782
for (int i = 0 ; i < 97 ; ++ i ) {
783
783
ringbuf_get (& ringbuf );
784
784
}
785
785
mp_printf (& mp_plat_print , "%04x\n" , ringbuf_get16 (& ringbuf ));
786
- mp_printf (& mp_plat_print , "%d %d\n" , ringbuf_free (& ringbuf ), ringbuf_avail (& ringbuf ));
786
+ mp_printf (& mp_plat_print , "%d %d\n" , ( int ) ringbuf_free (& ringbuf ), ( int ) ringbuf_avail (& ringbuf ));
787
787
788
788
// Two-byte put with wrap around on first byte:
789
789
ringbuf .iput = 0 ;
0 commit comments