Commit 22d9e912 authored by Tom Lane's avatar Tom Lane

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...
parent 73c5ad93
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Header: /cvsroot/pgsql/src/backend/access/transam/clog.c,v 1.5 2001/10/25 05:49:22 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/transam/clog.c,v 1.6 2001/10/25 20:37:29 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -936,11 +936,9 @@ CLOGPagePrecedes(int page1, int page2) ...@@ -936,11 +936,9 @@ CLOGPagePrecedes(int page1, int page2)
TransactionId xid1; TransactionId xid1;
TransactionId xid2; TransactionId xid2;
xid1 = (TransactionId) page1 *CLOG_XACTS_PER_PAGE; xid1 = ((TransactionId) page1) * CLOG_XACTS_PER_PAGE;
xid1 += FirstNormalTransactionId; xid1 += FirstNormalTransactionId;
xid2 = (TransactionId) page2 *CLOG_XACTS_PER_PAGE; xid2 = ((TransactionId) page2) * CLOG_XACTS_PER_PAGE;
xid2 += FirstNormalTransactionId; xid2 += FirstNormalTransactionId;
return TransactionIdPrecedes(xid1, xid2); return TransactionIdPrecedes(xid1, xid2);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.166 2001/10/25 05:49:22 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.167 2001/10/25 20:37:30 tgl Exp $
* *
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
...@@ -1492,7 +1492,7 @@ UpdateStats(Oid relid, double reltuples) ...@@ -1492,7 +1492,7 @@ UpdateStats(Oid relid, double reltuples)
reltuples = 1000; reltuples = 1000;
} }
else else
reltuples = (double) relpages *NTUPLES_PER_PAGE(whichRel->rd_rel->relnatts); reltuples = ((double) relpages) * NTUPLES_PER_PAGE(whichRel->rd_rel->relnatts);
} }
/* /*
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.23 2001/10/25 05:49:23 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.24 2001/10/25 20:37:30 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1244,8 +1244,7 @@ compute_scalar_stats(VacAttrStats *stats, ...@@ -1244,8 +1244,7 @@ compute_scalar_stats(VacAttrStats *stats,
{ {
int tupno = values[i].tupno; int tupno = values[i].tupno;
corr_xysum += (double) i *(double) tupno; corr_xysum += ((double) i) * ((double) tupno);
dups_cnt++; dups_cnt++;
if (tupnoLink[tupno] == tupno) if (tupnoLink[tupno] == tupno)
{ {
...@@ -1519,9 +1518,10 @@ compute_scalar_stats(VacAttrStats *stats, ...@@ -1519,9 +1518,10 @@ compute_scalar_stats(VacAttrStats *stats,
* (values_cnt-1)*values_cnt*(2*values_cnt-1) / 6. * (values_cnt-1)*values_cnt*(2*values_cnt-1) / 6.
*---------- *----------
*/ */
corr_xsum = (double) (values_cnt - 1) * (double) values_cnt / 2.0; corr_xsum = ((double) (values_cnt - 1)) *
corr_x2sum = (double) (values_cnt - 1) * (double) values_cnt * ((double) values_cnt) / 2.0;
(double) (2 * values_cnt - 1) / 6.0; corr_x2sum = ((double) (values_cnt - 1)) *
((double) values_cnt) * (double) (2 * values_cnt - 1) / 6.0;
/* And the correlation coefficient reduces to */ /* And the correlation coefficient reduces to */
corrs[0] = (values_cnt * corr_xysum - corr_xsum * corr_xsum) / corrs[0] = (values_cnt * corr_xysum - corr_xsum * corr_xsum) /
......
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