mirror of
https://github.com/postgres/postgres.git
synced 2025-12-19 17:02:53 +03:00
Replace most StaticAssertStmt() with StaticAssertDecl()
Similar to commit 75f49221c2, 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
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user