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

Commit0afe541

Browse files
committed
Add rint() to /port, remove from qnx/.
1 parent995773b commit0afe541

File tree

9 files changed

+19
-149
lines changed

9 files changed

+19
-149
lines changed

‎configure

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11078,7 +11078,8 @@ fi
1107811078
1107911079
1108011080
11081-
forac_funcin fseeko gethostname getopt_long getrusage inet_aton random srandom strcasecmp strdup strerror strtol strtoul
11081+
11082+
forac_funcin fseeko gethostname getopt_long getrusage inet_aton random rint srandom strcasecmp strdup strerror strtol strtoul
1108211083
do
1108311084
as_ac_var=`echo"ac_cv_func_$ac_func"|$as_tr_sh`
1108411085
echo"$as_me:$LINENO: checking for$ac_func">&5
@@ -11261,6 +11262,7 @@ LIBOBJS="$LIBOBJS dirmod.$ac_objext"
1126111262
LIBOBJS="$LIBOBJS opendir.$ac_objext" ;;
1126211263
esac
1126311264
11265+
# Now that rint() is /port, I am not sure this still works, bjm 2003-05-09
1126411266
# On HPUX 9, rint() is not in regular libm.a but in /lib/pa1.1/libm.a;
1126511267
# this hackery with HPUXMATHLIB allows us to cope.
1126611268
HPUXMATHLIB=""

‎configure.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $Header: /cvsroot/pgsql/configure.in,v 1.246 2003/05/0901:16:29 momjian Exp $
2+
dnl $Header: /cvsroot/pgsql/configure.in,v 1.247 2003/05/09 16:26:28 momjian Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -839,7 +839,7 @@ else
839839
AC_CHECK_FUNCS([fpclass fp_class fp_class_d class], [break])
840840
fi
841841

842-
AC_REPLACE_FUNCS([fseeko gethostname getopt_long getrusage inet_aton random srandom strcasecmp strdup strerror strtol strtoul])
842+
AC_REPLACE_FUNCS([fseeko gethostname getopt_long getrusage inet_aton randomrintsrandom strcasecmp strdup strerror strtol strtoul])
843843

844844
# system's version of getaddrinfo(), if any, may be used only if we found
845845
# a definition for struct addrinfo; see notes in src/include/getaddrinfo.h
@@ -867,6 +867,7 @@ AC_LIBOBJ(dirmod)
867867
AC_LIBOBJ(opendir) ;;
868868
esac
869869

870+
# Now that rint() is /port, I am not sure this still works, bjm 2003-05-09
870871
# On HPUX 9, rint() is not in regular libm.a but in /lib/pa1.1/libm.a;
871872
# this hackery with HPUXMATHLIB allows us to cope.
872873
HPUXMATHLIB=""

‎src/backend/port/qnx4/Makefile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,21 @@
44
# Makefile for port/qnx4
55
#
66
# IDENTIFICATION
7-
# $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/Makefile,v 1.4 2003/04/24 17:16:13 momjian Exp $
7+
# $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/Makefile,v 1.5 2003/05/0916:26:29 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

1111
subdir = src/backend/port/qnx4
1212
top_builddir = ../../../..
1313
include$(top_builddir)/src/Makefile.global
1414

15-
OBJS = isnan.orint.osem.o shm.o
15+
OBJS = isnan.o sem.o shm.o
1616

17-
all: SUBSYS.otstrinttstsem tstshm
17+
all: SUBSYS.o tstsem tstshm
1818

1919
SUBSYS.o:$(OBJS)
2020
$(LD)$(LDREL)$(LDOUT) SUBSYS.o$(OBJS)
2121

22-
tstrint: tstrint.o rint.o
23-
$(CC) -o tstrint rint.o tstrint.o
24-
2522
tstsem: tstsem.o sem.o
2623
$(CC) -o tstsem sem.o tstsem.o
2724

@@ -32,7 +29,7 @@ depend dep:
3229
$(CC) -MM$(CFLAGS)*.c>depend
3330

3431
clean:
35-
rm -f SUBSYS.o$(OBJS)tstrint tstrint.otstsem tstsem.o tstshm tstshm.o
32+
rm -f SUBSYS.o$(OBJS) tstsem tstsem.o tstshm tstshm.o
3633

3734
ifeq (depend,$(wildcard depend))
3835
include depend

‎src/backend/port/qnx4/tstrint.c

Lines changed: 0 additions & 32 deletions
This file was deleted.

‎src/include/c.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $Id: c.h,v 1.142 2003/05/0901:16:29 momjian Exp $
15+
* $Id: c.h,v 1.143 2003/05/0916:26:29 momjian Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -811,6 +811,10 @@ extern int isinf(double x);
811811
externintgethostname(char*name,intnamelen);
812812
#endif
813813

814+
#ifndefHAVE_RINT
815+
externdoublerint(doublex);
816+
#endif
817+
814818
#ifndefHAVE_INET_ATON
815819
# include<netinet/in.h>
816820
# include<arpa/inet.h>

‎src/interfaces/ecpg/pgtypeslib/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.5 2003/04/08 17:06:15 tgl Exp $
7+
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/pgtypeslib/Makefile,v 1.6 2003/05/09 16:26:29 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -18,7 +18,8 @@ SO_MINOR_VERSION= 0.0
1818

1919
overrideCPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(top_srcdir)/src/include/utils$(CPPFLAGS)
2020

21-
OBJS= numeric.o datetime.o common.o dt_common.o timestamp.o interval.o
21+
OBJS= numeric.o datetime.o common.o dt_common.o timestamp.o interval.o\
22+
$(filter rint.o,$(LIBOBJS))
2223

2324
all: all-lib
2425

‎src/interfaces/ecpg/pgtypeslib/dt.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ int DecodeDateTime(char **, int *, int, int *, struct tm *, fsec_t *, int *, boo
299299
voidj2date(int,int*,int*,int*);
300300
voidGetCurrentDateTime(structtm*);
301301
intdate2j(int,int,int);
302-
doublerint(doublex);
303302

304303
externchar*pgtypes_date_weekdays_short[];
305304
externchar*pgtypes_date_months[];

‎src/interfaces/ecpg/pgtypeslib/dt_common.c

Lines changed: 0 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -510,108 +510,6 @@ char* pgtypes_date_weekdays_short[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri",
510510

511511
char*pgtypes_date_months[]= {"January","February","March","April","May","June","July","August","September","October","November","December",NULL};
512512

513-
#ifndefHAVE_RINT
514-
515-
/* @(#)s_rint.c 5.1 93/09/24 */
516-
/*
517-
* ====================================================
518-
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
519-
*
520-
* Developed at SunPro, a Sun Microsystems, Inc. business.
521-
* Permission to use, copy, modify, and distribute this
522-
* software is freely granted, provided that this notice
523-
* is preserved.
524-
* ====================================================
525-
*/
526-
527-
/*
528-
* rint(x)
529-
* Return x rounded to integral value according to the prevailing
530-
* rounding mode.
531-
* Method:
532-
*Using floating addition.
533-
* Exception:
534-
*Inexact flag raised if x not equal to rint(x).
535-
*/
536-
537-
staticconstdoubleone=1.0,
538-
TWO52[2]= {
539-
4.50359962737049600000e+15,/* 0x43300000, 0x00000000 */
540-
-4.50359962737049600000e+15,/* 0xC3300000, 0x00000000 */
541-
};
542-
543-
double
544-
rint(doublex)
545-
{
546-
inti0,
547-
n0,
548-
j0,
549-
sx;
550-
unsignedi,
551-
i1;
552-
doublew,
553-
t;
554-
555-
n0= (*((int*)&one) >>29) ^1;
556-
i0=*(n0+ (int*)&x);
557-
sx= (i0 >>31)&1;
558-
i1=*(1-n0+ (int*)&x);
559-
j0= ((i0 >>20)&0x7ff)-0x3ff;
560-
if (j0<20)
561-
{
562-
if (j0<0)
563-
{
564-
if (((i0&0x7fffffff) |i1)==0)
565-
returnx;
566-
i1 |= (i0&0x0fffff);
567-
i0 &=0xfffe0000;
568-
i0 |= ((i1 |-i1) >>12)&0x80000;
569-
*(n0+ (int*)&x)=i0;
570-
w=TWO52[sx]+x;
571-
t=w-TWO52[sx];
572-
i0=*(n0+ (int*)&t);
573-
*(n0+ (int*)&t)= (i0&0x7fffffff) | (sx <<31);
574-
returnt;
575-
}
576-
else
577-
{
578-
i= (0x000fffff) >>j0;
579-
if (((i0&i) |i1)==0)
580-
returnx;/* x is integral */
581-
i >>=1;
582-
if (((i0&i) |i1)!=0)
583-
{
584-
if (j0==19)
585-
i1=0x40000000;
586-
else
587-
i0= (i0& (~i)) | ((0x20000) >>j0);
588-
}
589-
}
590-
}
591-
elseif (j0>51)
592-
{
593-
if (j0==0x400)
594-
returnx+x;/* inf or NaN */
595-
else
596-
returnx;/* x is integral */
597-
}
598-
else
599-
{
600-
i= ((unsigned) (0xffffffff)) >> (j0-20);
601-
if ((i1&i)==0)
602-
returnx;/* x is integral */
603-
i >>=1;
604-
if ((i1&i)!=0)
605-
i1= (i1& (~i)) | ((0x40000000) >> (j0-20));
606-
}
607-
*(n0+ (int*)&x)=i0;
608-
*(1-n0+ (int*)&x)=i1;
609-
w=TWO52[sx]+x;
610-
returnw-TWO52[sx];
611-
}
612-
613-
#endif/* !HAVE_RINT */
614-
615513
staticdatetkn*
616514
datebsearch(char*key,datetkn*base,unsignedintnel)
617515
{

‎src/backend/port/qnx4/rint.crenamed to‎src/port/rint.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/rint.c,v 1.3 2001/08/24 14:07:49 petere Exp $
10+
* $Header: /cvsroot/pgsql/src/port/rint.c,v 1.1 2003/05/09 16:26:29 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp