Diff
Not logged in

Differences From Artifact [bd309aa713]:

To Artifact [0d78cf74a8]:


554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577

int
Tcl_NumUtfChars(
    register CONST char *src,	/* The UTF-8 string to measure. */
    int length)			/* The length of the string in bytes, or -1
				 * for strlen(string). */
{
    register int i;

    /*
     * The separate implementations are faster.
     *
     * Since this is a time-sensitive function, we also do the check for the
     * single-byte char case specially.
     */

    i = 0;
    if (length < 0) {
	while ((*src != '\0') && (i < INT_MAX)) {
	    src = TclUtfNext(src);
	    i++;
	}
    } else {
	register const char *endPtr = src + length - TCL_UTF_MAX;







|








<







554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569

570
571
572
573
574
575
576

int
Tcl_NumUtfChars(
    register CONST char *src,	/* The UTF-8 string to measure. */
    int length)			/* The length of the string in bytes, or -1
				 * for strlen(string). */
{
    register int i = 0;

    /*
     * The separate implementations are faster.
     *
     * Since this is a time-sensitive function, we also do the check for the
     * single-byte char case specially.
     */


    if (length < 0) {
	while ((*src != '\0') && (i < INT_MAX)) {
	    src = TclUtfNext(src);
	    i++;
	}
    } else {
	register const char *endPtr = src + length - TCL_UTF_MAX;