summaryrefslogtreecommitdiffstats
path: root/generic/tclUtf.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2001-10-16 05:10:34 (GMT)
committerdgp <dgp@users.sourceforge.net>2001-10-16 05:10:34 (GMT)
commit15c387a97b11f816847a8836a2f60e091b7ff7ff (patch)
tree3bc613c0232ee4ef5707b1a11feecf8e83636bd6 /generic/tclUtf.c
parent4833f0f4df984e373b6500a7a707a63f36f2fc1d (diff)
downloadtcl-15c387a97b11f816847a8836a2f60e091b7ff7ff.zip
tcl-15c387a97b11f816847a8836a2f60e091b7ff7ff.tar.gz
tcl-15c387a97b11f816847a8836a2f60e091b7ff7ff.tar.bz2
* Added test to demonstrate memory corruption problems. [Bug 219393].
Diffstat (limited to 'generic/tclUtf.c')
-rw-r--r--generic/tclUtf.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index 66c89a2..b6a793d 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUtf.c,v 1.17 2001/09/13 19:31:04 hobbs Exp $
+ * RCS: @(#) $Id: tclUtf.c,v 1.18 2001/10/16 05:10:34 dgp Exp $
*/
#include "tclInt.h"
@@ -536,7 +536,7 @@ Tcl_NumUtfChars(str, len)
*
*---------------------------------------------------------------------------
*/
-char *
+CONST char *
Tcl_UtfFindFirst(string, ch)
CONST char *string; /* The UTF-8 string to be searched. */
int ch; /* The Tcl_UniChar to search for. */
@@ -547,7 +547,7 @@ Tcl_UtfFindFirst(string, ch)
while (1) {
len = Tcl_UtfToUniChar(string, &find);
if (find == ch) {
- return (char *) string;
+ return string;
}
if (*string == '\0') {
return NULL;
@@ -576,7 +576,7 @@ Tcl_UtfFindFirst(string, ch)
*---------------------------------------------------------------------------
*/
-char *
+CONST char *
Tcl_UtfFindLast(string, ch)
CONST char *string; /* The UTF-8 string to be searched. */
int ch; /* The Tcl_UniChar to search for. */
@@ -596,7 +596,7 @@ Tcl_UtfFindLast(string, ch)
}
string += len;
}
- return (char *) last;
+ return last;
}
/*
@@ -619,13 +619,13 @@ Tcl_UtfFindLast(string, ch)
*---------------------------------------------------------------------------
*/
-char *
+CONST char *
Tcl_UtfNext(str)
CONST char *str; /* The current location in the string. */
{
Tcl_UniChar ch;
- return (char *) str + Tcl_UtfToUniChar(str, &ch);
+ return str + Tcl_UtfToUniChar(str, &ch);
}
/*
@@ -649,7 +649,7 @@ Tcl_UtfNext(str)
*---------------------------------------------------------------------------
*/
-char *
+CONST char *
Tcl_UtfPrev(str, start)
CONST char *str; /* The current location in the string. */
CONST char *start; /* Pointer to the beginning of the
@@ -677,7 +677,7 @@ Tcl_UtfPrev(str, start)
}
look--;
}
- return (char *) str;
+ return str;
}
/*
@@ -728,7 +728,7 @@ Tcl_UniCharAtIndex(src, index)
*---------------------------------------------------------------------------
*/
-char *
+CONST char *
Tcl_UtfAtIndex(src, index)
register CONST char *src; /* The UTF-8 string. */
register int index; /* The position of the desired character. */
@@ -739,7 +739,7 @@ Tcl_UtfAtIndex(src, index)
index--;
src += Tcl_UtfToUniChar(src, &ch);
}
- return (char *) src;
+ return src;
}
/*
@@ -1272,7 +1272,7 @@ Tcl_UniCharToTitle(ch)
int
Tcl_UniCharLen(str)
- Tcl_UniChar *str; /* Unicode string to find length of. */
+ CONST Tcl_UniChar *str; /* Unicode string to find length of. */
{
int len = 0;