1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
Forwarded: https://github.com/hypermodeinc/ristretto/pull/470
From: Simon Josefsson <simon@josefsson.org>
Date: Sat, 4 Oct 2025 13:50:09 +0200
Subject: [PATCH] Fix compilation on 32-bit archs (#465)
src/github.com/dgraph-io/ristretto/sketch_test.go:67:8: cannot use 12 << 30 (untyped int constant 12884901888) as int value in assignment (overflows)
src/github.com/dgraph-io/ristretto/store_test.go:209:23: cannot use 4340958203495 (untyped int constant) as int value in argument to z.KeyToHash (overflows)
---
sketch_test.go | 2 +-
store_test.go | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sketch_test.go b/sketch_test.go
index 8e6a947..d1f3584 100644
--- a/sketch_test.go
+++ b/sketch_test.go
@@ -64,7 +64,7 @@ func TestSketchClear(t *testing.T) {
}
func TestNext2Power(t *testing.T) {
- sz := 12 << 30
+ sz := int64(12) << 30
szf := float64(sz) * 0.01
val := int64(szf)
t.Logf("szf = %.2f val = %d\n", szf, val)
diff --git a/store_test.go b/store_test.go
index e7923cb..c793e12 100644
--- a/store_test.go
+++ b/store_test.go
@@ -206,7 +206,7 @@ func TestStoreExpiration(t *testing.T) {
require.True(t, s.Expiration(key).IsZero())
// missing item
- key, _ = z.KeyToHash(4340958203495)
+ key, _ = z.KeyToHash(int64(4340958203495))
ttl = s.Expiration(key)
require.True(t, ttl.IsZero())
}
--
2.51.0
|