Commit 13000b44 authored by Heikki Linnakangas's avatar Heikki Linnakangas

Remove now-unnecessary casts.

Kevin Grittner
parent 5fe241c5
...@@ -1432,8 +1432,7 @@ GetSafeSnapshot(Snapshot origSnapshot) ...@@ -1432,8 +1432,7 @@ GetSafeSnapshot(Snapshot origSnapshot)
* them marked us as conflicted. * them marked us as conflicted.
*/ */
MySerializableXact->flags |= SXACT_FLAG_DEFERRABLE_WAITING; MySerializableXact->flags |= SXACT_FLAG_DEFERRABLE_WAITING;
while (!(SHMQueueEmpty((SHM_QUEUE *) while (!(SHMQueueEmpty(&MySerializableXact->possibleUnsafeConflicts) ||
&MySerializableXact->possibleUnsafeConflicts) ||
SxactIsROUnsafe(MySerializableXact))) SxactIsROUnsafe(MySerializableXact)))
{ {
LWLockRelease(SerializableXactHashLock); LWLockRelease(SerializableXactHashLock);
...@@ -3114,13 +3113,13 @@ ReleasePredicateLocks(const bool isCommit) ...@@ -3114,13 +3113,13 @@ ReleasePredicateLocks(const bool isCommit)
* opposed to 'outLink' for the r/w xacts. * opposed to 'outLink' for the r/w xacts.
*/ */
possibleUnsafeConflict = (RWConflict) possibleUnsafeConflict = (RWConflict)
SHMQueueNext((SHM_QUEUE *) &MySerializableXact->possibleUnsafeConflicts, SHMQueueNext(&MySerializableXact->possibleUnsafeConflicts,
(SHM_QUEUE *) &MySerializableXact->possibleUnsafeConflicts, &MySerializableXact->possibleUnsafeConflicts,
offsetof(RWConflictData, inLink)); offsetof(RWConflictData, inLink));
while (possibleUnsafeConflict) while (possibleUnsafeConflict)
{ {
nextConflict = (RWConflict) nextConflict = (RWConflict)
SHMQueueNext((SHM_QUEUE *) &MySerializableXact->possibleUnsafeConflicts, SHMQueueNext(&MySerializableXact->possibleUnsafeConflicts,
&possibleUnsafeConflict->inLink, &possibleUnsafeConflict->inLink,
offsetof(RWConflictData, inLink)); offsetof(RWConflictData, inLink));
...@@ -3153,13 +3152,13 @@ ReleasePredicateLocks(const bool isCommit) ...@@ -3153,13 +3152,13 @@ ReleasePredicateLocks(const bool isCommit)
* previously committed transactions. * previously committed transactions.
*/ */
conflict = (RWConflict) conflict = (RWConflict)
SHMQueueNext((SHM_QUEUE *) &MySerializableXact->outConflicts, SHMQueueNext(&MySerializableXact->outConflicts,
(SHM_QUEUE *) &MySerializableXact->outConflicts, &MySerializableXact->outConflicts,
offsetof(RWConflictData, outLink)); offsetof(RWConflictData, outLink));
while (conflict) while (conflict)
{ {
nextConflict = (RWConflict) nextConflict = (RWConflict)
SHMQueueNext((SHM_QUEUE *) &MySerializableXact->outConflicts, SHMQueueNext(&MySerializableXact->outConflicts,
&conflict->outLink, &conflict->outLink,
offsetof(RWConflictData, outLink)); offsetof(RWConflictData, outLink));
...@@ -3186,13 +3185,13 @@ ReleasePredicateLocks(const bool isCommit) ...@@ -3186,13 +3185,13 @@ ReleasePredicateLocks(const bool isCommit)
* we're rolling back, clear them all. * we're rolling back, clear them all.
*/ */
conflict = (RWConflict) conflict = (RWConflict)
SHMQueueNext((SHM_QUEUE *) &MySerializableXact->inConflicts, SHMQueueNext(&MySerializableXact->inConflicts,
(SHM_QUEUE *) &MySerializableXact->inConflicts, &MySerializableXact->inConflicts,
offsetof(RWConflictData, inLink)); offsetof(RWConflictData, inLink));
while (conflict) while (conflict)
{ {
nextConflict = (RWConflict) nextConflict = (RWConflict)
SHMQueueNext((SHM_QUEUE *) &MySerializableXact->inConflicts, SHMQueueNext(&MySerializableXact->inConflicts,
&conflict->inLink, &conflict->inLink,
offsetof(RWConflictData, inLink)); offsetof(RWConflictData, inLink));
...@@ -3213,13 +3212,13 @@ ReleasePredicateLocks(const bool isCommit) ...@@ -3213,13 +3212,13 @@ ReleasePredicateLocks(const bool isCommit)
* up if they are known safe or known unsafe. * up if they are known safe or known unsafe.
*/ */
possibleUnsafeConflict = (RWConflict) possibleUnsafeConflict = (RWConflict)
SHMQueueNext((SHM_QUEUE *) &MySerializableXact->possibleUnsafeConflicts, SHMQueueNext(&MySerializableXact->possibleUnsafeConflicts,
(SHM_QUEUE *) &MySerializableXact->possibleUnsafeConflicts, &MySerializableXact->possibleUnsafeConflicts,
offsetof(RWConflictData, outLink)); offsetof(RWConflictData, outLink));
while (possibleUnsafeConflict) while (possibleUnsafeConflict)
{ {
nextConflict = (RWConflict) nextConflict = (RWConflict)
SHMQueueNext((SHM_QUEUE *) &MySerializableXact->possibleUnsafeConflicts, SHMQueueNext(&MySerializableXact->possibleUnsafeConflicts,
&possibleUnsafeConflict->outLink, &possibleUnsafeConflict->outLink,
offsetof(RWConflictData, outLink)); offsetof(RWConflictData, outLink));
...@@ -3290,7 +3289,7 @@ ReleasePredicateLocks(const bool isCommit) ...@@ -3290,7 +3289,7 @@ ReleasePredicateLocks(const bool isCommit)
/* Add this to the list of transactions to check for later cleanup. */ /* Add this to the list of transactions to check for later cleanup. */
if (isCommit) if (isCommit)
SHMQueueInsertBefore(FinishedSerializableTransactions, SHMQueueInsertBefore(FinishedSerializableTransactions,
(SHM_QUEUE *) &(MySerializableXact->finishedLink)); &MySerializableXact->finishedLink);
if (!isCommit) if (!isCommit)
ReleaseOneSerializableXact(MySerializableXact, false, false); ReleaseOneSerializableXact(MySerializableXact, false, false);
...@@ -3789,7 +3788,7 @@ CheckForSerializableConflictOut(const bool visible, const Relation relation, ...@@ -3789,7 +3788,7 @@ CheckForSerializableConflictOut(const bool visible, const Relation relation,
errhint("The transaction might succeed if retried."))); errhint("The transaction might succeed if retried.")));
if (SxactHasSummaryConflictIn(MySerializableXact) if (SxactHasSummaryConflictIn(MySerializableXact)
|| !SHMQueueEmpty((SHM_QUEUE *) &MySerializableXact->inConflicts)) || !SHMQueueEmpty(&MySerializableXact->inConflicts))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_T_R_SERIALIZATION_FAILURE), (errcode(ERRCODE_T_R_SERIALIZATION_FAILURE),
errmsg("could not serialize access due to read/write dependencies among transactions"), errmsg("could not serialize access due to read/write dependencies among transactions"),
...@@ -4462,8 +4461,8 @@ PreCommit_CheckForSerializationFailure(void) ...@@ -4462,8 +4461,8 @@ PreCommit_CheckForSerializationFailure(void)
} }
nearConflict = (RWConflict) nearConflict = (RWConflict)
SHMQueueNext((SHM_QUEUE *) &MySerializableXact->inConflicts, SHMQueueNext(&MySerializableXact->inConflicts,
(SHM_QUEUE *) &MySerializableXact->inConflicts, &MySerializableXact->inConflicts,
offsetof(RWConflictData, inLink)); offsetof(RWConflictData, inLink));
while (nearConflict) while (nearConflict)
{ {
...@@ -4496,7 +4495,7 @@ PreCommit_CheckForSerializationFailure(void) ...@@ -4496,7 +4495,7 @@ PreCommit_CheckForSerializationFailure(void)
} }
nearConflict = (RWConflict) nearConflict = (RWConflict)
SHMQueueNext((SHM_QUEUE *) &MySerializableXact->inConflicts, SHMQueueNext(&MySerializableXact->inConflicts,
&nearConflict->inLink, &nearConflict->inLink,
offsetof(RWConflictData, inLink)); offsetof(RWConflictData, inLink));
} }
...@@ -4543,9 +4542,9 @@ AtPrepare_PredicateLocks(void) ...@@ -4543,9 +4542,9 @@ AtPrepare_PredicateLocks(void)
* outConflicts lists, if they're non-empty we'll represent that by * outConflicts lists, if they're non-empty we'll represent that by
* setting the appropriate summary conflict flags. * setting the appropriate summary conflict flags.
*/ */
if (!SHMQueueEmpty((SHM_QUEUE *) &MySerializableXact->inConflicts)) if (!SHMQueueEmpty(&MySerializableXact->inConflicts))
xactRecord->flags |= SXACT_FLAG_SUMMARY_CONFLICT_IN; xactRecord->flags |= SXACT_FLAG_SUMMARY_CONFLICT_IN;
if (!SHMQueueEmpty((SHM_QUEUE *) &MySerializableXact->outConflicts)) if (!SHMQueueEmpty(&MySerializableXact->outConflicts))
xactRecord->flags |= SXACT_FLAG_SUMMARY_CONFLICT_OUT; xactRecord->flags |= SXACT_FLAG_SUMMARY_CONFLICT_OUT;
RegisterTwoPhaseRecord(TWOPHASE_RM_PREDICATELOCK_ID, 0, RegisterTwoPhaseRecord(TWOPHASE_RM_PREDICATELOCK_ID, 0,
......
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