summaryrefslogtreecommitdiffstats
path: root/generic/tclRegexp.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2007-02-20 23:24:02 (GMT)
committernijtmans <nijtmans>2007-02-20 23:24:02 (GMT)
commit6ad116f411885307607d5bebcd6a987ebfafff40 (patch)
tree2fc3ee74f9099dbc66a0d0d154665561411fd654 /generic/tclRegexp.c
parent7ae3600bbf1577f02278766a0cca9d439a933bf9 (diff)
downloadtcl-6ad116f411885307607d5bebcd6a987ebfafff40.zip
tcl-6ad116f411885307607d5bebcd6a987ebfafff40.tar.gz
tcl-6ad116f411885307607d5bebcd6a987ebfafff40.tar.bz2
various "const" additions, in line with TIP #27
Diffstat (limited to 'generic/tclRegexp.c')
-rw-r--r--generic/tclRegexp.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/generic/tclRegexp.c b/generic/tclRegexp.c
index a9ddf03..4c258e6 100644
--- a/generic/tclRegexp.c
+++ b/generic/tclRegexp.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclRegexp.c,v 1.22 2006/04/07 01:12:11 hobbs Exp $
+ * RCS: @(#) $Id: tclRegexp.c,v 1.23 2007/02/20 23:24:02 nijtmans Exp $
*/
#include "tclInt.h"
@@ -85,7 +85,7 @@ static Tcl_ThreadDataKey dataKey;
* Declarations for functions used only in this file.
*/
-static TclRegexp * CompileRegexp(Tcl_Interp *interp, CONST char *pattern,
+static TclRegexp * CompileRegexp(Tcl_Interp *interp, const char *pattern,
int length, int flags);
static void DupRegexpInternalRep(Tcl_Obj *srcPtr,
Tcl_Obj *copyPtr);
@@ -93,7 +93,7 @@ static void FinalizeRegexp(ClientData clientData);
static void FreeRegexp(TclRegexp *regexpPtr);
static void FreeRegexpInternalRep(Tcl_Obj *objPtr);
static int RegExpExecUniChar(Tcl_Interp *interp, Tcl_RegExp re,
- CONST Tcl_UniChar *uniString, int numChars,
+ const Tcl_UniChar *uniString, int numChars,
int nmatches, int flags);
static int SetRegexpFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr);
@@ -136,7 +136,7 @@ Tcl_RegExp
Tcl_RegExpCompile(
Tcl_Interp *interp, /* For use in error reporting and to access
* the interp regexp cache. */
- CONST char *pattern) /* String for which to produce compiled
+ const char *pattern) /* String for which to produce compiled
* regular expression. */
{
return (Tcl_RegExp) CompileRegexp(interp, pattern, (int) strlen(pattern),
@@ -169,15 +169,15 @@ Tcl_RegExpExec(
Tcl_RegExp re, /* Compiled regular expression; must have been
* returned by previous call to
* Tcl_GetRegExpFromObj. */
- CONST char *text, /* Text against which to match re. */
- CONST char *start) /* If text is part of a larger string, this
+ const char *text, /* Text against which to match re. */
+ const char *start) /* If text is part of a larger string, this
* identifies beginning of larger string, so
* that "^" won't match. */
{
int flags, result, numChars;
TclRegexp *regexp = (TclRegexp *)re;
Tcl_DString ds;
- CONST Tcl_UniChar *ustr;
+ const Tcl_UniChar *ustr;
/*
* If the starting point is offset from the beginning of the buffer, then
@@ -237,13 +237,13 @@ Tcl_RegExpRange(
int index, /* 0 means give the range of the entire match,
* > 0 means give the range of a matching
* subrange. */
- CONST char **startPtr, /* Store address of first character in
+ const char **startPtr, /* Store address of first character in
* (sub-)range here. */
- CONST 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;
- CONST char *string;
+ const char *string;
if ((size_t) index > regexpPtr->re.re_nsub) {
*startPtr = *endPtr = NULL;
@@ -285,7 +285,7 @@ RegExpExecUniChar(
Tcl_Interp *interp, /* Interpreter to use for error reporting. */
Tcl_RegExp re, /* Compiled regular expression; returned by a
* previous call to Tcl_GetRegExpFromObj */
- CONST Tcl_UniChar *wString, /* String against which to match re. */
+ const Tcl_UniChar *wString, /* String against which to match re. */
int numChars, /* Length of Tcl_UniChar string (must be
* >=0). */
int nmatches, /* How many subexpression matches (counting
@@ -390,8 +390,8 @@ TclRegExpRangeUniChar(
int
Tcl_RegExpMatch(
Tcl_Interp *interp, /* Used for error reporting. May be NULL. */
- CONST char *text, /* Text to search for pattern matches. */
- CONST char *pattern) /* Regular expression to match against text. */
+ const char *text, /* Text to search for pattern matches. */
+ const char *pattern) /* Regular expression to match against text. */
{
Tcl_RegExp re;
@@ -616,7 +616,7 @@ TclRegAbout(
char buf[TCL_INTEGER_SPACE];
static struct infoname {
int bit;
- char *text;
+ const char *text;
} infonames[] = {
{REG_UBACKREF, "REG_UBACKREF"},
{REG_ULOOKAHEAD, "REG_ULOOKAHEAD"},
@@ -687,13 +687,13 @@ TclRegAbout(
void
TclRegError(
Tcl_Interp *interp, /* Interpreter for error reporting. */
- CONST 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 */
char cbuf[100]; /* lots in practice */
size_t n;
- char *p;
+ const char *p;
Tcl_ResetResult(interp);
n = TclReError(status, NULL, buf, sizeof(buf));
@@ -822,12 +822,12 @@ SetRegexpFromAny(
static TclRegexp *
CompileRegexp(
Tcl_Interp *interp, /* Used for error reporting if not NULL. */
- CONST 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;
- CONST Tcl_UniChar *uniString;
+ const Tcl_UniChar *uniString;
int numChars;
Tcl_DString stringBuf;
int status, i;