diff options
Diffstat (limited to 'generic/tclUtf.c')
-rw-r--r-- | generic/tclUtf.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 6c4cb7f..b878149 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -84,11 +84,17 @@ static const unsigned char totalBytes[256] = { 1,1,1,1 #endif }; + +/* + * Functions used only in this module. + */ + +static int UtfCount(int ch); /* *--------------------------------------------------------------------------- * - * TclUtfCount -- + * UtfCount -- * * Find the number of bytes in the Utf character "ch". * @@ -101,8 +107,8 @@ static const unsigned char totalBytes[256] = { *--------------------------------------------------------------------------- */ -int -TclUtfCount( +INLINE static int +UtfCount( int ch) /* The Tcl_UniChar whose size is returned. */ { if ((ch > 0) && (ch < UNICODE_SELF)) { @@ -137,7 +143,7 @@ TclUtfCount( *--------------------------------------------------------------------------- */ -int +INLINE int Tcl_UniCharToUtf( int ch, /* The Tcl_UniChar to be stored in the * buffer. */ @@ -823,7 +829,7 @@ Tcl_UtfToUpper( * char to dst if its size is <= the original char. */ - if (bytes < TclUtfCount(upChar)) { + if (bytes < UtfCount(upChar)) { memcpy(dst, src, (size_t) bytes); dst += bytes; } else { @@ -876,7 +882,7 @@ Tcl_UtfToLower( * char to dst if its size is <= the original char. */ - if (bytes < TclUtfCount(lowChar)) { + if (bytes < UtfCount(lowChar)) { memcpy(dst, src, (size_t) bytes); dst += bytes; } else { @@ -926,7 +932,7 @@ Tcl_UtfToTitle( bytes = TclUtfToUniChar(src, &ch); titleChar = Tcl_UniCharToTitle(ch); - if (bytes < TclUtfCount(titleChar)) { + if (bytes < UtfCount(titleChar)) { memcpy(dst, src, (size_t) bytes); dst += bytes; } else { @@ -938,7 +944,7 @@ Tcl_UtfToTitle( bytes = TclUtfToUniChar(src, &ch); lowChar = Tcl_UniCharToLower(ch); - if (bytes < TclUtfCount(lowChar)) { + if (bytes < UtfCount(lowChar)) { memcpy(dst, src, (size_t) bytes); dst += bytes; } else { |