Skip to content

Commit 8758134

Browse files
committed
Remove excess parens, use Abs instead of : ?.
1 parent 2e9c04e commit 8758134

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/backend/utils/adt/datetime.c

Lines changed: 8 additions & 8 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.139 2005/04/20 17:14:50 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.140 2005/05/21 03:38:05 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1551,7 +1551,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
15511551
return DTERR_FIELD_OVERFLOW;
15521552

15531553
/* timezone not specified? then find local timezone if possible */
1554-
if ((tzp != NULL) && (!(fmask & DTK_M(TZ))))
1554+
if (tzp != NULL && !(fmask & DTK_M(TZ)))
15551555
{
15561556
/*
15571557
* daylight savings time modifier but no standard timezone?
@@ -2205,7 +2205,7 @@ DecodeTimeOnly(char **field, int *ftype, int nf,
22052205
return DTERR_BAD_FORMAT;
22062206

22072207
/* timezone not specified? then find local timezone if possible */
2208-
if ((tzp != NULL) && (!(fmask & DTK_M(TZ))))
2208+
if (tzp != NULL && !(fmask & DTK_M(TZ)))
22092209
{
22102210
struct pg_tm tt,
22112211
*tmp = &tt;
@@ -3533,7 +3533,7 @@ EncodeDateTime(struct pg_tm * tm, fsec_t fsec, int *tzp, char **tzn, int style,
35333533
* have alpha time zone info available. tm_isdst != -1
35343534
* indicates that we have a valid time zone translation.
35353535
*/
3536-
if ((tzp != NULL) && (tm->tm_isdst >= 0))
3536+
if (tzp != NULL && tm->tm_isdst >= 0)
35373537
{
35383538
hour = -(*tzp / 3600);
35393539
min = ((abs(*tzp) / 60) % 60);
@@ -3579,7 +3579,7 @@ EncodeDateTime(struct pg_tm * tm, fsec_t fsec, int *tzp, char **tzn, int style,
35793579
else
35803580
sprintf((str + strlen(str)), ":%02d", tm->tm_sec);
35813581

3582-
if ((tzp != NULL) && (tm->tm_isdst >= 0))
3582+
if (tzp != NULL && tm->tm_isdst >= 0)
35833583
{
35843584
if (*tzn != NULL)
35853585
sprintf((str + strlen(str)), " %.*s", MAXTZLEN, *tzn);
@@ -3627,7 +3627,7 @@ EncodeDateTime(struct pg_tm * tm, fsec_t fsec, int *tzp, char **tzn, int style,
36273627
else
36283628
sprintf((str + strlen(str)), ":%02d", tm->tm_sec);
36293629

3630-
if ((tzp != NULL) && (tm->tm_isdst >= 0))
3630+
if (tzp != NULL && tm->tm_isdst >= 0)
36313631
{
36323632
if (*tzn != NULL)
36333633
sprintf((str + strlen(str)), " %.*s", MAXTZLEN, *tzn);
@@ -3686,7 +3686,7 @@ EncodeDateTime(struct pg_tm * tm, fsec_t fsec, int *tzp, char **tzn, int style,
36863686
sprintf((str + strlen(str)), " %04d",
36873687
((tm->tm_year > 0) ? tm->tm_year : -(tm->tm_year - 1)));
36883688

3689-
if ((tzp != NULL) && (tm->tm_isdst >= 0))
3689+
if (tzp != NULL && tm->tm_isdst >= 0)
36903690
{
36913691
if (*tzn != NULL)
36923692
sprintf((str + strlen(str)), " %.*s", MAXTZLEN, *tzn);
@@ -3787,7 +3787,7 @@ EncodeInterval(struct pg_tm * tm, fsec_t fsec, int style, char *str)
37873787
#ifdef HAVE_INT64_TIMESTAMP
37883788
sprintf(cp, ":%02d", abs(tm->tm_sec));
37893789
cp += strlen(cp);
3790-
sprintf(cp, ".%06d", ((fsec >= 0) ? fsec : -(fsec)));
3790+
sprintf(cp, ".%06d", Abs(fsec));
37913791
#else
37923792
fsec += tm->tm_sec;
37933793
sprintf(cp, ":%013.10f", fabs(fsec));

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