From: Tom Lane Date: Thu, 25 Oct 2001 20:37:30 +0000 (+0000) Subject: Fix a couple of places where lack of parenthesization of a cast X-Git-Tag: REL9_0_0~19271 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=22d9e912199dc2436d7a24bbfb82bcd768973020;p=pg-rex%2Fsyncrep.git 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... --- diff --git a/src/backend/access/transam/clog.c b/src/backend/access/transam/clog.c index 1436b32aa1..c0149f0cdb 100644 --- a/src/backend/access/transam/clog.c +++ b/src/backend/access/transam/clog.c @@ -13,7 +13,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * 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) TransactionId xid1; TransactionId xid2; - xid1 = (TransactionId) page1 *CLOG_XACTS_PER_PAGE; - + xid1 = ((TransactionId) page1) * CLOG_XACTS_PER_PAGE; xid1 += FirstNormalTransactionId; - xid2 = (TransactionId) page2 *CLOG_XACTS_PER_PAGE; - + xid2 = ((TransactionId) page2) * CLOG_XACTS_PER_PAGE; xid2 += FirstNormalTransactionId; return TransactionIdPrecedes(xid1, xid2); diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index 0afb9cf7e4..4e338b0eb2 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -8,7 +8,7 @@ * * * 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 @@ -1492,7 +1492,7 @@ UpdateStats(Oid relid, double reltuples) reltuples = 1000; } else - reltuples = (double) relpages *NTUPLES_PER_PAGE(whichRel->rd_rel->relnatts); + reltuples = ((double) relpages) * NTUPLES_PER_PAGE(whichRel->rd_rel->relnatts); } /* diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index 41c863a5ba..085032cd7a 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -8,7 +8,7 @@ * * * 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, { int tupno = values[i].tupno; - corr_xysum += (double) i *(double) tupno; - + corr_xysum += ((double) i) * ((double) tupno); dups_cnt++; if (tupnoLink[tupno] == tupno) { @@ -1519,9 +1518,10 @@ compute_scalar_stats(VacAttrStats *stats, * (values_cnt-1)*values_cnt*(2*values_cnt-1) / 6. *---------- */ - corr_xsum = (double) (values_cnt - 1) * (double) values_cnt / 2.0; - corr_x2sum = (double) (values_cnt - 1) * (double) values_cnt * - (double) (2 * values_cnt - 1) / 6.0; + corr_xsum = ((double) (values_cnt - 1)) * + ((double) values_cnt) / 2.0; + corr_x2sum = ((double) (values_cnt - 1)) * + ((double) values_cnt) * (double) (2 * values_cnt - 1) / 6.0; /* And the correlation coefficient reduces to */ corrs[0] = (values_cnt * corr_xysum - corr_xsum * corr_xsum) /