mirror of
https://github.com/postgres/postgres.git
synced 2025-05-06 19:59:18 +03:00
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
This commit is contained in:
parent
d22f885f89
commit
9e58705a7f
@ -131,7 +131,7 @@ sub generate_hash_function
|
||||
}
|
||||
$f .= sprintf "\n" if ($nhash % 8 != 0);
|
||||
$f .= sprintf "\t};\n\n";
|
||||
$f .= sprintf "\tconst unsigned char *k = key;\n";
|
||||
$f .= sprintf "\tconst unsigned char *k = (const unsigned char *) key;\n";
|
||||
$f .= sprintf "\tsize_t\t\tkeylen = %d;\n", $options{fixed_key_length}
|
||||
if (defined $options{fixed_key_length});
|
||||
$f .= sprintf "\tuint32\t\ta = %d;\n", $hash_seed1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user