summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-05-09 13:16:25 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-05-09 13:16:25 (GMT)
commite95d2eea7fc037bb5d2f5cd1cc3bb47211b2fd2d (patch)
treebf8c6e1d41bdfae759c1f75caa2376e7624db0c6
parent77b454d1b27748f24d3ba5b31081e7ba17903ca7 (diff)
parent2e02e1affdde86a1dd00fc78a73af5924c6d30a0 (diff)
downloadtcl-e95d2eea7fc037bb5d2f5cd1cc3bb47211b2fd2d.zip
tcl-e95d2eea7fc037bb5d2f5cd1cc3bb47211b2fd2d.tar.gz
tcl-e95d2eea7fc037bb5d2f5cd1cc3bb47211b2fd2d.tar.bz2
Merge 8.7
-rw-r--r--generic/tclOOInt.h6
-rw-r--r--tests/ooUtil.test6
-rw-r--r--win/tclWinFile.c2
-rw-r--r--win/tclWinReg.c8
4 files changed, 11 insertions, 11 deletions
diff --git a/generic/tclOOInt.h b/generic/tclOOInt.h
index c3f6fc2..0e666e9 100644
--- a/generic/tclOOInt.h
+++ b/generic/tclOOInt.h
@@ -589,12 +589,12 @@ MODULE_SCOPE void TclOOSetupVariableResolver(Tcl_Namespace *nsPtr);
/*
* A variation where the array is an array of structs. There's no issue with
* possible NULLs; every element of the array will be iterated over and the
- * varable set to a pointer to each of those elements in turn.
- * REQUIRES DECLARATION: Tcl_Size i;
+ * variable set to a pointer to each of those elements in turn.
+ * REQUIRES DECLARATION: Tcl_Size i; See [96551aca55] for more FOREACH_STRUCT details.
*/
#define FOREACH_STRUCT(var,ary) \
- for(i=0 ; var=&((ary).list[i]), i<(ary).num; i++)
+ if (i=0, (ary).num>0) for(; var=&((ary).list[i]), i<(ary).num; i++)
/*
* Convenience macros for iterating through hash tables. FOREACH_HASH_DECLS
diff --git a/tests/ooUtil.test b/tests/ooUtil.test
index c8be9c8..f41c668 100644
--- a/tests/ooUtil.test
+++ b/tests/ooUtil.test
@@ -429,7 +429,7 @@ test ooUtil-5.1 {TIP 478: abstract} -setup {
parent destroy
} -result {1 1 1 123 456 ::y}
-test ooUtil-6.1 {TIP 478: classvarable} -setup {
+test ooUtil-6.1 {TIP 478: classvariable} -setup {
oo::class create parent
} -body {
oo::class create xyz {
@@ -459,7 +459,7 @@ test ooUtil-6.1 {TIP 478: classvarable} -setup {
} -cleanup {
parent destroy
} -result {{1 2} {1 2} {2 3}}
-test ooUtil-6.2 {TIP 478: classvarable error case} -setup {
+test ooUtil-6.2 {TIP 478: classvariable error case} -setup {
oo::class create parent
} -body {
oo::class create xyz {
@@ -475,7 +475,7 @@ test ooUtil-6.2 {TIP 478: classvarable error case} -setup {
} -returnCodes error -cleanup {
parent destroy
} -result {bad variable name "x(1)": can't create a scalar variable that looks like an array element}
-test ooUtil-6.3 {TIP 478: classvarable error case} -setup {
+test ooUtil-6.3 {TIP 478: classvariable error case} -setup {
oo::class create parent
} -body {
oo::class create xyz {
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index bcd0920..cf71974 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -2725,7 +2725,7 @@ TclpObjNormalizePath(
sizeof(WCHAR));
Tcl_DStringAppend(&dsNorm,
(const char *) nativeName,
- (int) (wcslen(nativeName)*sizeof(WCHAR)));
+ wcslen(nativeName)*sizeof(WCHAR));
}
}
}
diff --git a/win/tclWinReg.c b/win/tclWinReg.c
index 3732550..1ccb105 100644
--- a/win/tclWinReg.c
+++ b/win/tclWinReg.c
@@ -804,7 +804,7 @@ GetValue(
*/
length = Tcl_DStringLength(&data) * (2 / sizeof(WCHAR));
- Tcl_DStringSetLength(&data, (int) length * sizeof(WCHAR));
+ Tcl_DStringSetLength(&data, length * sizeof(WCHAR));
result = RegQueryValueExW(key, nativeValue,
NULL, &type, (BYTE *) Tcl_DStringValue(&data), &length);
}
@@ -865,7 +865,7 @@ GetValue(
*/
Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(
- (BYTE *) Tcl_DStringValue(&data), (int) length));
+ (BYTE *) Tcl_DStringValue(&data), length));
}
Tcl_DStringFree(&data);
return result;
@@ -914,7 +914,7 @@ GetValueNames(
resultPtr = Tcl_NewObj();
Tcl_DStringInit(&buffer);
- Tcl_DStringSetLength(&buffer, (int) (MAX_KEY_LENGTH * sizeof(WCHAR)));
+ Tcl_DStringSetLength(&buffer, MAX_KEY_LENGTH * sizeof(WCHAR));
index = 0;
result = TCL_OK;
@@ -1221,7 +1221,7 @@ RecursiveDeleteKey(
}
Tcl_DStringInit(&subkey);
- Tcl_DStringSetLength(&subkey, (int) (MAX_KEY_LENGTH * sizeof(WCHAR)));
+ Tcl_DStringSetLength(&subkey, MAX_KEY_LENGTH * sizeof(WCHAR));
mode = saveMode;
while (result == ERROR_SUCCESS) {