summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorgriffin <briang42@easystreet.net>2024-05-26 19:43:33 (GMT)
committergriffin <briang42@easystreet.net>2024-05-26 19:43:33 (GMT)
commite379099ac36386b299ed649ee8e7a20c77b8f7e7 (patch)
tree81d5bf3cb0f169e0eca8b47a0755860a8deead7d /unix
parentca2e6faeaae3e6a777b4d56cdf0bb2e09f449b0f (diff)
parent09f254545c234fbd9bf3545493557f01d005899e (diff)
downloadtcl-e379099ac36386b299ed649ee8e7a20c77b8f7e7.zip
tcl-e379099ac36386b299ed649ee8e7a20c77b8f7e7.tar.gz
tcl-e379099ac36386b299ed649ee8e7a20c77b8f7e7.tar.bz2
Merge main
Diffstat (limited to 'unix')
-rw-r--r--unix/tclUnixChan.c17
-rw-r--r--unix/tclUnixFile.c8
2 files changed, 3 insertions, 22 deletions
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index 3f972ae..edb1edb 100644
--- a/unix/tclUnixChan.c
+++ b/unix/tclUnixChan.c
@@ -567,21 +567,6 @@ FileGetHandleProc(
*----------------------------------------------------------------------
*/
-static inline void
-StoreElementInDict(
- Tcl_Obj *dictObj,
- const char *name,
- Tcl_Obj *valueObj)
-{
- /*
- * We assume that the dict is being built fresh and that there's never any
- * duplicate keys.
- */
-
- Tcl_Obj *nameObj = Tcl_NewStringObj(name, -1);
- Tcl_DictObjPut(NULL, dictObj, nameObj, valueObj);
-}
-
static inline const char *
GetTypeFromMode(
int mode)
@@ -631,7 +616,7 @@ StatOpenFile(
*/
TclNewObj(dictObj);
-#define STORE_ELEM(name, value) StoreElementInDict(dictObj, name, value)
+#define STORE_ELEM(name, value) TclDictPut(NULL, dictObj, name, value)
STORE_ELEM("dev", Tcl_NewWideIntObj((long) statBuf.st_dev));
STORE_ELEM("ino", Tcl_NewWideIntObj((Tcl_WideInt) statBuf.st_ino));
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index ef2d4b9..93f6aa8 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -154,9 +154,7 @@ TclpFindExecutable(
#endif
{
Tcl_ExternalToUtfDStringEx(NULL, NULL, name, TCL_INDEX_NONE, TCL_ENCODING_PROFILE_TCL8, &utfName, NULL);
- TclSetObjNameOfExecutable(
- Tcl_NewStringObj(Tcl_DStringValue(&utfName), TCL_INDEX_NONE), NULL);
- Tcl_DStringFree(&utfName);
+ TclSetObjNameOfExecutable(Tcl_DStringToObj(&utfName), NULL);
goto done;
}
@@ -191,9 +189,7 @@ TclpFindExecutable(
Tcl_ExternalToUtfDStringEx(NULL, NULL, Tcl_DStringValue(&buffer), TCL_INDEX_NONE,
TCL_ENCODING_PROFILE_TCL8, &utfName, NULL);
- TclSetObjNameOfExecutable(
- Tcl_NewStringObj(Tcl_DStringValue(&utfName), TCL_INDEX_NONE), NULL);
- Tcl_DStringFree(&utfName);
+ TclSetObjNameOfExecutable(Tcl_DStringToObj(&utfName), NULL);
done:
Tcl_DStringFree(&buffer);