Attachment "tip27.patch" to
ticket [471509ffff]
added by
dgp
2001-11-27 01:13:03.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/tcl/tcl/ChangeLog,v
retrieving revision 1.729
diff -u -r1.729 ChangeLog
--- ChangeLog 2001/11/26 18:06:46 1.729
+++ ChangeLog 2001/11/26 18:08:42
@@ -1,3 +1,22 @@
+2001-11-26 Don Porter <[email protected]>
+
+ * doc/RegExp.3:
+ * doc/Utf.3:
+ * generic/tcl{,Int}.decls:
+ * generic/tclRegexp.c:
+ * generic/tclUtf.c: Updated APIs in generic/tclUtf.c and
+ generic/tclRegexp.c according to the guidelines of TIP 27.
+ [Patch 471509]
+
+ * generic/regc_locale.c (element,cclass):
+ * generic/tclCmdMZ.c (Tcl_StringObjCmd):
+ * generic/tclFileName.c (TclpGetNativePathType,SplitMacPath):
+ * generic/tclIO.c (ReadChars):
+ * mac/tclMacLoad.c (TclpLoadFile):
+ * win/tclWinFile.c (TclpGetUsedHome): Updated callers.
+
+ * generic/tcl{,Int}Decls.h: make genstubs
+
2001-11-26 Don Porter <[email protected]>
* generic/tclIntPlatDecls.h: 'make genstubs' after changes
Index: doc/RegExp.3
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/RegExp.3,v
retrieving revision 1.9
diff -u -r1.9 RegExp.3
--- doc/RegExp.3 2001/10/14 16:21:45 1.9
+++ doc/RegExp.3 2001/11/26 18:08:42
@@ -57,7 +57,7 @@
.VE 8.1
.AP char *string in
String to check for a match with a regular expression.
-.AP char *pattern in
+.AP "CONST char" *pattern in
String in the form of a regular expression pattern.
.AP Tcl_RegExp regexp in
Compiled regular expression. Must have been returned previously
@@ -71,12 +71,14 @@
Specifies which range is desired: 0 means the range of the entire
match, 1 or greater means the range that matched a parenthesized
sub-expression.
-.AP char **startPtr out
+.VS 8.4
+.AP "CONST char" **startPtr out
The address of the first character in the range is stored here, or
NULL if there is no such range.
-.AP char **endPtr out
+.AP "CONST char" **endPtr out
The address of the character just after the last one in the range
is stored here, or NULL if there is no such range.
+.VE 8.4
.VS 8.1
.AP int cflags in
OR-ed combination of compilation flags. See below for more information.
Index: doc/Utf.3
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/Utf.3,v
retrieving revision 1.9
diff -u -r1.9 Utf.3
--- doc/Utf.3 2001/04/06 23:14:08 1.9
+++ doc/Utf.3 2001/11/26 18:08:42
@@ -22,12 +22,14 @@
.sp
int
\fBTcl_UtfToUniChar\fR(\fIsrc, chPtr\fR)
+.VS 8.4
.sp
-char *
+CONST char *
\fBTcl_UniCharToUtfDString\fR(\fIuniStr, numChars, dstPtr\fR)
.sp
-Tcl_UniChar *
+CONST Tcl_UniChar *
\fBTcl_UtfToUniCharDString\fR(\fIsrc, len, dstPtr\fR)
+.VE 8.4
.sp
int
\fBTcl_UniCharLen\fR(\fIuniStr\fR)
@@ -54,24 +56,28 @@
.sp
int
\fBTcl_NumUtfChars\fR(\fIsrc, len\fR)
+.VS 8.4
.sp
-char *
+CONST char *
\fBTcl_UtfFindFirst\fR(\fIsrc, ch\fR)
.sp
-char *
+CONST char *
\fBTcl_UtfFindLast\fR(\fIsrc, ch\fR)
.sp
-char *
+CONST char *
\fBTcl_UtfNext\fR(\fIsrc\fR)
.sp
-char *
+CONST char *
\fBTcl_UtfPrev\fR(\fIsrc, start\fR)
+.VE 8.4
.sp
Tcl_UniChar
\fBTcl_UniCharAtIndex\fR(\fIsrc, index\fR)
+.VS 8.4
.sp
-char *
+CONST char *
\fBTcl_UtfAtIndex\fR(\fIsrc, index\fR)
+.VE 8.4
.sp
int
\fBTcl_UtfBackslash\fR(\fIsrc, readPtr, dst\fR)
Index: generic/regc_locale.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/regc_locale.c,v
retrieving revision 1.6
diff -u -r1.6 regc_locale.c
--- generic/regc_locale.c 2001/05/28 04:45:43 1.6
+++ generic/regc_locale.c 2001/11/26 18:08:42
@@ -567,7 +567,7 @@
struct cname *cn;
size_t len;
Tcl_DString ds;
- char *np;
+ CONST char *np;
/* generic: one-chr names stand for themselves */
assert(startp < endp);
@@ -714,7 +714,8 @@
size_t len;
struct cvec *cv = NULL;
Tcl_DString ds;
- char *np, **namePtr;
+ CONST char *np;
+ char **namePtr;
int i, index;
/*
Index: generic/tcl.decls
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tcl.decls,v
retrieving revision 1.66
diff -u -r1.66 tcl.decls
--- generic/tcl.decls 2001/11/21 02:36:20 1.66
+++ generic/tcl.decls 2001/11/26 18:08:42
@@ -749,18 +749,19 @@
void Tcl_RegisterObjType(Tcl_ObjType *typePtr)
}
declare 212 generic {
- Tcl_RegExp Tcl_RegExpCompile(Tcl_Interp *interp, char *string)
+ Tcl_RegExp Tcl_RegExpCompile(Tcl_Interp *interp, CONST char *string)
}
declare 213 generic {
int Tcl_RegExpExec(Tcl_Interp *interp, Tcl_RegExp regexp, \
CONST char *str, CONST char *start)
}
declare 214 generic {
- int Tcl_RegExpMatch(Tcl_Interp *interp, char *str, char *pattern)
+ int Tcl_RegExpMatch(Tcl_Interp *interp, CONST char *str, \
+ CONST char *pattern)
}
declare 215 generic {
- void Tcl_RegExpRange(Tcl_RegExp regexp, int index, char **startPtr, \
- char **endPtr)
+ void Tcl_RegExpRange(Tcl_RegExp regexp, int index, \
+ CONST char **startPtr, CONST char **endPtr)
}
declare 216 generic {
void Tcl_Release(ClientData clientData)
@@ -1151,7 +1152,7 @@
int Tcl_UniCharToUtf(int ch, char *buf)
}
declare 325 generic {
- char * Tcl_UtfAtIndex(CONST char *src, int index)
+ CONST char * Tcl_UtfAtIndex(CONST char *src, int index)
}
declare 326 generic {
int Tcl_UtfCharComplete(CONST char *src, int len)
@@ -1160,16 +1161,16 @@
int Tcl_UtfBackslash(CONST char *src, int *readPtr, char *dst)
}
declare 328 generic {
- char * Tcl_UtfFindFirst(CONST char *src, int ch)
+ CONST char * Tcl_UtfFindFirst(CONST char *src, int ch)
}
declare 329 generic {
- char * Tcl_UtfFindLast(CONST char *src, int ch)
+ CONST char * Tcl_UtfFindLast(CONST char *src, int ch)
}
declare 330 generic {
- char * Tcl_UtfNext(CONST char *src)
+ CONST char * Tcl_UtfNext(CONST char *src)
}
declare 331 generic {
- char * Tcl_UtfPrev(CONST char *src, CONST char *start)
+ CONST char * Tcl_UtfPrev(CONST char *src, CONST char *start)
}
declare 332 generic {
int Tcl_UtfToExternal(Tcl_Interp *interp, Tcl_Encoding encoding, \
@@ -1236,19 +1237,19 @@
int Tcl_UniCharIsWordChar(int ch)
}
declare 352 generic {
- int Tcl_UniCharLen(Tcl_UniChar *str)
+ int Tcl_UniCharLen(CONST Tcl_UniChar *str)
}
declare 353 generic {
int Tcl_UniCharNcmp(CONST Tcl_UniChar *cs, CONST Tcl_UniChar *ct,\
unsigned long n)
}
declare 354 generic {
- char * Tcl_UniCharToUtfDString(CONST Tcl_UniChar *string, int numChars, \
- Tcl_DString *dsPtr)
+ CONST char * Tcl_UniCharToUtfDString(CONST Tcl_UniChar *string, \
+ int numChars, Tcl_DString *dsPtr)
}
declare 355 generic {
- Tcl_UniChar * Tcl_UtfToUniCharDString(CONST char *string, int length, \
- Tcl_DString *dsPtr)
+ CONST Tcl_UniChar * Tcl_UtfToUniCharDString(CONST char *string, \
+ int length, Tcl_DString *dsPtr)
}
declare 356 generic {
Tcl_RegExp Tcl_GetRegExpFromObj(Tcl_Interp *interp, Tcl_Obj *patObj, int flags)
Index: generic/tclCmdMZ.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclCmdMZ.c,v
retrieving revision 1.51
diff -u -r1.51 tclCmdMZ.c
--- generic/tclCmdMZ.c 2001/11/21 17:17:17 1.51
+++ generic/tclCmdMZ.c 2001/11/26 18:08:43
@@ -2027,7 +2027,7 @@
Tcl_SetObjLength(resultPtr, length1);
} else {
int first, last;
- char *start, *end;
+ CONST char *start, *end;
length1 = Tcl_NumUtfChars(string1, length1) - 1;
if (TclGetIntForIndex(interp, objv[3], length1,
@@ -2071,7 +2071,7 @@
case STR_TRIM: {
Tcl_UniChar ch, trim;
- register char *p, *end;
+ register CONST char *p, *end;
char *check, *checkEnd;
int offset;
@@ -2160,7 +2160,7 @@
case STR_WORDEND: {
int cur;
Tcl_UniChar ch;
- char *p, *end;
+ CONST char *p, *end;
int numChars;
if (objc != 4) {
@@ -2198,7 +2198,7 @@
case STR_WORDSTART: {
int cur;
Tcl_UniChar ch;
- char *p;
+ CONST char *p;
int numChars;
if (objc != 4) {
Index: generic/tclDecls.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclDecls.h,v
retrieving revision 1.66
diff -u -r1.66 tclDecls.h
--- generic/tclDecls.h 2001/11/21 02:36:20 1.66
+++ generic/tclDecls.h 2001/11/26 18:08:43
@@ -690,17 +690,18 @@
Tcl_ObjType * typePtr));
/* 212 */
EXTERN Tcl_RegExp Tcl_RegExpCompile _ANSI_ARGS_((Tcl_Interp * interp,
- char * string));
+ CONST char * string));
/* 213 */
EXTERN int Tcl_RegExpExec _ANSI_ARGS_((Tcl_Interp * interp,
Tcl_RegExp regexp, CONST char * str,
CONST char * start));
/* 214 */
EXTERN int Tcl_RegExpMatch _ANSI_ARGS_((Tcl_Interp * interp,
- char * str, char * pattern));
+ CONST char * str, CONST char * pattern));
/* 215 */
EXTERN void Tcl_RegExpRange _ANSI_ARGS_((Tcl_RegExp regexp,
- int index, char ** startPtr, char ** endPtr));
+ int index, CONST char ** startPtr,
+ CONST char ** endPtr));
/* 216 */
EXTERN void Tcl_Release _ANSI_ARGS_((ClientData clientData));
/* 217 */
@@ -1038,7 +1039,7 @@
/* 324 */
EXTERN int Tcl_UniCharToUtf _ANSI_ARGS_((int ch, char * buf));
/* 325 */
-EXTERN char * Tcl_UtfAtIndex _ANSI_ARGS_((CONST char * src,
+EXTERN CONST char * Tcl_UtfAtIndex _ANSI_ARGS_((CONST char * src,
int index));
/* 326 */
EXTERN int Tcl_UtfCharComplete _ANSI_ARGS_((CONST char * src,
@@ -1047,15 +1048,15 @@
EXTERN int Tcl_UtfBackslash _ANSI_ARGS_((CONST char * src,
int * readPtr, char * dst));
/* 328 */
-EXTERN char * Tcl_UtfFindFirst _ANSI_ARGS_((CONST char * src,
+EXTERN CONST char * Tcl_UtfFindFirst _ANSI_ARGS_((CONST char * src,
int ch));
/* 329 */
-EXTERN char * Tcl_UtfFindLast _ANSI_ARGS_((CONST char * src,
+EXTERN CONST char * Tcl_UtfFindLast _ANSI_ARGS_((CONST char * src,
int ch));
/* 330 */
-EXTERN char * Tcl_UtfNext _ANSI_ARGS_((CONST char * src));
+EXTERN CONST char * Tcl_UtfNext _ANSI_ARGS_((CONST char * src));
/* 331 */
-EXTERN char * Tcl_UtfPrev _ANSI_ARGS_((CONST char * src,
+EXTERN CONST char * Tcl_UtfPrev _ANSI_ARGS_((CONST char * src,
CONST char * start));
/* 332 */
EXTERN int Tcl_UtfToExternal _ANSI_ARGS_((Tcl_Interp * interp,
@@ -1108,16 +1109,16 @@
/* 351 */
EXTERN int Tcl_UniCharIsWordChar _ANSI_ARGS_((int ch));
/* 352 */
-EXTERN int Tcl_UniCharLen _ANSI_ARGS_((Tcl_UniChar * str));
+EXTERN int Tcl_UniCharLen _ANSI_ARGS_((CONST Tcl_UniChar * str));
/* 353 */
EXTERN int Tcl_UniCharNcmp _ANSI_ARGS_((CONST Tcl_UniChar * cs,
CONST Tcl_UniChar * ct, unsigned long n));
/* 354 */
-EXTERN char * Tcl_UniCharToUtfDString _ANSI_ARGS_((
+EXTERN CONST char * Tcl_UniCharToUtfDString _ANSI_ARGS_((
CONST Tcl_UniChar * string, int numChars,
Tcl_DString * dsPtr));
/* 355 */
-EXTERN Tcl_UniChar * Tcl_UtfToUniCharDString _ANSI_ARGS_((
+EXTERN CONST Tcl_UniChar * Tcl_UtfToUniCharDString _ANSI_ARGS_((
CONST char * string, int length,
Tcl_DString * dsPtr));
/* 356 */
@@ -1780,10 +1781,10 @@
int (*tcl_RecordAndEvalObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * cmdPtr, int flags)); /* 209 */
void (*tcl_RegisterChannel) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel chan)); /* 210 */
void (*tcl_RegisterObjType) _ANSI_ARGS_((Tcl_ObjType * typePtr)); /* 211 */
- Tcl_RegExp (*tcl_RegExpCompile) _ANSI_ARGS_((Tcl_Interp * interp, char * string)); /* 212 */
+ Tcl_RegExp (*tcl_RegExpCompile) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * string)); /* 212 */
int (*tcl_RegExpExec) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_RegExp regexp, CONST char * str, CONST char * start)); /* 213 */
- int (*tcl_RegExpMatch) _ANSI_ARGS_((Tcl_Interp * interp, char * str, char * pattern)); /* 214 */
- void (*tcl_RegExpRange) _ANSI_ARGS_((Tcl_RegExp regexp, int index, char ** startPtr, char ** endPtr)); /* 215 */
+ int (*tcl_RegExpMatch) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, CONST char * pattern)); /* 214 */
+ void (*tcl_RegExpRange) _ANSI_ARGS_((Tcl_RegExp regexp, int index, CONST char ** startPtr, CONST char ** endPtr)); /* 215 */
void (*tcl_Release) _ANSI_ARGS_((ClientData clientData)); /* 216 */
void (*tcl_ResetResult) _ANSI_ARGS_((Tcl_Interp * interp)); /* 217 */
int (*tcl_ScanElement) _ANSI_ARGS_((CONST char * str, int * flagPtr)); /* 218 */
@@ -1893,13 +1894,13 @@
Tcl_UniChar (*tcl_UniCharToTitle) _ANSI_ARGS_((int ch)); /* 322 */
Tcl_UniChar (*tcl_UniCharToUpper) _ANSI_ARGS_((int ch)); /* 323 */
int (*tcl_UniCharToUtf) _ANSI_ARGS_((int ch, char * buf)); /* 324 */
- char * (*tcl_UtfAtIndex) _ANSI_ARGS_((CONST char * src, int index)); /* 325 */
+ CONST char * (*tcl_UtfAtIndex) _ANSI_ARGS_((CONST char * src, int index)); /* 325 */
int (*tcl_UtfCharComplete) _ANSI_ARGS_((CONST char * src, int len)); /* 326 */
int (*tcl_UtfBackslash) _ANSI_ARGS_((CONST char * src, int * readPtr, char * dst)); /* 327 */
- char * (*tcl_UtfFindFirst) _ANSI_ARGS_((CONST char * src, int ch)); /* 328 */
- char * (*tcl_UtfFindLast) _ANSI_ARGS_((CONST char * src, int ch)); /* 329 */
- char * (*tcl_UtfNext) _ANSI_ARGS_((CONST char * src)); /* 330 */
- char * (*tcl_UtfPrev) _ANSI_ARGS_((CONST char * src, CONST char * start)); /* 331 */
+ CONST char * (*tcl_UtfFindFirst) _ANSI_ARGS_((CONST char * src, int ch)); /* 328 */
+ CONST char * (*tcl_UtfFindLast) _ANSI_ARGS_((CONST char * src, int ch)); /* 329 */
+ CONST char * (*tcl_UtfNext) _ANSI_ARGS_((CONST char * src)); /* 330 */
+ CONST char * (*tcl_UtfPrev) _ANSI_ARGS_((CONST char * src, CONST char * start)); /* 331 */
int (*tcl_UtfToExternal) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Encoding encoding, CONST char * src, int srcLen, int flags, Tcl_EncodingState * statePtr, char * dst, int dstLen, int * srcReadPtr, int * dstWrotePtr, int * dstCharsPtr)); /* 332 */
char * (*tcl_UtfToExternalDString) _ANSI_ARGS_((Tcl_Encoding encoding, CONST char * src, int srcLen, Tcl_DString * dsPtr)); /* 333 */
int (*tcl_UtfToLower) _ANSI_ARGS_((char * src)); /* 334 */
@@ -1920,10 +1921,10 @@
int (*tcl_UniCharIsSpace) _ANSI_ARGS_((int ch)); /* 349 */
int (*tcl_UniCharIsUpper) _ANSI_ARGS_((int ch)); /* 350 */
int (*tcl_UniCharIsWordChar) _ANSI_ARGS_((int ch)); /* 351 */
- int (*tcl_UniCharLen) _ANSI_ARGS_((Tcl_UniChar * str)); /* 352 */
+ int (*tcl_UniCharLen) _ANSI_ARGS_((CONST Tcl_UniChar * str)); /* 352 */
int (*tcl_UniCharNcmp) _ANSI_ARGS_((CONST Tcl_UniChar * cs, CONST Tcl_UniChar * ct, unsigned long n)); /* 353 */
- char * (*tcl_UniCharToUtfDString) _ANSI_ARGS_((CONST Tcl_UniChar * string, int numChars, Tcl_DString * dsPtr)); /* 354 */
- Tcl_UniChar * (*tcl_UtfToUniCharDString) _ANSI_ARGS_((CONST char * string, int length, Tcl_DString * dsPtr)); /* 355 */
+ CONST char * (*tcl_UniCharToUtfDString) _ANSI_ARGS_((CONST Tcl_UniChar * string, int numChars, Tcl_DString * dsPtr)); /* 354 */
+ CONST Tcl_UniChar * (*tcl_UtfToUniCharDString) _ANSI_ARGS_((CONST char * string, int length, Tcl_DString * dsPtr)); /* 355 */
Tcl_RegExp (*tcl_GetRegExpFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * patObj, int flags)); /* 356 */
Tcl_Obj * (*tcl_EvalTokens) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Token * tokenPtr, int count)); /* 357 */
void (*tcl_FreeParse) _ANSI_ARGS_((Tcl_Parse * parsePtr)); /* 358 */
Index: generic/tclFileName.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclFileName.c,v
retrieving revision 1.25
diff -u -r1.25 tclFileName.c
--- generic/tclFileName.c 2001/10/16 05:31:18 1.25
+++ generic/tclFileName.c 2001/11/26 18:08:43
@@ -382,7 +382,7 @@
if (!Tcl_RegExpExec(NULL, re, path, path)) {
type = TCL_PATH_RELATIVE;
} else {
- char *root, *end;
+ CONST char *root, *end;
Tcl_RegExpRange(re, 2, &root, &end);
if (root != NULL) {
type = TCL_PATH_RELATIVE;
@@ -814,7 +814,7 @@
re = Tcl_GetRegExpFromObj(NULL, tsdPtr->macRootPatternPtr, REG_ADVANCED);
if (Tcl_RegExpExec(NULL, re, path, path) == 1) {
- char *start, *end;
+ CONST char *start, *end;
Tcl_Obj *nextElt;
/*
Index: generic/tclIO.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclIO.c,v
retrieving revision 1.41
diff -u -r1.41 tclIO.c
--- generic/tclIO.c 2001/11/07 04:47:54 1.41
+++ generic/tclIO.c 2001/11/26 18:08:45
@@ -4699,7 +4699,7 @@
* Got too many chars.
*/
- char *eof;
+ CONST char *eof;
eof = Tcl_UtfAtIndex(dst, toRead);
statePtr->inputEncodingState = oldState;
Index: generic/tclInt.decls
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclInt.decls,v
retrieving revision 1.38
diff -u -r1.38 tclInt.decls
--- generic/tclInt.decls 2001/11/23 01:26:47 1.38
+++ generic/tclInt.decls 2001/11/26 18:08:45
@@ -604,7 +604,7 @@
#}
declare 156 generic {
- void TclRegError (Tcl_Interp *interp, char *msg, \
+ void TclRegError (Tcl_Interp *interp, CONST char *msg, \
int status)
}
declare 157 generic {
Index: generic/tclIntDecls.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclIntDecls.h,v
retrieving revision 1.31
diff -u -r1.31 tclIntDecls.h
--- generic/tclIntDecls.h 2001/11/14 23:17:03 1.31
+++ generic/tclIntDecls.h 2001/11/26 18:08:45
@@ -471,7 +471,7 @@
/* Slot 155 is reserved */
/* 156 */
EXTERN void TclRegError _ANSI_ARGS_((Tcl_Interp * interp,
- char * msg, int status));
+ CONST char * msg, int status));
/* 157 */
EXTERN Var * TclVarTraceExists _ANSI_ARGS_((Tcl_Interp * interp,
char * varName));
@@ -690,7 +690,7 @@
Tcl_Obj * (*tclGetLibraryPath) _ANSI_ARGS_((void)); /* 153 */
void *reserved154;
void *reserved155;
- void (*tclRegError) _ANSI_ARGS_((Tcl_Interp * interp, char * msg, int status)); /* 156 */
+ void (*tclRegError) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * msg, int status)); /* 156 */
Var * (*tclVarTraceExists) _ANSI_ARGS_((Tcl_Interp * interp, char * varName)); /* 157 */
void (*tclSetStartupScriptFileName) _ANSI_ARGS_((char * filename)); /* 158 */
char * (*tclGetStartupScriptFileName) _ANSI_ARGS_((void)); /* 159 */
Index: generic/tclRegexp.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclRegexp.c,v
retrieving revision 1.13
diff -u -r1.13 tclRegexp.c
--- generic/tclRegexp.c 2001/10/16 05:31:19 1.13
+++ generic/tclRegexp.c 2001/11/26 18:08:45
@@ -88,7 +88,7 @@
*/
static TclRegexp * CompileRegexp _ANSI_ARGS_((Tcl_Interp *interp,
- char *pattern, int length, int flags));
+ CONST char *pattern, int length, int flags));
static void DupRegexpInternalRep _ANSI_ARGS_((Tcl_Obj *srcPtr,
Tcl_Obj *copyPtr));
static void FinalizeRegexp _ANSI_ARGS_((ClientData clientData));
@@ -141,7 +141,7 @@
Tcl_RegExpCompile(interp, string)
Tcl_Interp *interp; /* For use in error reporting and
* to access the interp regexp cache. */
- char *string; /* String for which to produce
+ CONST char *string; /* String for which to produce
* compiled regular expression. */
{
return (Tcl_RegExp) CompileRegexp(interp, string, (int) strlen(string),
@@ -183,7 +183,7 @@
int flags, result, numChars;
TclRegexp *regexp = (TclRegexp *)re;
Tcl_DString ds;
- Tcl_UniChar *ustr;
+ CONST Tcl_UniChar *ustr;
/*
* If the starting point is offset from the beginning of the buffer,
@@ -243,9 +243,9 @@
int index; /* 0 means give the range of the entire
* match, > 0 means give the range of
* a matching subrange. */
- char **startPtr; /* Store address of first character in
+ CONST char **startPtr; /* Store address of first character in
* (sub-) range here. */
- char **endPtr; /* Store address of character just after last
+ CONST char **endPtr; /* Store address of character just after last
* in (sub-) range here. */
{
TclRegexp *regexpPtr = (TclRegexp *) re;
@@ -398,8 +398,8 @@
int
Tcl_RegExpMatch(interp, string, pattern)
Tcl_Interp *interp; /* Used for error reporting. May be NULL. */
- char *string; /* String. */
- char *pattern; /* Regular expression to match against
+ CONST char *string; /* String. */
+ CONST char *pattern; /* Regular expression to match against
* string. */
{
Tcl_RegExp re;
@@ -696,7 +696,7 @@
void
TclRegError(interp, msg, status)
Tcl_Interp *interp; /* Interpreter for error reporting. */
- char *msg; /* Message to prepend to error. */
+ CONST char *msg; /* Message to prepend to error. */
int status; /* Status code to report. */
{
char buf[100]; /* ample in practice */
@@ -831,12 +831,12 @@
static TclRegexp *
CompileRegexp(interp, string, length, flags)
Tcl_Interp *interp; /* Used for error reporting if not NULL. */
- char *string; /* The regexp to compile (UTF-8). */
+ CONST char *string; /* The regexp to compile (UTF-8). */
int length; /* The length of the string in bytes. */
int flags; /* Compilation flags. */
{
TclRegexp *regexpPtr;
- Tcl_UniChar *uniString;
+ CONST Tcl_UniChar *uniString;
int numChars;
Tcl_DString stringBuf;
int status, i;
Index: generic/tclUtf.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclUtf.c,v
retrieving revision 1.19
diff -u -r1.19 tclUtf.c
--- generic/tclUtf.c 2001/10/16 05:31:19 1.19
+++ generic/tclUtf.c 2001/11/26 18:08:46
@@ -231,7 +231,7 @@
*---------------------------------------------------------------------------
*/
-char *
+CONST char *
Tcl_UniCharToUtfDString(wString, numChars, dsPtr)
CONST Tcl_UniChar *wString; /* Unicode string to convert to UTF-8. */
int numChars; /* Length of Unicode string in Tcl_UniChars
@@ -393,7 +393,7 @@
*---------------------------------------------------------------------------
*/
-Tcl_UniChar *
+CONST Tcl_UniChar *
Tcl_UtfToUniCharDString(string, length, dsPtr)
CONST char *string; /* UTF-8 string to convert to Unicode. */
int length; /* Length of UTF-8 string in bytes, or -1
@@ -536,7 +536,7 @@
*
*---------------------------------------------------------------------------
*/
-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 @@
while (1) {
len = Tcl_UtfToUniChar(string, &find);
if (find == ch) {
- return (char *) string;
+ return string;
}
if (*string == '\0') {
return NULL;
@@ -576,7 +576,7 @@
*---------------------------------------------------------------------------
*/
-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 @@
}
string += len;
}
- return (char *) last;
+ return last;
}
/*
@@ -619,13 +619,13 @@
*---------------------------------------------------------------------------
*/
-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 @@
*---------------------------------------------------------------------------
*/
-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 @@
}
look--;
}
- return (char *) str;
+ return str;
}
/*
@@ -728,7 +728,7 @@
*---------------------------------------------------------------------------
*/
-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 @@
index--;
src += Tcl_UtfToUniChar(src, &ch);
}
- return (char *) src;
+ return src;
}
/*
@@ -1272,7 +1272,7 @@
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;
Index: mac/tclMacLoad.c
===================================================================
RCS file: /cvsroot/tcl/tcl/mac/tclMacLoad.c,v
retrieving revision 1.8
diff -u -r1.8 tclMacLoad.c
--- mac/tclMacLoad.c 2001/11/23 01:27:45 1.8
+++ mac/tclMacLoad.c 2001/11/26 18:08:46
@@ -140,8 +140,9 @@
/*
* First thing we must do is infer the package name from the sym1
- * variable. This is kind of dumb since the caller actually knows
- * this value, it just doesn't give it to us.
+ * variable (by removing the "_Init" suffix). This is kind of dumb
+ * since the caller actually knows this value, it just doesn't give
+ * it to us.
*/
native = Tcl_UtfToExternalDString(NULL, sym1, -1, &ds);
native[strlen(native) - 5] = 0;
Index: win/tclWinFile.c
===================================================================
RCS file: /cvsroot/tcl/tcl/win/tclWinFile.c,v
retrieving revision 1.19
diff -u -r1.19 tclWinFile.c
--- win/tclWinFile.c 2001/11/19 17:45:13 1.19
+++ win/tclWinFile.c 2001/11/26 18:08:46
@@ -499,7 +499,8 @@
Tcl_DString ds;
int nameLen, badDomain;
char *domain;
- WCHAR *wName, *wHomeDir, *wDomain;
+ CONST WCHAR *wName;
+ WCHAR *wHomeDir, *wDomain;
WCHAR buf[MAX_PATH];
badDomain = 0;