Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Merge 8.7: fix compiler warning in tkConfig.c. Eliminate the last usage of Tcl_GetPathType() (which is documented as 'Obsolete' in Tcl) |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | main |
Files: | files | file ages | folders |
SHA3-256: |
c3a35eef419c77ba380f6a26a5ecc2c8 |
User & Date: | jan.nijtmans 2024-04-30 08:48:34 |
Original Comment: | Merge 8.7: fix compiler warning in tkConfig.c. Eliminate the last usage of Tcl_GetPathType() (which is documented as 'Obsolite' in Tcl) |
Context
2024-04-30
| ||
11:17 | Fix TkCygwinMainEx() function: Didn't work on Cygwin X11 yet, because it used the wrong Tk library name. Also symplify this function (int -> void return) Fix warning in tkWinTest.c check-in: 3fde0cbf user: jan.nijtmans tags: trunk, main | |
08:48 | Merge 8.7: fix compiler warning in tkConfig.c. Eliminate the last usage of Tcl_GetPathType() (which is documented as 'Obsolete' in Tcl) check-in: c3a35eef user: jan.nijtmans tags: trunk, main | |
08:44 | Eliminate the use of Tcl_GetPathType() check-in: 15e322ca user: jan.nijtmans tags: core-8-branch | |
08:35 | doc syntax correction. only remaining htmlhelp error: "CrtPhImgFmt: SYNOPSIS: output-directive: ignoring .fi" check-in: 3121bc61 user: oehhar tags: trunk, main | |
Changes
Changes to generic/tkConfig.c.
︙ | ︙ | |||
2172 2173 2174 2175 2176 2177 2178 | objPtr = Tcl_NewDoubleObj(*((double *) internalPtr)); } break; case TK_OPTION_STRING: objPtr = Tcl_NewStringObj(*((char **)internalPtr), TCL_INDEX_NONE); break; case TK_OPTION_STRING_TABLE: { | | | 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 | objPtr = Tcl_NewDoubleObj(*((double *) internalPtr)); } break; case TK_OPTION_STRING: objPtr = Tcl_NewStringObj(*((char **)internalPtr), TCL_INDEX_NONE); break; case TK_OPTION_STRING_TABLE: { int value = 0; if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { value = *((signed char *)internalPtr); } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { value = *((short *)internalPtr); } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_STRING_TABLE"); |
︙ | ︙ |
Changes to win/tkWinDialog.c.
︙ | ︙ | |||
586 587 588 589 590 591 592 | Tcl_DString *dsPtr, Tcl_Obj *initialPtr, int *indexPtr); static UINT APIENTRY OFNHookProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK MsgBoxCBTProc(int nCode, WPARAM wParam, LPARAM lParam); static void SetTkDialog(void *clientData); static const char *ConvertExternalFilename(LPCWSTR, Tcl_DString *); | > | | 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 | Tcl_DString *dsPtr, Tcl_Obj *initialPtr, int *indexPtr); static UINT APIENTRY OFNHookProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK MsgBoxCBTProc(int nCode, WPARAM wParam, LPARAM lParam); static void SetTkDialog(void *clientData); static const char *ConvertExternalFilename(LPCWSTR, Tcl_DString *); static Tcl_Obj *ConvertExternalFilenameObj(LPCWSTR); /* *------------------------------------------------------------------------- * * EatSpuriousMessageBugFix -- * * In the file open/save dialog, double clicking on a list item causes * the dialog box to close, but an unwanted WM_LBUTTONUP message is sent |
︙ | ︙ | |||
1400 1401 1402 1403 1404 1405 1406 | for (dw = 0; dw < count; ++dw) { hr = multiIf->lpVtbl->GetItemAt(multiIf, dw, &itemIf); if (FAILED(hr)) break; hr = itemIf->lpVtbl->GetDisplayName(itemIf, SIGDN_FILESYSPATH, &wstr); if (SUCCEEDED(hr)) { | | | | < < < < < | < < < | 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 | for (dw = 0; dw < count; ++dw) { hr = multiIf->lpVtbl->GetItemAt(multiIf, dw, &itemIf); if (FAILED(hr)) break; hr = itemIf->lpVtbl->GetDisplayName(itemIf, SIGDN_FILESYSPATH, &wstr); if (SUCCEEDED(hr)) { Tcl_Obj *fnds; fnds = ConvertExternalFilenameObj(wstr); CoTaskMemFree(wstr); Tcl_ListObjAppendElement( interp, multiObj, fnds); } itemIf->lpVtbl->Release(itemIf); if (FAILED(hr)) break; } } multiIf->lpVtbl->Release(multiIf); if (SUCCEEDED(hr)) resultObj = multiObj; else Tcl_DecrRefCount(multiObj); } } else { IShellItem *resultIf; hr = fdlgIf->lpVtbl->GetResult(fdlgIf, &resultIf); if (SUCCEEDED(hr)) { hr = resultIf->lpVtbl->GetDisplayName(resultIf, SIGDN_FILESYSPATH, &wstr); if (SUCCEEDED(hr)) { resultObj = ConvertExternalFilenameObj(wstr); CoTaskMemFree(wstr); } resultIf->lpVtbl->Release(resultIf); } } if (SUCCEEDED(hr)) { if (filterPtr && optsPtr->typeVariableObj) { UINT ftix; |
︙ | ︙ | |||
1685 1686 1687 1688 1689 1690 1691 | while (*files != '\0') { while (*files != '\0') { files++; } files++; if (*files != '\0') { Tcl_Obj *fullnameObj; | | | | < | | 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 | while (*files != '\0') { while (*files != '\0') { files++; } files++; if (*files != '\0') { Tcl_Obj *fullnameObj; Tcl_Obj *filenameObj; count++; filenameObj = ConvertExternalFilenameObj(files); fullnameObj = Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); Tcl_AppendToObj(fullnameObj, "/", TCL_INDEX_NONE); Tcl_AppendObjToObj(fullnameObj, filenameObj); gotFilename = 1; Tcl_DecrRefCount(filenameObj); Tcl_ListObjAppendElement(NULL, returnList, fullnameObj); } } if (count == 0) { /* * Only one file was returned. |
︙ | ︙ | |||
1945 1946 1947 1948 1949 1950 1951 | } else { /* * Replace directory terminating NULL with a with a backslash, * but only if not an absolute path. */ | < | | | | 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 | } else { /* * Replace directory terminating NULL with a with a backslash, * but only if not an absolute path. */ Tcl_Obj *tmpfile = ConvertExternalFilenameObj(buffer); if (TCL_PATH_ABSOLUTE == Tcl_FSGetPathType(tmpfile)) { /* re-get the full path to the start of the buffer */ buffer = ofnData->dynFileBuffer; SendMessageW(hdlg, CDM_GETSPEC, selsize, (LPARAM) buffer); } else { *(buffer-1) = '\\'; } buffer[selsize] = '\0'; /* Second NULL terminator. */ Tcl_DecrRefCount(tmpfile); } } else { /* * Nothing is selected, so just empty the string. */ if (buffer != NULL) { |
︙ | ︙ | |||
2524 2525 2526 2527 2528 2529 2530 | /* * Change the pathname to the Tcl "normalized" pathname, where back * slashes are used instead of forward slashes */ Tcl_ResetResult(interp); if (*path) { | < < | < < | 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 | /* * Change the pathname to the Tcl "normalized" pathname, where back * slashes are used instead of forward slashes */ Tcl_ResetResult(interp); if (*path) { Tcl_SetObjResult(interp, ConvertExternalFilenameObj(path)); } CleanupOFNOptions(&ofnOpts); return TCL_OK; } /* |
︙ | ︙ | |||
2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 | if (*p == '\\') { *p = '/'; } } return Tcl_DStringValue(dsPtr); } /* * ---------------------------------------------------------------------- * * GetFontObj -- * * Convert a windows LOGFONT into a Tk font description. | > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 | if (*p == '\\') { *p = '/'; } } return Tcl_DStringValue(dsPtr); } static Tcl_Obj * ConvertExternalFilenameObj( LPCWSTR filename) { char *p; int len = wcslen(filename) * 3; Tcl_Obj *r = Tcl_NewObj(); Tcl_SetObjLength(r, len); p = Tcl_GetString(r); len = WideCharToMultiByte(CP_UTF8, 0, filename, -1, p, len, NULL, NULL); for (; *p != '\0'; p++) { /* * Change the pathname to the Tcl "normalized" pathname, where back * slashes are used instead of forward slashes */ if (*p == '\\') { *p = '/'; } } Tcl_SetObjLength(r, len); return r; } /* * ---------------------------------------------------------------------- * * GetFontObj -- * * Convert a windows LOGFONT into a Tk font description. |
︙ | ︙ |