From d6b9036b665ab06fcb218295a69a011b385c9609 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 20 Sep 2019 10:30:42 +0000 Subject: One missing use of TCL_INDEX_NONE in stead of -1. Use some more type-casts, making compiling Tk less sensitive to the use of -DUNICODE or not. --- generic/tkMenu.c | 2 +- win/tkWinButton.c | 2 +- win/tkWinCursor.c | 6 +++--- win/tkWinWm.c | 2 +- win/ttkWinMonitor.c | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/generic/tkMenu.c b/generic/tkMenu.c index af77009..3240ff5 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -754,7 +754,7 @@ MenuWidgetObjCmd( first = 1; } - if ((first < 0) || (last < first)) { + if ((first == TCL_INDEX_NONE) || (last < first)) { goto done; } DeleteMenuCloneEntries(menuPtr, first, last); diff --git a/win/tkWinButton.c b/win/tkWinButton.c index 6fc5cf1..fc5d9e2 100644 --- a/win/tkWinButton.c +++ b/win/tkWinButton.c @@ -131,7 +131,7 @@ InitBoxes(void) ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - hrsrc = FindResourceW(module, L"buttons", RT_BITMAP); + hrsrc = FindResourceW(module, L"buttons", (LPWSTR) RT_BITMAP); if (hrsrc == NULL) { Tcl_Panic("FindResourceW() failed for buttons bitmap resource, " "resources in tk_base.rc must be linked into Tk dll or static executable"); diff --git a/win/tkWinCursor.c b/win/tkWinCursor.c index 3fe9899..3cf33e8 100644 --- a/win/tkWinCursor.c +++ b/win/tkWinCursor.c @@ -41,7 +41,7 @@ typedef struct { static struct CursorName { const char *name; - LPCWSTR id; + LPCTSTR id; } cursorNames[] = { {"starting", IDC_APPSTARTING}, {"arrow", IDC_ARROW}, @@ -71,7 +71,7 @@ static struct CursorName { * The default cursor is used whenever no other cursor has been specified. */ -#define TK_DEFAULT_CURSOR IDC_ARROW +#define TK_DEFAULT_CURSOR (LPCWSTR)IDC_ARROW /* *---------------------------------------------------------------------- @@ -145,7 +145,7 @@ TkGetCursorByName( for (namePtr = cursorNames; namePtr->name != NULL; namePtr++) { if (strcmp(namePtr->name, argv[0]) == 0) { - cursorPtr->winCursor = LoadCursorW(NULL, namePtr->id); + cursorPtr->winCursor = LoadCursorW(NULL, (LPCWSTR) namePtr->id); break; } } diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 1c895dd..167b8ea 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -892,7 +892,7 @@ InitWindowClass( tsdPtr->iconPtr = titlebaricon; } - class.hCursor = LoadCursorW(NULL, IDC_ARROW); + class.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); if (!RegisterClassW(&class)) { Tcl_Panic("Unable to register TkTopLevel class"); diff --git a/win/ttkWinMonitor.c b/win/ttkWinMonitor.c index 6a40866..8bcfca2 100644 --- a/win/ttkWinMonitor.c +++ b/win/ttkWinMonitor.c @@ -81,9 +81,9 @@ CreateThemeMonitorWindow(HINSTANCE hinst, Tcl_Interp *interp) wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hinst; - wc.hIcon = LoadIconW(NULL, IDI_APPLICATION); - wc.hIconSm = LoadIconW(NULL, IDI_APPLICATION); - wc.hCursor = LoadCursorW(NULL, IDC_ARROW); + wc.hIcon = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION); + wc.hIconSm = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION); + wc.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); wc.hbrBackground = (HBRUSH)COLOR_WINDOW; wc.lpszMenuName = name; wc.lpszClassName = name; -- cgit v0.12