summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2024-03-19 14:56:45 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2024-03-19 14:56:45 (GMT)
commit780e71600c142bee274fbf209304fb0ef2153143 (patch)
treebcfa89065ecea0a374bed505c235b77cba3db0a3 /generic/tclEncoding.c
parent8925939c12d52f0c01b12796108f74ec08addd1b (diff)
downloadtcl-780e71600c142bee274fbf209304fb0ef2153143.zip
tcl-780e71600c142bee274fbf209304fb0ef2153143.tar.gz
tcl-780e71600c142bee274fbf209304fb0ef2153143.tar.bz2
Fix indentation/brace usage style issues
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r--generic/tclEncoding.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index f60f949..1b71026 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -1236,7 +1236,7 @@ Tcl_ExternalToUtfDStringEx(
* and loop. Otherwise, return the result we got.
*/
if ((result != TCL_CONVERT_NOSPACE) &&
- !(result == TCL_CONVERT_MULTIBYTE && (flags & TCL_ENCODING_END))) {
+ !(result == TCL_CONVERT_MULTIBYTE && (flags & TCL_ENCODING_END))) {
Tcl_Size nBytesProcessed = (src - srcStart);
Tcl_DStringSetLength(dstPtr, soFar);
@@ -1251,14 +1251,12 @@ Tcl_ExternalToUtfDStringEx(
if (result != TCL_OK && interp != NULL) {
char buf[TCL_INTEGER_SPACE];
snprintf(buf, sizeof(buf), "%" TCL_SIZE_MODIFIER "d", nBytesProcessed);
- Tcl_SetObjResult(
- interp,
- Tcl_ObjPrintf("unexpected byte sequence starting at index %"
- TCL_SIZE_MODIFIER "d: '\\x%02X'",
- nBytesProcessed,
- UCHAR(srcStart[nBytesProcessed])));
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "unexpected byte sequence starting at index %"
+ TCL_SIZE_MODIFIER "d: '\\x%02X'",
+ nBytesProcessed, UCHAR(srcStart[nBytesProcessed])));
Tcl_SetErrorCode(
- interp, "TCL", "ENCODING", "ILLEGALSEQUENCE", buf, (void *)NULL);
+ interp, "TCL", "ENCODING", "ILLEGALSEQUENCE", buf, (void *)NULL);
}
}
if (result != TCL_OK) {
@@ -1563,7 +1561,7 @@ Tcl_UtfToExternalDStringEx(
* and loop. Otherwise, return the result we got.
*/
if ((result != TCL_CONVERT_NOSPACE) &&
- !(result == TCL_CONVERT_MULTIBYTE && (flags & TCL_ENCODING_END))) {
+ !(result == TCL_CONVERT_MULTIBYTE && (flags & TCL_ENCODING_END))) {
Tcl_Size nBytesProcessed = (src - srcStart);
Tcl_Size i = soFar + encodingPtr->nullSize - 1;
/* Loop as DStringSetLength only stores one nul byte at a time */
@@ -1582,17 +1580,15 @@ Tcl_UtfToExternalDStringEx(
Tcl_Size pos = Tcl_NumUtfChars(srcStart, nBytesProcessed);
int ucs4;
char buf[TCL_INTEGER_SPACE];
+
Tcl_UtfToUniChar(&srcStart[nBytesProcessed], &ucs4);
snprintf(buf, sizeof(buf), "%" TCL_SIZE_MODIFIER "d", nBytesProcessed);
- Tcl_SetObjResult(
- interp,
- Tcl_ObjPrintf(
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"unexpected character at index %" TCL_SIZE_MODIFIER
"u: 'U+%06X'",
- pos,
- ucs4));
+ pos, ucs4));
Tcl_SetErrorCode(interp, "TCL", "ENCODING", "ILLEGALSEQUENCE",
- buf, (void *)NULL);
+ buf, (void *)NULL);
}
}
if (result != TCL_OK) {
@@ -4337,10 +4333,8 @@ TclEncodingProfileNameToId(
}
}
if (interp) {
- Tcl_Obj *errorObj;
/* This code assumes at least two profiles :-) */
- errorObj =
- Tcl_ObjPrintf("bad profile name \"%s\": must be",
+ Tcl_Obj *errorObj = Tcl_ObjPrintf("bad profile name \"%s\": must be",
profileName);
for (i = 0; i < (numProfiles - 1); ++i) {
Tcl_AppendStringsToObj(
@@ -4384,9 +4378,7 @@ TclEncodingProfileIdToName(
}
}
if (interp) {
- Tcl_SetObjResult(
- interp,
- Tcl_ObjPrintf(
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"Internal error. Bad profile id \"%d\".",
profileValue));
Tcl_SetErrorCode(