Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9e58705

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 thesefunctions into header files, cpluspluscheck whines about that.Add the cast to pacify it.Discussion:https://postgr.es/m/b517ec3918d645eb950505eac8dd434e@gaz-is.ru
1 parentd22f885 commit9e58705

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)

[8]ページ先頭

©2009-2025 Movatter.jp