Commit eaa40705 authored by Tom Lane's avatar Tom Lane

Don't use anonymous unions.

Commit cc5f8136 introduced a language
feature that is not acceptable to strict C89 compilers.

Thomas Munro

Per buildfarm.
parent fba36655
...@@ -172,7 +172,7 @@ typedef struct SharedRecordTableKey ...@@ -172,7 +172,7 @@ typedef struct SharedRecordTableKey
{ {
TupleDesc local_tupdesc; TupleDesc local_tupdesc;
dsa_pointer shared_tupdesc; dsa_pointer shared_tupdesc;
}; } u;
bool shared; bool shared;
} SharedRecordTableKey; } SharedRecordTableKey;
...@@ -209,14 +209,14 @@ shared_record_table_compare(const void *a, const void *b, size_t size, ...@@ -209,14 +209,14 @@ shared_record_table_compare(const void *a, const void *b, size_t size,
TupleDesc t2; TupleDesc t2;
if (k1->shared) if (k1->shared)
t1 = (TupleDesc) dsa_get_address(area, k1->shared_tupdesc); t1 = (TupleDesc) dsa_get_address(area, k1->u.shared_tupdesc);
else else
t1 = k1->local_tupdesc; t1 = k1->u.local_tupdesc;
if (k2->shared) if (k2->shared)
t2 = (TupleDesc) dsa_get_address(area, k2->shared_tupdesc); t2 = (TupleDesc) dsa_get_address(area, k2->u.shared_tupdesc);
else else
t2 = k2->local_tupdesc; t2 = k2->u.local_tupdesc;
return equalTupleDescs(t1, t2) ? 0 : 1; return equalTupleDescs(t1, t2) ? 0 : 1;
} }
...@@ -232,9 +232,9 @@ shared_record_table_hash(const void *a, size_t size, void *arg) ...@@ -232,9 +232,9 @@ shared_record_table_hash(const void *a, size_t size, void *arg)
TupleDesc t; TupleDesc t;
if (k->shared) if (k->shared)
t = (TupleDesc) dsa_get_address(area, k->shared_tupdesc); t = (TupleDesc) dsa_get_address(area, k->u.shared_tupdesc);
else else
t = k->local_tupdesc; t = k->u.local_tupdesc;
return hashTupleDesc(t); return hashTupleDesc(t);
} }
...@@ -1710,14 +1710,14 @@ SharedRecordTypmodRegistryInit(SharedRecordTypmodRegistry *registry, ...@@ -1710,14 +1710,14 @@ SharedRecordTypmodRegistryInit(SharedRecordTypmodRegistry *registry,
/* Insert into the record table. */ /* Insert into the record table. */
record_table_key.shared = false; record_table_key.shared = false;
record_table_key.local_tupdesc = tupdesc; record_table_key.u.local_tupdesc = tupdesc;
record_table_entry = dshash_find_or_insert(record_table, record_table_entry = dshash_find_or_insert(record_table,
&record_table_key, &record_table_key,
&found); &found);
if (!found) if (!found)
{ {
record_table_entry->key.shared = true; record_table_entry->key.shared = true;
record_table_entry->key.shared_tupdesc = shared_dp; record_table_entry->key.u.shared_tupdesc = shared_dp;
} }
dshash_release_lock(record_table, record_table_entry); dshash_release_lock(record_table, record_table_entry);
} }
...@@ -2261,7 +2261,7 @@ find_or_make_matching_shared_tupledesc(TupleDesc tupdesc) ...@@ -2261,7 +2261,7 @@ find_or_make_matching_shared_tupledesc(TupleDesc tupdesc)
/* Try to find a matching tuple descriptor in the record table. */ /* Try to find a matching tuple descriptor in the record table. */
key.shared = false; key.shared = false;
key.local_tupdesc = tupdesc; key.u.local_tupdesc = tupdesc;
record_table_entry = (SharedRecordTableEntry *) record_table_entry = (SharedRecordTableEntry *)
dshash_find(CurrentSession->shared_record_table, &key, false); dshash_find(CurrentSession->shared_record_table, &key, false);
if (record_table_entry) if (record_table_entry)
...@@ -2271,7 +2271,7 @@ find_or_make_matching_shared_tupledesc(TupleDesc tupdesc) ...@@ -2271,7 +2271,7 @@ find_or_make_matching_shared_tupledesc(TupleDesc tupdesc)
record_table_entry); record_table_entry);
result = (TupleDesc) result = (TupleDesc)
dsa_get_address(CurrentSession->area, dsa_get_address(CurrentSession->area,
record_table_entry->key.shared_tupdesc); record_table_entry->key.u.shared_tupdesc);
Assert(result->tdrefcount == -1); Assert(result->tdrefcount == -1);
return result; return result;
...@@ -2342,7 +2342,7 @@ find_or_make_matching_shared_tupledesc(TupleDesc tupdesc) ...@@ -2342,7 +2342,7 @@ find_or_make_matching_shared_tupledesc(TupleDesc tupdesc)
/* Store it and return it. */ /* Store it and return it. */
record_table_entry->key.shared = true; record_table_entry->key.shared = true;
record_table_entry->key.shared_tupdesc = shared_dp; record_table_entry->key.u.shared_tupdesc = shared_dp;
dshash_release_lock(CurrentSession->shared_record_table, dshash_release_lock(CurrentSession->shared_record_table,
record_table_entry); record_table_entry);
result = (TupleDesc) result = (TupleDesc)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment