Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
9fd868d1
Commit
9fd868d1
authored
May 14, 1997
by
Thomas G. Lockhart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename new float and int conversion routines to avoid conflicts with
system calls on AIX (and probably other machines too).
parent
d906936e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
28 deletions
+28
-28
src/backend/utils/adt/float.c
src/backend/utils/adt/float.c
+14
-14
src/include/catalog/pg_proc.h
src/include/catalog/pg_proc.h
+9
-9
src/include/utils/builtins.h
src/include/utils/builtins.h
+5
-5
No files found.
src/backend/utils/adt/float.c
View file @
9fd868d1
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.1
4 1997/05/11 15:11:38
thomas Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.1
5 1997/05/14 04:35:10
thomas Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -24,7 +24,7 @@
* float4eq, float4ne, float4lt, float4le, float4gt, float4ge
* float8eq, float8ne, float8lt, float8le, float8gt, float8ge
* Conversion routines:
* ftod, dtof, i
tod, dtoi
, i2tod, dtoi2, itof, ftoi, i2tof, ftoi2
* ftod, dtof, i
4tod, dtoi4
, i2tod, dtoi2, itof, ftoi, i2tof, ftoi2
*
* Random float8 ops:
* dround, dtrunc, dsqrt, dcbrt, dpow, dexp, dlog1
...
...
@@ -743,17 +743,17 @@ float32 dtof(float64 num)
/*
* dtoi - converts a float8 number to an int4 number
* dtoi
4
- converts a float8 number to an int4 number
*/
int32
dtoi
(
float64
num
)
int32
dtoi
4
(
float64
num
)
{
int32
result
;
if
(
!
num
)
elog
(
WARN
,
"dtoi: unable to convert null"
,
NULL
);
elog
(
WARN
,
"dtoi
4
: unable to convert null"
,
NULL
);
if
((
*
num
<
INT_MIN
)
||
(
*
num
>
INT_MAX
))
elog
(
WARN
,
"dtoi: integer out of range"
,
NULL
);
elog
(
WARN
,
"dtoi
4
: integer out of range"
,
NULL
);
result
=
rint
(
*
num
);
return
(
result
);
...
...
@@ -779,9 +779,9 @@ int16 dtoi2(float64 num)
/*
* itod - converts an int4 number to a float8 number
* i
4
tod - converts an int4 number to a float8 number
*/
float64
itod
(
int32
num
)
float64
i
4
tod
(
int32
num
)
{
float64
result
;
...
...
@@ -807,17 +807,17 @@ float64 i2tod(int16 num)
/*
* ftoi - converts a float8 number to an int4 number
* ftoi
4
- converts a float8 number to an int4 number
*/
int32
ftoi
(
float32
num
)
int32
ftoi
4
(
float32
num
)
{
int32
result
;
if
(
!
num
)
elog
(
WARN
,
"ftoi: unable to convert null"
,
NULL
);
elog
(
WARN
,
"ftoi
4
: unable to convert null"
,
NULL
);
if
((
*
num
<
INT_MIN
)
||
(
*
num
>
INT_MAX
))
elog
(
WARN
,
"ftoi: integer out of range"
,
NULL
);
elog
(
WARN
,
"ftoi
4
: integer out of range"
,
NULL
);
result
=
rint
(
*
num
);
return
(
result
);
...
...
@@ -843,9 +843,9 @@ int16 ftoi2(float32 num)
/*
* itof - converts an int4 number to a float8 number
* i
4
tof - converts an int4 number to a float8 number
*/
float32
itof
(
int32
num
)
float32
i
4
tof
(
int32
num
)
{
float32
result
;
...
...
src/include/catalog/pg_proc.h
View file @
9fd868d1
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_proc.h,v 1.2
1 1997/05/11 15:19:33
thomas Exp $
* $Id: pg_proc.h,v 1.2
2 1997/05/14 04:34:19
thomas Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
...
...
@@ -392,10 +392,10 @@ DATA(insert OID = 312 ( dtof PGUID 11 f t f 2 f 700 "701" 100 0 0
DATA
(
insert
OID
=
313
(
i2toi4
PGUID
11
f
t
f
1
f
23
"21"
100
0
0
100
foo
bar
));
DATA
(
insert
OID
=
314
(
i4toi2
PGUID
11
f
t
f
1
f
21
"23"
100
0
0
100
foo
bar
));
DATA
(
insert
OID
=
315
(
keyfirsteq
PGUID
11
f
t
f
2
f
16
"0 21"
100
0
0
100
foo
bar
));
DATA
(
insert
OID
=
316
(
i
tod
PGUID
11
f
t
f
1
f
701
"23"
100
0
0
100
foo
bar
));
DATA
(
insert
OID
=
317
(
dtoi
PGUID
11
f
t
f
1
f
23
"701"
100
0
0
100
foo
bar
));
DATA
(
insert
OID
=
318
(
i
tof
PGUID
11
f
t
f
1
f
700
"23"
100
0
0
100
foo
bar
));
DATA
(
insert
OID
=
319
(
ftoi
PGUID
11
f
t
f
1
f
23
"700"
100
0
0
100
foo
bar
));
DATA
(
insert
OID
=
316
(
i
4tod
PGUID
11
f
t
f
1
f
701
"23"
100
0
0
100
foo
bar
));
DATA
(
insert
OID
=
317
(
dtoi
4
PGUID
11
f
t
f
1
f
23
"701"
100
0
0
100
foo
bar
));
DATA
(
insert
OID
=
318
(
i
4tof
PGUID
11
f
t
f
1
f
700
"23"
100
0
0
100
foo
bar
));
DATA
(
insert
OID
=
319
(
ftoi
4
PGUID
11
f
t
f
1
f
23
"700"
100
0
0
100
foo
bar
));
DATA
(
insert
OID
=
320
(
rtinsert
PGUID
11
f
t
f
5
f
23
"0"
100
0
0
100
foo
bar
));
DATA
(
insert
OID
=
321
(
rtdelete
PGUID
11
f
t
f
2
f
23
"0"
100
0
0
100
foo
bar
));
...
...
@@ -907,14 +907,14 @@ DATA(insert OID = 1405 ( int2 PGUID 14 f t f 1 f 21 "21" 100 0 0 10
DATA
(
insert
OID
=
1406
(
float8
PGUID
14
f
t
f
1
f
701
"701"
100
0
0
100
"select $1"
-
));
DATA
(
insert
OID
=
1407
(
float8
PGUID
14
f
t
f
1
f
701
"700"
100
0
0
100
"select ftod($1)"
-
));
DATA
(
insert
OID
=
1408
(
float8
PGUID
14
f
t
f
1
f
701
"23"
100
0
0
100
"select itod($1)"
-
));
DATA
(
insert
OID
=
1408
(
float8
PGUID
14
f
t
f
1
f
701
"23"
100
0
0
100
"select i
4
tod($1)"
-
));
DATA
(
insert
OID
=
1409
(
float8
PGUID
14
f
t
f
1
f
701
"21"
100
0
0
100
"select i2tod($1)"
-
));
DATA
(
insert
OID
=
1410
(
float4
PGUID
14
f
t
f
1
f
700
"23"
100
0
0
100
"select itof($1)"
-
));
DATA
(
insert
OID
=
1410
(
float4
PGUID
14
f
t
f
1
f
700
"23"
100
0
0
100
"select i
4
tof($1)"
-
));
DATA
(
insert
OID
=
1411
(
float4
PGUID
14
f
t
f
1
f
700
"21"
100
0
0
100
"select i2tof($1)"
-
));
DATA
(
insert
OID
=
1412
(
int4
PGUID
14
f
t
f
1
f
23
"23"
100
0
0
100
"select $1"
-
));
DATA
(
insert
OID
=
1413
(
int4
PGUID
14
f
t
f
1
f
23
"701"
100
0
0
100
"select dtoi($1)"
-
));
DATA
(
insert
OID
=
1413
(
int4
PGUID
14
f
t
f
1
f
23
"701"
100
0
0
100
"select dtoi
4
($1)"
-
));
DATA
(
insert
OID
=
1414
(
int4
PGUID
14
f
t
f
1
f
23
"21"
100
0
0
100
"select i2toi4($1)"
-
));
DATA
(
insert
OID
=
1415
(
int4
PGUID
14
f
t
f
1
f
23
"700"
100
0
0
100
"select ftoi($1)"
-
));
DATA
(
insert
OID
=
1415
(
int4
PGUID
14
f
t
f
1
f
23
"700"
100
0
0
100
"select ftoi
4
($1)"
-
));
DATA
(
insert
OID
=
1416
(
int2
PGUID
14
f
t
f
1
f
21
"21"
100
0
0
100
"select $1"
-
));
DATA
(
insert
OID
=
1417
(
int2
PGUID
14
f
t
f
1
f
21
"23"
100
0
0
100
"select i4toi2($1)"
-
));
DATA
(
insert
OID
=
1418
(
int2
PGUID
14
f
t
f
1
f
21
"701"
100
0
0
100
"select dtoi2($1)"
-
));
...
...
src/include/utils/builtins.h
View file @
9fd868d1
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: builtins.h,v 1.1
7 1997/05/11 15:13:47
thomas Exp $
* $Id: builtins.h,v 1.1
8 1997/05/14 04:33:41
thomas Exp $
*
* NOTES
* This should normally only be included by fmgr.h.
...
...
@@ -303,14 +303,14 @@ extern bool float8le(float64 arg1, float64 arg2);
extern
bool
float8gt
(
float64
arg1
,
float64
arg2
);
extern
bool
float8ge
(
float64
arg1
,
float64
arg2
);
extern
float64
ftod
(
float32
num
);
extern
float64
itod
(
int32
num
);
extern
float64
i
4
tod
(
int32
num
);
extern
float64
i2tod
(
int16
num
);
extern
float32
dtof
(
float64
num
);
extern
int32
dtoi
(
float64
num
);
extern
int32
dtoi
4
(
float64
num
);
extern
int16
dtoi2
(
float64
num
);
extern
float32
itof
(
int32
num
);
extern
float32
i
4
tof
(
int32
num
);
extern
float32
i2tof
(
int16
num
);
extern
int32
ftoi
(
float32
num
);
extern
int32
ftoi
4
(
float32
num
);
extern
int16
ftoi2
(
float32
num
);
extern
float64
dround
(
float64
arg1
);
extern
float64
dtrunc
(
float64
arg1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment