Skip to content

Commit 23d1f32

Browse files
committed
KVStore: fix warnings
1 parent f032b82 commit 23d1f32

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

libraries/KVStore/src/MbedCRC.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ constexpr bool have_crc_table(uint32_t polynomial, uint8_t width)
7575
(polynomial == POLY_8BIT_CCITT && width == 8) ||
7676
(polynomial == POLY_7BIT_SD && width == 7);
7777
#else
78+
(void)polynomial;
79+
(void)width;
7880
return false;
7981
#endif
8082
}

libraries/KVStore/src/TDBStore.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ TDBStore::TDBStore(BlockDevice *bd) : _ram_table(0), _max_keys(0),
129129
_area_params{}, _prog_size(0), _work_buf(0), _work_buf_size(0), _key_buf(0), _inc_set_handle(0)
130130
{
131131
for (int i = 0; i < _num_areas; i++) {
132-
_area_params[i] = { 0 };
132+
_area_params[i] = { 0, 0 };
133133
}
134134
for (int i = 0; i < _max_open_iterators; i++) {
135135
_iterator_table[i] = { 0 };
@@ -403,6 +403,7 @@ int TDBStore::read_record(uint8_t area, uint32_t offset, char *key,
403403
int TDBStore::find_record(uint8_t area, const char *key, uint32_t &offset,
404404
uint32_t &ram_table_ind, uint32_t &hash)
405405
{
406+
(void)area;
406407
ram_table_entry_t *ram_table = (ram_table_entry_t *) _ram_table;
407408
ram_table_entry_t *entry;
408409
int ret = KVSTORE_ERROR_ITEM_NOT_FOUND;
@@ -818,6 +819,7 @@ int TDBStore::get_info(const char *key, info_t *info)
818819

819820
int TDBStore::write_master_record(uint8_t area, uint16_t version, uint32_t &next_offset)
820821
{
822+
(void)area;
821823
master_record_data_t master_rec;
822824

823825
master_rec.version = version;
@@ -1482,11 +1484,10 @@ int TDBStore::check_erase_before_write(uint8_t area, uint32_t offset, uint32_t s
14821484
// In order to save init time, we don't check that the entire area is erased.
14831485
// Instead, whenever reaching an erase unit start erase it.
14841486
bool erase = false;
1485-
uint32_t start_offset;
1486-
uint32_t end_offset;
1487+
uint32_t start_offset = 0;
1488+
uint32_t end_offset = 0;
14871489
while (size) {
14881490
uint32_t dist, offset_from_start;
1489-
int ret;
14901491
offset_in_erase_unit(area, offset, offset_from_start, dist);
14911492
uint32_t chunk = std::min(size, dist);
14921493

0 commit comments

Comments
 (0)