mirror of
https://git.savannah.gnu.org/git/gperf.git
synced 2025-12-02 21:19:24 +00:00
Avoid "implicit fallthrough" warnings in the generated code.
This commit is contained in:
@@ -1,3 +1,12 @@
|
|||||||
|
2018-07-25 Bruno Haible <bruno@clisp.org>
|
||||||
|
|
||||||
|
Avoid "implicit fallthrough" warnings in the generated code.
|
||||||
|
Reported by Phil Willoughby at
|
||||||
|
<https://lists.gnu.org/archive/html/bug-gperf/2018-07/msg00002.html>.
|
||||||
|
* src/output.cc (Output::output_hash_function): Emit a more elaborate
|
||||||
|
fallthrough marker.
|
||||||
|
* tests/*.exp: Update.
|
||||||
|
|
||||||
2018-04-24 Bruno Haible <bruno@clisp.org>
|
2018-04-24 Bruno Haible <bruno@clisp.org>
|
||||||
|
|
||||||
Support input files with CR/LF line terminators.
|
Support input files with CR/LF line terminators.
|
||||||
|
|||||||
2
NEWS
2
NEWS
@@ -3,6 +3,8 @@ New in 3.2:
|
|||||||
Unix line terminators (LF).
|
Unix line terminators (LF).
|
||||||
Note: This is an incompatible change. If you want to use a keyword that
|
Note: This is an incompatible change. If you want to use a keyword that
|
||||||
ends in a CR byte, such as xyz<CR>, write it as "xyz\r".
|
ends in a CR byte, such as xyz<CR>, write it as "xyz\r".
|
||||||
|
* The generated code avoids "implicit fallthrough" warnings in 'switch'
|
||||||
|
statements.
|
||||||
|
|
||||||
New in 3.1:
|
New in 3.1:
|
||||||
* The generated C code is now in ANSI-C by default. If you want to support
|
* The generated C code is now in ANSI-C by default. If you want to support
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Output routines.
|
/* Output routines.
|
||||||
Copyright (C) 1989-1998, 2000, 2002-2004, 2006-2007, 2009, 2011-2012, 2016 Free Software Foundation, Inc.
|
Copyright (C) 1989-1998, 2000, 2002-2004, 2006-2007, 2009, 2011-2012, 2016, 2018 Free Software Foundation, Inc.
|
||||||
Written by Douglas C. Schmidt <schmidt@ics.uci.edu>
|
Written by Douglas C. Schmidt <schmidt@ics.uci.edu>
|
||||||
and Bruno Haible <bruno@clisp.org>.
|
and Bruno Haible <bruno@clisp.org>.
|
||||||
|
|
||||||
@@ -932,6 +932,15 @@ Output::output_hash_function () const
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* We've got to use the correct, but brute force, technique. */
|
/* We've got to use the correct, but brute force, technique. */
|
||||||
|
/* Pseudo-statement or comment that avoids a compiler warning or
|
||||||
|
lint warning. */
|
||||||
|
const char * const fallthrough_marker =
|
||||||
|
"#if defined __cplusplus && __cplusplus >= 201703L\n"
|
||||||
|
" [[fallthrough]];\n"
|
||||||
|
"#elif defined __GNUC__ && __GNUC__ >= 7\n"
|
||||||
|
" __attribute__ ((__fallthrough__));\n"
|
||||||
|
"#endif\n"
|
||||||
|
" /*FALLTHROUGH*/\n";
|
||||||
/* It doesn't really matter whether hval is an 'int' or
|
/* It doesn't really matter whether hval is an 'int' or
|
||||||
'unsigned int', but 'unsigned int' gives fewer warnings. */
|
'unsigned int', but 'unsigned int' gives fewer warnings. */
|
||||||
printf (" %sunsigned int hval = %s;\n\n"
|
printf (" %sunsigned int hval = %s;\n\n"
|
||||||
@@ -951,7 +960,7 @@ Output::output_hash_function () const
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (i > key_pos)
|
if (i > key_pos)
|
||||||
printf (" /*FALLTHROUGH*/\n"); /* Pacify lint. */
|
printf ("%s", fallthrough_marker);
|
||||||
for ( ; i > key_pos; i--)
|
for ( ; i > key_pos; i--)
|
||||||
printf (" case %d:\n", i);
|
printf (" case %d:\n", i);
|
||||||
|
|
||||||
@@ -964,7 +973,7 @@ Output::output_hash_function () const
|
|||||||
while (key_pos != PositionIterator::EOS && key_pos != Positions::LASTCHAR);
|
while (key_pos != PositionIterator::EOS && key_pos != Positions::LASTCHAR);
|
||||||
|
|
||||||
if (i >= _min_key_len)
|
if (i >= _min_key_len)
|
||||||
printf (" /*FALLTHROUGH*/\n"); /* Pacify lint. */
|
printf ("%s", fallthrough_marker);
|
||||||
for ( ; i >= _min_key_len; i--)
|
for ( ; i >= _min_key_len; i--)
|
||||||
printf (" case %d:\n", i);
|
printf (" case %d:\n", i);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,6 +86,11 @@ hash (str, len)
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
hval += asso_values[(unsigned char)str[2]];
|
hval += asso_values[(unsigned char)str[2]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
|
|||||||
@@ -93,6 +93,11 @@ hash (register const char *str, register size_t len)
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
hval += asso_values[(unsigned char)str[21]];
|
hval += asso_values[(unsigned char)str[21]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 21:
|
case 21:
|
||||||
case 20:
|
case 20:
|
||||||
@@ -106,33 +111,83 @@ hash (register const char *str, register size_t len)
|
|||||||
case 12:
|
case 12:
|
||||||
case 11:
|
case 11:
|
||||||
hval += asso_values[(unsigned char)str[10]+1];
|
hval += asso_values[(unsigned char)str[10]+1];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 10:
|
case 10:
|
||||||
hval += asso_values[(unsigned char)str[9]];
|
hval += asso_values[(unsigned char)str[9]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 9:
|
case 9:
|
||||||
hval += asso_values[(unsigned char)str[8]+1];
|
hval += asso_values[(unsigned char)str[8]+1];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 8:
|
case 8:
|
||||||
hval += asso_values[(unsigned char)str[7]+3];
|
hval += asso_values[(unsigned char)str[7]+3];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 7:
|
case 7:
|
||||||
hval += asso_values[(unsigned char)str[6]];
|
hval += asso_values[(unsigned char)str[6]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 6:
|
case 6:
|
||||||
hval += asso_values[(unsigned char)str[5]];
|
hval += asso_values[(unsigned char)str[5]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 5:
|
case 5:
|
||||||
hval += asso_values[(unsigned char)str[4]];
|
hval += asso_values[(unsigned char)str[4]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 4:
|
case 4:
|
||||||
hval += asso_values[(unsigned char)str[3]];
|
hval += asso_values[(unsigned char)str[3]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 3:
|
case 3:
|
||||||
hval += asso_values[(unsigned char)str[2]];
|
hval += asso_values[(unsigned char)str[2]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 2:
|
case 2:
|
||||||
hval += asso_values[(unsigned char)str[1]+1];
|
hval += asso_values[(unsigned char)str[1]+1];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 1:
|
case 1:
|
||||||
hval += asso_values[(unsigned char)str[0]];
|
hval += asso_values[(unsigned char)str[0]];
|
||||||
|
|||||||
145
tests/chill.exp
145
tests/chill.exp
@@ -84,90 +84,235 @@ hash (str, len)
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
hval += asso_values[(unsigned char)str[29]];
|
hval += asso_values[(unsigned char)str[29]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 29:
|
case 29:
|
||||||
hval += asso_values[(unsigned char)str[28]];
|
hval += asso_values[(unsigned char)str[28]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 28:
|
case 28:
|
||||||
hval += asso_values[(unsigned char)str[27]];
|
hval += asso_values[(unsigned char)str[27]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 27:
|
case 27:
|
||||||
hval += asso_values[(unsigned char)str[26]];
|
hval += asso_values[(unsigned char)str[26]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 26:
|
case 26:
|
||||||
hval += asso_values[(unsigned char)str[25]];
|
hval += asso_values[(unsigned char)str[25]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 25:
|
case 25:
|
||||||
hval += asso_values[(unsigned char)str[24]];
|
hval += asso_values[(unsigned char)str[24]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 24:
|
case 24:
|
||||||
hval += asso_values[(unsigned char)str[23]];
|
hval += asso_values[(unsigned char)str[23]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 23:
|
case 23:
|
||||||
hval += asso_values[(unsigned char)str[22]];
|
hval += asso_values[(unsigned char)str[22]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 22:
|
case 22:
|
||||||
hval += asso_values[(unsigned char)str[21]];
|
hval += asso_values[(unsigned char)str[21]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 21:
|
case 21:
|
||||||
hval += asso_values[(unsigned char)str[20]];
|
hval += asso_values[(unsigned char)str[20]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 20:
|
case 20:
|
||||||
hval += asso_values[(unsigned char)str[19]];
|
hval += asso_values[(unsigned char)str[19]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 19:
|
case 19:
|
||||||
hval += asso_values[(unsigned char)str[18]];
|
hval += asso_values[(unsigned char)str[18]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 18:
|
case 18:
|
||||||
hval += asso_values[(unsigned char)str[17]];
|
hval += asso_values[(unsigned char)str[17]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 17:
|
case 17:
|
||||||
hval += asso_values[(unsigned char)str[16]];
|
hval += asso_values[(unsigned char)str[16]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 16:
|
case 16:
|
||||||
hval += asso_values[(unsigned char)str[15]];
|
hval += asso_values[(unsigned char)str[15]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 15:
|
case 15:
|
||||||
hval += asso_values[(unsigned char)str[14]];
|
hval += asso_values[(unsigned char)str[14]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 14:
|
case 14:
|
||||||
hval += asso_values[(unsigned char)str[13]];
|
hval += asso_values[(unsigned char)str[13]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 13:
|
case 13:
|
||||||
hval += asso_values[(unsigned char)str[12]];
|
hval += asso_values[(unsigned char)str[12]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 12:
|
case 12:
|
||||||
hval += asso_values[(unsigned char)str[11]];
|
hval += asso_values[(unsigned char)str[11]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 11:
|
case 11:
|
||||||
hval += asso_values[(unsigned char)str[10]];
|
hval += asso_values[(unsigned char)str[10]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 10:
|
case 10:
|
||||||
hval += asso_values[(unsigned char)str[9]];
|
hval += asso_values[(unsigned char)str[9]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 9:
|
case 9:
|
||||||
hval += asso_values[(unsigned char)str[8]];
|
hval += asso_values[(unsigned char)str[8]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 8:
|
case 8:
|
||||||
hval += asso_values[(unsigned char)str[7]];
|
hval += asso_values[(unsigned char)str[7]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 7:
|
case 7:
|
||||||
hval += asso_values[(unsigned char)str[6]];
|
hval += asso_values[(unsigned char)str[6]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 6:
|
case 6:
|
||||||
hval += asso_values[(unsigned char)str[5]];
|
hval += asso_values[(unsigned char)str[5]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 5:
|
case 5:
|
||||||
hval += asso_values[(unsigned char)str[4]];
|
hval += asso_values[(unsigned char)str[4]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 4:
|
case 4:
|
||||||
hval += asso_values[(unsigned char)str[3]];
|
hval += asso_values[(unsigned char)str[3]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 3:
|
case 3:
|
||||||
hval += asso_values[(unsigned char)str[2]];
|
hval += asso_values[(unsigned char)str[2]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 2:
|
case 2:
|
||||||
hval += asso_values[(unsigned char)str[1]+1];
|
hval += asso_values[(unsigned char)str[1]+1];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 1:
|
case 1:
|
||||||
hval += asso_values[(unsigned char)str[0]];
|
hval += asso_values[(unsigned char)str[0]];
|
||||||
|
|||||||
@@ -86,11 +86,21 @@ hash (str, len)
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
hval += asso_values[(unsigned char)str[6]];
|
hval += asso_values[(unsigned char)str[6]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 6:
|
case 6:
|
||||||
case 5:
|
case 5:
|
||||||
case 4:
|
case 4:
|
||||||
hval += asso_values[(unsigned char)str[3]];
|
hval += asso_values[(unsigned char)str[3]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 3:
|
case 3:
|
||||||
case 2:
|
case 2:
|
||||||
|
|||||||
@@ -110,6 +110,11 @@ hash (str, len)
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
hval += asso_values[(unsigned char)str[2]];
|
hval += asso_values[(unsigned char)str[2]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
|
|||||||
@@ -97,13 +97,28 @@ hash (register const char *str, register size_t len)
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
hval += asso_values[(unsigned char)str[4]+1];
|
hval += asso_values[(unsigned char)str[4]+1];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 4:
|
case 4:
|
||||||
case 3:
|
case 3:
|
||||||
hval += asso_values[(unsigned char)str[2]];
|
hval += asso_values[(unsigned char)str[2]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 2:
|
case 2:
|
||||||
hval += asso_values[(unsigned char)str[1]+9];
|
hval += asso_values[(unsigned char)str[1]+9];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 1:
|
case 1:
|
||||||
hval += asso_values[(unsigned char)str[0]];
|
hval += asso_values[(unsigned char)str[0]];
|
||||||
|
|||||||
@@ -81,24 +81,59 @@ hash (register const char *str, register size_t len)
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
hval += asso_values[(unsigned char)str[7]];
|
hval += asso_values[(unsigned char)str[7]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 7:
|
case 7:
|
||||||
hval += asso_values[(unsigned char)str[6]];
|
hval += asso_values[(unsigned char)str[6]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 6:
|
case 6:
|
||||||
hval += asso_values[(unsigned char)str[5]];
|
hval += asso_values[(unsigned char)str[5]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 5:
|
case 5:
|
||||||
hval += asso_values[(unsigned char)str[4]];
|
hval += asso_values[(unsigned char)str[4]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 4:
|
case 4:
|
||||||
hval += asso_values[(unsigned char)str[3]];
|
hval += asso_values[(unsigned char)str[3]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 3:
|
case 3:
|
||||||
hval += asso_values[(unsigned char)str[2]];
|
hval += asso_values[(unsigned char)str[2]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 2:
|
case 2:
|
||||||
hval += asso_values[(unsigned char)str[1]];
|
hval += asso_values[(unsigned char)str[1]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 1:
|
case 1:
|
||||||
hval += asso_values[(unsigned char)str[0]];
|
hval += asso_values[(unsigned char)str[0]];
|
||||||
|
|||||||
@@ -84,6 +84,11 @@ hash (register const char *str, register size_t len)
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
hval += asso_values[(unsigned char)str[2]];
|
hval += asso_values[(unsigned char)str[2]];
|
||||||
|
#if defined __cplusplus && __cplusplus >= 201703L
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 2:
|
case 2:
|
||||||
case 1:
|
case 1:
|
||||||
|
|||||||
Reference in New Issue
Block a user