summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/vfprintf.c
Commit message (Collapse)AuthorAgeFilesLines
* Assume __STDC__, remove non-__STDC__ code.alfred2002-05-281-4/+0
| | | | Submitted by: keramida
* Fix the style of the SCM ID's.obrien2002-03-221-4/+2
| | | | I believe have made all of libc .c's as consistent as possible.
* Remove multi-line __P() usage.obrien2002-03-221-5/+5
|
* Remove __P() usage.obrien2002-03-211-6/+6
|
* Remove 'register' keyword.obrien2002-03-211-2/+2
|
* Fix some style bugsphantom2001-12-171-15/+18
| | | | Prompted by: mike
* Also fix cases when thousands separator should be put before number. Forphantom2001-12-131-2/+4
| | | | | example before for grouping sequence "\003\003" number 123456 was formated as ",123,456", now "123,456".
* Respect locale while handling of \' flag.phantom2001-12-131-22/+63
| | | | | | | | | | In original version grouping was hardcoded. It assumed that thousands separator should be inserted to separate each 3 numbers. I.e. grouping string "\003" was assumed for all cases. In correct case (per POSIX) vfprintf should respect locale defined non-monetary (LC_NUMERIC category) grouping sequence. Also simplify thousands_sep handling.
* * localeconv() usage is not FLOATING_POINT specific anymore (due to "'" flagphantom2001-12-071-3/+3
| | | | | addition) so move locale.h inclusion out of FLOATING_POINT ifdef's. * add more comments
* Implement several of the c99 updates to printf(3):fenner2001-11-301-115/+233
| | | | | | | | | | | | | | | | - New length modifiers: hh, j, t, z. - New flag: '. Note that %'f is not yet implemented. - Use "inf"/"nan" for efg formats, "INF"/"NAN" for EFG formats. - Implemented %q in terms of %ll; if "quad_t" is not "long long" %q will break. Still to do: - %C, %S, %lc, %ls (wide character support) - %'f (thousands in integer portion of %f) - %a/%A (exact hex representation of floating-point numbers) Garrett Wollman wrote the first version of the vfprintf.c update; Mike Barcroft wrote the first version of the printf.3 changes.
* Fixed style bugs in previous commit.bde2001-10-151-15/+15
|
* Make this compile on ia64.dfr2001-10-141-25/+46
|
* Mark some functions as __printflike() and/or taking const char * argumentskris2001-08-201-1/+1
| | | | | | instead of char *. MFC after: 2 weeks
* Remove freelists managed by Balloc/Bfree.tegge2001-02-151-5/+18
| | | | | | | | Change __dtoa to not free the string it allocated the previous time it was called. The caller now frees the string after usage if appropiate. PR: 15070 Reviewed by: deischen
* Take decimal point from locale instead of hardcoded '.' (SUSv2)ache2001-02-101-9/+10
|
* Backout previous commit. Use of spinlocks was not approved.tegge2001-02-091-18/+5
| | | | PR: 15070
* Protect freelists managed by Balloc/Bfree with a spinlock.tegge2001-02-081-5/+18
| | | | | | | Change __dtoa to not free the string it allocated the previous time it was called. The caller now frees the string after usage if appropiate. PR: 15070
* Remove _THREAD_SAFE and make libc thread-safe by default bydeischen2001-01-241-62/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adding (weak definitions to) stubs for some of the pthread functions. If the threads library is linked in, the real pthread functions will pulled in. Use the following convention for system calls wrapped by the threads library: __sys_foo - actual system call _foo - weak definition to __sys_foo foo - weak definition to __sys_foo Change all libc uses of system calls wrapped by the threads library from foo to _foo. In order to define the prototypes for _foo(), we introduce namespace.h and un-namespace.h (suggested by bde). All files that need to reference these system calls, should include namespace.h before any standard includes, then include un-namespace.h after the standard includes and before any local includes. <db.h> is an exception and shouldn't be included in between namespace.h and un-namespace.h namespace.h will define foo to _foo, and un-namespace.h will undefine foo. Try to eliminate some of the recursive calls to MT-safe functions in libc/stdio in preparation for adding a mutex to FILE. We have recursive mutexes, but would like to avoid using them if possible. Remove uneeded includes of <errno.h> from a few files. Add $FreeBSD$ to a few files in order to pass commitprep. Approved by: -arch
* Fix bugs in the handling of > 8 positional arguments:archie2001-01-061-14/+18
| | | | | | | | - The stack was getting smashed by __grow_type_table() - reallocf() was being called with the wrong pointer - The maximum argument number was being incorrectly computed PR: misc/23521
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Add support for long long modifier (e.g. %llx, %lld).dfr1999-03-111-3/+9
| | | | Reviewed by: bde
* Replace memory leaking instances of realloc with non-leaking reallocf.imp1998-09-161-2/+2
| | | | | | | | | | | In some cases replace if (a == null) a = malloc(x); else a = realloc(a, x); with simple reallocf(a, x). Per ANSI-C, this is guaranteed to be the same thing. I've been running these on my system here w/o ill effects for some time. However, the CTM-express is at part 6 of 34 for the CAM changes, so I've not been able to do a build world with the CAM in the tree with these changes. Shouldn't impact anything, but...
* Don't assign the va_list variable 'ap' directly to the argtable becausejb1998-05-081-19/+18
| | | | | va_list is not a pointer on alpha. Instead, use the va_arg() macro to return the address that is stored in the argtable.
* Add FILE locking stubs for libc.jb1998-04-111-17/+6
| | | | | | | | Change the FILE locking to support kernel threads when linked with libpthread (which you haven't see yet). This requires that libc become thread-safe and thread-aware, testing __isthreaded before attempting to do lock/unlock calls. The impact on non-threaded programs is minor. This change works with libc_r, so it's the best compromise.
* size_t -> unsignedache1998-01-041-3/+3
| | | | | in arguments length INT_MAX overflow check Suggested-by: bde
* Add overflow checks: if output size becomes bigger than INT_MAX,ache1997-12-251-2/+13
| | | | just return EOF
* Return back to BSD snprintf semantics which recent C9x standard adoptsache1997-12-241-9/+5
| | | | | | | | | | instead of Singe Unix, thanx Bruce for explaining, I am not realize standards war was there. But now, fix n == 0 case to not return error and fix check for too big n. Things left to do: check for overflow in arguments.
* Fix snprintf(...%n...)ache1997-12-241-5/+9
| | | | | | to pass not more than buffer size to %n agrument, old variant always assume infinite buffer. %n is for actually transmitted characters, not for planned ones.
* Comment that long double is poorly implemented, not that it is unimplemented.bde1997-12-191-2/+3
|
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* The following patch to lib/libc/stdio implements positional arguments injkh1997-01-141-22/+400
| | | | | | | | | a manner consistent with other implementations. Its done in a way that adds only a tiny amount of overhead when positional arguments are not used. I also have a test program to go with this, but don't know where it belongs in the tree. Submitted-By: Bill Fenner <fenner@FreeBSD.ORG>
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Suggested by: Bruce Evans, Jeffrey Hsu, Gary Palmerjraynard1996-06-221-1/+10
| | | | | | | | | | | | | | | | | | | | | Added $Id$'s to files that were lacking them (gpalmer), made some cosmetic changes to conform to style guidelines (bde) and checked against NetBSD and Lite2 to remove unnecessary divergences (hsu, bde) One last code cleanup:- Removed spurious casts in fseek.c and stdio.c. Added missing function argument in fwalk.c. Added missing header include in flags.c and rget.c. Put in casts where int's were being passed as size_t's. Put in missing prototypes for static functions. Changed second args of __sflags() inflags.c and writehook() in vasprintf.c from char * to const char * to conform to prototypes. This directory now compiles with no warnings with -Wall under gcc-2.6.3 and with considerably less warnings than before with the ultra-pedantic script I used for testing. (Most of the remaining ones are due to const poisoning).
* The 4.4-lite vfprintf counted the %# hex prefix and the sign infenner1996-03-201-8/+6
| | | | | | | | the precision; ANSI X3J11 is not crystal clear but certainly says that the precision specifies the number of /digits/, and signs and "0x" aren't really digits. NetBSD already has a similar patch.
* Reviewed by: julian and (hsu?)julian1996-01-221-3/+23
| | | | | | Submitted by: John Birrel(L?) changes for threadsafe operations
* Remove trailing whitespace.rgrimes1995-05-301-3/+3
|
* Obtained from: 1.1.5 (originally by jtc)bde1995-04-061-1/+2
| | | | | | | Fix printf("%g", 0.0) - print "0", not "0.". The previous fixes in this area had one non-cosmetic (non-)change that caused this bug. Bruce
* Remove `|| flags & ALT == 0' which was an obscure no-op, not abde1995-03-121-1/+1
| | | | parenthesization/precedence bug.
* Obtained from: 1.1.5. Originally by jtc. Cosmetically changed for thisbde1995-03-121-15/+23
| | | | | | | | | | | | | | | | | | commit by bde. Fix bugs in floating point formatting. The 4.4lite version is similar to revision 1.3 in old-cvs and is missing all of jtc's fixes in revision 1.4 in old-cvs. Revision 1.2 in ncvs fixed one of the old bugs but introduced at least one new one (for %.0e). old-cvs log: revision 1.4 date: 1993/11/04 19:38:22; author: jtc; state: Exp; lines: +33 -20 My work from NetBSD to make printf() & friends ANSI C compliant. Fixes several bugs in floating point formatting: 1. Trailing zeros were being stripped with %e format. 2. %g/%G formats incorrect. 3. Lots of other nits.
* Fix handling of 'e' format floating point so that it prints trailing zerosdfr1995-01-191-1/+0
| | | | correctly.
* BSD 4.4 Lite Lib Sourcesrgrimes1994-05-271-0/+859
OpenPOWER on IntegriCloud