Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 22d9e91

Browse files
committed
Fix a couple of places where lack of parenthesization of a cast
causes pgindent to make weird formatting decisions. Easiest fix seems to be to put in the extra parens...
1 parent 73c5ad9 commit 22d9e91

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

src/backend/access/transam/clog.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
1414
* Portions Copyright (c) 1994, Regents of the University of California
1515
*
16-
* $Header: /cvsroot/pgsql/src/backend/access/transam/clog.c,v 1.5 2001/10/25 05:49:22 momjian Exp $
16+
* $Header: /cvsroot/pgsql/src/backend/access/transam/clog.c,v 1.6 2001/10/25 20:37:29 tgl Exp $
1717
*
1818
*-------------------------------------------------------------------------
1919
*/
@@ -936,11 +936,9 @@ CLOGPagePrecedes(int page1, int page2)
936936
TransactionId xid1;
937937
TransactionId xid2;
938938

939-
xid1 = (TransactionId) page1 *CLOG_XACTS_PER_PAGE;
940-
939+
xid1 = ((TransactionId) page1) * CLOG_XACTS_PER_PAGE;
941940
xid1 += FirstNormalTransactionId;
942-
xid2 = (TransactionId) page2 *CLOG_XACTS_PER_PAGE;
943-
941+
xid2 = ((TransactionId) page2) * CLOG_XACTS_PER_PAGE;
944942
xid2 += FirstNormalTransactionId;
945943

946944
return TransactionIdPrecedes(xid1, xid2);

src/backend/catalog/index.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.166 2001/10/25 05:49:22 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.167 2001/10/25 20:37:30 tgl Exp $
1212
*
1313
*
1414
* INTERFACE ROUTINES
@@ -1492,7 +1492,7 @@ UpdateStats(Oid relid, double reltuples)
14921492
reltuples = 1000;
14931493
}
14941494
else
1495-
reltuples = (double) relpages *NTUPLES_PER_PAGE(whichRel->rd_rel->relnatts);
1495+
reltuples = ((double) relpages) * NTUPLES_PER_PAGE(whichRel->rd_rel->relnatts);
14961496
}
14971497

14981498
/*

src/backend/commands/analyze.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.23 2001/10/25 05:49:23 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.24 2001/10/25 20:37:30 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1244,8 +1244,7 @@ compute_scalar_stats(VacAttrStats *stats,
12441244
{
12451245
int tupno = values[i].tupno;
12461246

1247-
corr_xysum += (double) i *(double) tupno;
1248-
1247+
corr_xysum += ((double) i) * ((double) tupno);
12491248
dups_cnt++;
12501249
if (tupnoLink[tupno] == tupno)
12511250
{
@@ -1519,9 +1518,10 @@ compute_scalar_stats(VacAttrStats *stats,
15191518
* (values_cnt-1)*values_cnt*(2*values_cnt-1) / 6.
15201519
*----------
15211520
*/
1522-
corr_xsum = (double) (values_cnt - 1) * (double) values_cnt / 2.0;
1523-
corr_x2sum = (double) (values_cnt - 1) * (double) values_cnt *
1524-
(double) (2 * values_cnt - 1) / 6.0;
1521+
corr_xsum = ((double) (values_cnt - 1)) *
1522+
((double) values_cnt) / 2.0;
1523+
corr_x2sum = ((double) (values_cnt - 1)) *
1524+
((double) values_cnt) * (double) (2 * values_cnt - 1) / 6.0;
15251525

15261526
/* And the correlation coefficient reduces to */
15271527
corrs[0] = (values_cnt * corr_xysum - corr_xsum * corr_xsum) /

0 commit comments

Comments
 (0)