Skip to content

Commit e20028a

Browse files
author
Arto Kinnunen
authored
Fix compiler warnings (ARMmbed#1957)
1 parent ce72b55 commit e20028a

File tree

7 files changed

+28
-21
lines changed

7 files changed

+28
-21
lines changed

source/6LoWPAN/Thread/thread_extension.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ static int thread_extension_reset_req_cb(int8_t service_id, uint8_t source_addre
242242

243243
if ((session_id != thread_info(cur)->registered_commissioner.session_id) /*|| (signature_ptr == NULL)*/) { // todo: signature may not come in this early phase of implementors
244244
tr_debug("Request parse failed");
245-
ptr = thread_meshcop_tlv_data_write_uint8(ptr, MESHCOP_TLV_STATE, -1);
245+
ptr = thread_meshcop_tlv_data_write_uint8(ptr, MESHCOP_TLV_STATE, 0xff);
246246
}
247247

248248
// Downgrade if router
@@ -289,7 +289,7 @@ static int thread_extension_reenroll_req_cb(int8_t service_id, uint8_t source_ad
289289
if ((session_id != thread_info(cur)->registered_commissioner.session_id) ||/* (signature_ptr == NULL) || */
290290
thread_extension_primary_bbr_get(cur, pbbr_addr, NULL, NULL, NULL)) {
291291
tr_debug("Request parse failed");
292-
ptr = thread_meshcop_tlv_data_write_uint8(ptr, MESHCOP_TLV_STATE, -1);
292+
ptr = thread_meshcop_tlv_data_write_uint8(ptr, MESHCOP_TLV_STATE, 0xff);
293293
goto send_response;
294294
}
295295

source/6LoWPAN/Thread/thread_extension_bbr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ static int thread_pbbr_sec_data_set_recv_cb(int8_t service_id, uint8_t source_ad
392392
uint8_t *ptr = response;
393393

394394
// This is not yet supported, thus return state TLV rejected
395-
ptr = thread_meshcop_tlv_data_write_uint8(response, MESHCOP_TLV_STATE, -1);
395+
ptr = thread_meshcop_tlv_data_write_uint8(response, MESHCOP_TLV_STATE, 0xff);
396396

397397
coap_service_response_send(service_id, COAP_REQUEST_OPTIONS_NONE, request_ptr, COAP_MSG_CODE_RESPONSE_CHANGED, COAP_CT_OCTET_STREAM, response, ptr - response);
398398

source/6LoWPAN/Thread/thread_router_bootstrap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1949,9 +1949,9 @@ void thread_router_bootstrap_mle_receive_cb(int8_t interface_id, mle_message_t *
19491949
uint32_t timeout = 0;
19501950
uint64_t active_timestamp = 0;
19511951
uint64_t pending_timestamp = 0;
1952-
mle_tlv_info_t addressRegisterTlv = {0};
1953-
mle_tlv_info_t challengeTlv = {0};
1954-
mle_tlv_info_t tlv_req = {0};
1952+
mle_tlv_info_t addressRegisterTlv = {MLE_TYPE_SRC_ADDRESS, 0, 0};
1953+
mle_tlv_info_t challengeTlv = {MLE_TYPE_SRC_ADDRESS, 0, 0};
1954+
mle_tlv_info_t tlv_req = {MLE_TYPE_SRC_ADDRESS, 0, 0};
19551955
entry_temp = mac_neighbor_entry_get_by_ll64(mac_neighbor_info(cur), mle_msg->packet_src_address, false, NULL);
19561956

19571957
if (mle_tlv_read_8_bit_tlv(MLE_TYPE_STATUS, mle_msg->data_ptr, mle_msg->data_length, &status)) {

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,8 @@ static int8_t ws_fhss_initialize(protocol_interface_info_entry_t *cur)
356356
}
357357

358358
fhss_configuration.fhss_uc_dwell_interval = cur->ws_info->fhss_uc_dwell_interval;
359-
fhss_configuration.ws_uc_channel_function = cur->ws_info->fhss_uc_channel_function;
360-
fhss_configuration.ws_bc_channel_function = cur->ws_info->fhss_bc_channel_function;
359+
fhss_configuration.ws_uc_channel_function = (fhss_ws_channel_functions)cur->ws_info->fhss_uc_channel_function;
360+
fhss_configuration.ws_bc_channel_function = (fhss_ws_channel_functions)cur->ws_info->fhss_bc_channel_function;
361361
fhss_configuration.fhss_bc_dwell_interval = cur->ws_info->fhss_bc_dwell_interval;
362362
fhss_configuration.fhss_broadcast_interval = cur->ws_info->fhss_bc_interval;
363363

@@ -386,8 +386,8 @@ static int8_t ws_fhss_initialize(protocol_interface_info_entry_t *cur)
386386
static int8_t ws_fhss_set_defaults(protocol_interface_info_entry_t *cur, fhss_ws_configuration_t *fhss_configuration)
387387
{
388388
fhss_configuration->fhss_uc_dwell_interval = cur->ws_info->fhss_uc_dwell_interval;
389-
fhss_configuration->ws_uc_channel_function = cur->ws_info->fhss_uc_channel_function;
390-
fhss_configuration->ws_bc_channel_function = cur->ws_info->fhss_bc_channel_function;
389+
fhss_configuration->ws_uc_channel_function = (fhss_ws_channel_functions)cur->ws_info->fhss_uc_channel_function;
390+
fhss_configuration->ws_bc_channel_function = (fhss_ws_channel_functions)cur->ws_info->fhss_bc_channel_function;
391391
fhss_configuration->fhss_bc_dwell_interval = cur->ws_info->fhss_bc_dwell_interval;
392392
fhss_configuration->fhss_broadcast_interval = cur->ws_info->fhss_bc_interval;
393393
if (cur->ws_info->fhss_uc_fixed_channel != 0xffff) {
@@ -405,7 +405,9 @@ static int8_t ws_fhss_set_defaults(protocol_interface_info_entry_t *cur, fhss_ws
405405
static int8_t ws_fhss_border_router_configure(protocol_interface_info_entry_t *cur)
406406
{
407407
// Read configuration of existing FHSS and start using the default values for any network
408-
fhss_ws_configuration_t fhss_configuration = {0};
408+
fhss_ws_configuration_t fhss_configuration;
409+
memset(&fhss_configuration, 0, sizeof(fhss_ws_configuration_t));
410+
409411
if (ns_fhss_ws_configuration_get(cur->ws_info->fhss_api)) {
410412
memcpy(&fhss_configuration, ns_fhss_ws_configuration_get(cur->ws_info->fhss_api), sizeof(fhss_ws_configuration_t));
411413
}
@@ -428,7 +430,9 @@ static uint16_t ws_randomize_fixed_channel(uint16_t configured_fixed_channel, ui
428430
static int8_t ws_fhss_discovery_configure(protocol_interface_info_entry_t *cur)
429431
{
430432
// Read configuration of existing FHSS and start using the default values for any network
431-
fhss_ws_configuration_t fhss_configuration = {0};
433+
fhss_ws_configuration_t fhss_configuration;
434+
memset(&fhss_configuration, 0, sizeof(fhss_ws_configuration_t));
435+
432436
if (ns_fhss_ws_configuration_get(cur->ws_info->fhss_api)) {
433437
memcpy(&fhss_configuration, ns_fhss_ws_configuration_get(cur->ws_info->fhss_api), sizeof(fhss_ws_configuration_t));
434438
}
@@ -487,7 +491,7 @@ static void ws_bootstrap_primary_parent_set(struct protocol_interface_info_entry
487491
// Learning broadcast network configuration
488492
if (neighbor_info->ws_neighbor->broadcast_shedule_info_stored) {
489493
ws_fhss_set_defaults(cur, &fhss_configuration);
490-
fhss_configuration.ws_bc_channel_function = neighbor_info->ws_neighbor->fhss_data.bc_timing_info.broadcast_channel_function;
494+
fhss_configuration.ws_bc_channel_function = (fhss_ws_channel_functions)neighbor_info->ws_neighbor->fhss_data.bc_timing_info.broadcast_channel_function;
491495
if (fhss_configuration.ws_bc_channel_function == WS_FIXED_CHANNEL) {
492496
cur->ws_info->hopping_schdule.bc_fixed_channel = neighbor_info->ws_neighbor->fhss_data.bc_timing_info.fixed_channel;
493497
cur->ws_info->fhss_bc_fixed_channel = neighbor_info->ws_neighbor->fhss_data.bc_timing_info.fixed_channel;
@@ -1335,7 +1339,7 @@ static bool ws_neighbor_entry_nud_notify(mac_neighbor_table_entry_t *entry_ptr,
13351339
uint16_t switch_prob = randLIB_get_random_in_range(0, probe_period - 1);
13361340
//Take Random from time WS_NEIGHBOR_NUD_TIMEOUT - WS_NEIGHBOR_NUD_TIMEOUT*1.5
13371341
if (switch_prob < 2) {
1338-
tr_debug("Link Probe test with jitter %u, sample %u", time_from_start, etx_entry->etx_samples);
1342+
tr_debug("Link Probe test with jitter %"PRIu32", sample %u", time_from_start, etx_entry->etx_samples);
13391343
activate_nud = true;
13401344
}
13411345
}

source/Security/protocols/sec_prot_certs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void sec_prot_certs_delete(sec_prot_certs_t *certs);
8383
*
8484
* \return certificate chain entry or NULL
8585
*/
86-
cert_chain_entry_t *sec_prot_certs_chain_entry_create();
86+
cert_chain_entry_t *sec_prot_certs_chain_entry_create(void);
8787

8888
/**
8989
* sec_prot_certs_chain_entry_init initialize certificate chain entry
@@ -158,7 +158,7 @@ void sec_prot_certs_chain_list_delete(cert_chain_list_t *chain_list);
158158
*
159159
* \return certificate revocation list entry or NULL
160160
*/
161-
cert_revocat_list_entry_t *sec_prot_certs_revocat_list_entry_create();
161+
cert_revocat_list_entry_t *sec_prot_certs_revocat_list_entry_create(void);
162162

163163
/**
164164
* sec_prot_certs_revocat_list_entry_init initialize certificate revocation list entry

source/Service_Libs/fhss/channel_functions.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,16 @@ static uint32_t dh1cf_hashword(const uint32_t *key, size_t key_length, uint32_t
162162
key += 3;
163163
}
164164
switch (key_length) {
165-
case 3 :
165+
case 3:
166166
c += key[2];
167-
case 2 :
167+
/* fall through */
168+
case 2:
168169
b += key[1];
169-
case 1 :
170+
/* fall through */
171+
case 1:
170172
a += key[0];
171173
final(a, b, c);
174+
/* fall through */
172175
case 0:
173176
break;
174177
}

source/Service_Libs/fhss/fhss_ws.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ int fhss_ws_set_parent(fhss_structure_t *fhss_structure, const uint8_t eui64[8],
786786
// Update clock drift
787787
fhss_structure->ws->drift_per_millisecond_ns += divide_integer(MS_TO_NS(true_bc_interval_offset - own_bc_interval_offset), US_TO_MS(time_since_last_synch_us));
788788
}
789-
tr_debug("synch to parent: %s, drift: %ims in %u seconds, compensation: %ins per ms", trace_array(eui64, 8), true_bc_interval_offset - own_bc_interval_offset, US_TO_S(time_since_last_synch_us), fhss_structure->ws->drift_per_millisecond_ns);
789+
tr_debug("synch to parent: %s, drift: %"PRIi32"ms in %"PRIu32" seconds, compensation: %"PRIi32"ns per ms", trace_array(eui64, 8), true_bc_interval_offset - own_bc_interval_offset, US_TO_S(time_since_last_synch_us), fhss_structure->ws->drift_per_millisecond_ns);
790790
}
791791
return 0;
792792
}
@@ -822,7 +822,7 @@ int fhss_ws_configuration_set(fhss_structure_t *fhss_structure, const fhss_ws_co
822822
fhss_structure->rx_channel = fhss_configuration->unicast_fixed_channel;
823823
}
824824
platform_exit_critical();
825-
tr_info("fhss Configuration set, UC channel: %d, BC channel: %d, UC CF: %d, BC CF: %d, channels: %d, uc dwell: %d, bc dwell: %d, bc interval: %d, bsi:%d",
825+
tr_info("fhss Configuration set, UC channel: %d, BC channel: %d, UC CF: %d, BC CF: %d, channels: %d, uc dwell: %d, bc dwell: %d, bc interval: %"PRIu32", bsi:%d",
826826
fhss_structure->ws->fhss_configuration.unicast_fixed_channel,
827827
fhss_structure->ws->fhss_configuration.broadcast_fixed_channel,
828828
fhss_structure->ws->fhss_configuration.ws_uc_channel_function,

0 commit comments

Comments
 (0)