1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -05:00

Remove 'defused' parameter from wc_to_mb.

It's never set to anything but NULL at any call site, and there's been
a FIXME comment in uxucs.c for ages saying it should be removed. I
think it only existed in the first place because it was a facility
supported by the underlying Windows API function and we couldn't see a
reason _not_ to pass it through. But I'm cleaning up FIXMEs, so we
should get rid of it.

(It stood for 'default used', incidentally - as in 'did the function
at any point have to make use of the parameter providing a default
fallback character?'. Nothing to do with _defusing_ things :-)
This commit is contained in:
Simon Tatham
2018-10-06 11:45:26 +01:00
parent 461ade43d1
commit 07f99e6e82
6 changed files with 12 additions and 15 deletions

View File

@ -1157,7 +1157,7 @@ void get_unitab(int codepage, wchar_t * unitab, int ftype)
}
int wc_to_mb(int codepage, int flags, const wchar_t *wcstr, int wclen,
char *mbstr, int mblen, const char *defchr, int *defused,
char *mbstr, int mblen, const char *defchr,
struct unicode_data *ucsdata)
{
char *p;
@ -1180,7 +1180,6 @@ int wc_to_mb(int codepage, int flags, const wchar_t *wcstr, int wclen,
int j;
for (j = 0; defchr[j]; j++)
*p++ = defchr[j];
if (defused) *defused = 1;
}
#if 1
else
@ -1189,9 +1188,11 @@ int wc_to_mb(int codepage, int flags, const wchar_t *wcstr, int wclen,
assert(p - mbstr < mblen);
}
return p - mbstr;
} else
} else {
int defused;
return WideCharToMultiByte(codepage, flags, wcstr, wclen,
mbstr, mblen, defchr, defused);
mbstr, mblen, defchr, &defused);
}
}
int mb_to_wc(int codepage, int flags, const char *mbstr, int mblen,