Use long long for the 64-bit fingerprint table
authorChristopher Dykes <cdykes@fb.com>
Sat, 15 Jul 2017 07:48:16 +0000 (00:48 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sat, 15 Jul 2017 07:50:02 +0000 (00:50 -0700)
Summary: Because these are always 64-bit values. This hasn't actually been an issue but is the correct thing to do.

Reviewed By: yfeldblum

Differential Revision: D5425658

fbshipit-source-id: 5bc204b3d1af2c710bd8b1665211d2971ccf7be7

folly/build/GenerateFingerprintTables.cpp

index e8e5b75fae0af29e0e8da304239b7eba3a7324d3..da21e1716bec83b0b9c9c79fa6dfa3cead5f446f 100644 (file)
@@ -89,7 +89,7 @@ void computeTables(FILE* file, const FingerprintPolynomial<DEG>& poly) {
       "const uint64_t FingerprintTable<%d>::poly[%d] = {",
       DEG+1, FingerprintPolynomial<DEG>::size()));
   for (int j = 0; j < FingerprintPolynomial<DEG>::size(); j++) {
-    CHECK_ERR(fprintf(file, "%s%" PRIu64 "LU", j ? ", " : "", poly_val[j]));
+    CHECK_ERR(fprintf(file, "%s%" PRIu64 "LLU", j ? ", " : "", poly_val[j]));
   }
   CHECK_ERR(fprintf(file, "};\n\n"));
 
@@ -106,8 +106,8 @@ void computeTables(FILE* file, const FingerprintPolynomial<DEG>& poly) {
     for (int x = 0; x < 256; x++) {
       CHECK_ERR(fprintf(file, "    {"));
       for (int j = 0; j < FingerprintPolynomial<DEG>::size(); j++) {
-        CHECK_ERR(fprintf(
-          file, "%s%" PRIu64 "LU", (j ? ", " : ""), table[i][x][j]));
+        CHECK_ERR(
+            fprintf(file, "%s%" PRIu64 "LLU", (j ? ", " : ""), table[i][x][j]));
       }
       CHECK_ERR(fprintf(file, "},\n"));
     }