summaryrefslogtreecommitdiffstats
path: root/source/compiler-core/slang-perfect-hash.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-04-24 15:51:43 -0700
committerGitHub <noreply@github.com>2024-04-24 15:51:43 -0700
commitfc4c242442510fb97c3cfbf04d7582ebbc3bb0ed (patch)
tree0c19f6974dad99cbe1faa24b1aba41d0780008da /source/compiler-core/slang-perfect-hash.cpp
parent211b2ffc20d7798cab0b8483ccc3ec2b7ade49ab (diff)
Fix macos CI and clang warnings. (#4019)
* Fix macos CI. * Fix. * Fix. * Fix. * Fix clang warnings. * Fix more warnings.
Diffstat (limited to 'source/compiler-core/slang-perfect-hash.cpp')
-rw-r--r--source/compiler-core/slang-perfect-hash.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/compiler-core/slang-perfect-hash.cpp b/source/compiler-core/slang-perfect-hash.cpp
index d5c4902ed..a741f013c 100644
--- a/source/compiler-core/slang-perfect-hash.cpp
+++ b/source/compiler-core/slang-perfect-hash.cpp
@@ -146,7 +146,7 @@ String perfectHashToEmbeddableCpp(
w.print("bool %s(const UnownedStringSlice& str, %s& value)\n", String(funcName).getBuffer(), String(valueType).getBuffer());
line("{");
- w.print(" static const unsigned tableSalt[%ld] = {\n", hashParams.saltTable.getCount());
+ w.print(" static const unsigned tableSalt[%d] = {\n", (int)hashParams.saltTable.getCount());
w.print(" ");
for (Index i = 0; i < hashParams.saltTable.getCount(); ++i)
{
@@ -170,7 +170,7 @@ String perfectHashToEmbeddableCpp(
w.print(" using KV = std::pair<const char*, %s>;\n", String(valueType).getBuffer());
line("");
- w.print(" static const KV words[%ld] =\n", hashParams.destTable.getCount());
+ w.print(" static const KV words[%d] =\n", (int)hashParams.destTable.getCount());
line(" {");
for (Index i = 0; i < hashParams.destTable.getCount(); ++i)
{
@@ -191,7 +191,7 @@ String perfectHashToEmbeddableCpp(
line(" UInt32 h = salt;");
line(" for (const char c : str)");
line(" h = (h * 0x01000193) ^ c;");
- w.print(" return h %% %ld;\n", hashParams.saltTable.getCount());
+ w.print(" return h %% %d;\n", (int)hashParams.saltTable.getCount());
line(" };");
line("");