libsysprof: fix category inheritance

Move the bit lower so we can use bitfields properly, and add an unmask
helper to avoid all the 0xFF crap.
This commit is contained in:
Christian Hergert
2023-07-21 10:51:41 -07:00
parent ff5c0e4927
commit a99a89782a
4 changed files with 16 additions and 15 deletions

View File

@ -260,7 +260,7 @@ sysprof_categories_lookup (SysprofCategories *categories,
for (guint i = 0; i < rules->len; i++)
{
const Rule *rule = &g_array_index (rules, Rule, i);
gboolean ret = FALSE;
gboolean ret;
if (rule->kind == MATCH_EXACT)
ret = strcmp (rule->match, symbol) == 0;
@ -268,6 +268,8 @@ sysprof_categories_lookup (SysprofCategories *categories,
ret = g_str_has_prefix (symbol, rule->match);
else if (rule->kind == MATCH_SUFFIX)
ret = g_str_has_suffix (symbol, rule->match);
else
ret = FALSE;
if (ret)
{