Skip to content

Commit

Permalink
[fdb_kvdb]: fix shadow warning (#272)
Browse files Browse the repository at this point in the history
```bash
FlashDB/src/fdb_kvdb.c: In function ‘read_sector_info’:
FlashDB/src/fdb_kvdb.c:488:23: warning: declaration of ‘sector_cache’ shadows a previous local [-Wshadow]
  488 |         kv_sec_info_t sector_cache = get_sector_from_cache(db, sector->addr);
      |                       ^~~~~~~~~~~~
FlashDB/src/fdb_kvdb.c:421:19: note: shadowed declaration is here
  421 |     kv_sec_info_t sector_cache = get_sector_from_cache(db, addr);
      |                   ^~~~~~~~~~~~
```

Signed-off-by: FASTSHIFT <vifextech@foxmail.com>
  • Loading branch information
FASTSHIFT authored Jan 2, 2024
1 parent 7605205 commit 7dfed14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fdb_kvdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,8 @@ static fdb_err_t read_sector_info(fdb_kvdb_t db, uint32_t addr, kv_sec_info_t se
#ifdef FDB_KV_USING_CACHE
update_sector_cache(db, sector);
} else {
kv_sec_info_t sector_cache = get_sector_from_cache(db, sector->addr);
if (!sector_cache) {
kv_sec_info_t sec_cache = get_sector_from_cache(db, sector->addr);
if (!sec_cache) {
sector->empty_kv = FAILED_ADDR;
sector->remain = 0;
update_sector_cache(db, sector);
Expand Down

0 comments on commit 7dfed14

Please sign in to comment.