diff --git a/src/platforms/hosted/ftdi_bmp.c b/src/platforms/hosted/ftdi_bmp.c index 6851ecf..67938f3 100644 --- a/src/platforms/hosted/ftdi_bmp.c +++ b/src/platforms/hosted/ftdi_bmp.c @@ -588,11 +588,12 @@ static struct ftdi_transfer_control *tc_write = NULL; bufptr = 0; } -int libftdi_buffer_write(const uint8_t *data, int size) +size_t libftdi_buffer_write(const uint8_t *data, size_t size) { - if((bufptr + size) / BUF_SIZE > 0) libftdi_buffer_flush(); + if ((bufptr + size) / BUF_SIZE > 0) + libftdi_buffer_flush(); DEBUG_WIRE("Write %d bytes:", size); - for (int i = 0; i < size; i++) { + for (size_t i = 0; i < size; i++) { DEBUG_WIRE(" %02x", data[i]); if (i && (i & 0xf) == 0xf) DEBUG_WIRE("\n\t"); diff --git a/src/platforms/hosted/ftdi_bmp.h b/src/platforms/hosted/ftdi_bmp.h index 6e80ae9..79563fd 100644 --- a/src/platforms/hosted/ftdi_bmp.h +++ b/src/platforms/hosted/ftdi_bmp.h @@ -106,7 +106,7 @@ int ftdi_bmp_init(BMP_CL_OPTIONS_t *cl_opts, bmp_info_t *info) { return -1; } int libftdi_swdptap_init(ADIv5_DP_t *dp) { return -1; } int libftdi_jtagtap_init(jtag_proc_t *jtag_proc) { return 0; } void libftdi_buffer_flush(void) { } -int libftdi_buffer_write(const uint8_t *data, int size) { return size; } +size_t libftdi_buffer_write(const uint8_t *data, size_t size) { return size; } int libftdi_buffer_read(uint8_t *data, int size) { return size; } const char *libftdi_target_voltage(void) { return "ERROR"; } void libftdi_jtagtap_tdi_tdo_seq(uint8_t *const data_out, const bool final_tms, @@ -128,7 +128,7 @@ int ftdi_bmp_init(BMP_CL_OPTIONS_t *cl_opts, bmp_info_t *info); int libftdi_swdptap_init(ADIv5_DP_t *dp); int libftdi_jtagtap_init(jtag_proc_t *jtag_proc); void libftdi_buffer_flush(void); -int libftdi_buffer_write(const uint8_t *data, int size); +size_t libftdi_buffer_write(const uint8_t *data, size_t size); int libftdi_buffer_read(uint8_t *data, int size); const char *libftdi_target_voltage(void); void libftdi_jtagtap_tdi_tdo_seq(uint8_t *data_out, bool final_tms, const uint8_t *data_in, size_t ticks);