Skip to content

Commit ad7b47a

Browse files
committed
Fix sloppy macro coding (not enough parentheses).
1 parent ff7da2f commit ad7b47a

File tree

1 file changed

+22
-27
lines changed

1 file changed

+22
-27
lines changed

src/include/access/xact.h

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*-------------------------------------------------------------------------
22
*
33
* xact.h
4-
* postgres transaction system header
4+
* postgres transaction system definitions
55
*
66
*
77
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: xact.h,v 1.26 2000/06/08 22:37:38 momjian Exp $
10+
* $Id: xact.h,v 1.27 2000/07/28 01:04:40 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -17,6 +17,17 @@
1717
#include "access/transam.h"
1818
#include "utils/nabstime.h"
1919

20+
/*
21+
* Xact isolation levels
22+
*/
23+
#define XACT_DIRTY_READ 0 /* not implemented */
24+
#define XACT_READ_COMMITTED 1
25+
#define XACT_REPEATABLE_READ 2 /* not implemented */
26+
#define XACT_SERIALIZABLE 3
27+
28+
extern int DefaultXactIsoLevel;
29+
extern int XactIsoLevel;
30+
2031
/* ----------------
2132
* transaction state structure
2233
* ----------------
@@ -31,16 +42,7 @@ typedef struct TransactionStateData
3142
int blockState;
3243
} TransactionStateData;
3344

34-
/*
35-
* Xact isolation levels
36-
*/
37-
#define XACT_DIRTY_READ 0 /* not implemented */
38-
#define XACT_READ_COMMITTED 1
39-
#define XACT_REPEATABLE_READ 2 /* not implemented */
40-
#define XACT_SERIALIZABLE 3
41-
42-
extern int DefaultXactIsoLevel;
43-
extern int XactIsoLevel;
45+
typedef TransactionStateData *TransactionState;
4446

4547
/* ----------------
4648
* transaction states
@@ -64,23 +66,16 @@ extern int XactIsoLevel;
6466
#define TBLOCK_ABORT 4
6567
#define TBLOCK_ENDABORT 5
6668

67-
typedef TransactionStateData *TransactionState;
68-
69-
#define TransactionIdIsValid(xid) ((bool) (xid != NullTransactionId))
69+
/* ----------------
70+
* transaction ID manipulation macros
71+
* ----------------
72+
*/
73+
#define TransactionIdIsValid(xid) ((bool) ((xid) != NullTransactionId))
74+
#define TransactionIdEquals(id1, id2) ((bool) ((id1) == (id2)))
7075
#define TransactionIdStore(xid, dest) \
71-
(*((TransactionId*)dest) = (TransactionId)xid)
76+
(*((TransactionId*) (dest)) = (TransactionId) (xid))
7277
#define StoreInvalidTransactionId(dest) \
73-
(*((TransactionId*)dest) = NullTransactionId)
74-
75-
76-
/* ----------------------------------------------------------------
77-
* TransactionIdEquals
78-
* ----------------------------------------------------------------
79-
*/
80-
#define TransactionIdEquals(id1, id2) \
81-
( \
82-
((bool) ((id1) == (id2))) \
83-
)
78+
(*((TransactionId*) (dest)) = NullTransactionId)
8479

8580

8681
/* ----------------

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy