diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2013-06-25 16:36:29 -0400 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2013-06-25 16:41:47 -0400 |
commit | 4ca50e071024421e3b75bf7e48fda08141360636 (patch) | |
tree | 7eb04c0a0939c9c1214410a8af91f521a2ef10d2 | |
parent | 81166a2f7e1e792a746c907fe9e0318cc736311a (diff) | |
download | postgresql-4ca50e071024421e3b75bf7e48fda08141360636.tar.gz postgresql-4ca50e071024421e3b75bf7e48fda08141360636.zip |
Avoid inconsistent type declaration
Clang 3.3 correctly complains that a variable of type enum
MultiXactStatus cannot hold a value of -1, which makes sense. Change
the declared type of the variable to int instead, and apply casting as
necessary to avoid the warning.
Per notice from Andres Freund
-rw-r--r-- | src/backend/access/heap/heapam.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index e88dd30c648..1531f3b479a 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -116,12 +116,15 @@ static bool ConditionalMultiXactIdWait(MultiXactId multi, * update them). This table (and the macros below) helps us determine the * heavyweight lock mode and MultiXactStatus values to use for any particular * tuple lock strength. + * + * Don't look at lockstatus/updstatus directly! Use get_mxact_status_for_lock + * instead. */ static const struct { LOCKMODE hwlock; - MultiXactStatus lockstatus; - MultiXactStatus updstatus; + int lockstatus; + int updstatus; } tupleLockExtraInfo[MaxLockTupleMode + 1] = @@ -3847,7 +3850,7 @@ simple_heap_update(Relation relation, ItemPointer otid, HeapTuple tup) static MultiXactStatus get_mxact_status_for_lock(LockTupleMode mode, bool is_update) { - MultiXactStatus retval; + int retval; if (is_update) retval = tupleLockExtraInfo[mode].updstatus; @@ -3858,7 +3861,7 @@ get_mxact_status_for_lock(LockTupleMode mode, bool is_update) elog(ERROR, "invalid lock tuple mode %d/%s", mode, is_update ? "true" : "false"); - return retval; + return (MultiXactStatus) retval; } |