diff options
-rw-r--r-- | generic/tkEntry.c | 8 | ||||
-rw-r--r-- | generic/tkInt.h | 4 | ||||
-rw-r--r-- | library/ttk/combobox.tcl | 4 | ||||
-rw-r--r-- | library/ttk/cursors.tcl | 26 | ||||
-rw-r--r-- | library/ttk/panedwindow.tcl | 13 | ||||
-rw-r--r-- | library/ttk/spinbox.tcl | 4 | ||||
-rw-r--r-- | library/ttk/treeview.tcl | 6 | ||||
-rw-r--r-- | tests/ttk/ttk.test | 13 | ||||
-rwxr-xr-x | unix/configure | 10 | ||||
-rw-r--r-- | unix/tcl.m4 | 2 | ||||
-rwxr-xr-x | win/configure | 6 | ||||
-rw-r--r-- | win/tcl.m4 | 15 | ||||
-rw-r--r-- | win/tkWinDialog.c | 60 | ||||
-rw-r--r-- | win/tkWinDraw.c | 6 | ||||
-rw-r--r-- | win/tkWinEmbed.c | 13 | ||||
-rw-r--r-- | win/tkWinFont.c | 26 | ||||
-rw-r--r-- | win/tkWinImage.c | 22 | ||||
-rw-r--r-- | win/tkWinInit.c | 1 | ||||
-rw-r--r-- | win/tkWinKey.c | 23 | ||||
-rw-r--r-- | win/tkWinMenu.c | 14 | ||||
-rw-r--r-- | win/ttkWinXPTheme.c | 2 |
21 files changed, 183 insertions, 95 deletions
diff --git a/generic/tkEntry.c b/generic/tkEntry.c index cccc6d6..9ae3a03 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -197,15 +197,15 @@ static const Tk_OptionSpec sbOptSpec[] = { NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_ENTRY_BORDER_WIDTH, -1, offsetof(Entry, borderWidth), 0, 0, 0}, - {TK_OPTION_BORDER, "-buttonbackground", "Button.background", "Background", + {TK_OPTION_BORDER, "-buttonbackground", "buttonBackground", "Background", DEF_BUTTON_BG_COLOR, -1, offsetof(Spinbox, buttonBorder), 0, DEF_BUTTON_BG_MONO, 0}, - {TK_OPTION_CURSOR, "-buttoncursor", "Button.cursor", "Cursor", + {TK_OPTION_CURSOR, "-buttoncursor", "buttonCursor", "Cursor", DEF_BUTTON_CURSOR, -1, offsetof(Spinbox, bCursor), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_RELIEF, "-buttondownrelief", "Button.relief", "Relief", + {TK_OPTION_RELIEF, "-buttondownrelief", "buttonDownRelief", "Relief", DEF_BUTTON_RELIEF, -1, offsetof(Spinbox, bdRelief), 0, 0, 0}, - {TK_OPTION_RELIEF, "-buttonuprelief", "Button.relief", "Relief", + {TK_OPTION_RELIEF, "-buttonuprelief", "buttonUpRelief", "Relief", DEF_BUTTON_RELIEF, -1, offsetof(Spinbox, buRelief), 0, 0, 0}, {TK_OPTION_STRING, "-command", "command", "Command", DEF_SPINBOX_CMD, -1, offsetof(Spinbox, command), diff --git a/generic/tkInt.h b/generic/tkInt.h index 7ef7862..f916b97 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -67,8 +67,8 @@ #endif #if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 7) -# define Tcl_WCharToUtfDString Tcl_UniCharToUtfDString -# define Tcl_UtfToWCharDString Tcl_UtfToUniCharDString +# define Tcl_WCharToUtfDString ((char * (*)(const WCHAR *, int len, Tcl_DString *))Tcl_UniCharToUtfDString) +# define Tcl_UtfToWCharDString ((WCHAR * (*)(const char *, int len, Tcl_DString *))Tcl_UtfToUniCharDString) # define Tcl_Char16ToUtfDString Tcl_UniCharToUtfDString # define Tcl_UtfToChar16DString Tcl_UtfToUniCharDString #endif diff --git a/library/ttk/combobox.tcl b/library/ttk/combobox.tcl index 1355a04..2770142 100644 --- a/library/ttk/combobox.tcl +++ b/library/ttk/combobox.tcl @@ -149,12 +149,14 @@ proc ttk::combobox::Drag {w x} { # Set cursor. # proc ttk::combobox::Motion {w x y} { + variable State + ttk::saveCursor $w State(userConfCursor) [ttk::cursor text] if { [$w identify $x $y] eq "textarea" && [$w instate {!readonly !disabled}] } { ttk::setCursor $w text } else { - ttk::setCursor $w "" + ttk::setCursor $w $State(userConfCursor) } } diff --git a/library/ttk/cursors.tcl b/library/ttk/cursors.tcl index 852f01c..9125acb 100644 --- a/library/ttk/cursors.tcl +++ b/library/ttk/cursors.tcl @@ -137,8 +137,30 @@ proc ttk::cursor {name} { proc ttk::setCursor {w name} { variable Cursors - if {[$w cget -cursor] ne $Cursors($name)} { - $w configure -cursor $Cursors($name) + if {[info exists Cursors($name)]} { + set cursorname $Cursors($name) + } else { + set cursorname $name + } + if {[$w cget -cursor] ne $cursorname} { + $w configure -cursor $cursorname + } +} + +## ttk::saveCursor $w $saveVar $excludeList -- +# Set variable $saveVar to the -cursor value from widget $w, +# if either: +# a. $saveVar does not yet exist +# b. the currently user-specified cursor for $w is not in +# $excludeList + +proc ttk::saveCursor {w saveVar excludeList} { + upvar $saveVar sv + if {![info exists sv]} { + set sv [$w cget -cursor] + } + if {[$w cget -cursor] ni $excludeList} { + set sv [$w cget -cursor] } } diff --git a/library/ttk/panedwindow.tcl b/library/ttk/panedwindow.tcl index a2e073b..ba47003 100644 --- a/library/ttk/panedwindow.tcl +++ b/library/ttk/panedwindow.tcl @@ -62,13 +62,22 @@ proc ttk::panedwindow::Release {w x y} { # proc ttk::panedwindow::ResetCursor {w} { variable State + + ttk::saveCursor $w State(userConfCursor) \ + [list [ttk::cursor hresize] [ttk::cursor vresize]] + if {!$State(pressed)} { - ttk::setCursor $w {} + ttk::setCursor $w $State(userConfCursor) } } proc ttk::panedwindow::SetCursor {w x y} { - set cursor "" + variable State + + ttk::saveCursor $w State(userConfCursor) \ + [list [ttk::cursor hresize] [ttk::cursor vresize]] + + set cursor $State(userConfCursor) if {[llength [$w identify $x $y]]} { # Assume we're over a sash. switch -- [$w cget -orient] { diff --git a/library/ttk/spinbox.tcl b/library/ttk/spinbox.tcl index 90a1572..9728755 100644 --- a/library/ttk/spinbox.tcl +++ b/library/ttk/spinbox.tcl @@ -29,12 +29,14 @@ ttk::bindMouseWheel TSpinbox [list ttk::spinbox::MouseWheel %W] # Sets cursor. # proc ttk::spinbox::Motion {w x y} { + variable State + ttk::saveCursor $w State(userConfCursor) [ttk::cursor text] if { [$w identify $x $y] eq "textarea" && [$w instate {!readonly !disabled}] } { ttk::setCursor $w text } else { - ttk::setCursor $w "" + ttk::setCursor $w $State(userConfCursor) } } diff --git a/library/ttk/treeview.tcl b/library/ttk/treeview.tcl index 8cd3e75..99210af 100644 --- a/library/ttk/treeview.tcl +++ b/library/ttk/treeview.tcl @@ -102,7 +102,11 @@ proc ttk::treeview::Keynav {w dir} { # Sets cursor, active element ... # proc ttk::treeview::Motion {w x y} { - set cursor {} + variable State + + ttk::saveCursor $w State(userConfCursor) [ttk::cursor hresize] + + set cursor $State(userConfCursor) set activeHeading {} switch -- [$w identify region $x $y] { diff --git a/tests/ttk/ttk.test b/tests/ttk/ttk.test index 9f78966..9fb4c30 100644 --- a/tests/ttk/ttk.test +++ b/tests/ttk/ttk.test @@ -507,6 +507,19 @@ test ttk-12.2 "-cursor option" -body { .b cget -cursor } -result arrow +test ttk-12.2.1 "-cursor option, widget doesn't overwrite it" -setup { + ttk::treeview .tr + pack .tr + update +} -body { + .tr configure -cursor X_cursor + event generate .tr <Motion> + update + .tr cget -cursor +} -cleanup { + destroy .tr +} -result {X_cursor} + test ttk-12.3 "-borderwidth frame option" -body { destroy .t toplevel .t diff --git a/unix/configure b/unix/configure index 571b9ec..705b75c 100755 --- a/unix/configure +++ b/unix/configure @@ -4249,12 +4249,7 @@ fi if test "$GCC" = yes; then : CFLAGS_OPTIMIZE=-O2 - CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wpointer-arith" - case "${CC}" in - *++) - CFLAGS_WARNING="${CFLAGS_WARNING} -Wunused-parameter" - ;; - esac + CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wpointer-arith -Wunused-parameter" else @@ -6201,9 +6196,6 @@ fi if test "${tcl_cv_type_64bit}" = none ; then -$as_echo "#define MP_32BIT 1" >>confdefs.h - - $as_echo "#define TCL_WIDE_INT_IS_LONG 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 diff --git a/unix/tcl.m4 b/unix/tcl.m4 index a38ae92..1233cd2 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -989,7 +989,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ CFLAGS_DEBUG=-g AS_IF([test "$GCC" = yes], [ CFLAGS_OPTIMIZE=-O2 - CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wdeclaration-after-statement -Wpointer-arith" + CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wpointer-arith -Wunused-parameter" ], [ CFLAGS_OPTIMIZE=-O CFLAGS_WARNING="" diff --git a/win/configure b/win/configure index 95a550c..af50495 100755 --- a/win/configure +++ b/win/configure @@ -4273,7 +4273,7 @@ $as_echo "using shared flags" >&6; } case "${CC}" in *++) - CFLAGS_WARNING="${CFLAGS_WARNING} -Wno-format -Wunused-parameter" + CFLAGS_WARNING="${CFLAGS_WARNING} -Wno-format" ;; *) CFLAGS_WARNING="${CFLAGS_WARNING} -Wdeclaration-after-statement" @@ -4648,10 +4648,6 @@ $as_echo "#define HAVE_CAST_TO_UNION 1" >>confdefs.h fi fi - -$as_echo "#define MP_32BIT 1" >>confdefs.h - - # DL_LIBS is empty, but then we match the Unix version @@ -541,14 +541,14 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ if test "$ac_cv_cross" = "yes"; then case "$do64bit" in amd64|x64|yes) - CC="x86_64-w64-mingw32-gcc" + CC="x86_64-w64-mingw32-${CC}" LD="x86_64-w64-mingw32-ld" AR="x86_64-w64-mingw32-ar" RANLIB="x86_64-w64-mingw32-ranlib" RC="x86_64-w64-mingw32-windres" ;; *) - CC="i686-w64-mingw32-gcc" + CC="i686-w64-mingw32-${CC}" LD="i686-w64-mingw32-ld" AR="i686-w64-mingw32-ar" RANLIB="i686-w64-mingw32-ranlib" @@ -685,10 +685,19 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" - CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wdeclaration-after-statement -Wpointer-arith" + CFLAGS_WARNING="-Wall -Wwrite-strings -Wsign-compare -Wpointer-arith -Wunused-parameter" LDFLAGS_DEBUG= LDFLAGS_OPTIMIZE= + case "${CC}" in + *++) + CFLAGS_WARNING="${CFLAGS_WARNING} -Wno-format" + ;; + *) + CFLAGS_WARNING="${CFLAGS_WARNING} -Wdeclaration-after-statement" + ;; + esac + # Specify the CC output file names based on the target name CC_OBJNAME="-o \[$]@" CC_EXENAME="-o \[$]@" diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index 6059d21..8c80ca9 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -423,7 +423,7 @@ typedef struct IFileSaveDialogVtbl { ULONG ( STDMETHODCALLTYPE *Release )( IFileSaveDialog *); HRESULT ( STDMETHODCALLTYPE *Show )( IFileSaveDialog *, HWND); - HRESULT ( STDMETHODCALLTYPE *SetFileTypes )( IFileSaveDialog * this, + HRESULT ( STDMETHODCALLTYPE *SetFileTypes )( IFileSaveDialog *, UINT, const TCLCOMDLG_FILTERSPEC *); HRESULT ( STDMETHODCALLTYPE *SetFileTypeIndex )( IFileSaveDialog *, UINT); @@ -718,7 +718,7 @@ void TkWinDialogDebug( int debug) { - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); tsdPtr->debugFlag = debug; @@ -750,7 +750,7 @@ Tk_ChooseColorObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - Tk_Window tkwin = clientData, parent; + Tk_Window tkwin = (Tk_Window)clientData, parent; HWND hWnd; int i, oldMode, winCode, result; CHOOSECOLORW chooseColor; @@ -904,10 +904,11 @@ ColorDlgHookProc( WPARAM wParam, /* First message parameter. */ LPARAM lParam) /* Second message parameter. */ { - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); const char *title; CHOOSECOLOR *ccPtr; + (void)wParam; if (WM_INITDIALOG == uMsg) { @@ -1085,7 +1086,7 @@ ParseOFNOptions( ZeroMemory(optsPtr, sizeof(*optsPtr)); // optsPtr->forceXPStyle = 1; - optsPtr->tkwin = clientData; + optsPtr->tkwin = (Tk_Window)clientData; optsPtr->confirmOverwrite = 1; /* By default we ask for confirmation */ Tcl_DStringInit(&optsPtr->utfDirString); optsPtr->file[0] = 0; @@ -1146,7 +1147,7 @@ ParseOFNOptions( Tcl_DStringFree(&ds); break; case FILE_PARENT: - optsPtr->tkwin = Tk_NameToWindow(interp, string, clientData); + optsPtr->tkwin = Tk_NameToWindow(interp, string, (Tk_Window)clientData); if (optsPtr->tkwin == NULL) goto error_return; break; @@ -1205,7 +1206,7 @@ static int VistaFileDialogsAvailable() { HRESULT hr; IFileDialog *fdlgPtr = NULL; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (tsdPtr->newFileDialogsState == FDLG_STATE_INIT) { @@ -1267,7 +1268,7 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, IShellItem *dirIf = NULL; LPWSTR wstr; Tcl_Obj *resultObj = NULL; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); int oldMode; @@ -1409,7 +1410,7 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, if (normPath) { LPCWSTR nativePath; Tcl_IncrRefCount(normPath); - nativePath = Tcl_FSGetNativePath(normPath); /* Points INTO normPath*/ + nativePath = (LPCWSTR)Tcl_FSGetNativePath(normPath); /* Points INTO normPath*/ if (nativePath) { hr = ShellProcs.SHCreateItemFromParsingName( nativePath, NULL, @@ -1576,7 +1577,7 @@ static int GetFileNameXP(Tcl_Interp *interp, OFNOpts *optsPtr, enum OFNOper oper Tcl_DString utfFilterString, ds; Tcl_DString extString, filterString, dirString, titleString; const char *str; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); ZeroMemory(&ofnData, sizeof(OFNData)); @@ -1621,7 +1622,7 @@ static int GetFileNameXP(Tcl_Interp *interp, OFNOpts *optsPtr, enum OFNOper oper */ ofnData.dynFileBufferSize = 512; - ofnData.dynFileBuffer = ckalloc(512 * sizeof(WCHAR)); + ofnData.dynFileBuffer = (WCHAR *)ckalloc(512 * sizeof(WCHAR)); } if (optsPtr->extObj != NULL) { @@ -1919,10 +1920,11 @@ OFNHookProc( WPARAM wParam, /* Message parameter */ LPARAM lParam) /* Message parameter */ { - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); OPENFILENAME *ofnPtr; OFNData *ofnData; + (void)wParam; if (uMsg == WM_INITDIALOG) { TkWinSetUserData(hdlg, lParam); @@ -1967,7 +1969,7 @@ OFNHookProc( if ((selsize > 1) && (dirsize > 0)) { if (ofnData->dynFileBufferSize < buffersize) { - buffer = ckrealloc(buffer, buffersize * sizeof(WCHAR)); + buffer = (WCHAR *)ckrealloc(buffer, buffersize * sizeof(WCHAR)); ofnData->dynFileBufferSize = buffersize; ofnData->dynFileBuffer = buffer; } @@ -2099,7 +2101,7 @@ MakeFilter( */ const char *defaultFilter = "All Files (*.*)"; - p = filterStr = ckalloc(30); + p = filterStr = (char *)ckalloc(30); strcpy(p, defaultFilter); p+= strlen(defaultFilter); @@ -2135,7 +2137,7 @@ MakeFilter( * twice the size of the string to format the filter */ - filterStr = ckalloc(len * 3); + filterStr = (char *)ckalloc(len * 3); for (filterPtr = flist.filters, p = filterStr; filterPtr; filterPtr = filterPtr->next) { @@ -2288,7 +2290,7 @@ static int MakeFilterVista( Tcl_DStringInit(&ds); Tcl_DStringInit(&patterns); - dlgFilterPtr = ckalloc(flist.numFilters * sizeof(*dlgFilterPtr)); + dlgFilterPtr = (TCLCOMDLG_FILTERSPEC *)ckalloc(flist.numFilters * sizeof(*dlgFilterPtr)); for (i = 0, filterPtr = flist.filters; filterPtr; @@ -2306,7 +2308,7 @@ static int MakeFilterVista( Tcl_UtfToWCharDString(filterPtr->name, -1, &ds); nbytes = Tcl_DStringLength(&ds); /* # bytes, not Unicode chars */ nbytes += sizeof(WCHAR); /* Terminating \0 */ - dlgFilterPtr[i].pszName = ckalloc(nbytes); + dlgFilterPtr[i].pszName = (LPCWSTR)ckalloc(nbytes); memmove((void *) dlgFilterPtr[i].pszName, Tcl_DStringValue(&ds), nbytes); Tcl_DStringFree(&ds); @@ -2335,7 +2337,7 @@ static int MakeFilterVista( Tcl_UtfToWCharDString(Tcl_DStringValue(&patterns), -1, &ds); nbytes = Tcl_DStringLength(&ds); /* # bytes, not Unicode chars */ nbytes += sizeof(WCHAR); /* Terminating \0 */ - dlgFilterPtr[i].pszSpec = ckalloc(nbytes); + dlgFilterPtr[i].pszSpec = (LPCWSTR)ckalloc(nbytes); memmove((void *)dlgFilterPtr[i].pszSpec, Tcl_DStringValue(&ds), nbytes); Tcl_DStringFree(&ds); Tcl_DStringSetLength(&patterns, 0); @@ -2626,7 +2628,7 @@ ChooseDirectoryValidateProc( Tcl_DString tempString; Tcl_DString initDirString; WCHAR string[MAX_PATH]; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (tsdPtr->debugFlag) { @@ -2789,7 +2791,7 @@ Tk_MessageBoxObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - Tk_Window tkwin = clientData, parent; + Tk_Window tkwin = (Tk_Window)clientData, parent; HWND hWnd; Tcl_Obj *messageObj, *titleObj, *detailObj, *tmpObj; int defaultBtn, icon, type; @@ -2803,7 +2805,7 @@ Tk_MessageBoxObjCmd( MSG_DEFAULT, MSG_DETAIL, MSG_ICON, MSG_MESSAGE, MSG_PARENT, MSG_TITLE, MSG_TYPE }; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_DString titleBuf, tmpBuf; LPCWSTR titlePtr, tmpPtr; @@ -2973,7 +2975,7 @@ MsgBoxCBTProc( WPARAM wParam, LPARAM lParam) { - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (nCode == HCBT_CREATEWND) { @@ -3020,7 +3022,7 @@ static void SetTkDialog( ClientData clientData) { - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); char buf[32]; @@ -3113,7 +3115,7 @@ ApplyLogfont( Tcl_Obj **objv, **tmpv; Tcl_ListObjGetElements(NULL, cmdObj, &objc, &objv); - tmpv = ckalloc(sizeof(Tcl_Obj *) * (objc + 2)); + tmpv = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj *) * (objc + 2)); memcpy(tmpv, objv, sizeof(Tcl_Obj *) * objc); tmpv[objc] = GetFontObj(hdc, logfontPtr); TkBackgroundEvalObjv(interp, objc+1, tmpv, TCL_EVAL_GLOBAL); @@ -3151,7 +3153,7 @@ HookProc( CHOOSEFONT *pcf = (CHOOSEFONT *) lParam; HWND hwndCtrl; static HookData *phd = NULL; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (WM_INITDIALOG == msg && lParam != 0) { @@ -3294,14 +3296,14 @@ FontchooserConfigureCmd( int objc, Tcl_Obj *const objv[]) { - Tk_Window tkwin = clientData; + Tk_Window tkwin = (Tk_Window)clientData; HookData *hdPtr = NULL; int i, r = TCL_OK; static const char *const optionStrings[] = { "-parent", "-title", "-font", "-command", "-visible", NULL }; - hdPtr = Tcl_GetAssocData(interp, "::tk::fontchooser", NULL); + hdPtr = (HookData *)Tcl_GetAssocData(interp, "::tk::fontchooser", NULL); /* * With no arguments we return all the options in a dict. @@ -3438,7 +3440,7 @@ FontchooserShowCmd( Tcl_Obj *const objv[]) { Tcl_DString ds; - Tk_Window tkwin = clientData, parent; + Tk_Window tkwin = (Tk_Window)clientData, parent; CHOOSEFONTW cf; LOGFONTW lf; HDC hdc; @@ -3447,7 +3449,7 @@ FontchooserShowCmd( (void)objc; (void)objv; - hdPtr = Tcl_GetAssocData(interp, "::tk::fontchooser", NULL); + hdPtr = (HookData *)Tcl_GetAssocData(interp, "::tk::fontchooser", NULL); parent = tkwin; if (hdPtr->parentObj) { diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c index 1257d46..b21376a 100644 --- a/win/tkWinDraw.c +++ b/win/tkWinDraw.c @@ -244,7 +244,7 @@ ConvertPoints( if (tsdPtr->winPoints != NULL) { ckfree(tsdPtr->winPoints); } - tsdPtr->winPoints = ckalloc(sizeof(POINT) * npoints); + tsdPtr->winPoints = (POINT *)ckalloc(sizeof(POINT) * npoints); if (tsdPtr->winPoints == NULL) { tsdPtr->nWinPoints = -1; return NULL; @@ -987,6 +987,7 @@ XFillPolygon( HPEN pen; TkWinDCState state; HDC dc; + (void)shape; if (d == None) { return BadDrawable; @@ -1407,6 +1408,7 @@ TkScrollWindow( { HWND hwnd = TkWinGetHWND(Tk_WindowId(tkwin)); RECT scrollRect; + (void)gc; scrollRect.left = x; scrollRect.top = y; @@ -1483,6 +1485,8 @@ TkpDrawHighlightBorder( int highlightWidth, Drawable drawable) { + (void)bgGC; + TkDrawInsetFocusHighlight(tkwin, fgGC, highlightWidth, drawable, 0); } diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c index 716d456..c6a8b94 100644 --- a/win/tkWinEmbed.c +++ b/win/tkWinEmbed.c @@ -69,7 +69,7 @@ void TkWinCleanupContainerList(void) { Container *nextPtr; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); for (; tsdPtr->firstContainerPtr != NULL; @@ -99,11 +99,16 @@ TkWinCleanupContainerList(void) /* ARGSUSED */ int TkpTestembedCmd( - ClientData clientData, + ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { + (void)dummy; + (void)interp; + (void)objc; + (void)objv; + return TCL_OK; } @@ -371,7 +376,7 @@ TkpMakeContainer( */ Tk_MakeWindowExist(tkwin); - containerPtr = ckalloc(sizeof(Container)); + containerPtr = (Container *)ckalloc(sizeof(Container)); containerPtr->parentPtr = winPtr; containerPtr->parentHWnd = Tk_GetHWND(Tk_WindowId(tkwin)); containerPtr->embeddedHWnd = NULL; @@ -1050,6 +1055,8 @@ TkpRedirectKeyEvent( XEvent *eventPtr) /* X event to redirect (should be KeyPress or * KeyRelease). */ { + (void)winPtr; + (void)eventPtr; /* not implemented */ } diff --git a/win/tkWinFont.c b/win/tkWinFont.c index 451dc68..7bea983 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -299,8 +299,8 @@ TkpGetNativeFont( } tkwin = (Tk_Window) ((TkWindow *) tkwin)->mainPtr->winPtr; - fontPtr = ckalloc(sizeof(WinFont)); - InitFont(tkwin, GetStockObject(object), 0, fontPtr); + fontPtr = (WinFont *)ckalloc(sizeof(WinFont)); + InitFont(tkwin, (HFONT)GetStockObject(object), 0, fontPtr); return (TkFont *) fontPtr; } @@ -557,7 +557,7 @@ TkpGetFontFromAttributes( hFont = GetScreenFont(faPtr, faceName, (int)(TkFontGetPixels(tkwin, faPtr->size) + 0.5), 0.0); if (tkFontPtr == NULL) { - fontPtr = ckalloc(sizeof(WinFont)); + fontPtr = (WinFont *)ckalloc(sizeof(WinFont)); } else { fontPtr = (WinFont *) tkFontPtr; ReleaseFont(fontPtr); @@ -660,6 +660,8 @@ WinFontFamilyEnumProc( WCHAR *faceName = lfPtr->elfLogFont.lfFaceName; Tcl_Obj *resultObj = (Tcl_Obj *) lParam; Tcl_DString faceString; + (void)tmPtr; + (void)fontType; Tcl_DStringInit(&faceString); Tcl_WCharToUtfDString(faceName, wcslen(faceName), &faceString); @@ -1079,6 +1081,7 @@ Tk_DrawChars( HDC dc; WinFont *fontPtr; TkWinDCState state; + (void)tkfont; fontPtr = (WinFont *) gc->font; display->request++; @@ -1227,6 +1230,7 @@ TkDrawAngledChars( HDC dc; WinFont *fontPtr; TkWinDCState state; + (void)tkfont; fontPtr = (WinFont *) gc->font; display->request++; @@ -1744,6 +1748,7 @@ AllocFontFamily( WCHAR buf[LF_FACESIZE]; ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + (void)base; hFont = SelectObject(hdc, hFont); GetTextFaceW(hdc, LF_FACESIZE, buf); @@ -2044,6 +2049,8 @@ WinFontCanUseProc( SubFont *subFontPtr; Tcl_DString faceString; Tcl_DString *nameTriedPtr; + (void)tmPtr; + (void)fontType; canUsePtr = (CanUse *) lParam; ch = canUsePtr->ch; @@ -2558,6 +2565,11 @@ WinFontExistProc( int fontType, /* Type of font (not used). */ LPARAM lParam) /* EnumFontData to hold result. */ { + (void)lfPtr; + (void)tmPtr; + (void)fontType; + (void)lParam; + return 0; } @@ -2766,8 +2778,8 @@ LoadFontRanges( segCount = subTable.segment.segCountX2 / 2; cbData = segCount * sizeof(USHORT); - startCount = ckalloc(cbData); - endCount = ckalloc(cbData); + startCount = (USHORT *)ckalloc(cbData); + endCount = (USHORT *)ckalloc(cbData); offset = encTable.offset + sizeof(subTable.segment); GetFontData(hdc, cmapKey, (DWORD) offset, endCount, cbData); @@ -2810,8 +2822,8 @@ LoadFontRanges( segCount = 1; cbData = segCount * sizeof(USHORT); - startCount = ckalloc(cbData); - endCount = ckalloc(cbData); + startCount = (USHORT *)ckalloc(cbData); + endCount = (USHORT *)ckalloc(cbData); startCount[0] = 0x0000; endCount[0] = 0x00ff; } diff --git a/win/tkWinImage.c b/win/tkWinImage.c index e1660a9..dfb72a8 100644 --- a/win/tkWinImage.c +++ b/win/tkWinImage.c @@ -212,7 +212,10 @@ XCreateImage( int bitmap_pad, int bytes_per_line) { - XImage* imagePtr = ckalloc(sizeof(XImage)); + XImage* imagePtr = (XImage*)ckalloc(sizeof(XImage)); + (void)display; + (void)visual; + imagePtr->width = width; imagePtr->height = height; imagePtr->xoffset = offset; @@ -300,6 +303,7 @@ XGetImageZPixmap( unsigned char *data; TkWinDCState state; BOOL ret; + (void)plane_mask; if (format != ZPixmap) { TkpDisplayWarning("Only ZPixmap types are implemented", @@ -350,7 +354,7 @@ XGetImageZPixmap( if (depth <= 8) { size += sizeof(unsigned short) << depth; } - bmInfo = ckalloc(size); + bmInfo = (BITMAPINFO *)ckalloc(size); bmInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmInfo->bmiHeader.biWidth = width; @@ -368,7 +372,7 @@ XGetImageZPixmap( unsigned char *p, *pend; GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_PAL_COLORS); - data = ckalloc(bmInfo->bmiHeader.biSizeImage); + data = (unsigned char *)ckalloc(bmInfo->bmiHeader.biSizeImage); if (!data) { /* printf("Failed to allocate data area for XImage.\n"); */ ret_image = NULL; @@ -404,7 +408,7 @@ XGetImageZPixmap( unsigned char *p; GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_PAL_COLORS); - data = ckalloc(bmInfo->bmiHeader.biSizeImage); + data = (unsigned char *)ckalloc(bmInfo->bmiHeader.biSizeImage); if (!data) { /* printf("Failed to allocate data area for XImage.\n"); */ ret_image = NULL; @@ -435,7 +439,7 @@ XGetImageZPixmap( } } else if (depth == 16) { GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_RGB_COLORS); - data = ckalloc(bmInfo->bmiHeader.biSizeImage); + data = (unsigned char *)ckalloc(bmInfo->bmiHeader.biSizeImage); if (!data) { /* printf("Failed to allocate data area for XImage.\n"); */ ret_image = NULL; @@ -461,7 +465,7 @@ XGetImageZPixmap( } } else { GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_RGB_COLORS); - data = ckalloc(width * height * 4); + data = (unsigned char *)ckalloc(width * height * 4); if (!data) { /* printf("Failed to allocate data area for XImage.\n"); */ ret_image = NULL; @@ -484,7 +488,7 @@ XGetImageZPixmap( unsigned int byte_width, h, w; byte_width = ((width * 3 + 3) & ~(unsigned)3); - smallBitBase = ckalloc(byte_width * height); + smallBitBase = (unsigned char *)ckalloc(byte_width * height); if (!smallBitBase) { ckfree(ret_image->data); ckfree(ret_image); @@ -614,7 +618,7 @@ XGetImage( imagePtr = XCreateImage(display, NULL, 32, format, 0, NULL, width, height, 32, 0); size = imagePtr->bytes_per_line * imagePtr->height; - imagePtr->data = ckalloc(size); + imagePtr->data = (char *)ckalloc(size); ZeroMemory(imagePtr->data, size); for (yy = 0; yy < height; yy++) { @@ -661,7 +665,7 @@ XGetImage( imagePtr = XCreateImage(display, NULL, 1, XYBitmap, 0, NULL, width, height, 32, 0); - imagePtr->data = ckalloc(imagePtr->bytes_per_line * imagePtr->height); + imagePtr->data = (char *)ckalloc(imagePtr->bytes_per_line * imagePtr->height); dc = GetDC(NULL); diff --git a/win/tkWinInit.c b/win/tkWinInit.c index 8f4ac5d..854d62f 100644 --- a/win/tkWinInit.c +++ b/win/tkWinInit.c @@ -35,6 +35,7 @@ int TkpInit( Tcl_Interp *interp) { + (void)interp; /* * This is necessary for static initialization, and is ok otherwise * because TkWinXInit flips a static bit to do its work just once. diff --git a/win/tkWinKey.c b/win/tkWinKey.c index 29f2ff0..43e9206 100644 --- a/win/tkWinKey.c +++ b/win/tkWinKey.c @@ -99,6 +99,7 @@ TkpGetString( XKeyEvent *keyEv = &eventPtr->xkey; int len; char buf[4]; + (void)winPtr; Tcl_DStringInit(dsPtr); if (keyEv->send_event == -1) { @@ -155,6 +156,7 @@ XKeycodeToKeysym( int index) { int state = 0; + (void)display; if (index & 0x01) { state |= ShiftMask; @@ -504,7 +506,7 @@ TkpInitKeymapInfo( } dispPtr->numModKeyCodes = 0; arraySize = KEYCODE_ARRAY_SIZE; - dispPtr->modKeyCodes = ckalloc(KEYCODE_ARRAY_SIZE * sizeof(KeyCode)); + dispPtr->modKeyCodes = (KeyCode *)ckalloc(KEYCODE_ARRAY_SIZE * sizeof(KeyCode)); for (i = 0, codePtr = modMapPtr->modifiermap; i < max; i++, codePtr++) { if (*codePtr == 0) { continue; @@ -520,18 +522,18 @@ TkpInitKeymapInfo( } } if (dispPtr->numModKeyCodes >= arraySize) { - KeyCode *new; + KeyCode *newKey; /* * Ran out of space in the array; grow it. */ arraySize *= 2; - new = ckalloc(arraySize * sizeof(KeyCode)); - memcpy(new, dispPtr->modKeyCodes, + newKey = (KeyCode *)ckalloc(arraySize * sizeof(KeyCode)); + memcpy(newKey, dispPtr->modKeyCodes, dispPtr->numModKeyCodes * sizeof(KeyCode)); ckfree(dispPtr->modKeyCodes); - dispPtr->modKeyCodes = new; + dispPtr->modKeyCodes = newKey; } dispPtr->modKeyCodes[dispPtr->numModKeyCodes] = *codePtr; dispPtr->numModKeyCodes++; @@ -555,6 +557,7 @@ TkpSetKeycodeAndState( int i; SHORT result; int shift; + (void)tkwin; eventPtr->xkey.keycode = 0; if (keySym == NoSymbol) { @@ -611,6 +614,7 @@ XKeysymToKeycode( { int i; SHORT result; + (void)display; /* * We check our private map first for a virtual keycode, as VkKeyScan will @@ -656,10 +660,11 @@ XModifierKeymap * XGetModifierMapping( Display *display) { - XModifierKeymap *map = ckalloc(sizeof(XModifierKeymap)); + XModifierKeymap *map = (XModifierKeymap *)ckalloc(sizeof(XModifierKeymap)); + (void)display; map->max_keypermod = 1; - map->modifiermap = ckalloc(sizeof(KeyCode) * 8); + map->modifiermap = (KeyCode *)ckalloc(sizeof(KeyCode) * 8); map->modifiermap[ShiftMapIndex] = VK_SHIFT; map->modifiermap[LockMapIndex] = VK_CAPITAL; map->modifiermap[ControlMapIndex] = VK_CONTROL; @@ -717,6 +722,8 @@ KeySym XStringToKeysym( _Xconst char *string) { + (void)string; + return NoSymbol; } @@ -740,6 +747,8 @@ char * XKeysymToString( KeySym keysym) { + (void)keysym; + return NULL; } diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 2b5e9af..f3adb26 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -233,13 +233,13 @@ GetNewID( TkMenuEntry *mePtr, /* The menu we are working with. */ WORD *menuIDPtr) /* The resulting id. */ { - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); WORD curID = tsdPtr->lastCommandID; while (1) { Tcl_HashEntry *commandEntryPtr; - int new; + int isNew; /* * Try the next ID number, taking care to wrap rather than stray @@ -255,8 +255,8 @@ GetNewID( } commandEntryPtr = Tcl_CreateHashEntry(&tsdPtr->commandTable, - INT2PTR(curID), &new); - if (new) { + INT2PTR(curID), &isNew); + if (isNew) { Tcl_SetHashValue(commandEntryPtr, mePtr); *menuIDPtr = curID; tsdPtr->lastCommandID = curID; @@ -285,7 +285,7 @@ static void FreeID( WORD commandID) { - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* @@ -328,7 +328,7 @@ TkpNewMenu( HMENU winMenuHdl; Tcl_HashEntry *hashEntryPtr; int newEntry; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); winMenuHdl = CreatePopupMenu(); @@ -374,7 +374,7 @@ TkpDestroyMenu( { HMENU winMenuHdl = (HMENU) menuPtr->platformData; const char *searchName; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (menuPtr->menuFlags & MENU_RECONFIGURE_PENDING) { diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c index 8a97852..784a96d 100644 --- a/win/ttkWinXPTheme.c +++ b/win/ttkWinXPTheme.c @@ -1025,7 +1025,7 @@ static ElementInfo ElementInfoTable[] = { { "Menubutton.dropdown", &GenericElementSpec, L"TOOLBAR", TP_SPLITBUTTONDROPDOWN,toolbutton_statemap, NOPAD,0 }, { "Treeview.field", &GenericElementSpec, L"TREEVIEW", - TVP_TREEITEM, treeview_statemap, PAD(1, 1, 1, 1), 0 }, + TVP_TREEITEM, treeview_statemap, PAD(1, 1, 1, 1), IGNORE_THEMESIZE }, { "Treeitem.indicator", &TreeIndicatorElementSpec, L"TREEVIEW", TVP_GLYPH, tvpglyph_statemap, PAD(1,1,6,0), PAD_MARGINS }, { "Treeheading.border", &GenericElementSpec, L"HEADER", |