From 493eb0da31be4520252e1af723342dc7ead0c3e5 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 12 Dec 2025 08:58:34 +0100 Subject: Replace most StaticAssertStmt() with StaticAssertDecl() Similar to commit 75f49221c22, it is preferable to use StaticAssertDecl() instead of StaticAssertStmt() when possible. Discussion: https://www.postgresql.org/message-id/flat/CA%2BhUKGKvr0x_oGmQTUkx%3DODgSksT2EtgCA6LmGx_jQFG%3DsDUpg%40mail.gmail.com --- contrib/hstore/hstore_compat.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'contrib') diff --git a/contrib/hstore/hstore_compat.c b/contrib/hstore/hstore_compat.c index d75e9cb23f5..3a9f7f45cb7 100644 --- a/contrib/hstore/hstore_compat.c +++ b/contrib/hstore/hstore_compat.c @@ -94,7 +94,7 @@ * etc. are compatible. * * If the above statement isn't true on some bizarre platform, we're - * a bit hosed (see StaticAssertStmt in hstoreValidOldFormat). + * a bit hosed. */ typedef struct { @@ -105,6 +105,9 @@ typedef struct pos:31; } HOldEntry; +StaticAssertDecl(sizeof(HOldEntry) == 2 * sizeof(HEntry), + "old hstore format is not upward-compatible"); + static int hstoreValidNewFormat(HStore *hs); static int hstoreValidOldFormat(HStore *hs); @@ -179,10 +182,6 @@ hstoreValidOldFormat(HStore *hs) if (hs->size_ & HS_FLAG_NEWVERSION) return 0; - /* New format uses an HEntry for key and another for value */ - StaticAssertStmt(sizeof(HOldEntry) == 2 * sizeof(HEntry), - "old hstore format is not upward-compatible"); - if (count == 0) return 2; -- cgit v1.2.3