Commit 87cb0495 authored by Petri Hintukainen's avatar Petri Hintukainen

initialize UO mask padding bits to 0

Allows comparing UO masks with memcmp
parent f6ce3112
......@@ -56,6 +56,8 @@ mpls_parse_uo(uint8_t *buf, BD_UO_MASK *uo)
BITBUFFER bb;
bb_init(&bb, buf, 8);
memset(uo, 0, sizeof(BD_UO_MASK));
uo->menu_call = bb_read(&bb, 1);
uo->title_search = bb_read(&bb, 1);
uo->chapter_search = bb_read(&bb, 1);
......
......@@ -63,9 +63,9 @@ typedef struct bd_uo_mask_table_s
static inline BD_UO_MASK bd_uo_mask_combine(BD_UO_MASK a, BD_UO_MASK b)
{
union {
BD_UO_MASK mask;
uint64_t u64;
} mask_a, mask_b, result;
BD_UO_MASK mask;
} mask_a = {0}, mask_b = {0}, result;
mask_a.mask = a;
mask_b.mask = b;
......@@ -78,9 +78,12 @@ static inline BD_UO_MASK bd_uo_mask_combine(BD_UO_MASK a, BD_UO_MASK b)
static inline BD_UO_MASK bd_empty_uo_mask(void)
{
const BD_UO_MASK empty = EMPTY_UO_MASK;
return empty;
}
static const union {
const uint64_t u64;
const BD_UO_MASK mask;
} empty = {0};
return empty.mask;
}
#endif // _BD_UO_MASK_TABLE_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment