Skip to content

Commit 9e58705

Browse files
committed
Make our perfect hash functions be valid C++.
While C is happy to cast "const void *" to "const unsigned char *" silently, C++ insists on an explicit cast. Since we put these functions into header files, cpluspluscheck whines about that. Add the cast to pacify it. Discussion: https://postgr.es/m/b517ec3918d645eb950505eac8dd434e@gaz-is.ru
1 parent d22f885 commit 9e58705

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tools/PerfectHash.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ sub generate_hash_function
131131
}
132132
$f .= sprintf "\n" if ($nhash % 8 != 0);
133133
$f .= sprintf "\t};\n\n";
134-
$f .= sprintf "\tconst unsigned char *k = key;\n";
134+
$f .= sprintf "\tconst unsigned char *k = (const unsigned char *) key;\n";
135135
$f .= sprintf "\tsize_t\t\tkeylen = %d;\n", $options{fixed_key_length}
136136
if (defined $options{fixed_key_length});
137137
$f .= sprintf "\tuint32\t\ta = %d;\n", $hash_seed1;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy