summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2025-06-02 14:18:14 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2025-06-02 14:18:14 (GMT)
commit56ec7b2901a5eb8c2d48aba65eee5eb82640b152 (patch)
tree77a3f7014e0fcca3ed885427f2b25851bdc4158e /generic/tclStringObj.c
parentf145c7fbd2a82a5f77eae1301caceb376bc4f8dd (diff)
downloadtcl-56ec7b2901a5eb8c2d48aba65eee5eb82640b152.zip
tcl-56ec7b2901a5eb8c2d48aba65eee5eb82640b152.tar.gz
tcl-56ec7b2901a5eb8c2d48aba65eee5eb82640b152.tar.bz2
Backport: Add [[unreachable]] and [[fallthrough]] from C23 (where available)
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r--generic/tclStringObj.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 7964142..2b0fbd7 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -2165,7 +2165,6 @@ Tcl_AppendFormatToObj(
}
case 'u':
- /* FALLTHRU */
case 'd':
case 'o':
case 'p':
@@ -2773,7 +2772,7 @@ AppendPrintfToObjVA(
if (sizeof(size_t) == sizeof(Tcl_WideInt)) {
size = 2;
}
- /* FALLTHRU */
+ TCL_FALLTHROUGH();
case 'c':
case 'i':
case 'u':
@@ -2868,7 +2867,7 @@ AppendPrintfToObjVA(
break;
case 'h':
size = -1;
- /* FALLTHRU */
+ TCL_FALLTHROUGH();
default:
p++;
}
@@ -3272,7 +3271,8 @@ TclStringCat(
} while (--oc);
} else {
/* Result will be concat of string reps. Pre-size it. */
- ov = objv; oc = objc;
+ ov = objv;
+ oc = objc;
do {
Tcl_Obj *pendingPtr = NULL;
@@ -3356,7 +3356,8 @@ TclStringCat(
return objv[first];
}
- objv += first; objc = (last - first + 1);
+ objv += first;
+ objc = (last - first + 1);
inPlace = (flags & TCL_STRING_IN_PLACE) && !Tcl_IsShared(*objv);
if (binary) {
@@ -3371,7 +3372,8 @@ TclStringCat(
if (inPlace) {
Tcl_Size start = 0;
- objResultPtr = *objv++; objc--;
+ objResultPtr = *objv++;
+ objc--;
(void)Tcl_GetBytesFromObj(NULL, objResultPtr, &start);
dst = Tcl_SetByteArrayLength(objResultPtr, length) + start;
} else {
@@ -3401,7 +3403,8 @@ TclStringCat(
if (inPlace) {
Tcl_Size start;
- objResultPtr = *objv++; objc--;
+ objResultPtr = *objv++;
+ objc--;
/* Ugly interface! Force resize of the unicode array. */
(void)Tcl_GetUnicodeFromObj(objResultPtr, &start);
@@ -3452,7 +3455,8 @@ TclStringCat(
if (inPlace) {
Tcl_Size start;
- objResultPtr = *objv++; objc--;
+ objResultPtr = *objv++;
+ objc--;
(void)TclGetStringFromObj(objResultPtr, &start);
if (0 == Tcl_AttemptSetObjLength(objResultPtr, length)) {