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

Commite6e3640

Browse files
committed
Move all the isinf() stuff from float.c to isinf.c, and build it according to
configure vs port specific #ifdef's...
1 parent79f99a3 commite6e3640

File tree

6 files changed

+181
-186
lines changed

6 files changed

+181
-186
lines changed

‎src/backend/parser/scan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* A lexical scanner generated by flex */
22

33
/* Scanner skeleton version:
4-
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.10 1998/01/2703:25:07 scrappy Exp $
4+
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.11 1998/02/02 00:03:39 scrappy Exp $
55
*/
66

77
#defineFLEX_SCANNER
@@ -539,7 +539,7 @@ char *yytext;
539539
*
540540
*
541541
* IDENTIFICATION
542-
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.10 1998/01/2703:25:07 scrappy Exp $
542+
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.11 1998/02/02 00:03:39 scrappy Exp $
543543
*
544544
*-------------------------------------------------------------------------
545545
*/

‎src/backend/port/isinf.c

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,63 @@
1-
/* $Id: isinf.c,v 1.1 1998/01/15 20:54:37 scrappy Exp $ */
1+
/* $Id: isinf.c,v 1.2 1998/02/02 00:03:46 scrappy Exp $ */
22

3-
#include<ieeefp.h>
43
#include<math.h>
5-
64
#include"config.h"
75

6+
#ifHAVE_FPCLASS
7+
# ifHAVE_IEEEFP_H
8+
# include<ieeefp.h>
9+
# endif
10+
int
11+
isinf(doubled)
12+
{
13+
fpclass_ttype=fpclass(d);
14+
15+
switch (type)
16+
{
17+
caseFP_SNAN:
18+
caseFP_QNAN:
19+
caseFP_NINF:
20+
caseFP_PINF:
21+
return (1);
22+
default:
23+
break;
24+
}
25+
return (0);
26+
}
27+
#endif
828

29+
#if defined(HAVE_FP_CLASS)|| defined(HAVE_FP_CLASS_D)
30+
# ifHAVE_FP_CLASS_H
31+
# include<fp_class.h>
32+
# endif
33+
int
34+
isinf(x)
35+
doublex;
36+
{
37+
#ifHAVE_FP_CLASS
38+
intfpclass=fp_class(x);
39+
#else
40+
intfpclass=fp_class_d(x);
41+
#endif
42+
43+
if (fpclass==FP_POS_INF)
44+
return (1);
45+
if (fpclass==FP_NEG_INF)
46+
return (-1);
47+
return (0);
48+
}
49+
#endif
50+
51+
#if defined(HAVE_CLASS)
952
int
1053
isinf(doublex)
1154
{
12-
if((fpclass(x)==FP_PINF)|| (fpclass(x)==FP_NINF))return1;
13-
elsereturn0;
14-
}
55+
intfpclass=class(x);
1556

57+
if (fpclass==FP_PLUS_INF)
58+
return (1);
59+
if (fpclass==FP_MINUS_INF)
60+
return (-1);
61+
return (0);
62+
}
63+
#endif

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

Lines changed: 1 addition & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.27 1998/01/13 19:28:32 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.28 1998/02/02 00:03:54 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1507,130 +1507,3 @@ doublex;
15071507
}
15081508

15091509
#endif/* !HAVE_CBRT */
1510-
1511-
#ifndefHAVE_ISINF
1512-
1513-
#if defined(aix)
1514-
1515-
#ifdefCLASS_CONFLICT
1516-
/* we want the math symbol */
1517-
#undef class
1518-
#endif/* CLASS_CONFICT */
1519-
1520-
/* The gcc doesn't support isinf() (without libgcc?) so we
1521-
* have to do it - Gerhard Reitofer
1522-
*/
1523-
#ifdef__GNUC__
1524-
1525-
staticint
1526-
isinf(doublex)
1527-
{
1528-
if (x==HUGE_VAL)
1529-
return(1);
1530-
if (x==-HUGE_VAL)
1531-
return(-1);
1532-
return(0);
1533-
}
1534-
1535-
#else/* __GNUC__ */
1536-
1537-
staticint
1538-
isinf(doublex)
1539-
{
1540-
intfpclass=class(x);
1541-
1542-
if (fpclass==FP_PLUS_INF)
1543-
return (1);
1544-
if (fpclass==FP_MINUS_INF)
1545-
return (-1);
1546-
return (0);
1547-
}
1548-
1549-
#endif/* __GNUC__ */
1550-
1551-
#endif/* aix */
1552-
1553-
#if defined(ultrix4)
1554-
#include<fp_class.h>
1555-
staticint
1556-
isinf(x)
1557-
doublex;
1558-
{
1559-
intfpclass=fp_class_d(x);
1560-
1561-
if (fpclass==FP_POS_INF)
1562-
return (1);
1563-
if (fpclass==FP_NEG_INF)
1564-
return (-1);
1565-
return (0);
1566-
}
1567-
1568-
#endif/* ultrix4 */
1569-
1570-
#if defined(alpha)
1571-
#include<fp_class.h>
1572-
staticint
1573-
isinf(x)
1574-
doublex;
1575-
{
1576-
intfpclass=fp_class(x);
1577-
1578-
if (fpclass==FP_POS_INF)
1579-
return (1);
1580-
if (fpclass==FP_NEG_INF)
1581-
return (-1);
1582-
return (0);
1583-
}
1584-
1585-
#endif/* alpha */
1586-
1587-
#if defined(sparc_solaris)|| defined(i386_solaris)|| defined(svr4)|| \
1588-
defined(sco)
1589-
#include<ieeefp.h>
1590-
staticint
1591-
isinf(d)
1592-
doubled;
1593-
{
1594-
fpclass_ttype=fpclass(d);
1595-
1596-
switch (type)
1597-
{
1598-
caseFP_SNAN:
1599-
caseFP_QNAN:
1600-
caseFP_NINF:
1601-
caseFP_PINF:
1602-
return (1);
1603-
default:
1604-
break;
1605-
}
1606-
1607-
return (0);
1608-
}
1609-
1610-
#endif/* sparc_solaris */
1611-
1612-
#if defined(irix5)
1613-
#include<ieeefp.h>
1614-
staticint
1615-
isinf(d)
1616-
doubled;
1617-
{
1618-
fpclass_ttype=fpclass(d);
1619-
1620-
switch (type)
1621-
{
1622-
caseFP_SNAN:
1623-
caseFP_QNAN:
1624-
caseFP_NINF:
1625-
caseFP_PINF:
1626-
return (1);
1627-
default:
1628-
break;
1629-
}
1630-
1631-
return (0);
1632-
}
1633-
1634-
#endif/* irix5 */
1635-
1636-
#endif/* !HAVE_ISINF */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp