mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-20 01:33:03 +00:00
(struniq_assert): Now returns void, and aborts if the assertion is false.
This commit is contained in:
@@ -51,21 +51,17 @@ struniq_new (const char *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------.
|
/*------------------------------.
|
||||||
| Return TRUE iff S is a struniq. |
|
| Abort if S is not a struniq. |
|
||||||
`---------------------------------*/
|
`------------------------------*/
|
||||||
|
|
||||||
bool
|
void
|
||||||
struniq_assert_p (const char *s)
|
struniq_assert (const char *s)
|
||||||
{
|
{
|
||||||
if (!hash_lookup (struniqs_table, s))
|
if (!hash_lookup (struniqs_table, s))
|
||||||
{
|
{
|
||||||
error (0, 0, "not a struniq: %s", quotearg (s));
|
error (0, 0, "not a struniq: %s", quotearg (s));
|
||||||
return false;
|
abort ();
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,8 +41,7 @@ struniq_t struniq_new (const char *s);
|
|||||||
void struniqs_new (void);
|
void struniqs_new (void);
|
||||||
|
|
||||||
/* Die if S is not a struniq. */
|
/* Die if S is not a struniq. */
|
||||||
#define struniq_assert(S) assert (struniq_assert_p (S));
|
void struniq_assert (const char *s);
|
||||||
bool struniq_assert_p (const char *s);
|
|
||||||
|
|
||||||
/* Free all the memory allocated for symbols. */
|
/* Free all the memory allocated for symbols. */
|
||||||
void struniqs_free (void);
|
void struniqs_free (void);
|
||||||
|
|||||||
Reference in New Issue
Block a user