summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r--generic/tclStringObj.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 7486631..66647f0 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -2443,10 +2443,10 @@ Tcl_AppendFormatToObj(
goto errorMsg;
}
if (ch == 'A') {
- char *p = TclGetString(segment) + 1;
- *p = 'x';
- p = strchr(p, 'P');
- if (p) *p = 'p';
+ char *q = TclGetString(segment) + 1;
+ *q = 'x';
+ q = strchr(q, 'P');
+ if (q) *q = 'p';
}
break;
}
@@ -3561,7 +3561,7 @@ TclStringFirst(
int lh, ln = Tcl_GetCharLength(needle);
Tcl_Obj *result;
int value = -1;
- Tcl_UniChar *check, *end, *uh, *un;
+ Tcl_UniChar *checkStr, *endStr, *uh, *un;
if (start < 0) {
start = 0;
@@ -3627,12 +3627,12 @@ TclStringFirst(
/* Don't start the loop if there cannot be a valid answer */
goto firstEnd;
}
- end = uh + lh;
+ endStr = uh + lh;
- for (check = uh + start; check + ln <= end; check++) {
- if ((*check == *un) && (0 ==
- memcmp(check + 1, un + 1, (ln-1) * sizeof(Tcl_UniChar)))) {
- value = (check - uh);
+ for (checkStr = uh + start; checkStr + ln <= endStr; checkStr++) {
+ if ((*checkStr == *un) && (0 ==
+ memcmp(checkStr + 1, un + 1, (ln-1) * sizeof(Tcl_UniChar)))) {
+ value = (checkStr - uh);
goto firstEnd;
}
}
@@ -3668,7 +3668,7 @@ TclStringLast(
int lh, ln = Tcl_GetCharLength(needle);
Tcl_Obj *result;
int value = -1;
- Tcl_UniChar *check, *uh, *un;
+ Tcl_UniChar *checkStr, *uh, *un;
if (ln == 0) {
/*
@@ -3714,14 +3714,14 @@ TclStringLast(
/* Don't start the loop if there cannot be a valid answer */
goto lastEnd;
}
- check = uh + last + 1 - ln;
- while (check >= uh) {
- if ((*check == un[0])
- && (0 == memcmp(check+1, un+1, (ln-1)*sizeof(Tcl_UniChar)))) {
- value = (check - uh);
+ checkStr = uh + last + 1 - ln;
+ while (checkStr >= uh) {
+ if ((*checkStr == un[0])
+ && (0 == memcmp(checkStr+1, un+1, (ln-1)*sizeof(Tcl_UniChar)))) {
+ value = (checkStr - uh);
goto lastEnd;
}
- check--;
+ checkStr--;
}
lastEnd:
TclNewIntObj(result, value);