diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-08-02 15:03:45 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-08-02 15:03:45 (GMT) |
commit | 2b096ec26df0564a66dc13dc0f0b84942db5273e (patch) | |
tree | 2f41b7f3b4a915791041575c3a51057f4dcab18e /generic | |
parent | 972ac8cc9d03192665f5f6eaaf49fc1b7c97d109 (diff) | |
parent | a41149258a75935ea1748f2fb603beb84e317ae8 (diff) | |
download | tcl-2b096ec26df0564a66dc13dc0f0b84942db5273e.zip tcl-2b096ec26df0564a66dc13dc0f0b84942db5273e.tar.gz tcl-2b096ec26df0564a66dc13dc0f0b84942db5273e.tar.bz2 |
Merge tip-548
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclDecls.h | 10 | ||||
-rw-r--r-- | generic/tclParse.c | 3 | ||||
-rw-r--r-- | generic/tclUtf.c | 4 |
3 files changed, 13 insertions, 4 deletions
diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 1fa1640..11c62cc 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -4157,6 +4157,16 @@ extern const TclStubs *tclStubsPtr; # undef Tcl_UniCharLen #endif + #if defined(USE_TCL_STUBS) +# define Tcl_WCharToUtfDString (sizeof(wchar_t) != sizeof(short) ? (char *(*)(const wchar_t *, int, Tcl_DString *))tclStubsPtr->tcl_UniCharToUtfDString : (char *(*)(const wchar_t *, int, Tcl_DString *))Tcl_Char16ToUtfDString) +# define Tcl_UtfToWCharDString (sizeof(wchar_t) != sizeof(short) ? (wchar_t *(*)(const char *, int, Tcl_DString *))tclStubsPtr->tcl_UtfToUniCharDString : (wchar_t *(*)(const char *, int, Tcl_DString *))Tcl_UtfToChar16DString) +# define Tcl_UtfToWChar (sizeof(wchar_t) != sizeof(short) ? tclStubsPtr->tcl_UtfToChar16 : Tcl_UtfToUniChar) +#else +# define Tcl_WCharToUtfDString (sizeof(wchar_t) != sizeof(short) ? (char *(*)(const wchar_t *, int, Tcl_DString *))Tcl_UniCharToUtfDString : (char *(*)(const wchar_t *, int, Tcl_DString *))Tcl_Char16ToUtfDString) +# define Tcl_UtfToWCharDString (sizeof(wchar_t) != sizeof(short) ? (wchar_t *(*)(const char *, int, Tcl_DString *))Tcl_UtfToUniCharDString : (wchar_t *(*)(const char *, int, Tcl_DString *))Tcl_UtfToChar16DString) +# define Tcl_UtfToWChar (sizeof(wchar_t) != sizeof(short) ? Tcl_UtfToChar16 : Tcl_UtfToUniChar) +#endif + /* * Deprecated Tcl procedures: */ diff --git a/generic/tclParse.c b/generic/tclParse.c index 093fbea..89b810f 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -784,8 +784,7 @@ TclParseBackslash( * of bytes scanned should be written. */ char *dst) /* NULL, or points to buffer where the UTF-8 * encoding of the backslash sequence is to be - * written. At most TCL_UTF_MAX bytes will be - * written there. */ + * written. At most 4 bytes will be written there. */ { register const char *p = src+1; Tcl_UniChar unichar = 0; diff --git a/generic/tclUtf.c b/generic/tclUtf.c index d48a51e..3f5a78d 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -266,7 +266,7 @@ Tcl_UniCharToUtfDString( char * Tcl_Char16ToUtfDString( - const unsigned short *uniStr, /* Utf-16 string to convert to UTF-8. */ + const unsigned short *uniStr,/* Utf-16 string to convert to UTF-8. */ int uniLength, /* Length of Utf-16 string. */ Tcl_DString *dsPtr) /* UTF-8 representation of string is appended * to this previously initialized DString. */ @@ -592,7 +592,7 @@ Tcl_UtfToUniCharDString( oldLength = Tcl_DStringLength(dsPtr); Tcl_DStringSetLength(dsPtr, - oldLength + (int) ((length + 1) * sizeof(int))); + oldLength + ((length + 1) * sizeof(int))); wString = (int *) (Tcl_DStringValue(dsPtr) + oldLength); w = wString; |