fix print lu format warnings with clang
This commit is contained in:
@@ -420,5 +420,5 @@ static void print_utf16(uint16_t *temp_buf, size_t buf_len) {
|
||||
_convert_utf16le_to_utf8(temp_buf + 1, utf16_len, (uint8_t *) temp_buf, sizeof(uint16_t) * buf_len);
|
||||
((uint8_t*) temp_buf)[utf8_len] = '\0';
|
||||
|
||||
printf((char*)temp_buf);
|
||||
printf("%s", (char*)temp_buf);
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ void tuh_cdc_rx_cb(uint8_t idx) {
|
||||
uint32_t count = tuh_cdc_read(idx, buf, bufsize);
|
||||
buf[count] = 0;
|
||||
|
||||
printf((char *) buf);
|
||||
printf("%s", (char *) buf);
|
||||
}
|
||||
|
||||
void tuh_cdc_mount_cb(uint8_t idx) {
|
||||
@@ -131,7 +131,7 @@ void tuh_cdc_mount_cb(uint8_t idx) {
|
||||
// otherwise you need to call tuh_cdc_set_line_coding() first
|
||||
cdc_line_coding_t line_coding = { 0 };
|
||||
if (tuh_cdc_get_local_line_coding(idx, &line_coding)) {
|
||||
printf(" Baudrate: %lu, Stop Bits : %u\r\n", line_coding.bit_rate, line_coding.stop_bits);
|
||||
printf(" Baudrate: %" PRIu32 ", Stop Bits : %u\r\n", line_coding.bit_rate, line_coding.stop_bits);
|
||||
printf(" Parity : %u, Data Width: %u\r\n", line_coding.parity, line_coding.data_bits);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -47,8 +47,8 @@ bool inquiry_complete_cb(uint8_t dev_addr, tuh_msc_complete_data_t const *cb_dat
|
||||
uint32_t const block_count = tuh_msc_get_block_count(dev_addr, cbw->lun);
|
||||
uint32_t const block_size = tuh_msc_get_block_size(dev_addr, cbw->lun);
|
||||
|
||||
printf("Disk Size: %lu MB\r\n", block_count / ((1024 * 1024) / block_size));
|
||||
printf("Block Count = %lu, Block Size: %lu\r\n", block_count, block_size);
|
||||
printf("Disk Size: %" PRIu32 " MB\r\n", block_count / ((1024 * 1024) / block_size));
|
||||
printf("Block Count = %" PRIu32 ", Block Size: %" PRIu32 "\r\n", block_count, block_size);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ bool inquiry_complete_cb(uint8_t dev_addr, tuh_msc_complete_data_t const * cb_da
|
||||
uint32_t const block_count = tuh_msc_get_block_count(dev_addr, cbw->lun);
|
||||
uint32_t const block_size = tuh_msc_get_block_size(dev_addr, cbw->lun);
|
||||
|
||||
printf("Disk Size: %lu MB\r\n", block_count / ((1024*1024)/block_size));
|
||||
printf("Disk Size: %" PRIu32 " MB\r\n", block_count / ((1024*1024)/block_size));
|
||||
// printf("Block Count = %lu, Block Size: %lu\r\n", block_count, block_size);
|
||||
|
||||
// For simplicity: we only mount 1 LUN per device
|
||||
@@ -541,10 +541,10 @@ void cli_cmd_ls(EmbeddedCli *cli, char *args, void *context)
|
||||
printf("%-40s", fno.fname);
|
||||
if (fno.fsize < 1024)
|
||||
{
|
||||
printf("%lu B\r\n", fno.fsize);
|
||||
printf("%" PRIu32 " B\r\n", fno.fsize);
|
||||
}else
|
||||
{
|
||||
printf("%lu KB\r\n", fno.fsize / 1024);
|
||||
printf("%" PRIu32 " KB\r\n", fno.fsize / 1024);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user