Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
277b2ea3
Commit
277b2ea3
authored
19 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Add comments about why errno is set to zero.
parent
814acfcc
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/backend/utils/adt/datetime.c
+11
-11
11 additions, 11 deletions
src/backend/utils/adt/datetime.c
src/backend/utils/adt/float.c
+13
-13
13 additions, 13 deletions
src/backend/utils/adt/float.c
with
24 additions
and
24 deletions
src/backend/utils/adt/datetime.c
+
11
−
11
View file @
277b2ea3
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.16
2
2005/12/01
17:56:34 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.16
3
2005/12/01
20:06:37 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1013,7 +1013,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
if
(
tzp
==
NULL
)
return
DTERR_BAD_FORMAT
;
errno
=
0
;
errno
=
0
;
/* avoid checking LONG_MIN/LONG_MAX */
val
=
strtol
(
field
[
i
],
&
cp
,
10
);
if
(
errno
==
ERANGE
)
return
DTERR_FIELD_OVERFLOW
;
...
...
@@ -1161,7 +1161,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
char
*
cp
;
int
val
;
errno
=
0
;
errno
=
0
;
/* avoid checking LONG_MIN/LONG_MAX */
val
=
strtol
(
field
[
i
],
&
cp
,
10
);
if
(
errno
==
ERANGE
)
return
DTERR_FIELD_OVERFLOW
;
...
...
@@ -1921,7 +1921,7 @@ DecodeTimeOnly(char **field, int *ftype, int nf,
break
;
}
errno
=
0
;
errno
=
0
;
/* avoid checking LONG_MIN/LONG_MAX */
val
=
strtol
(
field
[
i
],
&
cp
,
10
);
if
(
errno
==
ERANGE
)
return
DTERR_FIELD_OVERFLOW
;
...
...
@@ -2465,14 +2465,14 @@ DecodeTime(char *str, int fmask, int *tmask, struct pg_tm * tm, fsec_t *fsec)
*
tmask
=
DTK_TIME_M
;
errno
=
0
;
errno
=
0
;
/* avoid checking LONG_MIN/LONG_MAX */
tm
->
tm_hour
=
strtol
(
str
,
&
cp
,
10
);
if
(
errno
==
ERANGE
)
return
DTERR_FIELD_OVERFLOW
;
if
(
*
cp
!=
':'
)
return
DTERR_BAD_FORMAT
;
str
=
cp
+
1
;
errno
=
0
;
errno
=
0
;
/* avoid checking LONG_MIN/LONG_MAX */
tm
->
tm_min
=
strtol
(
str
,
&
cp
,
10
);
if
(
errno
==
ERANGE
)
return
DTERR_FIELD_OVERFLOW
;
...
...
@@ -2486,7 +2486,7 @@ DecodeTime(char *str, int fmask, int *tmask, struct pg_tm * tm, fsec_t *fsec)
else
{
str
=
cp
+
1
;
errno
=
0
;
errno
=
0
;
/* avoid checking LONG_MIN/LONG_MAX */
tm
->
tm_sec
=
strtol
(
str
,
&
cp
,
10
);
if
(
errno
==
ERANGE
)
return
DTERR_FIELD_OVERFLOW
;
...
...
@@ -2540,7 +2540,7 @@ DecodeNumber(int flen, char *str, bool haveTextMonth, int fmask,
*
tmask
=
0
;
errno
=
0
;
errno
=
0
;
/* avoid checking LONG_MIN/LONG_MAX */
val
=
strtol
(
str
,
&
cp
,
10
);
if
(
errno
==
ERANGE
)
return
DTERR_FIELD_OVERFLOW
;
...
...
@@ -2830,7 +2830,7 @@ DecodeTimezone(char *str, int *tzp)
if
(
*
str
!=
'+'
&&
*
str
!=
'-'
)
return
DTERR_BAD_FORMAT
;
errno
=
0
;
errno
=
0
;
/* avoid checking LONG_MIN/LONG_MAX */
hr
=
strtol
(
str
+
1
,
&
cp
,
10
);
if
(
errno
==
ERANGE
)
return
DTERR_TZDISP_OVERFLOW
;
...
...
@@ -2838,7 +2838,7 @@ DecodeTimezone(char *str, int *tzp)
/* explicit delimiter? */
if
(
*
cp
==
':'
)
{
errno
=
0
;
errno
=
0
;
/* avoid checking LONG_MIN/LONG_MAX */
min
=
strtol
(
cp
+
1
,
&
cp
,
10
);
if
(
errno
==
ERANGE
)
return
DTERR_TZDISP_OVERFLOW
;
...
...
@@ -3085,7 +3085,7 @@ DecodeInterval(char **field, int *ftype, int nf, int *dtype, struct pg_tm * tm,
case
DTK_DATE
:
case
DTK_NUMBER
:
errno
=
0
;
errno
=
0
;
/* avoid checking LONG_MIN/LONG_MAX */
val
=
strtol
(
field
[
i
],
&
cp
,
10
);
if
(
errno
==
ERANGE
)
return
DTERR_FIELD_OVERFLOW
;
...
...
This diff is collapsed.
Click to expand it.
src/backend/utils/adt/float.c
+
13
−
13
View file @
277b2ea3
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.11
6
2005/1
1/17 22:14:52 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.11
7
2005/1
2/01 20:06:37 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -278,7 +278,7 @@ float4in(PG_FUNCTION_ARGS)
while
(
*
num
!=
'\0'
&&
isspace
((
unsigned
char
)
*
num
))
num
++
;
errno
=
0
;
errno
=
0
;
/* avoid checking HUGE_VAL */
val
=
strtod
(
num
,
&
endptr
);
/* did we not see anything that looks like a double? */
...
...
@@ -445,7 +445,7 @@ float8in(PG_FUNCTION_ARGS)
while
(
*
num
!=
'\0'
&&
isspace
((
unsigned
char
)
*
num
))
num
++
;
errno
=
0
;
errno
=
0
;
/* avoid checking HUGE_VAL */
val
=
strtod
(
num
,
&
endptr
);
/* did we not see anything that looks like a double? */
...
...
@@ -1476,7 +1476,7 @@ dpow(PG_FUNCTION_ARGS)
* We must check both for errno getting set and for a NaN result, in order
* to deal with the vagaries of different platforms...
*/
errno
=
0
;
errno
=
0
;
/* avoid checking result for failure */
result
=
pow
(
arg1
,
arg2
);
if
(
errno
!=
0
#ifdef HAVE_FINITE
...
...
@@ -1506,7 +1506,7 @@ dexp(PG_FUNCTION_ARGS)
* to deal with the vagaries of different platforms. Also, a zero result
* implies unreported underflow.
*/
errno
=
0
;
errno
=
0
;
/* avoid checking result for failure */
result
=
exp
(
arg1
);
if
(
errno
!=
0
||
result
==
0
.
0
#ifdef HAVE_FINITE
...
...
@@ -1590,7 +1590,7 @@ dacos(PG_FUNCTION_ARGS)
float8
arg1
=
PG_GETARG_FLOAT8
(
0
);
float8
result
;
errno
=
0
;
errno
=
0
;
/* avoid checking result for failure */
result
=
acos
(
arg1
);
if
(
errno
!=
0
#ifdef HAVE_FINITE
...
...
@@ -1615,7 +1615,7 @@ dasin(PG_FUNCTION_ARGS)
float8
arg1
=
PG_GETARG_FLOAT8
(
0
);
float8
result
;
errno
=
0
;
errno
=
0
;
/* avoid checking result for failure */
result
=
asin
(
arg1
);
if
(
errno
!=
0
#ifdef HAVE_FINITE
...
...
@@ -1640,7 +1640,7 @@ datan(PG_FUNCTION_ARGS)
float8
arg1
=
PG_GETARG_FLOAT8
(
0
);
float8
result
;
errno
=
0
;
errno
=
0
;
/* avoid checking result for failure */
result
=
atan
(
arg1
);
if
(
errno
!=
0
#ifdef HAVE_FINITE
...
...
@@ -1666,7 +1666,7 @@ datan2(PG_FUNCTION_ARGS)
float8
arg2
=
PG_GETARG_FLOAT8
(
1
);
float8
result
;
errno
=
0
;
errno
=
0
;
/* avoid checking result for failure */
result
=
atan2
(
arg1
,
arg2
);
if
(
errno
!=
0
#ifdef HAVE_FINITE
...
...
@@ -1691,7 +1691,7 @@ dcos(PG_FUNCTION_ARGS)
float8
arg1
=
PG_GETARG_FLOAT8
(
0
);
float8
result
;
errno
=
0
;
errno
=
0
;
/* avoid checking result for failure */
result
=
cos
(
arg1
);
if
(
errno
!=
0
#ifdef HAVE_FINITE
...
...
@@ -1716,7 +1716,7 @@ dcot(PG_FUNCTION_ARGS)
float8
arg1
=
PG_GETARG_FLOAT8
(
0
);
float8
result
;
errno
=
0
;
errno
=
0
;
/* avoid checking result for failure */
result
=
tan
(
arg1
);
if
(
errno
!=
0
||
result
==
0
.
0
#ifdef HAVE_FINITE
...
...
@@ -1742,7 +1742,7 @@ dsin(PG_FUNCTION_ARGS)
float8
arg1
=
PG_GETARG_FLOAT8
(
0
);
float8
result
;
errno
=
0
;
errno
=
0
;
/* avoid checking result for failure */
result
=
sin
(
arg1
);
if
(
errno
!=
0
#ifdef HAVE_FINITE
...
...
@@ -1767,7 +1767,7 @@ dtan(PG_FUNCTION_ARGS)
float8
arg1
=
PG_GETARG_FLOAT8
(
0
);
float8
result
;
errno
=
0
;
errno
=
0
;
/* avoid checking result for failure */
result
=
tan
(
arg1
);
if
(
errno
!=
0
#ifdef HAVE_FINITE
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment