diff options
author | Tom Lane | 2019-05-31 14:40:00 +0000 |
---|---|---|
committer | Tom Lane | 2019-05-31 14:40:00 +0000 |
commit | 9e58705a7f9728f10b2e0f0c9adc6e6ecff7486e (patch) | |
tree | 712f87a4e704ea9f0f15752ec24fd4860c2d8847 | |
parent | d22f885f895add7e0184b08a78ba92ff091e36c4 (diff) |
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/[email protected]
-rw-r--r-- | src/tools/PerfectHash.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/PerfectHash.pm b/src/tools/PerfectHash.pm index bd339e38a22..54f5d4e9940 100644 --- a/src/tools/PerfectHash.pm +++ b/src/tools/PerfectHash.pm @@ -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; |