fix warnings for log_info/printf

This commit is contained in:
Matthias Ringwald 2020-11-30 14:26:45 +01:00
parent e883851f1d
commit 97d2cfbc6f
6 changed files with 17 additions and 15 deletions

View File

@ -208,7 +208,7 @@ static void btstack_tlv_flash_bank_write_header(btstack_tlv_flash_bank_t * self,
* @brief Check if erased from offset
*/
static int btstack_tlv_flash_bank_test_erased(btstack_tlv_flash_bank_t * self, int bank, uint32_t offset){
log_info("test erased: bank %u, offset %u", bank, offset);
log_info("test erased: bank %u, offset %u", bank, (unsigned int) offset);
uint32_t size = self->hal_flash_bank_impl->get_size(self->hal_flash_bank_context);
uint8_t buffer[16];
uint8_t empty16[16];
@ -217,7 +217,7 @@ static int btstack_tlv_flash_bank_test_erased(btstack_tlv_flash_bank_t * self, i
uint32_t copy_size = (offset + sizeof(empty16) < size) ? sizeof(empty16) : (size - offset);
btstack_tlv_flash_bank_read(self, bank, offset, buffer, copy_size);
if (memcmp(buffer, empty16, copy_size)) {
log_info("not erased %x - %x", offset, offset + copy_size);
log_info("not erased %x - %x", (unsigned int) offset, (unsigned int) (offset + copy_size));
return 0;
}
offset += copy_size;
@ -253,7 +253,8 @@ static void btstack_tlv_flash_bank_migrate(btstack_tlv_flash_bank_t * self){
uint32_t tag_len = it.len;
uint32_t tag_index = it.offset;
log_info("migrate pos %u, tag '%x' len %u -> new pos %u", tag_index, it.tag, tag_len, next_write_pos);
log_info("migrate pos %u, tag '%x' len %u -> new pos %u",
(unsigned int) tag_index, (unsigned int) it.tag, (unsigned int) tag_len, next_write_pos);
// copy header
uint8_t header_buffer[8];
@ -295,7 +296,7 @@ static void btstack_tlv_flash_bank_delete_tag_until_offset(btstack_tlv_flash_ban
btstack_tlv_flash_bank_iterator_init(self, &it, self->current_bank);
while (btstack_tlv_flash_bank_iterator_has_next(self, &it) && it.offset < offset){
if (it.tag == tag){
log_info("Erase tag '%x' at position %u", tag, it.offset);
log_info("Erase tag '%x' at position %u", (unsigned int) tag, (unsigned int) it.offset);
// mark entry as invalid
uint32_t zero_value = 0;
@ -329,7 +330,7 @@ static int btstack_tlv_flash_bank_get_tag(void * context, uint32_t tag, uint8_t
btstack_tlv_flash_bank_iterator_init(self, &it, self->current_bank);
while (btstack_tlv_flash_bank_iterator_has_next(self, &it)){
if (it.tag == tag){
log_info("Found tag '%x' at position %u", tag, it.offset);
log_info("Found tag '%x' at position %u", (unsigned int) tag, (unsigned int) it.offset);
tag_index = it.offset;
tag_len = it.len;
break;
@ -374,7 +375,7 @@ static int btstack_tlv_flash_bank_store_tag(void * context, uint32_t tag, const
big_endian_store_32(entry, 0, tag);
big_endian_store_32(entry, 4, data_size);
log_info("write '%x', len %u at %u", tag, data_size, self->write_offset);
log_info("write '%x', len %u at %u", (unsigned int) tag, (unsigned int) data_size, self->write_offset);
uint32_t value_offset = self->write_offset + 8;
#ifdef ENABLE_TLV_FLASH_EXPLICIT_DELETE_FIELD

View File

@ -156,7 +156,7 @@ static void le_device_db_tlv_scan(void){
entry_map[i] = 1;
num_valid_entries++;
}
log_info("num valid le device entries %u", num_valid_entries);
log_info("num valid le device entries %u", (unsigned int) num_valid_entries);
}
void le_device_db_init(void){
@ -242,7 +242,7 @@ int le_device_db_add(int addr_type, bd_addr_t addr, sm_key_t irk){
return -1;
}
log_info("new entry for index %u", index_to_use);
log_info("new entry for index %u", (unsigned int) index_to_use);
// store entry at index
le_device_db_entry_t entry;
@ -460,7 +460,7 @@ void le_device_db_dump(void){
// fetch entry
le_device_db_entry_t entry;
le_device_db_tlv_fetch(i, &entry);
log_info("%u: %u %s", i, entry.addr_type, bd_addr_to_str(entry.addr));
log_info("%u: %u %s", (unsigned int) i, entry.addr_type, bd_addr_to_str(entry.addr));
log_info_key("irk", entry.irk);
#ifdef ENABLE_LE_SIGNED_WRITE
log_info_key("local csrk", entry.local_csrk);

View File

@ -92,7 +92,7 @@ static int btstack_link_key_db_tlv_get_link_key(bd_addr_t bd_addr, link_key_t li
uint32_t tag = btstack_link_key_db_tag_for_index(i);
int size = self->btstack_tlv_impl->get_tag(self->btstack_tlv_context, tag, (uint8_t*) &entry, sizeof(entry));
if (size == 0) continue;
log_info("tag %x, addr %s", tag, bd_addr_to_str(entry.bd_addr));
log_info("tag %x, addr %s", (unsigned int) tag, bd_addr_to_str(entry.bd_addr));
if (memcmp(bd_addr, entry.bd_addr, 6)) continue;
// found, pass back
(void)memcpy(link_key, entry.link_key, 16);
@ -148,7 +148,8 @@ static void btstack_link_key_db_tlv_put_link_key(bd_addr_t bd_addr, link_key_t l
}
}
log_info("tag_for_addr %x, tag_for_empy %x, tag_for_lowest_seq_nr %x", tag_for_addr, tag_for_empty, tag_for_lowest_seq_nr);
log_info("tag_for_addr %x, tag_for_empy %x, tag_for_lowest_seq_nr %x",
(unsigned int) tag_for_addr, (unsigned int) tag_for_empty, (unsigned int) tag_for_lowest_seq_nr);
uint32_t tag_to_use = 0;
if (tag_for_addr){
@ -162,7 +163,7 @@ static void btstack_link_key_db_tlv_put_link_key(bd_addr_t bd_addr, link_key_t l
return;
}
log_info("store with tag %x", tag_to_use);
log_info("store with tag %x", (unsigned int) tag_to_use);
link_key_nvm_t entry;

View File

@ -349,7 +349,7 @@ static void btstack_sbc_decoder_insert_missing_frames(btstack_sbc_decoder_state_
}
if (bytes_in_frame_buffer){
log_error("PLC: not all bytes of zero frame processed, left %u\n", bytes_in_frame_buffer);
log_error("PLC: not all bytes of zero frame processed, left %u\n", (unsigned int) bytes_in_frame_buffer);
}
if (plc_enabled) {

View File

@ -308,7 +308,7 @@ static void goep_client_handle_sdp_query_event(uint8_t packet_type, uint16_t cha
if (de_get_element_type(attribute_value) != DE_UINT) break;
if (de_get_size_type(attribute_value) != DE_SIZE_32) break;
context->pbap_supported_features = big_endian_read_32(attribute_value, de_get_header_size(attribute_value));
log_info("pbap_supported_features 0x%x", context->pbap_supported_features);
log_info("pbap_supported_features 0x%x", (unsigned int) context->pbap_supported_features);
break;
default:
break;

View File

@ -1394,7 +1394,7 @@ static void parse_sequence(hfp_connection_t * hfp_connection){
case HFP_CMD_SUPPORT_CALL_HOLD_AND_MULTIPARTY_SERVICES:
log_info("Parsed Support call hold: %s\n", hfp_connection->line_buffer);
if (hfp_connection->line_size > 2 ) break;
strncpy((char *)hfp_connection->remote_call_services[hfp_connection->remote_call_services_index].name, (char *)hfp_connection->line_buffer, HFP_CALL_SERVICE_SIZE);
memcpy((char *)hfp_connection->remote_call_services[hfp_connection->remote_call_services_index].name, (char *)hfp_connection->line_buffer, HFP_CALL_SERVICE_SIZE-1);
hfp_connection->remote_call_services[hfp_connection->remote_call_services_index].name[HFP_CALL_SERVICE_SIZE - 1] = 0;
hfp_next_remote_call_services_index(hfp_connection);
break;