mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-13 22:33:03 +00:00
variant: produce stable results
Improve the output by ensuring a well defined order for type switches. * src/uniqstr.h: Style changes for macro arguments. (UNIQSTR_CMP): Replace by... (uniqstr_cmp): this. * src/uniqstr.c (uniqstr_cmp): New. Produce well defined results. * src/output.c: Use it.
This commit is contained in:
@@ -284,10 +284,10 @@ prepare_states (void)
|
||||
static int
|
||||
symbol_type_name_cmp (const symbol **lhs, const symbol **rhs)
|
||||
{
|
||||
int res = UNIQSTR_CMP((*lhs)->type_name, (*rhs)->type_name);
|
||||
if (res)
|
||||
return res;
|
||||
return (*lhs)->number - (*rhs)->number;
|
||||
int res = uniqstr_cmp ((*lhs)->type_name, (*rhs)->type_name);
|
||||
if (!res)
|
||||
res = (*lhs)->number - (*rhs)->number;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user