Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9dbd00b

Browse files
committed
Remove unnecessary parentheses in assignments.
Add spaces where needed.Reference time interval variables as tinterval.
1 parent3976899 commit9dbd00b

File tree

8 files changed

+164
-164
lines changed

8 files changed

+164
-164
lines changed

‎src/backend/utils/adt/acl.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/adt/acl.c,v 1.119 2005/07/14 21:46:30 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/acl.c,v 1.120 2005/07/21 04:41:42 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1017,7 +1017,7 @@ aclmask(const Acl *acl, Oid roleid, Oid ownerId,
10171017
if (aidata->ai_grantee==ACL_ID_PUBLIC||
10181018
aidata->ai_grantee==roleid)
10191019
{
1020-
result |=(aidata->ai_privs&mask);
1020+
result |=aidata->ai_privs&mask;
10211021
if ((how==ACLMASK_ALL) ? (result==mask) : (result!=0))
10221022
returnresult;
10231023
}
@@ -1030,7 +1030,7 @@ aclmask(const Acl *acl, Oid roleid, Oid ownerId,
10301030
* a given ACL entry grants any privileges still of interest before
10311031
* we perform the is_member test.
10321032
*/
1033-
remaining=(mask& ~result);
1033+
remaining=mask& ~result;
10341034
for (i=0;i<num;i++)
10351035
{
10361036
AclItem*aidata=&aidat[i];
@@ -1042,10 +1042,10 @@ aclmask(const Acl *acl, Oid roleid, Oid ownerId,
10421042
if ((aidata->ai_privs&remaining)&&
10431043
is_member_of_role(roleid,aidata->ai_grantee))
10441044
{
1045-
result |=(aidata->ai_privs&mask);
1045+
result |=aidata->ai_privs&mask;
10461046
if ((how==ACLMASK_ALL) ? (result==mask) : (result!=0))
10471047
returnresult;
1048-
remaining=(mask& ~result);
1048+
remaining=mask& ~result;
10491049
}
10501050
}
10511051

‎src/backend/utils/adt/cash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* workings can be found in the book "Software Solutions in C" by
1010
* Dale Schumacher, Academic Press, ISBN: 0-12-632360-7.
1111
*
12-
* $PostgreSQL: pgsql/src/backend/utils/adt/cash.c,v 1.64 2004/08/29 05:06:49 momjian Exp $
12+
* $PostgreSQL: pgsql/src/backend/utils/adt/cash.c,v 1.65 2005/07/21 04:41:43 momjian Exp $
1313
*/
1414

1515
#include"postgres.h"
@@ -197,7 +197,7 @@ cash_in(PG_FUNCTION_ARGS)
197197
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
198198
errmsg("invalid input syntax for type money: \"%s\"",str)));
199199

200-
result=(value*sgn);
200+
result=value*sgn;
201201

202202
#ifdefCASHDEBUG
203203
printf("cashin- result is %d\n",result);

‎src/backend/utils/adt/date.c

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.114 2005/07/2103:56:13 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.115 2005/07/2104:41:43 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -304,8 +304,7 @@ date2timestamptz(DateADT dateVal)
304304
tz=DetermineLocalTimeZone(tm);
305305

306306
#ifdefHAVE_INT64_TIMESTAMP
307-
result= (dateVal*USECS_PER_DAY)
308-
+ (tz*USECS_PER_SEC);
307+
result=dateVal*USECS_PER_DAY+tz*USECS_PER_SEC;
309308
#else
310309
result=dateVal* (double)SECS_PER_DAY+tz;
311310
#endif
@@ -725,7 +724,7 @@ timestamp_date(PG_FUNCTION_ARGS)
725724
if (TIMESTAMP_NOT_FINITE(timestamp))
726725
PG_RETURN_NULL();
727726

728-
if (timestamp2tm(timestamp,NULL,tm,&fsec,NULL,NULL)!=0)
727+
if (timestamp2tm(timestamp,NULL,tm,&fsec,NULL,NULL)!=0)
729728
ereport(ERROR,
730729
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
731730
errmsg("timestamp out of range")));
@@ -768,7 +767,7 @@ timestamptz_date(PG_FUNCTION_ARGS)
768767
if (TIMESTAMP_NOT_FINITE(timestamp))
769768
PG_RETURN_NULL();
770769

771-
if (timestamp2tm(timestamp,&tz,tm,&fsec,&tzn,NULL)!=0)
770+
if (timestamp2tm(timestamp,&tz,tm,&fsec,&tzn,NULL)!=0)
772771
ereport(ERROR,
773772
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
774773
errmsg("timestamp out of range")));
@@ -829,7 +828,7 @@ date_text(PG_FUNCTION_ARGS)
829828

830829
str=DatumGetCString(DirectFunctionCall1(date_out,date));
831830

832-
len=(strlen(str)+VARHDRSZ);
831+
len=strlen(str)+VARHDRSZ;
833832

834833
result=palloc(len);
835834

@@ -1337,7 +1336,7 @@ timestamp_time(PG_FUNCTION_ARGS)
13371336
if (TIMESTAMP_NOT_FINITE(timestamp))
13381337
PG_RETURN_NULL();
13391338

1340-
if (timestamp2tm(timestamp,NULL,tm,&fsec,NULL,NULL)!=0)
1339+
if (timestamp2tm(timestamp,NULL,tm,&fsec,NULL,NULL)!=0)
13411340
ereport(ERROR,
13421341
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
13431342
errmsg("timestamp out of range")));
@@ -1374,7 +1373,7 @@ timestamptz_time(PG_FUNCTION_ARGS)
13741373
if (TIMESTAMP_NOT_FINITE(timestamp))
13751374
PG_RETURN_NULL();
13761375

1377-
if (timestamp2tm(timestamp,&tz,tm,&fsec,&tzn,NULL)!=0)
1376+
if (timestamp2tm(timestamp,&tz,tm,&fsec,&tzn,NULL)!=0)
13781377
ereport(ERROR,
13791378
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
13801379
errmsg("timestamp out of range")));
@@ -1496,14 +1495,14 @@ time_pl_interval(PG_FUNCTION_ARGS)
14961495
TimeADTresult;
14971496

14981497
#ifdefHAVE_INT64_TIMESTAMP
1499-
result=(time+span->time);
1500-
result-=(result /USECS_PER_DAY*USECS_PER_DAY);
1498+
result=time+span->time;
1499+
result-=result /USECS_PER_DAY*USECS_PER_DAY;
15011500
if (result<INT64CONST(0))
15021501
result+=USECS_PER_DAY;
15031502
#else
15041503
TimeADTtime1;
15051504

1506-
result=(time+span->time);
1505+
result=time+span->time;
15071506
TMODULO(result,time1, (double)SECS_PER_DAY);
15081507
if (result<0)
15091508
result+=SECS_PER_DAY;
@@ -1523,14 +1522,14 @@ time_mi_interval(PG_FUNCTION_ARGS)
15231522
TimeADTresult;
15241523

15251524
#ifdefHAVE_INT64_TIMESTAMP
1526-
result=(time-span->time);
1527-
result-=(result /USECS_PER_DAY*USECS_PER_DAY);
1525+
result=time-span->time;
1526+
result-=result /USECS_PER_DAY*USECS_PER_DAY;
15281527
if (result<INT64CONST(0))
15291528
result+=USECS_PER_DAY;
15301529
#else
15311530
TimeADTtime1;
15321531

1533-
result=(time-span->time);
1532+
result=time-span->time;
15341533
TMODULO(result,time1, (double)SECS_PER_DAY);
15351534
if (result<0)
15361535
result+=SECS_PER_DAY;
@@ -1554,7 +1553,7 @@ time_text(PG_FUNCTION_ARGS)
15541553

15551554
str=DatumGetCString(DirectFunctionCall1(time_out,time));
15561555

1557-
len=(strlen(str)+VARHDRSZ);
1556+
len=strlen(str)+VARHDRSZ;
15581557

15591558
result=palloc(len);
15601559

@@ -1685,7 +1684,7 @@ time_part(PG_FUNCTION_ARGS)
16851684
elseif (type==RESERV&&val==DTK_EPOCH)
16861685
{
16871686
#ifdefHAVE_INT64_TIMESTAMP
1688-
result=(time /1000000.0);
1687+
result=time /1000000.0;
16891688
#else
16901689
result=time;
16911690
#endif
@@ -2036,12 +2035,12 @@ timetz_pl_interval(PG_FUNCTION_ARGS)
20362035
result= (TimeTzADT*)palloc(sizeof(TimeTzADT));
20372036

20382037
#ifdefHAVE_INT64_TIMESTAMP
2039-
result->time=(time->time+span->time);
2040-
result->time-=(result->time /USECS_PER_DAY*USECS_PER_DAY);
2038+
result->time=time->time+span->time;
2039+
result->time-=result->time /USECS_PER_DAY*USECS_PER_DAY;
20412040
if (result->time<INT64CONST(0))
20422041
result->time+=USECS_PER_DAY;
20432042
#else
2044-
result->time=(time->time+span->time);
2043+
result->time=time->time+span->time;
20452044
TMODULO(result->time,time1.time, (double)SECS_PER_DAY);
20462045
if (result->time<0)
20472046
result->time+=SECS_PER_DAY;
@@ -2069,12 +2068,12 @@ timetz_mi_interval(PG_FUNCTION_ARGS)
20692068
result= (TimeTzADT*)palloc(sizeof(TimeTzADT));
20702069

20712070
#ifdefHAVE_INT64_TIMESTAMP
2072-
result->time=(time->time-span->time);
2073-
result->time-=(result->time /USECS_PER_DAY*USECS_PER_DAY);
2071+
result->time=time->time-span->time;
2072+
result->time-=result->time /USECS_PER_DAY*USECS_PER_DAY;
20742073
if (result->time<INT64CONST(0))
20752074
result->time+=USECS_PER_DAY;
20762075
#else
2077-
result->time=(time->time-span->time);
2076+
result->time=time->time-span->time;
20782077
TMODULO(result->time,time1.time, (double)SECS_PER_DAY);
20792078
if (result->time<0)
20802079
result->time+=SECS_PER_DAY;
@@ -2265,7 +2264,7 @@ timestamptz_timetz(PG_FUNCTION_ARGS)
22652264
if (TIMESTAMP_NOT_FINITE(timestamp))
22662265
PG_RETURN_NULL();
22672266

2268-
if (timestamp2tm(timestamp,&tz,tm,&fsec,&tzn,NULL)!=0)
2267+
if (timestamp2tm(timestamp,&tz,tm,&fsec,&tzn,NULL)!=0)
22692268
ereport(ERROR,
22702269
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
22712270
errmsg("timestamp out of range")));
@@ -2315,7 +2314,7 @@ timetz_text(PG_FUNCTION_ARGS)
23152314

23162315
str=DatumGetCString(DirectFunctionCall1(timetz_out,timetz));
23172316

2318-
len=(strlen(str)+VARHDRSZ);
2317+
len=strlen(str)+VARHDRSZ;
23192318

23202319
result=palloc(len);
23212320

@@ -2497,7 +2496,8 @@ timetz_zone(PG_FUNCTION_ARGS)
24972496
pg_time_tnow;
24982497

24992498
/* Find the specified timezone */
2500-
len= (VARSIZE(zone)-VARHDRSZ>TZ_STRLEN_MAX)?TZ_STRLEN_MAX:(VARSIZE(zone)-VARHDRSZ);
2499+
len= (VARSIZE(zone)-VARHDRSZ>TZ_STRLEN_MAX) ?
2500+
TZ_STRLEN_MAX :VARSIZE(zone)-VARHDRSZ;
25012501
memcpy(tzname,VARDATA(zone),len);
25022502
tzname[len]=0;
25032503
tzp=pg_tzset(tzname);

‎src/backend/utils/adt/datetime.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.153 2005/07/2103:56:14 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.154 2005/07/2104:41:43 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -3275,8 +3275,8 @@ DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct pg_tm * tm,
32753275
intsec;
32763276

32773277
#ifdefHAVE_INT64_TIMESTAMP
3278-
sec=(*fsec /USECS_PER_SEC);
3279-
*fsec-=(sec*USECS_PER_SEC);
3278+
sec=*fsec /USECS_PER_SEC;
3279+
*fsec-=sec*USECS_PER_SEC;
32803280
#else
32813281
TMODULO(*fsec,sec,1.0);
32823282
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp