From 923be72f83a25825a5acca2871074d7fbe8327cb Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Sun, 1 Jun 2025 18:13:01 +0000 Subject: Cherrypick 57d619a23f - Jan's changes for unused vars --- win/tclWinInit.c | 55 +++---------------------------------------------------- 1 file changed, 3 insertions(+), 52 deletions(-) diff --git a/win/tclWinInit.c b/win/tclWinInit.c index 23aad3e..b3ea057 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -36,12 +36,6 @@ typedef struct { WORD wReserved; } OemId; -typedef struct { - Tcl_Encoding userEncoding; -} ThreadSpecificData; - -static Tcl_ThreadDataKey dataKey; - /* * The following arrays contain the human readable strings for the * processor values. @@ -154,9 +148,9 @@ TclpGetCodePageOnce( * - added bonus, RegGetValue is much more convenient to use */ if (RegGetValueA(HKEY_LOCAL_MACHINE, - "SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage", - "ACP", RRF_RT_REG_SZ, NULL, codePage+2, - &size) != ERROR_SUCCESS) { + "SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage", + "ACP", RRF_RT_REG_SZ, NULL, codePage+2, + &size) != ERROR_SUCCESS) { /* On failure, fallback to GetACP() */ UINT acp = GetACP(); snprintf(codePage, sizeof(codePage), "cp%u", acp); @@ -530,49 +524,6 @@ TclpSetInitialEncodings(void) Tcl_DStringFree(&encodingName); } -#if 0 - -/* - *--------------------------------------------------------------------------- - * - * TclpGetEncodingForUser -- - * - * Returns the Tcl_Encoding corresponding to the user code page. - * - * Results: - * A Tcl_Encoding value or NULL if the encoding cannot be found or - * if Tcl does not support the encoding. - * - * Side effects: - * The encoding is cached in the thread local storage. - *--------------------------------------------------------------------------- - */ -Tcl_Encoding -TclpGetEncodingForUser(Tcl_Interp *interp) -{ - /* - * In keeping with Windows, the encoding will not be updated if the - * registry value changes so we never need to update it once - * successfully retrieved. - */ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - if (tsdPtr->userEncoding == NULL) { - tsdPtr->userEncoding = - Tcl_GetEncoding(interp, TclpGetCodePage()); - } - return tsdPtr->userEncoding; -} - -void TclpReleaseEncodingForUser(void) -{ - ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); - if (tsdPtr->userEncoding) { - Tcl_FreeEncoding(tsdPtr->userEncoding); - tsdPtr->userEncoding = NULL; - } -} -#endif - const char * Tcl_GetEncodingNameForUser(Tcl_DString *bufPtr) { -- cgit v0.12