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
path: root/winsup
diff options
context:
space:
mode:
authorKeith Marshall <keithmarshall@@users.sf.net>2009-07-29 11:22:51 +0400
committerKeith Marshall <keithmarshall@@users.sf.net>2009-07-29 11:22:51 +0400
commit0c27cfc9b03ab2578b77e35abb8034831276d8de (patch)
tree6b8e7281e783edd9d3aed5b9073eba6fdc40ae88 /winsup
parent7a92f0348cd0b21de4f46dd369f20c520fe4439b (diff)
Correct disposition of wchar_t output in printf().
Diffstat (limited to 'winsup')
-rw-r--r--winsup/mingw/ChangeLog8
-rw-r--r--winsup/mingw/mingwex/stdio/pformat.c7
2 files changed, 11 insertions, 4 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog
index c960e6762..dbb0a2148 100644
--- a/winsup/mingw/ChangeLog
+++ b/winsup/mingw/ChangeLog
@@ -1,3 +1,11 @@
+2009-07-29 Keith Marshall <keithmarshall@users.sourceforge.net>
+
+ Correct disposition of wchar_t output in printf().
+
+ mingwex/stdio/pformat.c (__pformat) [%C]: Create new instance of...
+ (argval): ...this, in inner scope, with singular type `wchar_t'; use
+ it to pass one wchar to __pformat_wputchars(), for output.
+
2009-07-27 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* mingwex/stdio/pformat.c: Implement better fix for type punned warning.
diff --git a/winsup/mingw/mingwex/stdio/pformat.c b/winsup/mingw/mingwex/stdio/pformat.c
index 4b6ebcb5a..a59d5130f 100644
--- a/winsup/mingw/mingwex/stdio/pformat.c
+++ b/winsup/mingw/mingwex/stdio/pformat.c
@@ -734,8 +734,7 @@ char *__pformat_cvt( int mode, __pformat_fpreg_t x, int nd, int *dp, int *sign )
* his `__gdtoa()' function in a manner to provide extended precision
* replacements for `ecvt()' and `fcvt()'.
*/
- int k;
- unsigned int e = 0; char *ep;
+ int k; unsigned int e = 0; char *ep;
static FPI fpi = { 64, 1-16383-64+1, 32766-16383-64+1, FPI_Round_near, 0 };
/* Classify the argument into an appropriate `__gdtoa()' category...
@@ -1882,8 +1881,8 @@ int __pformat( int flags, void *dest, int max, const char *fmt, va_list argv )
/* considering any `long' type modifier as a reference to
* `wchar_t' data, (which is promoted to an `int' argument)...
*/
- argval.__pformat_ullong_t = (wchar_t)(va_arg( argv, int ));
- __pformat_wputchars( (wchar_t *)argval.__pformat_ptr_t, 1, &stream );
+ wchar_t argval = (wchar_t)(va_arg( argv, int ));
+ __pformat_wputchars( &argval, 1, &stream );
}
else