1
0
mirror of https://git.savannah.gnu.org/git/gperf.git synced 2025-12-02 13:09:22 +00:00

Add /*FALLTHROUGH*/ comments to output.

This commit is contained in:
Bruno Haible
2003-05-01 10:10:08 +00:00
parent ff0be60810
commit c170151d67
10 changed files with 79 additions and 0 deletions

View File

@@ -738,6 +738,15 @@ Output::output_hash_function () const
"#endif\n"
"#endif\n");
if (/* The function does not use the 'str' argument? */
_key_positions.get_size() == 0
|| /* The function uses 'str', but not the 'len' argument? */
(option[NOLENGTH]
&& _key_positions[0] < _min_key_len
&& _key_positions[_key_positions.get_size() - 1] != Positions::LASTCHAR))
/* Pacify lint. */
printf ("/*ARGSUSED*/\n");
if (option[KRC] | option[C] | option[ANSIC])
printf ("static ");
printf ("unsigned int\n");
@@ -862,6 +871,8 @@ Output::output_hash_function () const
int i = key_pos;
do
{
if (i > key_pos)
printf (" /*FALLTHROUGH*/\n"); /* Pacify lint. */
for ( ; i > key_pos; i--)
printf (" case %d:\n", i);
@@ -873,6 +884,8 @@ Output::output_hash_function () const
}
while (key_pos != PositionIterator::EOS && key_pos != Positions::LASTCHAR);
if (i >= _min_key_len)
printf (" /*FALLTHROUGH*/\n"); /* Pacify lint. */
for ( ; i >= _min_key_len; i--)
printf (" case %d:\n", i);
}