summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/vfwprintf.c
Commit message (Collapse)AuthorAgeFilesLines
* Initialize "nconv" to a reasonable value in all code paths. Prior tocperciva2008-08-041-1/+3
| | | | | | | this commit, sprintf("%s", "") could fail depending on what happened to be on the stack. Found by: LLVM/Clang Static Checker
* Correctly handle malloc() failure. While here, reduce the code size adas2008-06-291-3/+9
| | | | bit by removing some calls to the inline function addtype().
* Reduce the level of duplication between vfprintf() and vfwprintf()das2008-06-291-488/+3
| | | | | | by moving the positional argument handling code to a new file, printf-pos.c, and moving common definitions to printflocal.h. No functional change intended.
* Begin de-spaghettifying the code that handles positional arguments.das2008-06-291-94/+153
| | | | | | | | | | | | | | In particular, encapsulate the state of the type table in a struct, and add inline functions to initialize, free, and manipulate that state. This replaces some ugly macros that made proper error handling impossible. While here, remove an unneeded test for NULL and a variable that is initialized (many times!) but never used. The compiler didn't catch these because of rampant use of the same variable to mean different things in different places. This commit should not cause any changes in functionality.
* Next stage of stdio cleanup: Retire __sFILEX and merge the fields back intojhb2008-04-171-1/+2
| | | | | | | | | | | | | | | | | | | __sFILE. This was supposed to be done in 6.0. Some notes: - Where possible I restored the various lines to their pre-__sFILEX state. - Retire INITEXTRA() and just initialize the wchar bits (orientation and mbstate) explicitly instead. The various places that used INITEXTRA didn't need the locking fields or _up initialized. (Some places needed _up to exist and not be off the end of a NULL or garbage pointer, but they didn't require it to be initialized to a specific value.) - For now, stdio.h "knows" that pthread_t is a 'struct pthread *' to avoid namespace pollution of including all the pthread types in stdio.h. Once we remove all the inlines and make __sFILE private it can go back to using pthread_t, etc. - This does not remove any of the inlines currently and does not change any of the public ABI of 'FILE'. MFC after: 1 month Reviewed by: peter
* Catch up with vfprintf.c,v 1.77.das2007-12-181-0/+1
|
* Per Regents of the University of Calfornia letter, remove advertisingimp2007-01-091-4/+0
| | | | | | clause. # If I've done so improperly on a file, please let me know.
* Use correct type in va_arg argument.kan2006-09-211-1/+1
|
* Add missing #if's for NO_FLOATING_POINTphk2006-04-011-2/+4
|
* Be bug-for-bug compatible with the C standard with respect todas2005-04-161-2/+8
| | | | printf("%#.0o", 0). Cite an amusing passage from a defect report.
* Don't forget to va_end() the va_list we get from va_copy().des2004-08-261-0/+1
| | | | | Submitted by: Sean McNeil <sean@mcneil.com> MFC after: 3 days
* The third operand of the conditional operator should have type void too.stefanf2004-06-081-1/+1
| | | | Approved by: das (mentor)
* Rename cantwrite() to prepwrite(). The latter is less confusing,das2004-06-081-1/+1
| | | | since the macro isn't really a predicate, and it has side-effects.
* Fix damaged FBSDID.obrien2004-05-021-3/+1
|
* Merge vfprintf.c, v1.65:das2004-05-021-24/+17
| | | | | - s/#ifdef FLOATING_POINT/#ifndef NO_FLOATING_POINT/ - Remove HEXFLOAT
* Use the correct size to allocate, copy and clear argument type tablestjr2004-04-221-6/+9
| | | | | | | | | | after their change from an array of char to an array of enum. This fixes problems that occurred when using positional arguments in format strings, particularly with more than STATIC_ARG_TBL_SIZE (8) of them. PR: 65841 Submitted by: Steven Smith (mostly)
* Prepare to handle trivial state-dependent encodings. Full support fortjr2004-04-071-3/+10
| | | | | state-dependent encodings with locking shifts will come later if there is demand for it.
* Merge vfprintf.c, v1.61 and 1.62. For compatibility with __hdtoa()das2004-01-231-19/+25
| | | | | | | and to reduce diffs between vfprintf.c and vfwprintf.c, declare xdigs* to be char arrays rather than wchar_t arrays. In collaboration with: tjr
* Remove unused variables and function declarations. Add missing headers.nectar2004-01-061-2/+1
|
* Use __sfvwrite() instead of __sputc() via __fputwc() to write to faketjr2003-11-121-1/+30
| | | | | | | | string files (__SSTR flag set). This is necessary because __sputc() does not respect the __SALC flag, and crashes trying to flush the buffer instead of resizing it. PR: 59167
* Pass NULL instead of a pointer to a zeroed mbstate_t object.tjr2003-11-051-5/+2
|
* %E-like %g and %G conversions should remove trailing zeroes unlessdas2003-04-191-0/+7
| | | | | | | | the # flag is present. Implement this behavior and add a comment describing it. Noticed by: Enache Adrian <enache@rdslink.ro> Pointy hat to: das
* Merge in vfprintf.c rev. 1.58.tjr2003-04-141-9/+11
|
* Catch up with recent vfprintf.c changes.tjr2003-04-071-175/+215
|
* Add missing #include to unbreak previous commit.das2003-04-051-0/+1
|
* Correct some buffer sizes.das2003-04-051-9/+15
| | | | | | | | | | - __vfprintf()'s 'buf' has never been used for floating point, so don't define it in terms of (incorrect) constants describing floating point numbers. The actual size needed depends on sizeof(uintmax_t) and locale details, so I slightly overestimated. - We don't need a 308-character buffer to store the string "308". With long doubles and %a we need more than three characters, though.
* Merge vfprintf.c revision 1.52.tjr2003-03-141-2/+2
|
* Unexpand RCS tag.tjr2003-03-141-1/+1
|
* MFp4: Catch up to recent __dtoa() interface changes and removal of cvt()'stjr2003-03-131-11/+10
| | | | last argument.
* Set the error bit on the stream if an encoding error occurs. Improvetjr2002-10-161-1/+3
| | | | handling of multibyte sequences representing null wide characters.
* Add support for the XSI %C and %S formats, which are the same as %lctjr2002-10-161-0/+12
| | | | and %ls.
* Use the new va_copy macro to copy variable argument lists instead oftjr2002-09-241-1/+1
| | | | | | | | assignment. This is needed on powerpc but is also more correct for the other ports. Submitted by: grehan Tested on: alpha, i386, sparc64
* Add implementations of the wprintf() family of functions, which performtjr2002-09-211-0/+1538
formatted wide-character output.
OpenPOWER on IntegriCloud