Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Apr 2003 21:38:15 -0800 (PST)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 28299 for review
Message-ID:  <200304060538.h365cFp6077788@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=28299

Change 28299 by peter@peter_overcee on 2003/04/05 21:37:34

	IFC @28297

Affected files ...

.. //depot/projects/hammer/Makefile.inc1#9 integrate
.. //depot/projects/hammer/contrib/gdtoa/gdtoaimp.h#3 integrate
.. //depot/projects/hammer/contrib/ipfilter/Makefile#3 integrate
.. //depot/projects/hammer/contrib/ipfilter/man/ipmon.8#4 integrate
.. //depot/projects/hammer/gnu/usr.bin/binutils/ld/Makefile#2 integrate
.. //depot/projects/hammer/gnu/usr.bin/binutils/libiberty/Makefile#3 integrate
.. //depot/projects/hammer/kerberos5/lib/libasn1/Makefile#4 integrate
.. //depot/projects/hammer/kerberos5/lib/libhdb/Makefile#4 integrate
.. //depot/projects/hammer/lib/libc/alpha/_fpmath.h#2 integrate
.. //depot/projects/hammer/lib/libc/gdtoa/Makefile.inc#3 integrate
.. //depot/projects/hammer/lib/libc/gdtoa/_ldtoa.c#1 branch
.. //depot/projects/hammer/lib/libc/i386/_fpmath.h#2 integrate
.. //depot/projects/hammer/lib/libc/i386/string/Makefile.inc#4 integrate
.. //depot/projects/hammer/lib/libc/i386/string/wcschr.S#1 branch
.. //depot/projects/hammer/lib/libc/ia64/_fpmath.h#2 integrate
.. //depot/projects/hammer/lib/libc/powerpc/_fpmath.h#2 integrate
.. //depot/projects/hammer/lib/libc/sparc64/_fpmath.h#2 integrate
.. //depot/projects/hammer/lib/libc/stdio/floatio.h#2 integrate
.. //depot/projects/hammer/lib/libc/stdio/vfprintf.c#8 integrate
.. //depot/projects/hammer/lib/libc/stdio/vfwprintf.c#5 integrate
.. //depot/projects/hammer/lib/libc/stdlib/Makefile.inc#7 integrate
.. //depot/projects/hammer/lib/libc/stdtime/strptime.c#5 integrate
.. //depot/projects/hammer/lib/libncurses/Makefile#8 integrate
.. //depot/projects/hammer/lib/libstand/printf.c#5 integrate
.. //depot/projects/hammer/release/picobsd/tinyware/simple_httpd/simple_httpd.c#3 integrate
.. //depot/projects/hammer/sbin/ipmon/Makefile#2 integrate
.. //depot/projects/hammer/share/man/man4/Makefile#9 integrate
.. //depot/projects/hammer/share/man/man4/man4.i386/Makefile#4 integrate
.. //depot/projects/hammer/share/man/man4/man4.i386/smapi.4#1 branch
.. //depot/projects/hammer/share/man/man4/wi.4#6 integrate
.. //depot/projects/hammer/share/man/man4/wlan.4#1 branch
.. //depot/projects/hammer/share/mk/bsd.sys.mk#4 integrate
.. //depot/projects/hammer/share/timedef/it_IT.ISO8859-1.src#2 integrate
.. //depot/projects/hammer/sys/conf/options.i386#7 integrate
.. //depot/projects/hammer/sys/dev/ed/if_ed.c#6 integrate
.. //depot/projects/hammer/sys/dev/fxp/if_fxp.c#9 integrate
.. //depot/projects/hammer/sys/dev/fxp/if_fxpreg.h#4 integrate
.. //depot/projects/hammer/sys/i386/conf/NOTES#11 integrate
.. //depot/projects/hammer/sys/i386/i386/swtch.s#4 integrate
.. //depot/projects/hammer/sys/i386/i386/tsc.c#3 integrate
.. //depot/projects/hammer/sys/i386/isa/vesa.c#3 integrate
.. //depot/projects/hammer/sys/ia64/ia64/sscdisk.c#6 integrate
.. //depot/projects/hammer/sys/kern/kern_physio.c#5 integrate
.. //depot/projects/hammer/sys/kern/link_elf.c#11 integrate
.. //depot/projects/hammer/sys/kern/vfs_aio.c#10 integrate
.. //depot/projects/hammer/sys/kern/vfs_bio.c#12 integrate
.. //depot/projects/hammer/sys/pci/if_xl.c#10 integrate
.. //depot/projects/hammer/sys/vm/vm_pager.c#4 integrate
.. //depot/projects/hammer/tools/build/Makefile#1 branch
.. //depot/projects/hammer/tools/build/Makefile.boot#1 branch
.. //depot/projects/hammer/tools/build/dummy.c#1 branch
.. //depot/projects/hammer/tools/build/endian.h#1 branch
.. //depot/projects/hammer/tools/build/langinfo.h#1 branch
.. //depot/projects/hammer/tools/build/progname.c#1 branch
.. //depot/projects/hammer/tools/regression/lib/libc/stdio/Makefile#2 integrate
.. //depot/projects/hammer/tools/regression/lib/libc/stdio/test-printfloat.c#1 branch
.. //depot/projects/hammer/usr.bin/xargs/xargs.c#6 integrate
.. //depot/projects/hammer/usr.bin/xinstall/Makefile#3 integrate
.. //depot/projects/hammer/usr.sbin/ppp/ncpaddr.c#4 integrate
.. //depot/projects/hammer/usr.sbin/rtadvd/config.c#4 integrate

Differences ...

==== //depot/projects/hammer/Makefile.inc1#9 (text+ko) ====

@@ -1,5 +1,5 @@
 #
-# $FreeBSD: src/Makefile.inc1,v 1.330 2003/04/01 11:39:04 ru Exp $
+# $FreeBSD: src/Makefile.inc1,v 1.333 2003/04/06 03:50:28 imp Exp $
 #
 # Make command line options:
 #	-DMAKE_KERBEROS5 to build Kerberos5
@@ -159,6 +159,9 @@
 #
 # Building a world goes through the following stages
 #
+# 1. libbuild stage [BMAKE]
+#	This stage is responsible for creating compatibility shims that are
+#	needed by the bootstrap-tool, build-tool and cross-tool stages.
 # 1. bootstrap-tool stage [BMAKE]
 #	This stage is responsible for creating programs that
 #	are needed for backward compatibility reasons. They
@@ -187,19 +190,20 @@
 		GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac
 
 # bootstrap-tool stage
-BMAKEENV=	MAKEOBJDIRPREFIX=${WORLDTMP} \
-		DESTDIR= \
-		INSTALL="sh ${.CURDIR}/tools/install.sh"
-BMAKE=		${BMAKEENV} ${MAKE} -f Makefile.inc1 \
+BMAKEENV=	DESTDIR= \
+		INSTALL="sh ${.CURDIR}/tools/install.sh" \
+		__MAKE_CONF=${.CURDIR}/tools/build/Makefile.boot \
+		OLD_MAKE_CONF=${__MAKE_CONF} \
+		WORLDTMP=${WORLDTMP}
+BMAKE=		MAKEOBJDIRPREFIX=${WORLDTMP} \
+		${BMAKEENV} ${MAKE} -f Makefile.inc1 \
 		BOOTSTRAPPING=${OSRELDATE} \
 		-DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
 		-DNO_CPU_CFLAGS -DNO_WARNS
 
 # build-tool stage
-TMAKEENV=	MAKEOBJDIRPREFIX=${OBJTREE} \
-		DESTDIR= \
-		INSTALL="sh ${.CURDIR}/tools/install.sh"
-TMAKE=		${TMAKEENV} ${MAKE} -f Makefile.inc1 \
+TMAKE=		MAKEOBJDIRPREFIX=${OBJTREE} \
+		${BMAKEENV} ${MAKE} -f Makefile.inc1 \
 		BOOTSTRAPPING=${OSRELDATE} -DNO_CPU_CFLAGS -DNO_WARNS
 
 # cross-tool stage
@@ -275,6 +279,15 @@
 	mkdir -p ${WORLDTMP}/usr/include/${_dir}
 .endfor
 	ln -sf ${.CURDIR}/sys ${WORLDTMP}
+.for _dir in lib include include/sys
+	mkdir -p ${WORLDTMP}/build/usr/${_dir}
+.endfor
+_libbuild:
+	@echo
+	@echo "--------------------------------------------------------------"
+	@echo ">>> stage 1: libbuild"
+	@echo "--------------------------------------------------------------"
+	cd ${.CURDIR}; ${BMAKE} libbuild
 _bootstrap-tools:
 	@echo
 	@echo "--------------------------------------------------------------"
@@ -335,7 +348,7 @@
 
 WMAKE_TGTS=
 .if !defined(SUBDIR_OVERRIDE)
-WMAKE_TGTS+=	_worldtmp _bootstrap-tools
+WMAKE_TGTS+=	_worldtmp _libbuild _bootstrap-tools
 .endif
 WMAKE_TGTS+=	_cleanobj _obj _build-tools
 .if !defined(SUBDIR_OVERRIDE)
@@ -609,13 +622,23 @@
 _strfile=	games/fortune/strfile
 .endif
 
+libbuild:
+.for _tool in tools/build
+	@${ECHODIR} "===> ${_tool}"; \
+	    cd ${.CURDIR}/${_tool}; \
+	    ${MAKE} DIRPRFX=${_tool}/ obj; \
+	    ${MAKE} DIRPRFX=${_tool}/ depend; \
+	    ${MAKE} DIRPRFX=${_tool}/ all; \
+	    ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/build install
+.endfor
+
 bootstrap-tools:
 .for _tool in ${_strfile} usr.bin/yacc usr.bin/colldef \
     usr.bin/makewhatis usr.bin/rpcgen usr.bin/uudecode \
     usr.bin/xargs usr.bin/xinstall \
     usr.sbin/config usr.sbin/kbdcontrol \
     gnu/usr.bin/gperf gnu/usr.bin/groff gnu/usr.bin/texinfo
-	${ECHODIR} "===> ${_tool}"; \
+	@${ECHODIR} "===> ${_tool}"; \
 		cd ${.CURDIR}/${_tool}; \
 		${MAKE} DIRPRFX=${_tool}/ obj; \
 		${MAKE} DIRPRFX=${_tool}/ depend; \
@@ -648,7 +671,7 @@
 .for _tool in bin/csh bin/sh gnu/usr.bin/cc/cc_tools ${_fortran} \
     ${_libkrb5} lib/libncurses ${_share} \
     ${_aicasm} usr.bin/awk usr.bin/file usr.sbin/sysinstall
-	${ECHODIR} "===> ${_tool}"; \
+	@${ECHODIR} "===> ${_tool}"; \
 		cd ${.CURDIR}/${_tool}; \
 		${MAKE} DIRPRFX=${_tool}/ obj; \
 		${MAKE} DIRPRFX=${_tool}/ build-tools
@@ -682,7 +705,7 @@
 .for _tool in ${_btxld} ${_elf2aout} ${_elf2exe} \
     gnu/usr.bin/binutils ${_crunchide} \
     gnu/usr.bin/cc ${_xlint} ${_kgzip}
-	${ECHODIR} "===> ${_tool}"; \
+	@${ECHODIR} "===> ${_tool}"; \
 		cd ${.CURDIR}/${_tool}; \
 		${MAKE} DIRPRFX=${_tool}/ obj; \
 		${MAKE} DIRPRFX=${_tool}/ depend; \
@@ -764,7 +787,7 @@
 .for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs}
 ${_lib}__L: .PHONY
 .if exists(${.CURDIR}/${_lib})
-	${ECHODIR} "===> ${_lib}"; \
+	@${ECHODIR} "===> ${_lib}"; \
 		cd ${.CURDIR}/${_lib}; \
 		${MAKE} DIRPRFX=${_lib}/ depend; \
 		${MAKE} DIRPRFX=${_lib}/ all; \
@@ -776,7 +799,7 @@
 # static PAM library, and dynamic PAM library before dynamic PAM
 # modules.
 lib/libpam__L: .PHONY
-	${ECHODIR} "===> lib/libpam"; \
+	@${ECHODIR} "===> lib/libpam"; \
 		cd ${.CURDIR}/lib/libpam; \
 		${MAKE} DIRPRFX=lib/libpam/ depend; \
 		${MAKE} DIRPRFX=lib/libpam/ -D_NO_LIBPAM_SO_YET all; \

==== //depot/projects/hammer/contrib/gdtoa/gdtoaimp.h#3 (text+ko) ====

@@ -26,7 +26,7 @@
 
 ****************************************************************/
 
-/* $FreeBSD: src/contrib/gdtoa/gdtoaimp.h,v 1.3 2003/03/19 20:25:45 das Exp $ */
+/* $FreeBSD: src/contrib/gdtoa/gdtoaimp.h,v 1.4 2003/04/05 22:09:26 das Exp $ */
 
 /* This is a variation on dtoa.c that converts arbitary binary
    floating-point formats to and from decimal notation.  It uses
@@ -600,6 +600,8 @@
  extern Bigint *diff ANSI((Bigint*, Bigint*));
  extern char *dtoa ANSI((double d, int mode, int ndigits,
 			int *decpt, int *sign, char **rve));
+ extern char *gdtoa ANSI((FPI *fpi, int be, ULong *bits, int *kindp,
+			  int mode, int ndigits, int *decpt, char **rve));
  extern char *g__fmt ANSI((char*, char*, char*, int, ULong));
  extern int gethex ANSI((CONST char**, FPI*, Long*, Bigint**, int));
  extern void hexdig_init_D2A(Void);

==== //depot/projects/hammer/contrib/ipfilter/Makefile#3 (text+ko) ====

@@ -3,6 +3,7 @@
 #
 # See the IPFILTER.LICENCE file for details on licencing.
 #
+# $FreeBSD: src/contrib/ipfilter/Makefile,v 1.2 2003/04/05 09:25:19 darrenr Exp $
 # $Id: Makefile,v 2.11.2.15 2002/12/02 04:22:56 darrenr Exp $
 #
 BINDEST=/usr/local/bin
@@ -29,7 +30,7 @@
 #
 # The facility you wish to log messages from ipmon to syslogd with.
 #
-LOGFAC=-DLOGFAC=LOG_LOCAL0
+LOGFAC=-DLOGFAC=LOG_SECURITY
 
 #
 # Uncomment the next 3 lines if you want to view the state table a la top(1)

==== //depot/projects/hammer/contrib/ipfilter/man/ipmon.8#4 (text+ko) ====

@@ -1,4 +1,4 @@
-.\" $FreeBSD: src/contrib/ipfilter/man/ipmon.8,v 1.12 2003/02/15 06:32:48 darrenr Exp $
+.\" $FreeBSD: src/contrib/ipfilter/man/ipmon.8,v 1.13 2003/04/05 21:12:58 darrenr Exp $
 .TH ipmon 8
 .SH NAME
 ipmon \- monitors /dev/ipl for logged packets
@@ -126,7 +126,7 @@
 .B \-s
 Packet information read in will be sent through syslogd rather than
 saved to a file.  The default facility when compiled and installed is
-\fBlocal0\fP.  The following levels are used:
+\fBsecurity\fP.  The following levels are used:
 .IP
 .B LOG_INFO
 \- packets logged using the "log" keyword as the action rather

==== //depot/projects/hammer/gnu/usr.bin/binutils/ld/Makefile#2 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile,v 1.23 2002/07/29 09:40:08 ru Exp $
+# $FreeBSD: src/gnu/usr.bin/binutils/ld/Makefile,v 1.24 2003/04/05 20:30:29 imp Exp $
 
 .include "../Makefile.inc0"
 
@@ -10,20 +10,12 @@
 	ldgram.y ldlang.c ldlex.l ldmain.c ldmisc.c \
 	ldver.c ldwrite.c lexsup.c mri.c
 
-.if defined(BOOTSTRAPPING) && !exists(/usr/include/elf-hints.h)
-SRCS+=	elf-hints.h
-CLEANFILES+=	elf-hints.h
-
-elf-hints.h:
-	ln -sf ${.CURDIR}/../../../../include/${.TARGET} .
-.endif
-
 WARNS=	1
 CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}/usr/libdata\"
 CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\"
 CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd
 NOSHARED?= yes
-DPADD=	${RELTOP}/libbfd/libbfd.a
+DPADD+=	${RELTOP}/libbfd/libbfd.a
 DPADD+=	${RELTOP}/libiberty/libiberty.a
 LDADD=	${DPADD}
 CLEANDIRS+=	ldscripts

==== //depot/projects/hammer/gnu/usr.bin/binutils/libiberty/Makefile#3 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/gnu/usr.bin/binutils/libiberty/Makefile,v 1.17 2002/11/13 13:49:29 ru Exp $
+# $FreeBSD: src/gnu/usr.bin/binutils/libiberty/Makefile,v 1.18 2003/04/05 20:30:29 imp Exp $
 
 .include "../Makefile.inc0"
 
@@ -10,11 +10,6 @@
 	hex.c floatformat.c hashtab.c lbasename.c make-temp-file.c \
 	objalloc.c obstack.c safe-ctype.c xatexit.c xexit.c xmalloc.c \
 	xstrdup.c xstrerror.c
-.if defined(BOOTSTRAPPING) && \
-    ( ${BOOTSTRAPPING} < 440000 || \
-    ( ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500022 ))
-SRCS+=	basename.c
-.endif
 WARNS=	1
 CFLAGS+=	-DHAVE_CONFIG_H
 INTERNALLIB=	true

==== //depot/projects/hammer/kerberos5/lib/libasn1/Makefile#4 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/kerberos5/lib/libasn1/Makefile,v 1.17 2002/11/13 13:49:29 ru Exp $
+# $FreeBSD: src/kerberos5/lib/libasn1/Makefile,v 1.18 2003/04/05 20:30:29 imp Exp $
 
 LIB=	asn1
 CFLAGS+=-I${KRB5DIR}/include \
@@ -104,13 +104,7 @@
 	print_version.o				\
 	get_window_size.c			\
 	strupr.c
-	${CC} ${CFLAGS} ${.OODATE} -o ${.TARGET}
-
-.if defined(BOOTSTRAPPING) && \
-    ( ${BOOTSTRAPPING} < 440001 || \
-    ( ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500023 ))
-asn1_compile: getprogname.c setprogname.c
-.endif
+	${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.OODATE} ${LDADD}
 
 parse.o:	parse.c roken.h
 

==== //depot/projects/hammer/kerberos5/lib/libhdb/Makefile#4 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/kerberos5/lib/libhdb/Makefile,v 1.10 2002/11/13 13:49:29 ru Exp $
+# $FreeBSD: src/kerberos5/lib/libhdb/Makefile,v 1.11 2003/04/05 20:30:29 imp Exp $
 
 LIB=	hdb
 CFLAGS+=-I${KRB5DIR}/include \
@@ -59,13 +59,7 @@
 		gen_encode.c gen_decode.c gen_free.c gen_length.c \
 		gen_copy.c gen_glue.c getarg.c warnerr.c print_version.o \
 		get_window_size.c strupr.c
-	${CC} ${CFLAGS} ${.OODATE} -o ${.TARGET}
-
-.if defined(BOOTSTRAPPING) && \
-    ( ${BOOTSTRAPPING} < 440001 || \
-    ( ${BOOTSTRAPPING} >= 500000 && ${BOOTSTRAPPING} < 500023 ))
-asn1_compile: getprogname.c setprogname.c
-.endif
+	${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.OODATE} ${LDADD}
 
 parse.o:	parse.c
 

==== //depot/projects/hammer/lib/libc/alpha/_fpmath.h#2 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libc/alpha/_fpmath.h,v 1.2 2003/02/11 15:19:31 des Exp $
+ * $FreeBSD: src/lib/libc/alpha/_fpmath.h,v 1.3 2003/04/05 22:10:13 das Exp $
  */
 
 union IEEEl2bits {
@@ -37,3 +37,9 @@
 };
 
 #define	mask_nbit_l(u)	((void)0)
+#define	LDBL_IMPLICIT_NBIT
+
+#define	LDBL_TO_ARRAY32(u, a) do {			\
+	(a)[0] = (uint32_t)(u).bits.manl;		\
+	(a)[1] = (uint32_t)(u).bits.manh;		\
+} while(0)

==== //depot/projects/hammer/lib/libc/gdtoa/Makefile.inc#3 (text+ko) ====

@@ -1,9 +1,9 @@
-# $FreeBSD: src/lib/libc/gdtoa/Makefile.inc,v 1.2 2003/03/13 18:55:14 obrien Exp $
+# $FreeBSD: src/lib/libc/gdtoa/Makefile.inc,v 1.3 2003/04/05 22:10:13 das Exp $
 
 # netlib gdtoa sources
 .PATH: ${.CURDIR}/gdtoa
 
-MISRCS+=glue.c
+MISRCS+=_ldtoa.c glue.c
 GDTOASRCS=dmisc.c dtoa.c gdtoa.c gethex.c gmisc.c \
 	hd_init.c hexnan.c misc.c smisc.c \
 	strtoIg.c strtod.c strtodg.c strtof.c strtord.c sum.c ulp.c

==== //depot/projects/hammer/lib/libc/i386/_fpmath.h#2 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libc/i386/_fpmath.h,v 1.1 2003/02/08 20:37:52 mike Exp $
+ * $FreeBSD: src/lib/libc/i386/_fpmath.h,v 1.2 2003/04/05 22:10:13 das Exp $
  */
 
 union IEEEl2bits {
@@ -38,3 +38,8 @@
 };
 
 #define	mask_nbit_l(u)	((u).bits.manh &= 0x7fffffff)
+
+#define	LDBL_TO_ARRAY32(u, a) do {			\
+	(a)[0] = (uint32_t)(u).bits.manl;		\
+	(a)[1] = (uint32_t)(u).bits.manh;		\
+} while(0)

==== //depot/projects/hammer/lib/libc/i386/string/Makefile.inc#4 (text+ko) ====

@@ -1,6 +1,7 @@
 #	@(#)Makefile.inc	8.1 (Berkeley) 6/4/93
-# $FreeBSD: src/lib/libc/i386/string/Makefile.inc,v 1.12 2003/03/14 11:01:12 tjr Exp $
+# $FreeBSD: src/lib/libc/i386/string/Makefile.inc,v 1.13 2003/04/05 04:17:05 tjr Exp $
 
 MDSRCS+=bcmp.S bcopy.S bzero.S ffs.S index.S memchr.S memcmp.S memcpy.S \
 	memmove.S memset.S rindex.S strcat.S strchr.S strcmp.S strcpy.S \
-	strlen.S strncmp.S strrchr.S swab.S wcscmp.S wcslen.S wmemchr.S
+	strlen.S strncmp.S strrchr.S swab.S wcschr.S wcscmp.S wcslen.S \
+	wmemchr.S

==== //depot/projects/hammer/lib/libc/ia64/_fpmath.h#2 (text+ko) ====

@@ -24,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libc/ia64/_fpmath.h,v 1.2 2003/02/26 16:04:34 mike Exp $
+ * $FreeBSD: src/lib/libc/ia64/_fpmath.h,v 1.3 2003/04/05 22:10:13 das Exp $
  */
 
 #include <sys/endian.h>
@@ -53,3 +53,8 @@
 #else /* _BIG_ENDIAN */
 #define	mask_nbit_l(u)	((u).bits.manh &= 0xffffff7f)
 #endif
+
+#define	LDBL_TO_ARRAY32(u, a) do {			\
+	(a)[0] = (uint32_t)(u).bits.manl;		\
+	(a)[1] = (uint32_t)(u).bits.manh;		\
+} while(0)

==== //depot/projects/hammer/lib/libc/powerpc/_fpmath.h#2 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libc/powerpc/_fpmath.h,v 1.1 2003/02/08 20:37:53 mike Exp $
+ * $FreeBSD: src/lib/libc/powerpc/_fpmath.h,v 1.2 2003/04/05 22:10:13 das Exp $
  */
 
 union IEEEl2bits {
@@ -38,3 +38,11 @@
 
 /* XXX does powerpc have a normalization bit? */
 #define	mask_nbit_l(u)	((void)0)
+#define	LDBL_IMPLICIT_NBIT
+
+#define	LDBL_TO_ARRAY32(u, a) do {			\
+	(a)[0] = (uint32_t)(u).bits.manl;		\
+	(a)[1] = (uint32_t)((u).bits.manl >> 32);      	\
+	(a)[2] = (uint32_t)(u).bits.manh;		\
+	(a)[3] = (uint32_t)((u).bits.manh >> 32);	\
+} while(0)

==== //depot/projects/hammer/lib/libc/sparc64/_fpmath.h#2 (text+ko) ====

@@ -24,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libc/sparc64/_fpmath.h,v 1.1 2003/02/08 20:37:54 mike Exp $
+ * $FreeBSD: src/lib/libc/sparc64/_fpmath.h,v 1.2 2003/04/05 22:10:13 das Exp $
  */
 
 union IEEEl2bits {
@@ -38,3 +38,11 @@
 };
 
 #define	mask_nbit_l(u)	((void)0)
+#define	LDBL_IMPLICIT_NBIT
+
+#define	LDBL_TO_ARRAY32(u, a) do {			\
+	(a)[0] = (uint32_t)(u).bits.manl;		\
+	(a)[1] = (uint32_t)((u).bits.manl >> 32);      	\
+	(a)[2] = (uint32_t)(u).bits.manh;		\
+	(a)[3] = (uint32_t)((u).bits.manh >> 32);	\
+} while(0)

==== //depot/projects/hammer/lib/libc/stdio/floatio.h#2 (text+ko) ====

@@ -34,14 +34,23 @@
  * SUCH DAMAGE.
  *
  *	@(#)floatio.h	8.1 (Berkeley) 6/4/93
- * $FreeBSD: src/lib/libc/stdio/floatio.h,v 1.2 2002/03/22 23:42:01 obrien Exp $
+ * $FreeBSD: src/lib/libc/stdio/floatio.h,v 1.4 2003/04/05 22:11:42 das Exp $
  */
 
 /*
  * Floating point scanf/printf (input/output) definitions.
  */
 
-/* 11-bit exponent (VAX G floating point) is 308 decimal digits */
-#define	MAXEXP		308
-/* 128 bit fraction takes up 39 decimal digits; max reasonable precision */
-#define	MAXFRACT	39
+/*
+ * MAXEXPDIG is the maximum number of decimal digits needed to store a
+ * floating point exponent in the largest supported format.  It should
+ * be ceil(log10(LDBL_MAX_10_EXP)) or, if hexadecimal floating point
+ * conversions are supported, ceil(log10(LDBL_MAX_EXP)).  But since it
+ * is presently never greater than 5 in practice, we fudge it.
+ */
+#define	MAXEXPDIG	6
+#if LDBL_MAX_EXP > 999999
+#error "floating point buffers too small"
+#endif
+
+char *__ldtoa(long double *, int, int, int *, int *, char **);

==== //depot/projects/hammer/lib/libc/stdio/vfprintf.c#8 (text+ko) ====

@@ -38,7 +38,7 @@
 static char sccsid[] = "@(#)vfprintf.c	8.1 (Berkeley) 6/4/93";
 #endif /* LIBC_SCCS and not lint */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.52 2003/03/14 04:48:09 das Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.54 2003/04/05 22:11:42 das Exp $");
 
 /*
  * Actual printf innards.
@@ -111,9 +111,9 @@
 
 static int	__sprint(FILE *, struct __suio *);
 static int	__sbprintf(FILE *, const char *, va_list) __printflike(2, 0);
-static char	*__ujtoa(uintmax_t, char *, int, int, char *, int, char,
+static char	*__ujtoa(uintmax_t, char *, int, int, const char *, int, char,
 		    const char *);
-static char	*__ultoa(u_long, char *, int, int, char *, int, char,
+static char	*__ultoa(u_long, char *, int, int, const char *, int, char,
 		    const char *);
 static char	*__wcsconv(wchar_t *, int);
 static void	__find_arguments(const char *, va_list, union arg **);
@@ -185,7 +185,7 @@
  * use the given digits.
  */
 static char *
-__ultoa(u_long val, char *endp, int base, int octzero, char *xdigs,
+__ultoa(u_long val, char *endp, int base, int octzero, const char *xdigs,
 	int needgrp, char thousep, const char *grp)
 {
 	char *cp = endp;
@@ -262,7 +262,7 @@
 
 /* Identical to __ultoa, but for intmax_t. */
 static char *
-__ujtoa(uintmax_t val, char *endp, int base, int octzero, char *xdigs, 
+__ujtoa(uintmax_t val, char *endp, int base, int octzero, const char *xdigs, 
 	int needgrp, char thousep, const char *grp)
 {
 	char *cp = endp;
@@ -407,31 +407,36 @@
 }
 
 #ifdef FLOATING_POINT
+
+#define	dtoa		__dtoa
+#define	freedtoa	__freedtoa
+
+#include <float.h>
 #include <math.h>
 #include "floatio.h"
+#include "gdtoa.h"
 
-#define	BUF		((MAXEXP*2)+MAXFRACT+1)		/* + decimal point */
 #define	DEFPREC		6
 
-extern char *__dtoa(double, int, int, int *, int *, char **);
-extern void __freedtoa(char *s);
-
-static char *cvt(double, int, int, char *, int *, int, int *);
 static int exponent(char *, int, int);
 
-#else /* no FLOATING_POINT */
+#endif /* FLOATING_POINT */
 
-#define	BUF		136
+/*
+ * The size of the buffer we use as scratch space for integer
+ * conversions, among other things.  Technically, we would need the
+ * most space for base 10 conversions with thousands' grouping
+ * characters between each pair of digits.  100 bytes is a
+ * conservative overestimate even for a 128-bit uintmax_t.
+ */
+#define	BUF	100
 
-#endif /* FLOATING_POINT */
-
 #define STATIC_ARG_TBL_SIZE 8           /* Size of static argument table. */
 
 /*
  * Flags used during conversion.
  */
 #define	ALT		0x001		/* alternate form */
-#define	HEXPREFIX	0x002		/* add 0x or 0X prefix */
 #define	LADJUST		0x004		/* left adjustment */
 #define	LONGDBL		0x008		/* long double */
 #define	LONGINT		0x010		/* long integer */
@@ -460,19 +465,41 @@
 	int flags;		/* flags as above */
 	int ret;		/* return value accumulator */
 	int width;		/* width from format (%8d), or 0 */
-	int prec;		/* precision from format (%.3d), or -1 */
+	int prec;		/* precision from format; <0 for N/A */
 	char sign;		/* sign prefix (' ', '+', '-', or \0) */
 	char thousands_sep;	/* locale specific thousands separator */
 	const char *grouping;	/* locale specific numeric grouping rules */
 #ifdef FLOATING_POINT
+	/*
+	 * We can decompose the printed representation of floating
+	 * point numbers into several parts, some of which may be empty:
+	 *
+	 * [+|-| ] [0x|0X] MMM . NNN [e|E|p|P] [+|-] ZZ
+	 *    A       B     ---C---      D       E   F
+	 *
+	 * A:	'sign' holds this value if present; '\0' otherwise
+	 * B:	ox[1] holds the 'x' or 'X'; '\0' if not hexadecimal
+	 * C:	cp points to the string MMMNNN.  Leading and trailing
+	 *	zeros are not in the string and must be added.
+	 * D:	expchar holds this character; '\0' if no exponent, e.g. %f
+	 * F:	at least two digits for decimal, at least one digit for hex
+	 */
 	char *decimal_point;	/* locale specific decimal point */
-	char softsign;		/* temporary negative sign for floats */
-	double _double;		/* double precision arguments %[eEfgG] */
+	int signflag;		/* true if float is negative */
+	union {			/* floating point arguments %[aAeEfFgG] */
+		double dbl;
+		long double ldbl;
+	} fparg;
 	int expt;		/* integer value of exponent */
+	char expchar;		/* exponent character: [eEpP\0] */
+	char *dtoaend;		/* pointer to end of converted digits */
 	int expsize;		/* character count for expstr */
-	int ndig;		/* actual number of digits returned by cvt */
-	char expstr[7];		/* buffer for exponent string */
+	int lead;		/* sig figs before decimal or group sep */
+	int ndig;		/* actual number of digits returned by dtoa */
+	char expstr[MAXEXPDIG+2];	/* buffer for exponent string: e+ZZZ */
 	char *dtoaresult;	/* buffer allocated by dtoa */
+	int nseps;		/* number of group separators with ' */
+	int nrepeats;		/* number of repeats of the last group */
 #endif
 	u_long	ulval;		/* integer arguments %[diouxX] */
 	uintmax_t ujval;	/* %j, %ll, %q, %t, %z integers */
@@ -481,12 +508,12 @@
 	int realsz;		/* field size expanded by dprec, sign, etc */
 	int size;		/* size of converted field or string */
 	int prsize;             /* max size of printed field */
-	char *xdigs;		/* digits for [xX] conversion */
+	const char *xdigs;     	/* digits for %[xX] conversion */
 #define NIOV 8
 	struct __suio uio;	/* output information: summary */
 	struct __siov iov[NIOV];/* ... and individual io vectors */
-	char buf[BUF];		/* space for %c, %[diouxX], %[eEfFgG] */
-	char ox[2];		/* space for 0x hex-prefix */
+	char buf[BUF];		/* buffer with space for digits of uintmax_t */
+	char ox[2];		/* space for 0x; ox[1] is either x, X, or \0 */
 	union arg *argtable;    /* args, built due to positional arg */
 	union arg statargtable [STATIC_ARG_TBL_SIZE];
 	int nextarg;            /* 1-based argument index */
@@ -504,6 +531,9 @@
 	static char zeroes[PADSIZE] =
 	 {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'};
 
+	static const char xdigs_lower[16] = "0123456789abcdef";
+	static const char xdigs_upper[16] = "0123456789ABCDEF";
+
 	/*
 	 * BEWARE, these `goto error' on error, and PAD uses `n'.
 	 */
@@ -643,6 +673,7 @@
 		width = 0;
 		prec = -1;
 		sign = '\0';
+		ox[1] = '\0';
 
 rflag:		ch = *fmt++;
 reswitch:	switch (ch) {
@@ -797,86 +828,122 @@
 #ifdef HEXFLOAT
 		case 'a':
 		case 'A':
+			if (ch == 'a') {
+				ox[1] = 'x';
+				xdigs = xdigs_lower;
+				expchar = 'p';
+			} else {
+				ox[1] = 'X';
+				xdigs = xdigs_upper;
+				expchar = 'P';
+			}
+			/*
+			 * XXX We don't actually have a conversion
+			 * XXX routine for this yet.
+			 */
+			if (flags & LONGDBL) {
+				fparg.ldbl = (double)GETARG(long double);
+				dtoaresult = cp =
+				    __hldtoa(fparg.ldbl, xdigs, prec,
+				    &expt, &signflag, &dtoaend);
+			} else {
+				fparg.dbl = GETARG(double);
+				dtoaresult = cp =
+				    __hdtoa(fparg.dbl, xdigs, prec,
+				    &expt, &signflag, &dtoaend);
+			}
+			goto fp_begin;
 #endif
 		case 'e':
 		case 'E':
-			/*-
-			 * Grouping apply to %i, %d, %u, %f, %F, %g, %G
-			 * conversion specifiers only. For other conversions
-			 * behavior is undefined.
-			 *	-- POSIX
-			 */
-			flags &= ~GROUPING;
-			/*FALLTHROUGH*/
+			expchar = ch;
+			if (prec < 0)	/* account for digit before decpt */
+				prec = DEFPREC + 1;
+			else
+				prec++;
+			goto fp_begin;
 		case 'f':
 		case 'F':
+			expchar = '\0';
 			goto fp_begin;
 		case 'g':
 		case 'G':
+			expchar = ch - ('g' - 'e');
 			if (prec == 0)
 				prec = 1;
-fp_begin:		if (prec == -1)
+fp_begin:
+			if (prec < 0)
 				prec = DEFPREC;
-			if (flags & LONGDBL)
-				/* XXX this loses precision. */
-				_double = (double)GETARG(long double);
-			else
-				_double = GETARG(double);
-			/* do this before tricky precision changes */
-			if (isinf(_double)) {
-				if (_double < 0)
-					sign = '-';
-				if (isupper(ch))
-					cp = "INF";
-				else
-					cp = "inf";
-				size = 3;
-				break;
+			if (dtoaresult != NULL)
+				freedtoa(dtoaresult);
+			if (flags & LONGDBL) {
+				fparg.ldbl = GETARG(long double);
+				dtoaresult = cp =
+				    __ldtoa(&fparg.ldbl, expchar ? 2 : 3, prec,
+				    &expt, &signflag, &dtoaend);
+			} else {
+				fparg.dbl = GETARG(double);
+				dtoaresult = cp =
+				    dtoa(fparg.dbl, expchar ? 2 : 3, prec,
+				    &expt, &signflag, &dtoaend);
+				if (expt == 9999)
+					expt = INT_MAX;
 			}
-			if (isnan(_double)) {
-				if (isupper(ch))
-					cp = "NAN";
-				else
-					cp = "nan";
+			if (signflag)
+				sign = '-';
+			if (expt == INT_MAX) {	/* inf or nan */
+				if (*cp == 'N') {
+					cp = (ch >= 'a') ? "nan" : "NAN";
+					sign = '\0';
+				} else
+					cp = (ch >= 'a') ? "inf" : "INF";
 				size = 3;
 				break;
 			}
 			flags |= FPT;
-			if (dtoaresult != NULL) {
-				__freedtoa(dtoaresult);
-				dtoaresult = NULL;
-			}
-			dtoaresult = cp = cvt(_double, prec, flags, &softsign,
-				&expt, ch, &ndig);
+			ndig = dtoaend - cp;
 			if (ch == 'g' || ch == 'G') {
-				if (expt <= -4 || expt > prec)
-					ch = (ch == 'g') ? 'e' : 'E';
-				else
-					ch = 'g';
+				if (expt > -4 && expt <= prec) {
+					/* Make %[gG] smell like %[fF] */
+					expchar = '\0';
+					if (flags & ALT)
+						prec -= expt;
+					else
+						prec = ndig - expt;
+					if (prec < 0)
+						prec = 0;
+				}
 			}
-			if (ch == 'e' || ch == 'E') {
-				--expt;
-				expsize = exponent(expstr, expt, ch);
-				size = expsize + ndig;
-				if (ndig > 1 || flags & ALT)
+			if (expchar) {
+				expsize = exponent(expstr, expt - 1, expchar);
+				size = expsize + prec;
+				if (prec || flags & ALT)
 					++size;
-			} else if (ch == 'f' || ch == 'F') {
+			} else {
 				if (expt > 0) {
 					size = expt;
 					if (prec || flags & ALT)
 						size += prec + 1;
 				} else	/* "0.X" */
 					size = prec + 2;
-			} else if (expt >= ndig) {	/* fixed g fmt */
-				size = expt;
-				if (flags & ALT)
-					++size;
-			} else
-				size = ndig + (expt > 0 ?
-					1 : 2 - expt);
-
-			if (softsign)
-				sign = '-';
+				if (grouping && expt > 0) {
+					/* space for thousands' grouping */
+					nseps = nrepeats = 0;
+					lead = expt;
+					while (*grouping != CHAR_MAX) {
+						if (lead <= *grouping)
+							break;
+						lead -= *grouping;
+						if (*(grouping+1)) {
+							nseps++;
+							grouping++;
+						} else
+							nrepeats++;
+					}
+					size += nseps + nrepeats;
+				} else
+					lead = (expt < ndig) ? expt : ndig;
+			}
 			break;
 #endif /* FLOATING_POINT */
 		case 'n':
@@ -922,9 +989,9 @@
 			 */
 			ujval = (uintmax_t)(uintptr_t)GETARG(void *);
 			base = 16;
-			xdigs = "0123456789abcdef";
-			flags = flags | INTMAXT | HEXPREFIX;
-			ch = 'x';
+			xdigs = xdigs_lower;
+			flags = flags | INTMAXT;
+			ox[1] = 'x';
 			goto nosign;
 		case 'S':
 			flags |= LONGINT;
@@ -976,10 +1043,10 @@
 			base = 10;
 			goto nosign;
 		case 'X':
-			xdigs = "0123456789ABCDEF";
+			xdigs = xdigs_upper;
 			goto hex;
 		case 'x':
-			xdigs = "0123456789abcdef";
+			xdigs = xdigs_lower;
 hex:
 			if (flags & INTMAX_SIZE)
 				ujval = UJARG();
@@ -989,7 +1056,7 @@
 			/* leading 0x/X only if non-zero */
 			if (flags & ALT &&
 			    (flags & INTMAX_SIZE ? ujval != 0 : ulval != 0))
-				flags |= HEXPREFIX;
+				ox[1] = ch;
 
 			flags &= ~GROUPING;
 			/* unsigned conversions */
@@ -1022,6 +1089,8 @@
 					    grouping);
 			}
 			size = buf + BUF - cp;
+			if (size > BUF)	/* should never happen */
+				abort();
 			break;
 		default:	/* "%?" prints ?, unless ? is NUL */
 			if (ch == '\0')
@@ -1051,7 +1120,7 @@
 		realsz = dprec > size ? dprec : size;
 		if (sign)
 			realsz++;
-		else if (flags & HEXPREFIX)
+		else if (ox[1])
 			realsz += 2;
 
 		prsize = width > realsz ? width : realsz;
@@ -1067,9 +1136,8 @@
 		/* prefix */
 		if (sign) {
 			PRINT(&sign, 1);
-		} else if (flags & HEXPREFIX) {
+		} else if (ox[1]) {	/* ox[1] is either x, X, or \0 */
 			ox[0] = '0';
-			ox[1] = ch;
 			PRINT(ox, 2);
 		}
 
@@ -1085,42 +1153,49 @@
 		if ((flags & FPT) == 0) {
 			PRINT(cp, size);
 		} else {	/* glue together f_p fragments */
-			if (ch >= 'f') {	/* 'f' or 'g' */
-				if (_double == 0) {
-					/* kludge for __dtoa irregularity */
-					PRINT("0", 1);
-					if (expt < ndig || (flags & ALT) != 0) {
-						PRINT(decimal_point, 1);
-						PAD(ndig - 1, zeroes);
-					}
-				} else if (expt <= 0) {
-					PRINT("0", 1);
-					PRINT(decimal_point, 1);
+			if (!expchar) {	/* %[fF] or sufficiently short %[gG] */
+				if (expt <= 0) {
+					buf[0] = '0';
+					buf[1] = *decimal_point;
+					PRINT(buf, 2);
 					PAD(-expt, zeroes);
-					PRINT(cp, ndig);
-				} else if (expt >= ndig) {
-					PRINT(cp, ndig);
-					PAD(expt - ndig, zeroes);
-					if (flags & ALT)
-						PRINT(decimal_point, 1);
+					if (ndig > 0)
+						PRINT(cp, ndig);
 				} else {
-					PRINT(cp, expt);
-					cp += expt;
-					PRINT(decimal_point, 1);
-					PRINT(cp, ndig-expt);
+					PRINT(cp, lead);
+					cp += lead;
+					if (grouping) {
+						while (nseps>0 || nrepeats>0) {
+							if (nrepeats > 0)
+								nrepeats--;
+							else {
+								grouping--;
+								nseps--;
+							}
+							PRINT(&thousands_sep,
+							    1);
+							PRINT(cp, *grouping);
+							cp += *grouping;
+						}
+					} else {
+						PAD(expt - lead, zeroes);
+					}
+					if (prec || flags & ALT)
+						PRINT(decimal_point,1);

>>> TRUNCATED FOR MAIL (1000 lines) <<<



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304060538.h365cFp6077788>