From 5ce1359ee5f0fe594f97c68ec2795ef20f59817f Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 2 Jun 2021 12:11:39 +0200 Subject: [PATCH] add 'U' to unsigned constants --- 3rd-party/rijndael/rijndael.c | 6 +++--- src/ble/le_device_db_tlv.c | 2 +- src/ble/sm.c | 4 ++-- src/hci.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/3rd-party/rijndael/rijndael.c b/3rd-party/rijndael/rijndael.c index 4b774cfbf..8739571b4 100644 --- a/3rd-party/rijndael/rijndael.c +++ b/3rd-party/rijndael/rijndael.c @@ -694,9 +694,9 @@ static const u32 Td4[256] = static const u32 rcon[] = { - 0x01000000, 0x02000000, 0x04000000, 0x08000000, - 0x10000000, 0x20000000, 0x40000000, 0x80000000, - 0x1B000000, 0x36000000, + 0x01000000U, 0x02000000U, 0x04000000U, 0x08000000U, + 0x10000000U, 0x20000000U, 0x40000000U, 0x80000000U, + 0x1B000000U, 0x36000000U, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */ }; diff --git a/src/ble/le_device_db_tlv.c b/src/ble/le_device_db_tlv.c index 8f8ae2c62..029783b68 100644 --- a/src/ble/le_device_db_tlv.c +++ b/src/ble/le_device_db_tlv.c @@ -199,7 +199,7 @@ void le_device_db_remove(int index){ int le_device_db_add(int addr_type, bd_addr_t addr, sm_key_t irk){ uint32_t highest_seq_nr = 0; - uint32_t lowest_seq_nr = 0xFFFFFFFF; + uint32_t lowest_seq_nr = 0xFFFFFFFFU; int index_for_lowest_seq_nr = -1; int index_for_addr = -1; int index_for_empty = -1; diff --git a/src/ble/sm.c b/src/ble/sm.c index 1582bc83e..fe10507fe 100644 --- a/src/ble/sm.c +++ b/src/ble/sm.c @@ -3335,7 +3335,7 @@ static void sm_handle_random_result_ph2_tk(void * arg){ sm_reset_tk(); uint32_t tk; - if (sm_fixed_passkey_in_display_role == 0xffffffff){ + if (sm_fixed_passkey_in_display_role == 0xffffffffU){ // map random to 0-999999 without speding much cycles on a modulus operation tk = little_endian_read_32(sm_random_data,0); tk = tk & 0xfffff; // 1048575 @@ -4410,7 +4410,7 @@ void sm_init(void){ sm_max_encryption_key_size = 16; sm_min_encryption_key_size = 7; - sm_fixed_passkey_in_display_role = 0xffffffff; + sm_fixed_passkey_in_display_role = 0xffffffffU; sm_reconstruct_ltk_without_le_device_db_entry = true; #ifdef USE_CMAC_ENGINE diff --git a/src/hci.c b/src/hci.c index 718c8f1a9..447457fc6 100644 --- a/src/hci.c +++ b/src/hci.c @@ -1417,10 +1417,10 @@ static void hci_initializing_run(void){ case HCI_INIT_SET_EVENT_MASK: hci_stack->substate = HCI_INIT_W4_SET_EVENT_MASK; if (hci_le_supported()){ - hci_send_cmd(&hci_set_event_mask,0xffffffff, 0x3FFFFFFF); + hci_send_cmd(&hci_set_event_mask,0xFFFFFFFFU, 0x3FFFFFFFU); } else { // Kensington Bluetooth 2.1 USB Dongle (CSR Chipset) returns an error for 0xffff... - hci_send_cmd(&hci_set_event_mask,0xffffffff, 0x1FFFFFFF); + hci_send_cmd(&hci_set_event_mask,0xFFFFFFFFU, 0x1FFFFFFFU); } break;