summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2003-05-01 10:10:08 +0000
committerBruno Haible <bruno@clisp.org>2003-05-01 10:10:08 +0000
commitc170151d6755c4229439882784e275f9584ab186 (patch)
tree7f0c5b6d630bf85a34baa8292e57fad03a69ead6 /src
parentff0be608102a1ccc42211a9a55554cdb57dcde4c (diff)
downloadgperf-c170151d6755c4229439882784e275f9584ab186.tar.gz
Add /*FALLTHROUGH*/ comments to output.
Diffstat (limited to 'src')
-rw-r--r--src/output.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/output.cc b/src/output.cc
index a7433d1..f693505 100644
--- a/src/output.cc
+++ b/src/output.cc
@@ -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);
}