Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-10-16 * libc/stdio/vfprintf.c (__sbprintf): Fix comment.Corinna Vinschen
2012-10-16 * libc/include/sys/features.h (__GNUC_PREREQ): Define. UseCorinna Vinschen
throughout in place of explicit GNUC version checks. * libc/include/_ansi.h (_NOINLINE): Define. (_NOINLINE_STATIC): Define. * libc/stdio/vfprintf.c (__sbprintf): Define _NOINLINE_STATIC.
2012-08-08 Throughout, run newlib with -Wall -Werror option and fix bugs andCorinna Vinschen
compiler warnings found this way. * libc/stdio/freopen.c (_freopen_r): Fix bug setting _flags. * libc/include/stdio.h (_rename): Define when building newlib. * libc/include/sys/signal.h (_kill): Ditto. * libc/include/sys/stat.h (_mkdir): Ditto. * libc/include/sys/time.h (_gettimeofday): Ditto. * libc/include/sys/times.h (_times): Ditto. * libc/include/sys/wait.h (_wait): Ditto. * libc/locale/lmessages.c (empty): Don't define for Cygwin. * libc/locale/lmonetary.c (cnv): Ditto. * libc/locale/nl_langinfo.c (nl_langinfo): Ditto for variable s. * libc/posix/collate.c: Throughout cast to avoid compiler warning. * libc/posix/engine.c (matcher): Initialize dp to avoid compiler warning. * libc/posix/glob.c: Disable on Cygwin. Explain why. * libc/posix/regcomp.c: Fix "uninitialized" compiler warnings. (dissect): Deliberately silence gcc compiler warning. Add comment to explain why. * libc/posix/wordexp.c (wordexp): Remove num_bytes variable since result is never used. * libc/posix/popen.c (popen): Ditto for variable last. * libc/reent/mkdirr.c: Include sys/stat.h. * libc/reent/renamer.c: Include stdio.h. * libc/search/hash.c: Throughout use underscored variants of the stat function family. (init_hash): Add missing definition for the __USE_INTERNAL_STAT64 case. * libc/search/hash_bigkey.c (__big_insert): Add parenthesis to avoid compiler warning. * libc/search/hash_page.c (overflow_page): Initalize freep to NULL to avoid compiler warning. * libc/stdio/asiprintf.c (_asiprintf_r): Cast unsigned char * to char * to avoid compiler warning. (asiprintf): Ditto. * libc/stdio/asprintf.c (_asprintf_r): Ditto. (asprintf): Ditto. * libc/stdio/vasiprintf.c (_vasiprintf_r): Ditto. * libc/stdio/vasprintf.c (_vasprintf_r): Ditto. * libc/stdio/mktemp.c (_gettemp): Cast to unsigned char in call to isdigit to avoid compiler warning. * libc/stdio/vfprintf.c (_VFPRINTF_R): Initialize variables used for grouping to avoid compiler warning. Only define and set nseps and nrepeats if they are really used. * libc/stdio/vfwprintf.c (_VFWPRINTF_R): Ditto. Only define state if it is really used. * libc/stdio/vfscanf.c (u_char): Revert to be defined as unsigned char. (__SVFSCANF_R): Cast fmt in call to __mbtowc. * libc/stdlib/mbtowc_r.c (JIS_state_table): Disable when building Cygwin. (JIS_action_table): Ditto. * libc/stdlib/wctomb_r.c (__utf8_wctomb): Add parenthesis to avoid compiler warning. * libc/string/strcasestr.c: Deliberately silence gcc compiler warning. Add comment to explain why. * libc/time/strptime.c (strptime): Cast to unsigned char in calls to isspace to avoid compiler warning. * libm/math/e_atan2.c (__ieee754_atan2): Add parenthesis to avoid compiler warning. * libm/math/e_exp.c (__ieee754_exp): Initialize k to 0 to avoid compiler warning. Drop setting it to 0 later. * libm/math/ef_exp.c (__ieee754_expf): Ditto. * libm/math/e_pow.c (__ieee754_pow): Add braces to avoid compiler warning. * libm/math/ef_pow.c (__ieee754_powf): Ditto. * libm/math/er_lgamma.c (__ieee754_lgamma_r): Initialize nadj to 0 to avoid compiler warning. * libm/math/erf_lgamma.c (__ieee754_lgammaf_r): Ditto. * libm/math/e_rem_pio2.c (__ieee754_rem_pio2): Ditto for variable z. * libm/common/sf_round.c (roundf): Remove signbit variable since result is never used.
2012-05-30 * libc/stdio/local.h (_newlib_flockfile_start): New macro toCorinna Vinschen
secure stream related critical section against thread cancellation. (_newlib_flockfile_exit): Ditto. (_newlib_sfp_lock_end): Ditto. (_newlib_sfp_lock_start): Ditto for the list of streams. (_newlib_sfp_lock_exit): Ditto. (_newlib_sfp_lock_end): Ditto. Use aforementioned macros in place of _flockfile/_funlockfile and __sfp_lock_acquire/__sfp_lock_release throughout the code. * libc/stdio/fclose.c: Explicitely disable and re-enable thread cancellation. Explain why. * libc/stdio/freopen.c: Ditto. * libc/stdio64/freopen64.c: Ditto.
2012-01-13 * libc/stdio/sprintf.c: Document 'm' conversion specifier.Yaakov Selkowitz
* libc/stdio/swprintf.c: Ditto. * libc/stdio/vfprintf.c (_VFPRINTF_R) [_GLIBC_EXTENSION]: Handle 'm' conversion specifier. * libc/stdio/vfwprintf.c (_VFWPRINTF_R) [_GLIBC_EXTENSION]: Ditto.
2010-02-15 * libc/stdio/vfprintf.c (_VFPRINTF_R): Drop printing a redundantCorinna Vinschen
decimal point in case the float argument is an integral value.
2010-02-05 * libc/stdio/vfprintf.c: Include locale.h also if _WANT_IO_C99_FORMATSCorinna Vinschen
is defined. Raise conversion buffer size to make sure it has enough room for numbers plus grouping character. Define GROUPING flag. (_VFPRINTF_R): Add PRINTANDPAD macro. Handle grouping flag character. Handle grouping for decimal integer and float values. * libc/stdio/vfwprintf.c: Ditto.
2010-01-14 * libc/stdio/vfprintf.c (_VFPRINTF_R): Just wave bytes invalid inCorinna Vinschen
the current charset through.
2009-11-18 * libc/stdio/vfprintf.c: Include ../stdlib/local.h. Replace call toCorinna Vinschen
_mbtowc_r with direct call to __mbtowc. * libc/stdio/vfscanf.c: Ditto. * libc/stdlib/btowc.c: Include local.h. Replace call to _mbtowc_r with direct call to __mbtowc. * libc/stdlib/mblen.c: Ditto. * libc/stdlib/mblen_r.c: Ditto. * libc/stdlib/mbrtowc.c: Ditto. * libc/stdlib/mbstowcs_r.c: Ditto. * libc/stdlib/mbtowc.c: Ditto. * libc/stdlib/wcrtomb.c: Include local.h. Replace call to _wctomb_r with direct call to __wctomb. * libc/stdlib/wcsnrtombs.c: Ditto. (_wcsnrtombs_r): Ditto. * libc/stdlib/wcstombs_r.c: Ditto. * libc/stdlib/wctob.c: Ditto. * libc/stdlib/wctomb.c: Ditto. * libc/stdlib/mbrtowc.c (mbrtowc): Implement independently from _mbrtowc_r, unless PREFER_SIZE_OVER_SPEED or __OPTIMIZE_SIZE__ are defined. * libc/stdlib/wcrtomb.c (wcrtomb): Implement independently from _wcrtomb_r, unless PREFER_SIZE_OVER_SPEED or __OPTIMIZE_SIZE__ are defined. * libc/stdlib/mbtowc_r.c (__utf8_mbtowc): Drop unnecessary test for ch >= 0.
2009-06-16 * libc/stdio/vfprintf.c (_VFPRINTF_R): Use actual length ofCorinna Vinschen
radix char instead of assuming length 1. * libc/stdlib/gdtoa-gethex.c: Remove use of USE_LOCALE. (gethex): Allow multibyte decimal point. Fix compiler warnings due to different signedness of pointer types. * libc/stdlib/strtod.c: Remove use of USE_LOCALE. (_strtod_r): Allow multibyte decimal point. * libc/stdlib/wcstod.c (_wcstod_r): Evaluate correct wide char endptr position if the decimal point is a multibyte char.
2009-03-11 * libc/include/wchar.h (fwscanf, swscanf, vfwscanf, vswscanf, vwscanf,Corinna Vinschen
wscanf): Declare. (_fwscanf_r, _swscanf_r, _vfwscanf_r, _vswscanf_r, _vwscanf_r, _wscanf_r): Declare. * libc/stdio/Makefile.am: Add new wscanf files. * libc/stdio/Makefile.in: Regenerate. * libc/stdio/fwscanf.c: New file. * libc/stdio/local.h (__svfwscanf_r, __ssvfwscanf_r, __svfiwscanf_r, __ssvfiwscanf_r): Declare. * libc/stdio/stdio.tex: Add new documentation references. * libc/stdio/swscanf.c: New file. * libc/stdio/vfwscanf.c: New file. * libc/stdio/vswscanf.c: New file. * libc/stdio/vwscanf.c: New file. * libc/stdio/wscanf.c: New file. * libc/stdio/vfscanf.c (_sungetc_r): Make externaly available. Only define if INTEGER_ONLY is defined. Declare otherwise. (__ssrefill_r): Ditto. (_sfread_r): Ditto. Remove static eofread/eofread1 functions and use __seofread function instead, throughout. * libc/stdio/local.h (__seofread): Declare. * libc/stdio/stdio.c (__seofread): Define. * libc/stdio/fgetwc.c (__fgetwc): Fix compiler warning. * libc/stdio/fgetws.c (_fgetws_r): Ditto. * libc/stdio/fread.c (_fread_r): Ditto. * libc/stdio/vfprintf.c: Ditto. * libc/stdio/vswprintf.c: Ditto.
2009-03-06 * libc/include/stdio.h (__VALIST): Guard against multiple definition.Corinna Vinschen
* libc/include/wchar.h: Include stdarg.h. (__VALIST): Define conditionally. (fwprintf, swprintf, vfwprintf, vswprintf, vwprintf, wprintf: Declare. (_fwprintf_r, _swprintf_r, _vfwprintf_r, _vswprintf_r, _vwprintf_r, _wprintf_r): Declare. * libc/stdio/Makefile.am: Add new files. * libc/stdio/Makefile.in: Regenerate. * libc/stdio/fwprintf.c: New file. * libc/stdio/local.h (_svfwprintf_r, _svfiwprintf_r): Declare. (__CH_CLASS, __STATE, __ACTION): Move definition from vfprintf.c here and move to the __ namespace. (__chclass, __state_table, __action_table): Declare. * libc/stdio/stdio.tex: Add new documentation references. * libc/stdio/swprintf.c: New file. * libc/stdio/vfprintf.c (__SPRINT): New macro to call the right __sprint_r function according to compilation unit. Use throughout. (__ssprint_r): Rename STRING_ONLY variant from __sprint_r. Make externaly available. Only define if INTEGER_ONLY is defined. (__sprint_r): Make externaly available. Only define if INTEGER_ONLY is defined. Handle stream orientation. (__sbprintf): Copy FILE's _flags2 member as well. (__chclass, __state_table, __action_table): Prepend __ to name and make externally available. * libc/stdio/vfwprintf.c: New file. * libc/stdio/vswprintf.c: New file. * libc/stdio/vwprintf.c: New file. * libc/stdio/wprintf.c: New file.
2008-12-112008-12-10 Corinna Vinschen <corinna@vinschen.de>Jeff Johnston
Implement basic wide char stdio functionality, based on FreeBSD. * libc/include/stdio.h (__SORD): Define. (__SWID): Define. * libc/include/wchar.h: Add declarations for new wide char functions. (getwc): Define as macro. (getwchar): Ditto. (putwc): Ditto. (putwchar): Ditto. * libc/include/sys/reent.h (struct __sFILE): Add _mbstate member. (struct __sFILE64): Ditto. * libc/stdio/Makefile.am (ELIX_4_SOURCES): Add fgetwc.c, fgetws.c, fputwc.c, fputws.c, fwide.c, getwc.c, getwchar.c, putwc.c, putwchar.c and ungetwc.c. (CHEWOUT_FILES): Add fgetwc.def, fgetws.def, fputwc.def, fputws.def, fwide.def, getwc.def, getwchar.def, putwc.def, putwchar.def and ungetwc.def. Add header dependency rules for the new files. * libc/stdio/Makefile.in: Regenerate. * libc/stdio/fgetwc.c: New file, implementing fgetwc and _fgetwc_r. * libc/stdio/fgetws.c: New file, implementing fgetws and _fgetws_r. * libc/stdio/findfp.c (std): Initialize FILE's _mbstate member. (__sfmoreglue): Ditto. * libc/stdio/fputs.c (_fputs_r): Set stream orientation. * libc/stdio/fputwc.c: New file, implementing fputwc and _fputwc_r. * libc/stdio/fputws.c: New file, implementing fputws and _fputws_r. * libc/stdio/fread.c (_fread_r): Set stream orientation. * libc/stdio/freopen.c (_freopen_r): Reset stream orientation. Reset _mbstate. * libc/stdio/fseek.c (_fseek_r): Reset _mbstate. * libc/stdio/fwide.c: New file, implementing fwide and _fwide_r. * libc/stdio/fwrite.c (_fwrite_r): Set stream orientation. * libc/stdio/getwc.c: New file, implementing getwc and _getwc_r. * libc/stdio/getwchar.c: New file, implementing getwchar and _getwchar_r. * libc/stdio/local.h (ORIENT): New macro. * libc/stdio/puts.c (_puts_r): Set stream orientation. * libc/stdio/putwc.c: New file, implementing putwc and _putwc_r. * libc/stdio/putwchar.c: New file, implementing putwchar and _putwchar_r. * libc/stdio/refill.c (__srefill_r): Set stream orientation. * libc/stdio/stdio.tex: Add documentation for new functions. * libc/stdio/ungetc.c (_ungetc_r): Set stream orientation. * libc/stdio/ungetwc.c: New file, implementing ungetwc and _ungetwc_r. * libc/stdio/vfscanf.c (__SVFSCANF_R): Set stream orientation. * libc/stdio/wbuf.c (__swbuf_r): Ditto.
2008-11-012008-10-31 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston
* libc/stdio/diprintf.c: Modify documentation so eclipse newlib libhover docs generate properly. * libc/stdio/dprintf.c: Ditto. * libc/stdio/fflush.c: Ditto. * libc/stdio/fopencookie.c: Ditto. * libc/stdio/fread.c: Ditto. * libc/stdio/fsetpos.c: Ditto. * libc/stdio/getc_u.c: Ditto. * libc/stdio/getchar_u.c: Ditto. * libc/stdio/putc_u.c: Ditto. * libc/stdio/putchar_u.c: Ditto. * libc/stdio/remove.c: Ditto. * libc/stdio/siprintf.c: Ditto. * libc/stdio/siscanf.c: Ditto. * libc/stdio/sprintf.c: Ditto. * libc/stdio/sscanf.c: Ditto. * libc/stdio/vfprintf.c: Ditto. * libc/stdio/vfscanf.c: Ditto. * libc/stdio/viprintf.c: Ditto. * libc/stdio/viscanf.c: Ditto. * libc/stdlib/calloc.c: Ditto. * libc/stdlib/efgcvt.c: Ditto. * libc/stdlib/envlock.c: Ditto. * libc/time/asctime.c: Ditto. * libc/time/ctime.c: Ditto. * libc/time/gmtime.c: Ditto. * libc/time/lcltime.c: Ditto. * libc/time/tzset.c: Ditto. * libc/stdlib/envlock.h: Moved to libc/include.
2008-04-30Fix 2008-04-14 regression in asprintf(ptr,"").Eric Blake
* libc/stdio/asnprintf.c (asnprintf, _asnprintf_r): Avoid stdio baggage. * libc/stdio/asniprintf.c (asniprintf, _asniprintf_r): Likewise. * libc/stdio/asiprintf.c (asiprintf, _asiprintf_r): Likewise. * libc/stdio/vasniprintf.c (_vasniprintf_r): Likewise. * libc/stdio/vsnprintf.c (_vsnprintf_r): Likewise. * libc/stdio/vfprintf.c (_VFPRINTF_R) [STRING_ONLY]: Always malloc an initial buffer for asprintf.
2008-04-152008-04-14 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston
* libc/stdio/Makefile.am: Build vfprintf.c and vfscanf.c with -DSTRING_ONLY defined with and without -DINTEGER_ONLY defined to build special versions for sprintf/sscanf family functions. * libc/stdio/Makefile.in: Regenerated. * libc/stdio/vfprintf.c[STRING_ONLY][INTEGER_ONLY](_VFPRINTF_R): Redefine to be _svfiprintf_r which is optimized to work with siprintf family of functions (i.e. no I/O) and does not support floating-point. [STRING_ONLY][!INTEGER_ONLY](_VFPRINTF_R): Redefine to be _svfprintf_r which is optimized to work with sprintf family of functions and not use I/O. [STRING_ONLY](__sprint_r): New string only version of static function. designed to work with sprintf family of functions. * libc/stdio/vfscanf.c[STRING_ONLY][INTEGER_ONLY](_SVFSCANF_R): Redefine to be _ssvfiscanf_r which is optimized to work with siscanf family of functions (i.e. no I/O) and no float-point support. [STRING_ONLY][!INTEGER_ONLY](_SVFSCANF_R): Redefine to be __ssvfscanf_r which is optimized to work with sscanf family of functions and does not require I/O functions. * libc/stdio/asprintf.c: Call _svfprintf_r instead of _vfprintf_r. * libc/stdio/snprintf.c: Ditto. * libc/stdio/sprintf.c: Ditto. * libc/stdio/vasnprintf.c: Ditto. * libc/stdio/vasprintf.c: Ditto. * libc/stdio/siprintf.c: Call _svfiprintf_r instead of _vfiprintf_r. * libc/stdio/sniprintf.c: Ditto. * libc/stdio/vasiprintf.c: Ditto. * libc/stdio/vsiprintf.c: Ditto. * libc/stdio/vsniprintf.c: Ditto. * libc/stdio/vsprintf.c: Ditto. * libc/stdio/local.h: Add prototypes for _svfprintf_r, _svfiprintf_r, _ssvfscanf_r, and _ssvfiscanf_r. * libc/stdio/sscanf.c: Call _ssvfscanf_r instead of _svfscanf_r. * libc/stdio/vsscanf.c: Ditto. * libc/stdio/siscanf.c: Call _ssvfiscanf_r instead of _svfiscanf_r. * libc/stdio/vsiscanf.c: Ditto.
2007-12-19 * libc/stdio/vfprintf.c (_VFPRINTF_R): Use correct pointer in call toCorinna Vinschen
_wcsrtombs_r.
2007-10-13* libc/stdio/vfprintf.c (_VFPRINTF_R) [__OPTIMIZE_SIZE__]:Eric Blake
Correctly nest else within conditionals. Reported by Artur Lipowski.
2007-09-18Obey POSIX on printf("%.s", (char*)NULL).Eric Blake
* libc/stdio/vfprintf.c (_VFPRINTF_R): Take precision into account for %s on NULL. Skip NULL check when optimizing for size.
2007-07-19Fix 'make info'.Eric Blake
* libc/stdio/stdio.tex: Add missing include. * libc/stdio/vfprintf.c: Use expected node name. * libc/stdio/vfscanf.c: Likewise. * libc/stdio/sscanf.c: Likewise. * libc/stdio/sprintf.c: Likewise. * libc/stdio/siscanf.c: Likewise. * libc/stdio/siprintf.c: Likewise. * libc/stdio/fopencookie.c: Quote raw {}. Reported by DJ Delorie.
2007-07-14Fix fflush issues.Eric Blake
* libc/stdio/fflush.c (_fflush_r): New function. (fflush): Fix reentrancy and large offset behavior. * libc/include/stdio.h (_fflush_r): Add prototype. * libc/stdio/fclose.c (_fclose_r): All fflush callers changed. * libc/stdio/freopen.c (_freopen_r): Likewise. * libc/stdio/fseek.c (_fseek_r): Likewise. * libc/stdio/ftell.c (_ftell_r): Likewise. * libc/stdio/fvwrite.c (__sfvwrite_r): Likewise. * libc/stdio/refill.c (__srefill_r): Likewise. * libc/stdio/setvbuf.c (setvbuf): Likewise. * libc/stdio/ungetc.c (_ungetc_r): Likewise. * libc/stdio/vfprintf.c (__sbprintf): Likewise. * libc/stdio/wbuf.c (__swbuf_r): Likewise. * libc/stdio64/freopen64.c (_freopen64_r): Likewise. * libc/stdio64/fseeko64.c (_fseeko64_r): Likewise. Defer to 32-bit version if not large file. * libc/stdio64/ftello64.c (_ftello64_r): Likewise. * libc/stdio64/tmpfile64.c (_tmpfile64_r): Avoid compile warning.
2007-05-27* libc/stdio/vfprintf.c (_VFPRINTF_R): Populate 'ox' whenEric Blake
handling %p.
2007-05-24* libc/stdio/vfprintf.c (_VFPRINTF_R): Don't truncate %p whenEric Blake
sizeof(void*) is 8 but sizeof(long) is 4. * libc/stdio/vfscanf.c (__SVFSCANF_R): Likewise. Fix %i scanning of "-0x". Support "-nan" and "inf" for %e. Audit usage of ungetc to fix reentrancy and bug on encoding error in multibyte locales. Always return EOF on read error.
2007-05-24* libc/stdio/vfscanf.c (__SVFSCANF_R): Support scanf(%1$s).Eric Blake
Avoid warning when !FLOATING_POINT. * libc/stdio/vfprintf.c (_VFPRINTF_R): Simplify _NO_POS_ARGS slightly.
2007-05-18* libc/stdio/vfprintf.c [_WANT_IO_LONG_LONG]: Allow non-gccEric Blake
compilers. * libc/stdio/vfscanf.c: Likewise.
2007-05-14Reduce stack size of *printf.Eric Blake
* libc/stdio/vfprintf.c (_VFPRINTF_R): Fix use of decimal point in %f. Avoid malloc when possible for %S. (BUF): Improve stack locality by using smaller size. (MAXEXPLEN, _PRINTF_FLOAT_TYPE): Define. (exponent): Use smaller stack size.
2007-05-12Minimize printf/scanf size on platforms that don't need C99.Eric Blake
* acconfig.h (_WANT_IO_C99_FORMATS): New macro. * newlib.hin (_WANT_IO_C99_FORMATS): Likewise. * configure.in (newlib-io-c99-formats): New configure option. (_WANT_IO_C99_FORMATS): Define appropriately. * configure.host (*-linux*, cygwin): Default c99-formats to yes. * libc/stdio/vfprintf.c (_VFPRINTF_R) [!_WANT_IO_C99_FORMATS]: Cripple ' flag; hh, z, j, t sizes; a, A, F, C, S specifiers. * libc/stdio/vfscanf.c (_VFSCANF_R) [!_WANT_IO_C99_FORMATS]: Likewise. * configure: Regenerate.
2007-05-11* libc/stdio/vfprintf.c (_VFPRINTF_R, cvt, exponent, chclass)Eric Blake
(get_arg): Support '%a' and '%A'.
2007-05-08* libc/stdio/vfprintf.c: Fix typo in comments that breaks docs.Eric Blake
2007-05-04 Add support for asnprintf, and improve *printf documentation.Eric Blake
* libc/stdio/Makefile.am (ELIX_SOURCES): Rename... (ELIX_2_SOURCES): ...to this. (ELIX_4_SOURCES): Add new variable. Build asnprintf. (GENERAL_SOURCES): Move dprintf to ELIX_4_SOURCES. (CHEWOUT_FILES): Include diprintf in documentation. * libc/stdio/Makefile.in: Regenerate. * libc/stdio/diprintf.c: Improve documentation. * libc/stdio/dprintf.c: Likewise. * libc/stdio/siprintf.c: Likewise. * libc/stdio/sprintf.c: Likewise. * libc/stdio/vfprintf.c: Likewise. * libc/stdio/viprintf.c: Likewise. * libc/stdio/vsniprintf.c: Consolidate documentation. * libc/stdio/asiprintf.c: Refer to documentation. * libc/stdio/asprintf.c: Likewise. * libc/stdio/fiprintf.c: Likewise. * libc/stdio/fprintf.c: Likewise. * libc/stdio/iprintf.c: Likewise. * libc/stdio/printf.c: Likewise. * libc/stdio/sniprintf.c: Likewise. * libc/stdio/vdiprintf.c: Likewise. * libc/stdio/vdprintf.c: Likewise. * libc/stdio/vsiprintf.c: Likewise. * libc/stdio/fvwrite.c (__sfvwrite_r): Handle asnprintf. * libc/stdio/asniprintf.c (asniprintf, _asniprintf_r): New file. * libc/stdio/asnprintf.c (asnprintf, _asnprintf_r): New file. * libc/stdio/vasniprintf.c (vasniprintf, _vasniprintf_r): New file. * libc/stdio/vasnprintf.c (vasnprintf, _vasnprintf_r): New file. * libc/stdio/vdprintf.c (_vdprintf_r): Rewrite to avoid malloc in typical case. * libc/stdio/vdiprintf.c (_vdiprintf_r): Likewise. * libc/include/stdio.h: Add prototypes for new functions; sort existing functions.
2007-04-252007-04-25 Eric Blake <ebb9@byu.net>Jeff Johnston
* libc/stdio/vfprintf.c (get_arg): Support %1$lc. Simplify types that promote to int.
2007-04-25 * libc/stdio/vfprintf.c (_VFPRINTF_R): Don't zero pad on infinityEric Blake
or NaN with %05f.
2007-04-24 * libc/stdio/vfprintf.c (_VFPRINTF_R): Avoid multibyte when notEric Blake
_MB_CAPABLE.
2007-04-24 * libc/include/limits.h (NL_ARGMAX): Define a default value.Eric Blake
* libc/stdio/vfprintf.c (MAX_POS_ARGS): Define in terms of NL_ARGMAX, if present.
2007-04-242007-04-23 Brian Dessent <brian@dessent.net>Jeff Johnston
* libc/stdio/vfprintf.c (_vfprintf_r): When the alternate-form flag has been specified with types 'f', 'F', 'g', or 'G', ensure the trailing decimal is printed.
2007-04-13 * libc/stdio/vfprintf.c (_VFPRINTF_F, cvt): Don't confuse %F with %e.Eric Blake
(chclass): Recognize 'F', 'X', 'n', and not 'W'. (get_arg): Handle %1$F, %1$n.
2007-03-152007-03-15 Eric Blake <ebb9@byu.net>Jeff Johnston
* libc/stdio/local.h (cantwrite, FREEUB, FREELB): Make reentrant. (__smakebuf): Rename... (__smakebuf_r): to this. * libc/stdio/fvwrite.h (__swsetup_r): Rename, from __swsetup. * libc/stdio/makebuf.c (__smakebuf): Detect failed asprint allocation, then rename... (__smakebuf_r): ...to this and fix reentrancy. * libc/stdio/wsetup.c (__swsetup): Detect failed asprintf allocation, then rename... (__swsetup_r): ...to this and fix reentrancy. * libc/stdio/fseek.c (_fseek_r): Fix reentrancy. * libc/stdio/refill.c (__srefill_r): Likewise. * libc/stdio/fclose.c (_fclose_r): Likewise. * libc/stdio/fread.c (_fread_r): Likewise. * libc/stdio/freopen.c (_freopen_r): Likewise. * libc/stdio/wbuf.c (__swbuf_r): Likewise. * libc/stdio64/fseeko64.c (_fseeko64_r): Likewise. * libc/stdio/fvwrite.c (__sfvwrite_r): Set errno properly on failed asprintf allocation, and fix reentrancy. * libc/stdio/snprintf.c (snprintf, _snprintf_r): Report overflow, as required by POSIX. * libc/stdio/sniprintf.c (sniprintf, _sniprintf_r): Likewise. * libc/stdio/vsnprintf.c (vsnprintf, _vsnprintf_r): Likewise. * libc/stdio/vsniprintf.c (vsniprintf, _vsniprintf_r): Likewise.
2006-11-152006-11-14 Eric Blake <ebb9@byu.net>Jeff Johnston
* libc/stdio/vfprintf.c (_vfprintf_r): Support ' flag. (chclass): ' is a flag. j, t, and z are modifiers.
2006-09-272006-09-26 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston
* libc/include/stdio.h[_REENT_SMALL]: Do not allow macros for clearerr, feof, or fileno. * libc/include/sys/reent.h[_REENT_SMALL](struct _reent): Change the dummy std stream scheme to use pointers to const external fake files, one for each standard stream. * libc/stdio/local.h (CHECK_INIT): Change to take a file pointer argument. For _REENT_SMALL, reset the file pointer if it matches one of the fake std stream pointers. * libc/stdio/clearerr.c: Fix CHECK_INIT macro to add file pointer argument. * libc/stdio/fclose.c: Ditto. * libc/stdio/feof.c: Ditto. * libc/stdio/ferror.c: Ditto. * libc/stdio/fflush.c: Ditto. * libc/stdio/fgetc.c: Ditto. * libc/stdio/fgets.c: Ditto. * libc/stdio/fileno.c: Ditto. * libc/stdio/findfp.c: Ditto. * libc/stdio/fputc.c: Ditto. * libc/stdio/fputs.c: Ditto. * libc/stdio/fread.c: Ditto. * libc/stdio/freopen.c: Ditto. * libc/stdio/fseek.c: Ditto. * libc/stdio/ftell.c: Ditto. * libc/stdio/fwrite.c: Ditto. * libc/stdio/getc.c: Ditto. * libc/stdio/getdelim.c: Ditto. * libc/stdio/putc.c: Ditto. * libc/stdio/refill.c: Ditto. * libc/stdio/setvbuf.c: Ditto. * libc/stdio/ungetc.c: Ditto. * libc/stdio/vfprintf.c: Ditto. * libc/stdio/vfscanf.c: Ditto. * libc/stdio/wbuf.c: Ditto.: Ditto. * libc/stdio/wsetup.c: Ditto. * libc/stdio64/freopen64.c: Ditto. * libc/stdio64/fseeko64.c: Ditto. * libc/stdio64/ftello64.c: Ditto. * libc/machine/powerpc/vfprintf.c: Ditto. * libc/machine/powerpc/vfscanf.c: Ditto.
2006-09-072006-09-06 Eric Blake <ebb9@byu.net>Jeff Johnston
* libc/stdio/vfprintf.c (_vfprintf_r, get_arg): Add 'hh', 'j', 't', and 'z' modifiers.
2006-06-152006-06-14 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston
* libc/include/stdio.h: Add new reentrant I/O prototypes for read/write functions. Change getc/putc macros to have reentrant underlying macros/functions. This includes __sgetc_raw_r, __sgetc_r, and __sputc_r. * libc/stdio/fgetc.c: Fix and/or add reentrant version to call new reentrant I/O functions/macros for reading/writing. * libc/stdio/fgets.c: Ditto. * libc/stdio/fputc.c: Ditto. * libc/stdio/fputs.c: Ditto. * libc/stdio/fread.c: Ditto. * libc/stdio/fseek.c: Ditto. * libc/stdio64/fseeko64.c: Ditto. * libc/stdio/fwrite.c: Ditto. * libc/stdio/getc.c: Ditto. * libc/stdio/getc_u.c: Ditto. * libc/stdio/getchar.c: Ditto. * libc/stdio/getchar_u.c: Ditto. * libc/stdio/putc.c: Ditto. * libc/stdio/putc_u.c: Ditto. * libc/stdio/putchar.c: Ditto. * libc/stdio/puts.c: Ditto. * libc/stdio/vfprintf.c: Ditto. * libc/stdio/vfscanf.c: Ditto. * libc/stdio/fvwrite.c: Change __sfvwrite into reentrant __sfvwrite_r. Change all previous callers of __sfvwrite. Set errno to EBADF and set error flag on if attempt is made to write to file that does not allow writing. * libc/stdio/fvwrite.h: Fix new reentrant prototypes. * libc/stdio/local.h: Ditto. * libc/stdio/refill.c: Turn __srefill into reentrant __srefill_r. Set errno to EBADF and the error flag on if attempt is made to read unreadable file. Change all previous callers of __srefill. * libc/stdio/rget.c * libc/stdio/wbuf.c: Turn __swbuf into reentrant __swbuf_r. Change all previous callers of __swbuf. * libc/sys/linux/machine/i386/huge_val.h: Ifdef out file contents since huge value macros are already defined correctly for i386 by <math.h>.
2005-10-292005-10-28 Bob Wilson <bob.wilson@acm.org>Jeff Johnston
* libc/stdio/siprintf.c: Wrap long lines in ANSI_SYNOPSIS. * libc/stdio/siscanf.c: Likewise. * libc/stdio/sprintf.c: Likewise. * libc/stdio/sscanf.c: Likewise. * libc/stdio/vfprintf.c: Likewise. * libc/stdio/vfscanf.c: Likewise. * libc/stdio/viprintf.c: Likewise. * libc/stdio/viscanf.c: Likewise.
2005-10-152005-10-14 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston
* libc/stdio/vfprintf.c (_VFPRINTF_R): Fix up "inf" and "nan" processing for systems that have long double support.
2005-10-122005-10-11 David Weatherford <weath@tensilica.com>Jeff Johnston
* libc/stdio/vfprintf.c (_VFPRINTF_R): Recognize 'F' format. Print "inf" and "nan" in lowercase for e/f/g formats and in uppercase for E/F/G formats.
2005-06-162005-06-16 Christopher Faylor <cgf@timesys.com>Jeff Johnston
* libc/stdio/vfprintf.c (cvt): Don't rely on pointer aliasing to determine characteristics of long double. Use a union instead. * ldtoa.c (_ldtoa_r): Ditto. (_ldcheck): Ditto. (_strtold): Ditto. (union uconv): New union.
2005-03-222005-03-21 Nicholas Wourms <nwourms@netscape.net>Jeff Johnston
* libc/stdio/vfprintf.c: Move newlib.h before _WANT_IO_POS_ARGS test, since _WANT_IO_POS_ARGS is now defined in there. Remove duplicate reent.h include.
2005-02-082005-02-07 Antony King <antony.king@st.com>Jeff Johnston
* libc/stdio/clearerr.c (clearerr): Ensure CHECK_INIT() is called before _flockfile to prevent lock object use before initialisation. _REENT_SMALL_CHECK_INIT() and CHECK_INIT() take a struct _reent * instead of a FILE *. * libc/stdio/fclose.c (_fclose_r): Ditto. * libc/stdio/feof.c (feof): Ditto. * libc/stdio/ferror.c (ferror): Ditto. * libc/stdio/fflush.c (fflush): Ditto. * libc/stdio/fgetc.c (fgetc): Ditto. * libc/stdio/fgets.c (fgets): Ditto. * libc/stdio/fileno.c (fileno): Ditto. * libc/stdio/fputc.c (fputc): Ditto. * libc/stdio/fputs.c (fputs): Ditto. * libc/stdio/fread.c (fread): Ditto. * libc/stdio/freopen.c (_freopen_r): Ditto. * libc/stdio/fseek.c (_fseek_r): Ditto. * libc/stdio/ftell.c (_ftell_r): Ditto. * libc/stdio/fwrite.c (fwrite): Ditto. * libc/stdio/getc.c (getc): Ditto. * libc/stdio/getdelim.c (__getdelim): Ditto. * libc/stdio/putc.c (putc): Ditto. * libc/stdio/setvbuf.c (setvbuf): Ditto. * libc/stdio/ungetc.c (_ungetc_r): Ditto. * libc/stdio/vfprintf.c (_VFPRINTF_R): Ditto. * libc/stdio64/freopen64.c (_freopen64_r): Ditto. * libc/stdio64/fseeko64.c (_fseeko64_r): Ditto. * libc/stdio64/ftello64.c (_ftello64_r): Ditto. * libc/stdio/local.h (CHECK_INIT): Argument is now a struct _reent * instead of a FILE * and so replace incorrect use of _REENT with argument. * libc/sys/arm/syscalls.c (CHECK_INIT): Ditto. * libc/stdio/getchar.c (getchar): _REENT_SMALL_CHECK_INIT() and CHECK_INIT() take a struct _reent * instead of a FILE *. * libc/stdio/iprintf.c (iprintf, _iprintf_r): Ditto. * libc/stdio/iscanf.c (iscanf, _iscanf_r): Ditto. * libc/stdio/perror.c (perror): Ditto. * libc/stdio/printf.c (printf, _printf_r): Ditto. * libc/stdio/putchar.c (putchar): Ditto. * libc/stdio/puts.c (puts): Ditto. * libc/stdio/refill.c (__srefill): Ditto. * libc/stdio/scanf.c (scanf, _scanf_r): Ditto. * libc/stdio/vfscanf.c (VFSCANF, _VFSCANF_R): Ditto. * libc/stdio/viprintf.c (viprintf, _viprintf_r): Ditto. * libc/stdio/viscanf.c (viscanf, _viscanf_r): Ditto. * libc/stdio/vprintf.c (vprintf, _vprintf_r): Ditto. * libc/stdio/vscanf.c (vscanf, _vscanf_r): Ditto. * libc/stdio/wbuf.c (__swbuf): Ditto. * libc/stdio/wsetup.c (__swsetup): Ditto. * libc/stdlib/mallocr.c (malloc_stats): Ditto. * libc/stdlib/mstats.c (_mstats_r): Ditto. * libc/include/sys/reent.h (_REENT_SMALL_CHECK_INIT): Ditto. * libc/machine/powerpc/vfscanf.c (vfscanf): Ditto. * libc/stdio/fgetpos.c (_fgetpos_r): Removed unnecessary calls to _flockfile and _funlockfile; rely on locking in _ftell_r. * libc/stdio64/fgetpos64.c (_fgetpos64_r): Ditto (_ftello64_r). * libc/machine/powerpc/vfprintf.c (__sbprintf): Removed unnecessary initialision of _data field in FILE structure. * libc/machine/powerpc/vfprintf.c (VFPRINTF): Added CHECK_INIT() call.
2004-06-122004-06-11 Antony King <antony.king@st.com>Jeff Johnston
* libc/include/sys/_types.h: Include <sys/lock.h> and change _flock_t to be of type _LOCK_RECURSIVE_T. * libc/include/sys/reent.h: (_REENT_INIT): Reformat. (_REENT_INIT_PTR): Ditto. Use memset where appropriate. (_global_impure_ptr): New declaration. (_GLOBAL_REENT): Change to be _global_impure_ptr. * libc/include/sys/stdio.h: Include <sys/lock.h> and <sys/reent.h>. (_flockfile)[!_SINGLE_THREAD]: Add code for lock call. (_funlockfile)[!SINGLE_THREAD]: Ditto. * libc/reent/impure.c: Set _global_impure_ptr to _impure_ptr. * libc/stdio/fclose.c: Remove casting of fp lock to _LOCK_RECURSIVE_T. * libc/stdio/findfp.c: Ditto. * libc/stdio/fopen.c: Ditto. * libc/stdio/freopen.c: Ditto. * libc/stdio/vfprintf.c: Ditto. * libc/stdio64/fopen64.c: Ditto. * libc/stdlib/envlock.c: Add default stubs that use generic locking code. * libc/stdlib/mlock.c: Ditto. Jeff Johnston <jjohnstn@redhat.com> * libc/sys/linux/sys/_types.h (__flock_mutex_t): New subtype. (_flock_t): Change to be a struct containing a single member named mutex which is of type __flock_mutex_t.
2004-05-272004-05-27 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston
* libc/stdio/vfprintf.c (_VFPRINTF): Move file locking from here ... (_VFPRINTF_R): ... to here so all I/O printf routines are covered.
2004-05-262004-05-25 Artem B. Bityuckiy <abitytsky@softminecorp.com>Jeff Johnston
* newlib.hin: (_WANT_IO_POS_ARGS): New define. (_WANT_IO_LONG_LONG): Ditto. (_WANT_IO_LONG_DOUBLE): Ditto. * configure.in: Add new configuration options --enable-newlib-io-long-long and --enable-newlib-io-long-double which tie to new defines in newlib.hin. * configure: Regenerated. * configure.host: Add checks for new configuration options. Also fix up check for --enable-newlib-io-pos-args so configuration option will override any default for a given platform. Remove defining compiler flags for the _WANT_IO* options. * libc/stdio/vfprintf.c: Change to use new newlib.hin defines instead of looking for old compiler flags. * libc/stdio/vfscanf.c: Ditto. * libc/stdio/vfieeefp.h: Ditto. * libc/machine/powerpc/vfprintf.c: Ditto. * libc/machine/powerpc/vfscanf.c: Ditto.