PERFORCE change 52113 for review

Marcel Moolenaar marcel at FreeBSD.org
Sun May 2 19:29:25 PDT 2004


http://perforce.freebsd.org/chv.cgi?CH=52113

Change 52113 by marcel at marcel_nfs on 2004/05/02 19:28:39

	IFC @52112

Affected files ...

.. //depot/projects/gdb/bin/ls/extern.h#3 integrate
.. //depot/projects/gdb/bin/ls/ls.1#4 integrate
.. //depot/projects/gdb/bin/ls/print.c#6 integrate
.. //depot/projects/gdb/bin/ls/util.c#3 integrate
.. //depot/projects/gdb/gnu/usr.bin/gzip/gzip.h#2 integrate
.. //depot/projects/gdb/gnu/usr.bin/gzip/unzip.c#2 integrate
.. //depot/projects/gdb/lib/libarchive/archive_entry.c#11 integrate
.. //depot/projects/gdb/lib/libc/Makefile#3 integrate
.. //depot/projects/gdb/lib/libc/gen/fmtcheck.c#2 integrate
.. //depot/projects/gdb/lib/libc/stdio/vfprintf.c#5 integrate
.. //depot/projects/gdb/lib/libc/stdio/vfscanf.c#4 integrate
.. //depot/projects/gdb/lib/libc/stdio/vfwprintf.c#5 integrate
.. //depot/projects/gdb/lib/libc/stdio/vfwscanf.c#4 integrate
.. //depot/projects/gdb/release/doc/en_US.ISO8859-1/relnotes/common/new.sgml#15 integrate
.. //depot/projects/gdb/release/scripts/print-cdrom-packages.sh#5 integrate
.. //depot/projects/gdb/sbin/Makefile#6 integrate
.. //depot/projects/gdb/sbin/ggate/ggatec/ggatec.c#2 integrate
.. //depot/projects/gdb/sbin/ggate/ggated/ggated.c#2 integrate
.. //depot/projects/gdb/sbin/ggate/ggatel/ggatel.c#2 integrate
.. //depot/projects/gdb/sbin/ggate/shared/ggate.c#2 integrate
.. //depot/projects/gdb/secure/Makefile#3 integrate
.. //depot/projects/gdb/share/man/man4/asr.4#2 integrate
.. //depot/projects/gdb/share/man/man4/hme.4#2 integrate
.. //depot/projects/gdb/sys/alpha/conf/GENERIC#3 integrate
.. //depot/projects/gdb/sys/amd64/conf/GENERIC#5 integrate
.. //depot/projects/gdb/sys/cam/scsi/scsi_da.c#5 integrate
.. //depot/projects/gdb/sys/conf/files#22 integrate
.. //depot/projects/gdb/sys/conf/files.i386#12 integrate
.. //depot/projects/gdb/sys/conf/majors#5 integrate
.. //depot/projects/gdb/sys/contrib/pf/net/pf.c#5 integrate
.. //depot/projects/gdb/sys/contrib/pf/net/pf_ioctl.c#5 integrate
.. //depot/projects/gdb/sys/contrib/pf/net/pf_norm.c#3 integrate
.. //depot/projects/gdb/sys/dev/asr/asr.c#6 integrate
.. //depot/projects/gdb/sys/dev/cy/cy.c#2 integrate
.. //depot/projects/gdb/sys/dev/cy/cy_isa.c#2 integrate
.. //depot/projects/gdb/sys/dev/cy/cy_pci.c#2 integrate
.. //depot/projects/gdb/sys/dev/cy/cyvar.h#1 branch
.. //depot/projects/gdb/sys/dev/usb/usbdevs#7 integrate
.. //depot/projects/gdb/sys/dev/usb/usbdevs.h#7 integrate
.. //depot/projects/gdb/sys/dev/usb/usbdevs_data.h#7 integrate
.. //depot/projects/gdb/sys/dev/usb/uvscom.c#2 integrate
.. //depot/projects/gdb/sys/geom/gate/g_gate.c#2 integrate
.. //depot/projects/gdb/sys/geom/gate/g_gate.h#2 integrate
.. //depot/projects/gdb/sys/i386/conf/GENERIC#8 integrate
.. //depot/projects/gdb/sys/i386/conf/NOTES#11 integrate
.. //depot/projects/gdb/sys/i386/isa/cy.c#4 delete
.. //depot/projects/gdb/sys/i386/isa/cyreg.h#2 delete
.. //depot/projects/gdb/sys/i386/isa/ic/cd1400.h#2 delete
.. //depot/projects/gdb/sys/ia64/acpica/madt.c#2 integrate
.. //depot/projects/gdb/sys/ia64/conf/GENERIC#3 integrate
.. //depot/projects/gdb/sys/ia64/conf/SKI#2 integrate
.. //depot/projects/gdb/sys/kern/kern_clock.c#6 integrate
.. //depot/projects/gdb/sys/netinet/ip_input.c#6 integrate
.. //depot/projects/gdb/sys/netinet/ip_output.c#7 integrate
.. //depot/projects/gdb/sys/netinet/ip_var.h#5 integrate
.. //depot/projects/gdb/sys/netinet/tcp_input.c#7 integrate
.. //depot/projects/gdb/sys/pc98/conf/GENERIC#7 integrate
.. //depot/projects/gdb/sys/pc98/pc98/sio.c#6 integrate
.. //depot/projects/gdb/sys/pci/cy_pci.c#3 delete
.. //depot/projects/gdb/sys/powerpc/conf/GENERIC#3 integrate
.. //depot/projects/gdb/sys/sparc64/conf/GENERIC#4 integrate
.. //depot/projects/gdb/sys/sys/mbuf.h#6 integrate
.. //depot/projects/gdb/tools/tools/nanobsd/i386.diskimage#5 integrate
.. //depot/projects/gdb/usr.bin/du/du.c#3 integrate
.. //depot/projects/gdb/usr.bin/m4/TEST/math.m4#1 branch
.. //depot/projects/gdb/usr.bin/m4/expr.c#2 integrate
.. //depot/projects/gdb/usr.bin/rpcgen/rpc_main.c#2 integrate
.. //depot/projects/gdb/usr.bin/sed/TEST/math.sed#2 integrate
.. //depot/projects/gdb/usr.bin/tar/bsdtar.c#6 integrate
.. //depot/projects/gdb/usr.bin/tar/bsdtar.h#4 integrate
.. //depot/projects/gdb/usr.bin/tar/bsdtar_platform.h#2 integrate
.. //depot/projects/gdb/usr.bin/tar/read.c#4 integrate
.. //depot/projects/gdb/usr.bin/tar/write.c#8 integrate

Differences ...

==== //depot/projects/gdb/bin/ls/extern.h#3 (text+ko) ====

@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  *
  *	from: @(#)extern.h	8.1 (Berkeley) 5/31/93
- * $FreeBSD: src/bin/ls/extern.h,v 1.22 2004/04/06 20:06:47 markm Exp $
+ * $FreeBSD: src/bin/ls/extern.h,v 1.23 2004/05/02 11:25:37 tjr Exp $
  */
 
 int	 acccmp(const FTSENT *, const FTSENT *);
@@ -45,6 +45,7 @@
 void	 printscol(const DISPLAY *);
 void	 printstream(const DISPLAY *);
 void	 usage(void);
+int	 prn_normal(const char *);
 size_t	 len_octal(const char *, int);
 int	 prn_octal(const char *);
 int	 prn_printable(const char *);

==== //depot/projects/gdb/bin/ls/ls.1#4 (text+ko) ====

@@ -29,9 +29,9 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)ls.1	8.7 (Berkeley) 7/29/94
-.\" $FreeBSD: src/bin/ls/ls.1,v 1.79 2004/04/06 20:06:47 markm Exp $
+.\" $FreeBSD: src/bin/ls/ls.1,v 1.80 2004/05/02 11:25:37 tjr Exp $
 .\"
-.Dd March 21, 2004
+.Dd May 2, 2004
 .Dt LS 1
 .Os
 .Sh NAME
@@ -673,7 +673,3 @@
 .Sh BUGS
 To maintain backward compatibility, the relationships between the many
 options are quite complex.
-.Pp
-The
-.Nm
-utility does not recognize multibyte characters in filenames.

==== //depot/projects/gdb/bin/ls/print.c#6 (text+ko) ====

@@ -36,7 +36,7 @@
 #endif /* not lint */
 #endif
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/bin/ls/print.c,v 1.70 2004/04/06 20:06:47 markm Exp $");
+__FBSDID("$FreeBSD: src/bin/ls/print.c,v 1.71 2004/05/02 11:25:37 tjr Exp $");
 
 #include <sys/param.h>
 #include <sys/stat.h>
@@ -147,7 +147,7 @@
 	else if (f_nonprint)
 		return prn_printable(name);
 	else
-		return printf("%s", name);
+		return prn_normal(name);
 }
 
 void
@@ -239,6 +239,7 @@
 	for (p = dp->list, chcnt = 0; p; p = p->fts_link) {
 		if (p->fts_number == NO_PRINT)
 			continue;
+		/* XXX strlen does not take octal escapes into account. */
 		if (strlen(p->fts_name) + chcnt +
 		    (p->fts_link ? 2 : 0) >= (unsigned)termwidth) {
 			putchar('\n');

==== //depot/projects/gdb/bin/ls/util.c#3 (text+ko) ====

@@ -36,7 +36,7 @@
 #endif /* not lint */
 #endif
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/bin/ls/util.c,v 1.33 2004/04/06 20:06:47 markm Exp $");
+__FBSDID("$FreeBSD: src/bin/ls/util.c,v 1.34 2004/05/02 11:25:37 tjr Exp $");
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -44,25 +44,81 @@
 #include <ctype.h>
 #include <err.h>
 #include <fts.h>
+#include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <wchar.h>
+#include <wctype.h>
 
 #include "ls.h"
 #include "extern.h"
 
 int
+prn_normal(const char *s)
+{
+	mbstate_t mbs;
+	wchar_t wc;
+	int i, n;
+	size_t clen;
+
+	memset(&mbs, 0, sizeof(mbs));
+	n = 0;
+	while ((clen = mbrtowc(&wc, s, MB_LEN_MAX, &mbs)) != 0) {
+		if (clen == (size_t)-2) {
+			n += printf("%s", s);
+			break;
+		}
+		if (clen == (size_t)-1) {
+			memset(&mbs, 0, sizeof(mbs));
+			putchar((unsigned char)*s);
+			s++;
+			n++;
+			continue;
+		}
+		for (i = 0; i < (int)clen; i++)
+			putchar((unsigned char)s[i]);
+		s += clen;
+		n += wcwidth(wc);
+	}
+	return (n);
+}
+
+int
 prn_printable(const char *s)
 {
-	char c;
-	int n;
+	mbstate_t mbs;
+	wchar_t wc;
+	int i, n;
+	size_t clen;
 
-	for (n = 0; (c = *s) != '\0'; ++s, ++n)
-		if (isprint((unsigned char)c))
-			putchar(c);
-		else
+	memset(&mbs, 0, sizeof(mbs));
+	n = 0;
+	while ((clen = mbrtowc(&wc, s, MB_LEN_MAX, &mbs)) != 0) {
+		if (clen == (size_t)-1) {
+			putchar('?');
+			s++;
+			n++;
+			memset(&mbs, 0, sizeof(mbs));
+			continue;
+		}
+		if (clen == (size_t)-2) {
+			putchar('?');
+			n++;
+			break;
+		}
+		if (!iswprint(wc)) {
 			putchar('?');
-	return n;
+			s += clen;
+			n++;
+			continue;
+		}
+		for (i = 0; i < (int)clen; i++)
+			putchar((unsigned char)s[i]);
+		s += clen;
+		n += wcwidth(wc);
+	}
+	return (n);
 }
 
 /*
@@ -81,70 +137,83 @@
 size_t
 len_octal(const char *s, int len)
 {
-	size_t r = 0;
+	mbstate_t mbs;
+	wchar_t wc;
+	size_t clen, r;
 
-	while (len--)
-		if (isprint((unsigned const char)*s++)) r++; else r += 4;
-	return r;
+	memset(&mbs, 0, sizeof(mbs));
+	r = 0;
+	while (len != 0 && (clen = mbrtowc(&wc, s, len, &mbs)) != 0) {
+		if (clen == (size_t)-1) {
+			r += 4;
+			s++;
+			len--;
+			memset(&mbs, 0, sizeof(mbs));
+			continue;
+		}
+		if (clen == (size_t)-2) {
+			r += 4 * len;
+			break;
+		}
+		if (iswprint(wc))
+			r++;
+		else
+			r += 4 * clen;
+		s += clen;
+	}
+	return (r);
 }
 
 int
 prn_octal(const char *s)
 {
-        unsigned char ch;
-	int len = 0;
+	static const char esc[] = "\\\\\"\"\aa\bb\ff\nn\rr\tt\vv";
+	const char *p;
+	mbstate_t mbs;
+	wchar_t wc;
+	size_t clen;
+	unsigned char ch;
+	int goodchar, i, len, prtlen;
 	
-        while ((ch = (unsigned char)*s++)) {
-	        if (isprint(ch) && (ch != '\"') && (ch != '\\'))
-		        putchar(ch), len++;
-	        else if (f_octal_escape) {
-	                putchar('\\');
-		        switch (ch) {
-			case '\\':
-			        putchar('\\');
-				break;
-			case '\"':
-			        putchar('"');
-				break;
-			case '\a':
-			        putchar('a');
-				break;
-			case '\b':
-			        putchar('b');
-				break;
-			case '\f':
-			        putchar('f');
-				break;
-			case '\n':
-			        putchar('n');
-				break;
-			case '\r':
-			        putchar('r');
-				break;
-			case '\t':
-			        putchar('t');
-				break;
-			case '\v':
-			        putchar('v');
-				break;
- 		        default:
+	memset(&mbs, 0, sizeof(mbs));
+	len = 0;
+	while ((clen = mbrtowc(&wc, s, MB_LEN_MAX, &mbs)) != 0) {
+		goodchar = clen != (size_t)-1 && clen != (size_t)-2;
+		if (goodchar && iswprint(wc) && wc != L'\"' && wc != L'\\') {
+			for (i = 0; i < (int)clen; i++)
+				putchar((unsigned char)s[i]);
+			len += wcwidth(wc);
+		} else if (goodchar && f_octal_escape && wc >= 0 &&
+		    wc <= (wchar_t)UCHAR_MAX &&
+		    (p = strchr(esc, (char)wc)) != NULL) {
+			putchar('\\');
+			putchar(p[1]);
+			len += 2;
+		} else {
+			if (goodchar)
+				prtlen = clen;
+			else if (clen == (size_t)-1)
+				prtlen = 1;
+			else
+				prtlen = strlen(s);
+			for (i = 0; i < prtlen; i++) {
+				ch = (unsigned char)s[i];
+				putchar('\\');
 		                putchar('0' + (ch >> 6));
 		                putchar('0' + ((ch >> 3) & 7));
 		                putchar('0' + (ch & 7));
-		                len += 2;
-			        break;
-		        }
-		        len += 2;
-	        }
-		else {
-			putchar('\\');
-	                putchar('0' + (ch >> 6));
-	                putchar('0' + ((ch >> 3) & 7));
-	                putchar('0' + (ch & 7));
-	                len += 4;
+				len += 4;
+			}
 		}
+		if (clen == (size_t)-2)
+			break;
+		if (clen == (size_t)-1) {
+			memset(&mbs, 0, sizeof(mbs));
+			s++;
+		} else
+			s += clen;
 	}
-	return len;
+	return (len);
 }
 
 void

==== //depot/projects/gdb/gnu/usr.bin/gzip/gzip.h#2 (text+ko) ====

@@ -2,6 +2,8 @@
  * Copyright (C) 1992-1993 Jean-loup Gailly.
  * This is free software; you can redistribute it and/or modify it under the
  * terms of the GNU General Public License, see the file COPYING.
+ *
+ * $FreeBSD: src/gnu/usr.bin/gzip/gzip.h,v 1.4 2004/05/02 23:07:49 obrien Exp $
  */
 
 #if defined(__STDC__) || defined(PROTO)
@@ -41,9 +43,10 @@
 
 #define local static
 
-typedef unsigned char  uch;
-typedef unsigned short ush;
-typedef unsigned long  ulg;
+#include <stdint.h>
+typedef uint8_t uch;
+typedef uint16_t ush;
+typedef uint32_t  ulg;
 
 /* Return codes from gzip */
 #define OK      0

==== //depot/projects/gdb/gnu/usr.bin/gzip/unzip.c#2 (text+ko) ====

@@ -14,7 +14,7 @@
  */
 
 #ifdef RCSID
-static char rcsid[] = "$FreeBSD: src/gnu/usr.bin/gzip/unzip.c,v 1.6 1999/08/27 23:35:54 peter Exp $";
+static char rcsid[] = "$FreeBSD: src/gnu/usr.bin/gzip/unzip.c,v 1.7 2004/05/02 02:54:37 tjr Exp $";
 #endif
 
 #include "tailor.h"
@@ -35,6 +35,7 @@
 #define LOCEXT 28               /* offset of extra field length */
 #define LOCHDR 30               /* size of local header, including sig */
 #define EXTHDR 16               /* size of extended local header, inc sig */
+#define RAND_HEAD_LEN  12       /* length of encryption random header */
 
 
 /* Globals */
@@ -103,6 +104,7 @@
     ulg orig_len = 0;       /* original uncompressed length */
     int n;
     uch buf[EXTHDR];        /* extended local header */
+    int err = OK;
 
     ifd = in;
     ofd = out;
@@ -136,9 +138,6 @@
 	}
 	while (n--) {
 	    uch c = (uch)get_byte();
-#ifdef CRYPT
-	    if (decrypt) zdecode(c);
-#endif
 	    put_ubyte(c);
 	}
 	flush_window();
@@ -172,10 +171,14 @@
 
     /* Validate decompression */
     if (orig_crc != updcrc(outbuf, 0)) {
-	error("invalid compressed data--crc error");
+	fprintf(stderr, "\n%s: %s: invalid compressed data--crc error\n",
+		progname, ifname);
+	err = ERROR;
     }
-    if (orig_len != (ulg)bytes_out) {
-	error("invalid compressed data--length error");
+    if (((orig_len - (ulg)bytes_out) & 0x0ffffffffL) != 0) {
+	fprintf(stderr, "\n%s: %s: invalid compressed data--length error\n",
+		progname, ifname);
+	err = ERROR;
     }
 
     /* Check if there are more entries in a pkzip file */
@@ -189,11 +192,12 @@
 	    fprintf(stderr,
 		    "%s: %s has more than one entry -- unchanged\n",
 		    progname, ifname);
-	    exit_code = ERROR;
-	    ext_header = pkzip = 0;
-	    return ERROR;
+	    err = ERROR;
 	}
     }
     ext_header = pkzip = 0; /* for next file */
-    return OK;
+    if (err == OK) return OK;
+    exit_code = ERROR;
+    if (!test) abort_gzip();
+    return err;
 }

==== //depot/projects/gdb/lib/libarchive/archive_entry.c#11 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.10 2004/04/26 23:37:54 kientzle Exp $");
+__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry.c,v 1.11 2004/05/02 00:38:38 kientzle Exp $");
 
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -35,6 +35,10 @@
 #include <string.h>
 #include <wchar.h>
 
+#ifdef LINUX
+#include <ext2fs/ext2_fs.h>	/* for Linux file flags */
+#endif
+
 #include "archive.h"
 #include "archive_entry.h"
 

==== //depot/projects/gdb/lib/libc/Makefile#3 (text+ko) ====

@@ -1,5 +1,5 @@
 #	@(#)Makefile	8.2 (Berkeley) 2/3/94
-# $FreeBSD: src/lib/libc/Makefile,v 1.50 2004/01/19 16:16:53 nectar Exp $
+# $FreeBSD: src/lib/libc/Makefile,v 1.51 2004/05/02 10:55:07 das Exp $
 #
 # All library objects contain FreeBSD revision strings by default; they may be
 # excluded as a space-saving measure.  To produce a library that does
@@ -64,6 +64,9 @@
 .if !defined(NO_HESIOD_LIBC)
 CFLAGS+= -DHESIOD
 .endif
+.if defined(NO_FP_LIBC)
+CFLAGS+= -DNO_FLOATING_POINT
+.endif
 
 # If there are no machine dependent sources, append all the
 # machine-independent sources:

==== //depot/projects/gdb/lib/libc/gen/fmtcheck.c#2 (text+ko) ====

@@ -35,7 +35,7 @@
 
 /*	$NetBSD: fmtcheck.c,v 1.2 2000/11/01 01:17:20 briggs Exp $	*/
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/gen/fmtcheck.c,v 1.6 2003/06/29 01:11:31 das Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/gen/fmtcheck.c,v 1.7 2004/05/02 10:55:05 das Exp $");
 
 #include <stdio.h>
 #include <string.h>
@@ -57,8 +57,10 @@
 	FMTCHECK_QUADPOINTER,
 	FMTCHECK_PTRDIFFTPOINTER,
 	FMTCHECK_SIZETPOINTER,
+#ifndef NO_FLOATING_POINT
 	FMTCHECK_DOUBLE,
 	FMTCHECK_LONGDOUBLE,
+#endif
 	FMTCHECK_STRING,
 	FMTCHECK_WIDTH,
 	FMTCHECK_PRECISION,
@@ -149,6 +151,7 @@
 			RETURN(pf,f,FMTCHECK_UNKNOWN);
 		RETURN(pf,f,FMTCHECK_LONG);
 	}
+#ifndef NO_FLOATING_POINT
 	if (strchr("aAeEfFgG", *f)) {
 		if (longdouble)
 			RETURN(pf,f,FMTCHECK_LONGDOUBLE);
@@ -156,6 +159,7 @@
 			RETURN(pf,f,FMTCHECK_UNKNOWN);
 		RETURN(pf,f,FMTCHECK_DOUBLE);
 	}
+#endif
 	if (*f == 'c') {
 		if (sh + lg + quad + longdouble + ptrdifft + sizet)
 			RETURN(pf,f,FMTCHECK_UNKNOWN);

==== //depot/projects/gdb/lib/libc/stdio/vfprintf.c#5 (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.64 2004/04/22 11:35:12 tjr Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.65 2004/05/02 10:55:05 das Exp $");
 
 /*
  * Actual printf innards.
@@ -66,10 +66,6 @@
 #include "local.h"
 #include "fvwrite.h"
 
-/* Define FLOATING_POINT to get floating point, HEXFLOAT to get %a. */
-#define	FLOATING_POINT
-#define	HEXFLOAT
-
 union arg {
 	int	intarg;
 	u_int	uintarg;
@@ -91,7 +87,7 @@
 	ptrdiff_t *pptrdiffarg;
 	size_t	*psizearg;
 	intmax_t *pintmaxarg;
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 	double	doublearg;
 	long double longdoublearg;
 #endif
@@ -411,7 +407,7 @@
 	return (ret);
 }
 
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 
 #define	dtoa		__dtoa
 #define	freedtoa	__freedtoa
@@ -425,7 +421,7 @@
 
 static int exponent(char *, int, int);
 
-#endif /* FLOATING_POINT */
+#endif /* !NO_FLOATING_POINT */
 
 /*
  * The size of the buffer we use as scratch space for integer
@@ -474,7 +470,7 @@
 	char sign;		/* sign prefix (' ', '+', '-', or \0) */
 	char thousands_sep;	/* locale specific thousands separator */
 	const char *grouping;	/* locale specific numeric grouping rules */
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 	/*
 	 * We can decompose the printed representation of floating
 	 * point numbers into several parts, some of which may be empty:
@@ -641,7 +637,7 @@
 	thousands_sep = '\0';
 	grouping = NULL;
 	convbuf = NULL;
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 	dtoaresult = NULL;
 	decimal_point = localeconv()->decimal_point;
 #endif
@@ -762,7 +758,7 @@
 			}
 			width = n;
 			goto reswitch;
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 		case 'L':
 			flags |= LONGDBL;
 			goto rflag;
@@ -836,8 +832,7 @@
 			}
 			base = 10;
 			goto number;
-#ifdef FLOATING_POINT
-#ifdef HEXFLOAT
+#ifndef NO_FLOATING_POINT
 		case 'a':
 		case 'A':
 			if (ch == 'a') {
@@ -869,7 +864,6 @@
 			if (expt == INT_MAX)
 				ox[1] = '\0';
 			goto fp_common;
-#endif	/* HEXFLOAT */
 		case 'e':
 		case 'E':
 			expchar = ch;
@@ -971,7 +965,7 @@
 					lead = expt;
 			}
 			break;
-#endif /* FLOATING_POINT */
+#endif /* !NO_FLOATING_POINT */
 		case 'n':
 			/*
 			 * Assignment-like behavior is specified if the
@@ -1176,7 +1170,7 @@
 		PAD(dprec - size, zeroes);
 
 		/* the string or number proper */
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 		if ((flags & FPT) == 0) {
 			PRINT(cp, size);
 		} else {	/* glue together f_p fragments */
@@ -1239,7 +1233,7 @@
 done:
 	FLUSH();
 error:
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 	if (dtoaresult != NULL)
 		freedtoa(dtoaresult);
 #endif
@@ -1373,7 +1367,7 @@
 			}
 			width = n;
 			goto reswitch;
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 		case 'L':
 			flags |= LONGDBL;
 			goto rflag;
@@ -1420,11 +1414,9 @@
 		case 'i':
 			ADDSARG();
 			break;
-#ifdef FLOATING_POINT
-#ifdef HEXFLOAT
+#ifndef NO_FLOATING_POINT
 		case 'a':
 		case 'A':
-#endif
 		case 'e':
 		case 'E':
 		case 'f':
@@ -1435,7 +1427,7 @@
 			else
 				ADDTYPE(T_DOUBLE);
 			break;
-#endif /* FLOATING_POINT */
+#endif /* !NO_FLOATING_POINT */
 		case 'n':
 			if (flags & INTMAXT)
 				ADDTYPE(TP_INTMAXT);
@@ -1555,7 +1547,7 @@
 		    case TP_INTMAXT:
 			(*argtable) [n].pintmaxarg = va_arg (ap, intmax_t *);
 			break;
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 		    case T_DOUBLE:
 			(*argtable) [n].doublearg = va_arg (ap, double);
 			break;
@@ -1612,7 +1604,7 @@
 }
 
 
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 
 static int
 exponent(char *p0, int exp, int fmtch)
@@ -1649,4 +1641,4 @@
 	}
 	return (p - p0);
 }
-#endif /* FLOATING_POINT */
+#endif /* !NO_FLOATING_POINT */

==== //depot/projects/gdb/lib/libc/stdio/vfscanf.c#4 (text+ko) ====

@@ -38,7 +38,7 @@
 static char sccsid[] = "@(#)vfscanf.c	8.1 (Berkeley) 6/4/93";
 #endif /* LIBC_SCCS and not lint */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdio/vfscanf.c,v 1.36 2004/04/07 09:55:05 tjr Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdio/vfscanf.c,v 1.37 2004/05/02 10:55:05 das Exp $");
 
 #include "namespace.h"
 #include <ctype.h>
@@ -56,9 +56,7 @@
 #include "libc_private.h"
 #include "local.h"
 
-#define FLOATING_POINT
-
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 #include <locale.h>
 #endif
 
@@ -254,7 +252,7 @@
 			base = 16;
 			break;
 
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 		case 'A': case 'E': case 'F': case 'G':
 		case 'a': case 'e': case 'f': case 'g':
 			c = CT_FLOAT;
@@ -768,7 +766,7 @@
 			nconversions++;
 			break;
 
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 		case CT_FLOAT:
 			/* scan a floating point number as if by strtod */
 			if (width == 0 || width > sizeof(buf) - 1)
@@ -793,7 +791,7 @@
 			nread += width;
 			nconversions++;
 			break;
-#endif /* FLOATING_POINT */
+#endif /* !NO_FLOATING_POINT */
 		}
 	}
 input_failure:
@@ -915,7 +913,7 @@
 	/* NOTREACHED */
 }
 
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 static int
 parsefloat(FILE *fp, char *buf, char *end)
 {

==== //depot/projects/gdb/lib/libc/stdio/vfwprintf.c#5 (text+ko) ====

@@ -34,14 +34,13 @@
  * SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
 #if 0
 #if defined(LIBC_SCCS) && !defined(lint)
 static char sccsid[] = "@(#)vfprintf.c	8.1 (Berkeley) 6/4/93";
 #endif /* LIBC_SCCS and not lint */
-__FBSDID("FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.62 2004/01/18 10:32:49 das Exp");
 #endif
-__FBSDID("$FreeBSD: src/lib/libc/stdio/vfwprintf.c,v 1.18 2004/04/22 11:35:12 tjr Exp $");
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/lib/libc/stdio/vfwprintf.c,v 1.20 2004/05/02 20:09:14 obrien Exp $");
 
 /*
  * Actual wprintf innards.
@@ -70,10 +69,6 @@
 #include "local.h"
 #include "fvwrite.h"
 
-/* Define FLOATING_POINT to get floating point, HEXFLOAT to get %a. */
-#define	FLOATING_POINT
-#define	HEXFLOAT
-
 union arg {
 	int	intarg;
 	u_int	uintarg;
@@ -95,7 +90,7 @@
 	ptrdiff_t *pptrdiffarg;
 	size_t	*psizearg;
 	intmax_t *pintmaxarg;
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 	double	doublearg;
 	long double longdoublearg;
 #endif
@@ -435,7 +430,7 @@
 	return (ret);
 }
 
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 
 #define	dtoa		__dtoa
 #define	freedtoa	__freedtoa
@@ -449,7 +444,7 @@
 
 static int exponent(wchar_t *, int, wchar_t);
 
-#endif /* FLOATING_POINT */
+#endif /* !NO_FLOATING_POINT */
 
 /*
  * The size of the buffer we use as scratch space for integer
@@ -497,7 +492,7 @@
 	wchar_t sign;		/* sign prefix (' ', '+', '-', or \0) */
 	char thousands_sep;	/* locale specific thousands separator */
 	const char *grouping;	/* locale specific numeric grouping rules */
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 	/*
 	 * We can decompose the printed representation of floating
 	 * point numbers into several parts, some of which may be empty:
@@ -648,7 +643,7 @@
 
 	thousands_sep = '\0';
 	grouping = NULL;
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 	decimal_point = localeconv()->decimal_point;
 #endif
 	convbuf = NULL;
@@ -766,7 +761,7 @@
 			}
 			width = n;
 			goto reswitch;
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 		case 'L':
 			flags |= LONGDBL;
 			goto rflag;
@@ -828,8 +823,7 @@
 			}
 			base = 10;
 			goto number;
-#ifdef FLOATING_POINT
-#ifdef HEXFLOAT
+#ifndef NO_FLOATING_POINT
 		case 'a':
 		case 'A':
 			if (ch == 'a') {
@@ -864,7 +858,6 @@
 			cp = convbuf = __mbsconv(dtoaresult, -1);
 			freedtoa(dtoaresult);
 			goto fp_common;
-#endif	/* HEXFLOAT */
 		case 'e':
 		case 'E':
 			expchar = ch;
@@ -968,7 +961,7 @@
 					lead = expt;
 			}
 			break;
-#endif /* FLOATING_POINT */
+#endif /* !NO_FLOATING_POINT */
 		case 'n':
 			/*
 			 * Assignment-like behavior is specified if the
@@ -1176,7 +1169,7 @@
 		PAD(dprec - size, zeroes);
 
 		/* the string or number proper */
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 		if ((flags & FPT) == 0) {
 			PRINT(cp, size);
 		} else {	/* glue together f_p fragments */
@@ -1369,7 +1362,7 @@
 			}
 			width = n;
 			goto reswitch;
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 		case 'L':
 			flags |= LONGDBL;
 			goto rflag;
@@ -1416,11 +1409,9 @@
 		case 'i':
 			ADDSARG();
 			break;
-#ifdef FLOATING_POINT
-#ifdef HEXFLOAT
+#ifndef NO_FLOATING_POINT
 		case 'a':
 		case 'A':
-#endif
 		case 'e':
 		case 'E':
 		case 'f':
@@ -1431,7 +1422,7 @@
 			else
 				ADDTYPE(T_DOUBLE);
 			break;
-#endif /* FLOATING_POINT */
+#endif /* !NO_FLOATING_POINT */
 		case 'n':
 			if (flags & INTMAXT)
 				ADDTYPE(TP_INTMAXT);
@@ -1551,7 +1542,7 @@
 		    case TP_INTMAXT:
 			(*argtable) [n].pintmaxarg = va_arg (ap, intmax_t *);
 			break;
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 		    case T_DOUBLE:
 			(*argtable) [n].doublearg = va_arg (ap, double);
 			break;
@@ -1608,7 +1599,7 @@
 }
 
 
-#ifdef FLOATING_POINT
+#ifndef NO_FLOATING_POINT
 
 static int
 exponent(wchar_t *p0, int exp, wchar_t fmtch)
@@ -1645,4 +1636,4 @@
 	}
 	return (p - p0);
 }
-#endif /* FLOATING_POINT */
+#endif /* !NO_FLOATING_POINT */

==== //depot/projects/gdb/lib/libc/stdio/vfwscanf.c#4 (text+ko) ====

@@ -34,14 +34,13 @@
  * SUCH DAMAGE.
  */
 
-#include <sys/cdefs.h>
 #if 0
 #if defined(LIBC_SCCS) && !defined(lint)
 static char sccsid[] = "@(#)vfscanf.c	8.1 (Berkeley) 6/4/93";
 #endif /* LIBC_SCCS and not lint */
-__FBSDID("FreeBSD: src/lib/libc/stdio/vfscanf.c,v 1.35 2004/01/31 23:16:09 das Exp ");
 #endif
-__FBSDID("$FreeBSD: src/lib/libc/stdio/vfwscanf.c,v 1.10 2004/04/07 09:55:05 tjr Exp $");
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/lib/libc/stdio/vfwscanf.c,v 1.12 2004/05/02 20:13:29 obrien Exp $");

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


More information about the p4-projects mailing list