Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4ca50e0

Browse files
committed
Avoid inconsistent type declaration
Clang 3.3 correctly complains that a variable of type enumMultiXactStatus cannot hold a value of -1, which makes sense. Changethe declared type of the variable to int instead, and apply casting asnecessary to avoid the warning.Per notice from Andres Freund
1 parent81166a2 commit4ca50e0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

‎src/backend/access/heap/heapam.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,15 @@ static bool ConditionalMultiXactIdWait(MultiXactId multi,
116116
* update them). This table (and the macros below) helps us determine the
117117
* heavyweight lock mode and MultiXactStatus values to use for any particular
118118
* tuple lock strength.
119+
*
120+
* Don't look at lockstatus/updstatus directly! Use get_mxact_status_for_lock
121+
* instead.
119122
*/
120123
staticconststruct
121124
{
122125
LOCKMODEhwlock;
123-
MultiXactStatuslockstatus;
124-
MultiXactStatusupdstatus;
126+
intlockstatus;
127+
intupdstatus;
125128
}
126129

127130
tupleLockExtraInfo[MaxLockTupleMode+1]=
@@ -3847,7 +3850,7 @@ simple_heap_update(Relation relation, ItemPointer otid, HeapTuple tup)
38473850
staticMultiXactStatus
38483851
get_mxact_status_for_lock(LockTupleModemode,boolis_update)
38493852
{
3850-
MultiXactStatusretval;
3853+
intretval;
38513854

38523855
if (is_update)
38533856
retval=tupleLockExtraInfo[mode].updstatus;
@@ -3858,7 +3861,7 @@ get_mxact_status_for_lock(LockTupleMode mode, bool is_update)
38583861
elog(ERROR,"invalid lock tuple mode %d/%s",mode,
38593862
is_update ?"true" :"false");
38603863

3861-
returnretval;
3864+
return(MultiXactStatus)retval;
38623865
}
38633866

38643867

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp