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
0afe5417
Commit
0afe5417
authored
May 09, 2003
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add rint() to /port, remove from qnx/.
parent
995773be
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
19 additions
and
149 deletions
+19
-149
configure
configure
+3
-1
configure.in
configure.in
+3
-2
src/backend/port/qnx4/Makefile
src/backend/port/qnx4/Makefile
+4
-7
src/backend/port/qnx4/tstrint.c
src/backend/port/qnx4/tstrint.c
+0
-32
src/include/c.h
src/include/c.h
+5
-1
src/interfaces/ecpg/pgtypeslib/Makefile
src/interfaces/ecpg/pgtypeslib/Makefile
+3
-2
src/interfaces/ecpg/pgtypeslib/dt.h
src/interfaces/ecpg/pgtypeslib/dt.h
+0
-1
src/interfaces/ecpg/pgtypeslib/dt_common.c
src/interfaces/ecpg/pgtypeslib/dt_common.c
+0
-102
src/port/rint.c
src/port/rint.c
+1
-1
No files found.
configure
View file @
0afe5417
...
...
@@ -11078,7 +11078,8 @@ fi
for
ac_func
in
fseeko gethostname getopt_long getrusage inet_aton random srandom strcasecmp strdup strerror strtol strtoul
for
ac_func
in
fseeko gethostname getopt_long getrusage inet_aton random rint srandom strcasecmp strdup strerror strtol strtoul
do
as_ac_var
=
`
echo
"ac_cv_func_
$ac_func
"
|
$as_tr_sh
`
echo
"
$as_me
:
$LINENO
: checking for
$ac_func
"
>
&5
...
...
@@ -11261,6 +11262,7 @@ LIBOBJS="$LIBOBJS dirmod.$ac_objext"
LIBOBJS
=
"
$LIBOBJS
opendir.
$ac_objext
"
;;
esac
# Now that rint() is /port, I am not sure this still works, bjm 2003-05-09
# On HPUX 9, rint() is not in regular libm.a but in /lib/pa1.1/libm.a;
# this hackery with HPUXMATHLIB allows us to cope.
HPUXMATHLIB
=
""
...
...
configure.in
View file @
0afe5417
dnl Process this file with autoconf to produce a configure script.
dnl $Header: /cvsroot/pgsql/configure.in,v 1.24
6 2003/05/09 01:16:29
momjian Exp $
dnl $Header: /cvsroot/pgsql/configure.in,v 1.24
7 2003/05/09 16:26:28
momjian Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
...
...
@@ -839,7 +839,7 @@ else
AC_CHECK_FUNCS([fpclass fp_class fp_class_d class], [break])
fi
AC_REPLACE_FUNCS([fseeko gethostname getopt_long getrusage inet_aton random srandom strcasecmp strdup strerror strtol strtoul])
AC_REPLACE_FUNCS([fseeko gethostname getopt_long getrusage inet_aton random
rint
srandom strcasecmp strdup strerror strtol strtoul])
# system's version of getaddrinfo(), if any, may be used only if we found
# a definition for struct addrinfo; see notes in src/include/getaddrinfo.h
...
...
@@ -867,6 +867,7 @@ AC_LIBOBJ(dirmod)
AC_LIBOBJ(opendir) ;;
esac
# Now that rint() is /port, I am not sure this still works, bjm 2003-05-09
# On HPUX 9, rint() is not in regular libm.a but in /lib/pa1.1/libm.a;
# this hackery with HPUXMATHLIB allows us to cope.
HPUXMATHLIB=""
...
...
src/backend/port/qnx4/Makefile
View file @
0afe5417
...
...
@@ -4,7 +4,7 @@
# Makefile for port/qnx4
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/Makefile,v 1.
4 2003/04/24 17:16:13
momjian Exp $
# $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/Makefile,v 1.
5 2003/05/09 16:26:29
momjian Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -12,16 +12,13 @@ subdir = src/backend/port/qnx4
top_builddir
=
../../../..
include
$(top_builddir)/src/Makefile.global
OBJS
=
isnan.o
rint.o
sem.o shm.o
OBJS
=
isnan.o sem.o shm.o
all
:
SUBSYS.o tst
rint tst
sem tstshm
all
:
SUBSYS.o tstsem tstshm
SUBSYS.o
:
$(OBJS)
$(LD)
$(LDREL)
$(LDOUT)
SUBSYS.o
$(OBJS)
tstrint
:
tstrint.o rint.o
$(CC)
-o
tstrint rint.o tstrint.o
tstsem
:
tstsem.o sem.o
$(CC)
-o
tstsem sem.o tstsem.o
...
...
@@ -32,7 +29,7 @@ depend dep:
$(CC)
-MM
$(CFLAGS)
*
.c
>
depend
clean
:
rm
-f
SUBSYS.o
$(OBJS)
tst
rint tstrint.o tst
sem tstsem.o tstshm tstshm.o
rm
-f
SUBSYS.o
$(OBJS)
tstsem tstsem.o tstshm tstshm.o
ifeq
(depend,$(wildcard depend))
include
depend
...
...
src/backend/port/qnx4/tstrint.c
deleted
100644 → 0
View file @
995773be
/*-------------------------------------------------------------------------
*
* tstrint.c
* rint() test
*
* Copyright (c) 1999, repas AEG Automation GmbH
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/tstrint.c,v 1.4 2002/11/08 20:23:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "c.h"
#include <errno.h>
int
main
(
int
argc
,
char
**
argv
)
{
double
x
;
if
(
argc
!=
2
)
exit
(
1
);
x
=
strtod
(
argv
[
1
],
NULL
);
printf
(
"rint( %f ) = %f
\n
"
,
x
,
rint
(
x
));
return
0
;
}
src/include/c.h
View file @
0afe5417
...
...
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: c.h,v 1.14
2 2003/05/09 01:1
6:29 momjian Exp $
* $Id: c.h,v 1.14
3 2003/05/09 16:2
6:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -811,6 +811,10 @@ extern int isinf(double x);
extern
int
gethostname
(
char
*
name
,
int
namelen
);
#endif
#ifndef HAVE_RINT
extern
double
rint
(
double
x
);
#endif
#ifndef HAVE_INET_ATON
# include <netinet/in.h>
# include <arpa/inet.h>
...
...
src/interfaces/ecpg/pgtypeslib/Makefile
View file @
0afe5417
...
...
@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.
5 2003/04/08 17:06:15 tgl
Exp $
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.
6 2003/05/09 16:26:29 momjian
Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -18,7 +18,8 @@ SO_MINOR_VERSION= 0.0
override CPPFLAGS
:
= -I$(top_srcdir)/src/interfaces/ecpg/include -I$(top_srcdir)/src/include/utils $(CPPFLAGS)
OBJS
=
numeric.o datetime.o common.o dt_common.o timestamp.o interval.o
OBJS
=
numeric.o datetime.o common.o dt_common.o timestamp.o interval.o
\
$(
filter
rint.o,
$(LIBOBJS)
)
all
:
all-lib
...
...
src/interfaces/ecpg/pgtypeslib/dt.h
View file @
0afe5417
...
...
@@ -299,7 +299,6 @@ int DecodeDateTime(char **, int *, int, int *, struct tm *, fsec_t *, int *, boo
void
j2date
(
int
,
int
*
,
int
*
,
int
*
);
void
GetCurrentDateTime
(
struct
tm
*
);
int
date2j
(
int
,
int
,
int
);
double
rint
(
double
x
);
extern
char
*
pgtypes_date_weekdays_short
[];
extern
char
*
pgtypes_date_months
[];
...
...
src/interfaces/ecpg/pgtypeslib/dt_common.c
View file @
0afe5417
...
...
@@ -510,108 +510,6 @@ char* pgtypes_date_weekdays_short[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri",
char
*
pgtypes_date_months
[]
=
{
"January"
,
"February"
,
"March"
,
"April"
,
"May"
,
"June"
,
"July"
,
"August"
,
"September"
,
"October"
,
"November"
,
"December"
,
NULL
};
#ifndef HAVE_RINT
/* @(#)s_rint.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
/*
* rint(x)
* Return x rounded to integral value according to the prevailing
* rounding mode.
* Method:
* Using floating addition.
* Exception:
* Inexact flag raised if x not equal to rint(x).
*/
static
const
double
one
=
1
.
0
,
TWO52
[
2
]
=
{
4.50359962737049600000e+15
,
/* 0x43300000, 0x00000000 */
-
4.50359962737049600000e+15
,
/* 0xC3300000, 0x00000000 */
};
double
rint
(
double
x
)
{
int
i0
,
n0
,
j0
,
sx
;
unsigned
i
,
i1
;
double
w
,
t
;
n0
=
(
*
((
int
*
)
&
one
)
>>
29
)
^
1
;
i0
=
*
(
n0
+
(
int
*
)
&
x
);
sx
=
(
i0
>>
31
)
&
1
;
i1
=
*
(
1
-
n0
+
(
int
*
)
&
x
);
j0
=
((
i0
>>
20
)
&
0x7ff
)
-
0x3ff
;
if
(
j0
<
20
)
{
if
(
j0
<
0
)
{
if
(((
i0
&
0x7fffffff
)
|
i1
)
==
0
)
return
x
;
i1
|=
(
i0
&
0x0fffff
);
i0
&=
0xfffe0000
;
i0
|=
((
i1
|
-
i1
)
>>
12
)
&
0x80000
;
*
(
n0
+
(
int
*
)
&
x
)
=
i0
;
w
=
TWO52
[
sx
]
+
x
;
t
=
w
-
TWO52
[
sx
];
i0
=
*
(
n0
+
(
int
*
)
&
t
);
*
(
n0
+
(
int
*
)
&
t
)
=
(
i0
&
0x7fffffff
)
|
(
sx
<<
31
);
return
t
;
}
else
{
i
=
(
0x000fffff
)
>>
j0
;
if
(((
i0
&
i
)
|
i1
)
==
0
)
return
x
;
/* x is integral */
i
>>=
1
;
if
(((
i0
&
i
)
|
i1
)
!=
0
)
{
if
(
j0
==
19
)
i1
=
0x40000000
;
else
i0
=
(
i0
&
(
~
i
))
|
((
0x20000
)
>>
j0
);
}
}
}
else
if
(
j0
>
51
)
{
if
(
j0
==
0x400
)
return
x
+
x
;
/* inf or NaN */
else
return
x
;
/* x is integral */
}
else
{
i
=
((
unsigned
)
(
0xffffffff
))
>>
(
j0
-
20
);
if
((
i1
&
i
)
==
0
)
return
x
;
/* x is integral */
i
>>=
1
;
if
((
i1
&
i
)
!=
0
)
i1
=
(
i1
&
(
~
i
))
|
((
0x40000000
)
>>
(
j0
-
20
));
}
*
(
n0
+
(
int
*
)
&
x
)
=
i0
;
*
(
1
-
n0
+
(
int
*
)
&
x
)
=
i1
;
w
=
TWO52
[
sx
]
+
x
;
return
w
-
TWO52
[
sx
];
}
#endif
/* !HAVE_RINT */
static
datetkn
*
datebsearch
(
char
*
key
,
datetkn
*
base
,
unsigned
int
nel
)
{
...
...
src/
backend/port/qnx4
/rint.c
→
src/
port
/rint.c
View file @
0afe5417
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/
backend/port/qnx4/Attic/rint.c,v 1.3 2001/08/24 14:07:49 petere
Exp $
* $Header: /cvsroot/pgsql/src/
port/rint.c,v 1.1 2003/05/09 16:26:29 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
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