diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2015-12-18 12:42:40 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2015-12-18 12:42:40 +0100 |
commit | ac39f7b4e819b8200cda8be56c82964a6e18f909 (patch) | |
tree | 28c69c66ca18b6ccf203cdb8eb9c770d7ad680e8 /winsup/cygwin/strfuncs.cc | |
parent | 7d5b16ab9a7a7ad143e83f4c13b02eb13c9dca02 (diff) | |
download | cygnal-ac39f7b4e819b8200cda8be56c82964a6e18f909.tar.gz cygnal-ac39f7b4e819b8200cda8be56c82964a6e18f909.tar.bz2 cygnal-ac39f7b4e819b8200cda8be56c82964a6e18f909.zip |
Drop sys_cp_wcstombs and save two arguments per call
* strfuncs.cc (sys_cp_wcstombs): Delete and move functionality into
sys_wcstombs.
* wchar.h (sys_cp_wcstombs): Drop declaration.
* fhandler_console.cc (dev_console::con_to_str): Call sys_wcstombs.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/strfuncs.cc')
-rw-r--r-- | winsup/cygwin/strfuncs.cc | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/winsup/cygwin/strfuncs.cc b/winsup/cygwin/strfuncs.cc index 0be0f53f2..e73cd63bc 100644 --- a/winsup/cygwin/strfuncs.cc +++ b/winsup/cygwin/strfuncs.cc @@ -59,7 +59,7 @@ static const WCHAR tfx_chars[] = { 0xf000 | '|', '}', '~', 127 }; -/* This is the table for the reverse functionality in sys_cp_wcstombs. +/* This is the table for the reverse functionality in sys_wcstombs. It differs deliberately in two code places (space and dot) to allow converting back space and dot on filesystems only supporting DOS filenames. */ @@ -410,8 +410,7 @@ __big5_mbtowc (struct _reent *r, wchar_t *pwc, const char *s, size_t n, function should be raised. */ size_t __reg3 -sys_cp_wcstombs (wctomb_p f_wctomb, const char *charset, char *dst, size_t len, - const wchar_t *src, size_t nwc) +sys_wcstombs (char *dst, size_t len, const wchar_t *src, size_t nwc) { char buf[10]; char *ptr = dst; @@ -419,6 +418,8 @@ sys_cp_wcstombs (wctomb_p f_wctomb, const char *charset, char *dst, size_t len, size_t n = 0; mbstate_t ps; save_errno save; + wctomb_p f_wctomb = cygheap->locale.wctomb; + const char *charset = cygheap->locale.charset; memset (&ps, 0, sizeof ps); if (dst == NULL) @@ -495,13 +496,6 @@ sys_cp_wcstombs (wctomb_p f_wctomb, const char *charset, char *dst, size_t len, return n; } -size_t __reg3 -sys_wcstombs (char *dst, size_t len, const wchar_t * src, size_t nwc) -{ - return sys_cp_wcstombs (cygheap->locale.wctomb, cygheap->locale.charset, - dst, len, src, nwc); -} - /* Allocate a buffer big enough for the string, always including the terminating '\0'. The buffer pointer is returned in *dst_p, the return value is the number of bytes written to the buffer, as usual. |