Added designated initaliser, to prevent any possible problem with

ordering
This commit is contained in:
Scott Anderson 2017-04-07 00:19:14 +12:00
parent fe54a6725e
commit 3a32be67ed
1 changed files with 11 additions and 12 deletions

View File

@ -23,17 +23,16 @@ enum criteria_type { // *must* keep in sync with criteria_strings[]
CRIT_LAST CRIT_LAST
}; };
// this *must* match the ordering in criteria_type enum static const char * const criteria_strings[CRIT_LAST] = {
static const char * const criteria_strings[] = { [CRIT_CLASS] = "class",
"class", [CRIT_CON_MARK] = "con_mark",
"con_mark", [CRIT_ID] = "id",
"id", [CRIT_INSTANCE] = "instance",
"instance", [CRIT_TITLE] = "title",
"title", [CRIT_URGENT] = "urgent", // either "latest" or "oldest" ...
"urgent", // either "latest" or "oldest" ... [CRIT_WINDOW_ROLE] = "window_role",
"window_role", [CRIT_WINDOW_TYPE] = "window_type",
"window_type", [CRIT_WORKSPACE] = "workspace"
"workspace"
}; };
/** /**
@ -240,7 +239,7 @@ ect_cleanup:
} }
static int regex_cmp(const char *item, const pcre *regex) { static int regex_cmp(const char *item, const pcre *regex) {
return pcre_exec(regex, NULL, item, strlen(item), 0, 0, NULL, 0); return pcre_exec(regex, NULL, item, strlen(item), 0, 0, NULL, 0);
} }
// test a single view if it matches list of criteria tokens (all of them). // test a single view if it matches list of criteria tokens (all of them).