v7-0003-Add-UINT64CONST-not-sure-when-we-actually-need-th.patch
text/x-patch
Filename: v7-0003-Add-UINT64CONST-not-sure-when-we-actually-need-th.patch
Type: text/x-patch
Part: 10
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch v7-0003
Subject: Add UINT64CONST (not sure when we actually need that)
| File | + | − |
|---|---|---|
| src/include/common/hashfn_unstable.h | 3 | 3 |
From 7416a25418fbc576fc549b9a31cc44d219501c92 Mon Sep 17 00:00:00 2001
From: John Naylor <john.naylor@postgresql.org>
Date: Sat, 9 Dec 2023 16:14:04 +0700
Subject: [PATCH v7 03/13] Add UINT64CONST (not sure when we actually need
that)
fasthash*_orig left alone for now.
---
src/include/common/hashfn_unstable.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/include/common/hashfn_unstable.h b/src/include/common/hashfn_unstable.h
index fbae7a5522..7ed1e5335a 100644
--- a/src/include/common/hashfn_unstable.h
+++ b/src/include/common/hashfn_unstable.h
@@ -56,7 +56,7 @@ static inline uint64
fasthash_mix(uint64 h)
{
h ^= h >> 23;
- h *= 0x2127599bf4325c37ULL;
+ h *= UINT64CONST(0x2127599bf4325c37);
h ^= h >> 47;
return h;
}
@@ -65,7 +65,7 @@ static inline void
fasthash_combine(fasthash_state* hs)
{
hs->hash ^= fasthash_mix(hs->accum);
- hs->hash *= 0x880355f21e6d1965ULL;
+ hs->hash *= UINT64CONST(0x880355f21e6d1965);
/* reset hash state for next input */
hs->accum = 0;
@@ -79,7 +79,7 @@ fasthash_init(fasthash_state *hs, int len, uint64 seed)
// since we don't know the length for a nul-terminated string
// handle some other way -- maybe we can accum the length in
// the state and fold it in during the finalizer (cf. xxHash3)
- hs->hash = seed ^ (len * 0x880355f21e6d1965ULL);
+ hs->hash = seed ^ (len * UINT64CONST(0x880355f21e6d1965));
}
static inline void
--
2.43.0