Skip to content

Commit 0e6b152

Browse files
committed
Comment "errno = 0" in a more generic way.
1 parent ace17c1 commit 0e6b152

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

src/backend/utils/adt/datetime.c

Lines changed: 11 additions & 11 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.163 2005/12/01 20:06:37 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.164 2005/12/01 21:11:58 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1013,7 +1013,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
10131013
if (tzp == NULL)
10141014
return DTERR_BAD_FORMAT;
10151015

1016-
errno = 0; /* avoid checking LONG_MIN/LONG_MAX */
1016+
errno = 0; /* avoid having to check the result for failure */
10171017
val = strtol(field[i], &cp, 10);
10181018
if (errno == ERANGE)
10191019
return DTERR_FIELD_OVERFLOW;
@@ -1161,7 +1161,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
11611161
char *cp;
11621162
int val;
11631163

1164-
errno = 0; /* avoid checking LONG_MIN/LONG_MAX */
1164+
errno = 0; /* avoid having to check the result for failure */
11651165
val = strtol(field[i], &cp, 10);
11661166
if (errno == ERANGE)
11671167
return DTERR_FIELD_OVERFLOW;
@@ -1921,7 +1921,7 @@ DecodeTimeOnly(char **field, int *ftype, int nf,
19211921
break;
19221922
}
19231923

1924-
errno = 0; /* avoid checking LONG_MIN/LONG_MAX */
1924+
errno = 0; /* avoid having to check the result for failure */
19251925
val = strtol(field[i], &cp, 10);
19261926
if (errno == ERANGE)
19271927
return DTERR_FIELD_OVERFLOW;
@@ -2465,14 +2465,14 @@ DecodeTime(char *str, int fmask, int *tmask, struct pg_tm * tm, fsec_t *fsec)
24652465

24662466
*tmask = DTK_TIME_M;
24672467

2468-
errno = 0; /* avoid checking LONG_MIN/LONG_MAX */
2468+
errno = 0; /* avoid having to check the result for failure */
24692469
tm->tm_hour = strtol(str, &cp, 10);
24702470
if (errno == ERANGE)
24712471
return DTERR_FIELD_OVERFLOW;
24722472
if (*cp != ':')
24732473
return DTERR_BAD_FORMAT;
24742474
str = cp + 1;
2475-
errno = 0; /* avoid checking LONG_MIN/LONG_MAX */
2475+
errno = 0; /* avoid having to check the result for failure */
24762476
tm->tm_min = strtol(str, &cp, 10);
24772477
if (errno == ERANGE)
24782478
return DTERR_FIELD_OVERFLOW;
@@ -2486,7 +2486,7 @@ DecodeTime(char *str, int fmask, int *tmask, struct pg_tm * tm, fsec_t *fsec)
24862486
else
24872487
{
24882488
str = cp + 1;
2489-
errno = 0; /* avoid checking LONG_MIN/LONG_MAX */
2489+
errno = 0; /* avoid having to check the result for failure */
24902490
tm->tm_sec = strtol(str, &cp, 10);
24912491
if (errno == ERANGE)
24922492
return DTERR_FIELD_OVERFLOW;
@@ -2540,7 +2540,7 @@ DecodeNumber(int flen, char *str, bool haveTextMonth, int fmask,
25402540

25412541
*tmask = 0;
25422542

2543-
errno = 0; /* avoid checking LONG_MIN/LONG_MAX */
2543+
errno = 0; /* avoid having to check the result for failure */
25442544
val = strtol(str, &cp, 10);
25452545
if (errno == ERANGE)
25462546
return DTERR_FIELD_OVERFLOW;
@@ -2830,15 +2830,15 @@ DecodeTimezone(char *str, int *tzp)
28302830
if (*str != '+' && *str != '-')
28312831
return DTERR_BAD_FORMAT;
28322832

2833-
errno = 0; /* avoid checking LONG_MIN/LONG_MAX */
2833+
errno = 0; /* avoid having to check the result for failure */
28342834
hr = strtol(str + 1, &cp, 10);
28352835
if (errno == ERANGE)
28362836
return DTERR_TZDISP_OVERFLOW;
28372837

28382838
/* explicit delimiter? */
28392839
if (*cp == ':')
28402840
{
2841-
errno = 0; /* avoid checking LONG_MIN/LONG_MAX */
2841+
errno = 0; /* avoid having to check the result for failure */
28422842
min = strtol(cp + 1, &cp, 10);
28432843
if (errno == ERANGE)
28442844
return DTERR_TZDISP_OVERFLOW;
@@ -3085,7 +3085,7 @@ DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct pg_tm * tm,
30853085

30863086
case DTK_DATE:
30873087
case DTK_NUMBER:
3088-
errno = 0; /* avoid checking LONG_MIN/LONG_MAX */
3088+
errno = 0; /* avoid having to check the result for failure */
30893089
val = strtol(field[i], &cp, 10);
30903090
if (errno == ERANGE)
30913091
return DTERR_FIELD_OVERFLOW;

src/backend/utils/adt/float.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.117 2005/12/01 20:06:37 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.118 2005/12/01 21:11:58 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -278,7 +278,7 @@ float4in(PG_FUNCTION_ARGS)
278278
while (*num != '\0' && isspace((unsigned char) *num))
279279
num++;
280280

281-
errno = 0; /* avoid checking HUGE_VAL */
281+
errno = 0; /* avoid having to check the result for failure */
282282
val = strtod(num, &endptr);
283283

284284
/* did we not see anything that looks like a double? */
@@ -445,7 +445,7 @@ float8in(PG_FUNCTION_ARGS)
445445
while (*num != '\0' && isspace((unsigned char) *num))
446446
num++;
447447

448-
errno = 0; /* avoid checking HUGE_VAL */
448+
errno = 0; /* avoid having to check the result for failure */
449449
val = strtod(num, &endptr);
450450

451451
/* did we not see anything that looks like a double? */
@@ -1476,7 +1476,7 @@ dpow(PG_FUNCTION_ARGS)
14761476
* We must check both for errno getting set and for a NaN result, in order
14771477
* to deal with the vagaries of different platforms...
14781478
*/
1479-
errno = 0; /* avoid checking result for failure */
1479+
errno = 0; /* avoid having to check the result for failure */
14801480
result = pow(arg1, arg2);
14811481
if (errno != 0
14821482
#ifdef HAVE_FINITE
@@ -1506,7 +1506,7 @@ dexp(PG_FUNCTION_ARGS)
15061506
* to deal with the vagaries of different platforms. Also, a zero result
15071507
* implies unreported underflow.
15081508
*/
1509-
errno = 0; /* avoid checking result for failure */
1509+
errno = 0; /* avoid having to check the result for failure */
15101510
result = exp(arg1);
15111511
if (errno != 0 || result == 0.0
15121512
#ifdef HAVE_FINITE
@@ -1590,7 +1590,7 @@ dacos(PG_FUNCTION_ARGS)
15901590
float8 arg1 = PG_GETARG_FLOAT8(0);
15911591
float8 result;
15921592

1593-
errno = 0; /* avoid checking result for failure */
1593+
errno = 0; /* avoid having to check the result for failure */
15941594
result = acos(arg1);
15951595
if (errno != 0
15961596
#ifdef HAVE_FINITE
@@ -1615,7 +1615,7 @@ dasin(PG_FUNCTION_ARGS)
16151615
float8 arg1 = PG_GETARG_FLOAT8(0);
16161616
float8 result;
16171617

1618-
errno = 0; /* avoid checking result for failure */
1618+
errno = 0; /* avoid having to check the result for failure */
16191619
result = asin(arg1);
16201620
if (errno != 0
16211621
#ifdef HAVE_FINITE
@@ -1640,7 +1640,7 @@ datan(PG_FUNCTION_ARGS)
16401640
float8 arg1 = PG_GETARG_FLOAT8(0);
16411641
float8 result;
16421642

1643-
errno = 0; /* avoid checking result for failure */
1643+
errno = 0; /* avoid having to check the result for failure */
16441644
result = atan(arg1);
16451645
if (errno != 0
16461646
#ifdef HAVE_FINITE
@@ -1666,7 +1666,7 @@ datan2(PG_FUNCTION_ARGS)
16661666
float8 arg2 = PG_GETARG_FLOAT8(1);
16671667
float8 result;
16681668

1669-
errno = 0; /* avoid checking result for failure */
1669+
errno = 0; /* avoid having to check the result for failure */
16701670
result = atan2(arg1, arg2);
16711671
if (errno != 0
16721672
#ifdef HAVE_FINITE
@@ -1691,7 +1691,7 @@ dcos(PG_FUNCTION_ARGS)
16911691
float8 arg1 = PG_GETARG_FLOAT8(0);
16921692
float8 result;
16931693

1694-
errno = 0; /* avoid checking result for failure */
1694+
errno = 0; /* avoid having to check the result for failure */
16951695
result = cos(arg1);
16961696
if (errno != 0
16971697
#ifdef HAVE_FINITE
@@ -1716,7 +1716,7 @@ dcot(PG_FUNCTION_ARGS)
17161716
float8 arg1 = PG_GETARG_FLOAT8(0);
17171717
float8 result;
17181718

1719-
errno = 0; /* avoid checking result for failure */
1719+
errno = 0; /* avoid having to check the result for failure */
17201720
result = tan(arg1);
17211721
if (errno != 0 || result == 0.0
17221722
#ifdef HAVE_FINITE
@@ -1742,7 +1742,7 @@ dsin(PG_FUNCTION_ARGS)
17421742
float8 arg1 = PG_GETARG_FLOAT8(0);
17431743
float8 result;
17441744

1745-
errno = 0; /* avoid checking result for failure */
1745+
errno = 0; /* avoid having to check the result for failure */
17461746
result = sin(arg1);
17471747
if (errno != 0
17481748
#ifdef HAVE_FINITE
@@ -1767,7 +1767,7 @@ dtan(PG_FUNCTION_ARGS)
17671767
float8 arg1 = PG_GETARG_FLOAT8(0);
17681768
float8 result;
17691769

1770-
errno = 0; /* avoid checking result for failure */
1770+
errno = 0; /* avoid having to check the result for failure */
17711771
result = tan(arg1);
17721772
if (errno != 0
17731773
#ifdef HAVE_FINITE

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