mirror of
https://github.com/libretro/RetroArch
synced 2025-04-02 07:20:34 +00:00
Try to fix Coverity warning 'uninitialized scalar variable'
This commit is contained in:
parent
f82e51e5e8
commit
68bb87f392
@ -464,8 +464,8 @@ int libretrodb_create_index(libretrodb_t *db,
|
|||||||
struct node_iter_ctx nictx;
|
struct node_iter_ctx nictx;
|
||||||
struct rmsgpack_dom_value key;
|
struct rmsgpack_dom_value key;
|
||||||
libretrodb_index_t idx;
|
libretrodb_index_t idx;
|
||||||
uint64_t idx_header_offset;
|
|
||||||
struct rmsgpack_dom_value item;
|
struct rmsgpack_dom_value item;
|
||||||
|
uint64_t idx_header_offset = 0;
|
||||||
libretrodb_cursor_t cur = {0};
|
libretrodb_cursor_t cur = {0};
|
||||||
struct rmsgpack_dom_value *field = NULL;
|
struct rmsgpack_dom_value *field = NULL;
|
||||||
void *buff = NULL;
|
void *buff = NULL;
|
||||||
@ -474,15 +474,14 @@ int libretrodb_create_index(libretrodb_t *db,
|
|||||||
uint64_t item_loc = libretrodb_tell(db);
|
uint64_t item_loc = libretrodb_tell(db);
|
||||||
bintree_t *tree = bintree_new(node_compare, &field_size);
|
bintree_t *tree = bintree_new(node_compare, &field_size);
|
||||||
|
|
||||||
|
item.type = RDT_NULL;
|
||||||
|
|
||||||
if (!tree || (libretrodb_cursor_open(db, &cur, NULL) != 0))
|
if (!tree || (libretrodb_cursor_open(db, &cur, NULL) != 0))
|
||||||
goto clean;
|
goto clean;
|
||||||
|
|
||||||
key.type = RDT_STRING;
|
key.type = RDT_STRING;
|
||||||
key.val.string.len = strlen(field_name);
|
key.val.string.len = strlen(field_name);
|
||||||
|
key.val.string.buff = (char *) field_name; /* We know we aren't going to change it */
|
||||||
/* We know we aren't going to change it */
|
|
||||||
key.val.string.buff = (char *) field_name;
|
|
||||||
item.type = RDT_NULL;
|
|
||||||
|
|
||||||
while (libretrodb_cursor_read_item(&cur, &item) == 0)
|
while (libretrodb_cursor_read_item(&cur, &item) == 0)
|
||||||
{
|
{
|
||||||
@ -522,9 +521,7 @@ int libretrodb_create_index(libretrodb_t *db,
|
|||||||
|
|
||||||
buff = malloc(field_size + sizeof(uint64_t));
|
buff = malloc(field_size + sizeof(uint64_t));
|
||||||
if (!buff)
|
if (!buff)
|
||||||
{
|
|
||||||
goto clean;
|
goto clean;
|
||||||
}
|
|
||||||
|
|
||||||
memcpy(buff, field->val.binary.buff, field_size);
|
memcpy(buff, field->val.binary.buff, field_size);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user