fix warnings: missing cast, unreachable code

This commit is contained in:
Matthias Ringwald 2018-10-05 10:53:00 +02:00
parent 5078863bb5
commit 4395a00033
4 changed files with 12 additions and 10 deletions

View File

@ -548,9 +548,10 @@ static void att_server_handle_can_send_now(void){
hci_con_handle_t request_con_handle = HCI_CON_HANDLE_INVALID;
hci_con_handle_t last_send_con_handle = HCI_CON_HANDLE_INVALID;
int can_send_now = 1;
int phase;
int phase_index;
for (phase = ATT_SERVER_RUN_PHASE_1_REQUESTS; phase <= ATT_SERVER_RUN_PHASE_3_NOTIFICATIONS; phase++){
for (phase_index = ATT_SERVER_RUN_PHASE_1_REQUESTS; phase_index <= ATT_SERVER_RUN_PHASE_3_NOTIFICATIONS; phase_index++){
att_server_run_phase_t phase = (att_server_run_phase_t) phase_index;
hci_con_handle_t skip_connections_until = att_server_last_can_send_now;
while (1){
btstack_linked_list_iterator_t it;

View File

@ -3184,7 +3184,6 @@ static int sm_validate_stk_generation_method(void){
return (sm_accepted_stk_generation_methods & SM_STK_GENERATION_METHOD_OOB) != 0;
case NUMERIC_COMPARISON:
return (sm_accepted_stk_generation_methods & SM_STK_GENERATION_METHOD_NUMERIC_COMPARISON) != 0;
return 1;
default:
return 0;
}

View File

@ -671,11 +671,13 @@ static void btstack_crypto_run(void){
btstack_crypto_wait_for_hci_result = 1;
hci_send_cmd(&hci_le_generate_dhkey, &btstack_crypto_ec_p192->public_key[0], &btstack_crypto_ec_p192->public_key[32]);
#endif
#endif
break;
default:
break;
}
break;
#endif /* ENABLE_ECC_P256 */
default:
break;
}
}
static void btstack_crypto_handle_random_data(const uint8_t * data, uint16_t len){

View File

@ -113,9 +113,9 @@ uint8_t btstack_slip_encoder_get_byte(void){
encoder_state = SLIP_ENCODER_SEND_DD;
return 0xdb;
default:
return next_byte;
break;
}
break;
return next_byte;
case SLIP_ENCODER_SEND_DC:
encoder_state = SLIP_ENCODER_DEFAULT;
return 0x0dc;