diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-10-28 14:20:10 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-10-28 14:20:10 (GMT) |
commit | 561fe24459c6d4f750c4ebe2a138aa563b1fb58c (patch) | |
tree | e673960f89c60cf441d8f7ccf2a0f29dcebfad18 /win | |
parent | 7cd7731a93610c00e44c811f86b7afd62e83b82e (diff) | |
download | tk-561fe24459c6d4f750c4ebe2a138aa563b1fb58c.zip tk-561fe24459c6d4f750c4ebe2a138aa563b1fb58c.tar.gz tk-561fe24459c6d4f750c4ebe2a138aa563b1fb58c.tar.bz2 |
Fix some C++ comments in ttkWinXPTheme.c (needed for MSVC++ 6.0)
Fix some typing errors in code comments.
Some eol-spacing elimination
Diffstat (limited to 'win')
-rw-r--r-- | win/tkWin.h | 8 | ||||
-rw-r--r-- | win/tkWinCursor.c | 2 | ||||
-rw-r--r-- | win/tkWinFont.c | 8 | ||||
-rw-r--r-- | win/tkWinInt.h | 4 | ||||
-rw-r--r-- | win/tkWinMenu.c | 2 | ||||
-rw-r--r-- | win/tkWinPort.h | 2 | ||||
-rw-r--r-- | win/ttkWinMonitor.c | 4 | ||||
-rw-r--r-- | win/ttkWinXPTheme.c | 46 |
8 files changed, 40 insertions, 36 deletions
diff --git a/win/tkWin.h b/win/tkWin.h index 00d3486..8e4bdef 100644 --- a/win/tkWin.h +++ b/win/tkWin.h @@ -43,9 +43,9 @@ /* * The following messages are used to communicate between a Tk toplevel - * and its container window. A Tk container may not be able to provide - * service to all of the following requests at the moment. But an embedded - * Tk window will send out these requests to support external Tk container + * and its container window. A Tk container may not be able to provide + * service to all of the following requests at the moment. But an embedded + * Tk window will send out these requests to support external Tk container * application. */ @@ -66,7 +66,7 @@ /* * The following are sub-messages (wParam) for TK_INFO. An embedded window may - * send a TK_INFO message with one of the sub-messages to query a container + * send a TK_INFO message with one of the sub-messages to query a container * for verification and availability */ #define TK_CONTAINER_VERIFY 0x01 diff --git a/win/tkWinCursor.c b/win/tkWinCursor.c index dee3419..cb36b29 100644 --- a/win/tkWinCursor.c +++ b/win/tkWinCursor.c @@ -104,7 +104,7 @@ TkGetCursorByName( /* * All cursor names are valid lists of one element (for - * Unix-compatability), even unadorned system cursor names. + * Unix-compatibility), even unadorned system cursor names. */ if (Tcl_SplitList(interp, string, &argc, &argv) != TCL_OK) { diff --git a/win/tkWinFont.c b/win/tkWinFont.c index 1292772..bdd0d05 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -338,7 +338,7 @@ CreateNamedSystemLogFont( { HFONT hFont; int r; - + hFont = CreateFontIndirect(logFontPtr); r = CreateNamedSystemFont(interp, tkwin, name, hFont); DeleteObject((HGDIOBJ)hFont); @@ -368,7 +368,7 @@ CreateNamedSystemFont( { WinFont winfont; int r; - + TkDeleteNamedFont(NULL, tkwin, name); InitFont(tkwin, hFont, 0, &winfont); r = TkCreateNamedFont(interp, tkwin, name, &winfont.font.fa); @@ -446,7 +446,7 @@ TkWinSetupSystemFonts(TkMainInfo *mainPtr) { LOGFONTA lfFixed = { 0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, - 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, "" + 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, "" }; long pointSize, dpi; HDC hdc = GetDC(NULL); @@ -457,7 +457,7 @@ TkWinSetupSystemFonts(TkMainInfo *mainPtr) CreateNamedSystemLogFont(interp, tkwin, "TkFixedFont", &lfFixed); } - /* + /* * Setup the remaining standard Tk font names as named fonts. */ diff --git a/win/tkWinInt.h b/win/tkWinInt.h index abac7b0..451457d 100644 --- a/win/tkWinInt.h +++ b/win/tkWinInt.h @@ -243,8 +243,8 @@ int TkpWmGetState(TkWindow *winPtr); /* * The following functions are not present in old versions of Windows - * API headers but are used in the Tk source to ensure 64bit - * compatability. + * API headers but are used in the Tk source to ensure 64bit + * compatibility. */ #ifndef GetClassLongPtr diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 5772f04..64d3d65 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -217,7 +217,7 @@ GetNewID( TkMenuEntry *mePtr, /* The menu we are working with. */ WORD *menuIDPtr) /* The resulting id. */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); WORD curID = tsdPtr->lastCommandID; diff --git a/win/tkWinPort.h b/win/tkWinPort.h index 2925dae..54e07b7 100644 --- a/win/tkWinPort.h +++ b/win/tkWinPort.h @@ -118,7 +118,7 @@ | ((p)->green & 0xff00) | (((p)->blue << 8) & 0xff0000)) | 0x20000000) /* - * These calls implement native bitmaps which are not currently + * These calls implement native bitmaps which are not currently * supported under Windows. The macros eliminate the calls. */ diff --git a/win/ttkWinMonitor.c b/win/ttkWinMonitor.c index 25c9c0c..6848a1b 100644 --- a/win/ttkWinMonitor.c +++ b/win/ttkWinMonitor.c @@ -74,7 +74,7 @@ CreateThemeMonitorWindow(HINSTANCE hinst, Tcl_Interp *interp) HWND hwnd = NULL; TCHAR title[32] = TEXT("TtkMonitorWindow"); TCHAR name[32] = TEXT("TtkMonitorClass"); - + wc.cbSize = sizeof(WNDCLASSEX); wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = (WNDPROC)WndProc; @@ -99,7 +99,7 @@ CreateThemeMonitorWindow(HINSTANCE hinst, Tcl_Interp *interp) return hwnd; } -static void +static void DestroyThemeMonitorWindow(void *clientData) { HWND hwnd = (HWND)clientData; diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c index 5bc2483..bd83dfa 100644 --- a/win/ttkWinXPTheme.c +++ b/win/ttkWinXPTheme.c @@ -106,7 +106,7 @@ LoadXPThemeProcs(HINSTANCE *phlib) * We have successfully loaded the library. Proceed in storing the * addresses of the functions we want to use. */ - XPThemeProcs *procs = (XPThemeProcs*)ckalloc(sizeof(XPThemeProcs)); + XPThemeProcs *procs = (XPThemeProcs *)ckalloc(sizeof(XPThemeProcs)); #define LOADPROC(name) \ (0 != (procs->name = (name ## Proc *)(void *)GetProcAddress(handle, #name) )) @@ -138,7 +138,7 @@ LoadXPThemeProcs(HINSTANCE *phlib) static void XPThemeDeleteProc(void *clientData) { - XPThemeData *themeData = clientData; + XPThemeData *themeData = (XPThemeData *)clientData; FreeLibrary(themeData->hlibrary); ckfree(clientData); } @@ -146,9 +146,11 @@ XPThemeDeleteProc(void *clientData) static int XPThemeEnabled(Ttk_Theme theme, void *clientData) { - XPThemeData *themeData = clientData; + XPThemeData *themeData = (XPThemeData *)clientData; int active = themeData->procs->IsThemeActive(); int themed = themeData->procs->IsAppThemed(); + (void)theme; + return (active && themed); } @@ -411,7 +413,7 @@ typedef struct static ElementData * NewElementData(XPThemeProcs *procs, ElementInfo *info) { - ElementData *elementData = (ElementData*)ckalloc(sizeof(ElementData)); + ElementData *elementData = (ElementData *)ckalloc(sizeof(ElementData)); elementData->procs = procs; elementData->info = info; @@ -427,7 +429,7 @@ NewElementData(XPThemeProcs *procs, ElementInfo *info) */ static void DestroyElementData(void *clientData) { - ElementData *elementData = clientData; + ElementData *elementData = (ElementData *)clientData; if (elementData->info->flags & HEAP_ELEMENT) { ckfree((char *)elementData->info->statemap); ckfree((char *)elementData->info->className); @@ -453,7 +455,7 @@ InitElementData(ElementData *elementData, Tk_Window tkwin, Drawable d) { Window win = Tk_WindowId(tkwin); - if (win != None) { + if (win) { elementData->hwnd = Tk_GetHWND(win); } else { elementData->hwnd = elementData->procs->stubWindow; @@ -495,9 +497,10 @@ static void GenericElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) { - ElementData *elementData = clientData; + ElementData *elementData = (ElementData *)clientData; HRESULT result; SIZE size; + (void)elementRecord; if (!InitElementData(elementData, tkwin, 0)) return; @@ -531,8 +534,9 @@ static void GenericElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, unsigned int state) { - ElementData *elementData = clientData; + ElementData *elementData = (ElementData *)clientData; RECT rc; + (void)elementRecord; if (!InitElementData(elementData, tkwin, d)) { return; @@ -576,7 +580,7 @@ GenericSizedElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) { - ElementData *elementData = clientData; + ElementData *elementData = (ElementData *)clientData; if (!InitElementData(elementData, tkwin, 0)) return; @@ -612,7 +616,7 @@ SpinboxArrowElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) { - ElementData *elementData = clientData; + ElementData *elementData = (ElementData *)clientData; if (!InitElementData(elementData, tkwin, 0)) return; @@ -641,9 +645,10 @@ static void ThumbElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, unsigned int state) { - ElementData *elementData = clientData; + ElementData *elementData = (ElementData *)clientData; unsigned stateId = Ttk_StateTableLookup(elementData->info->statemap, state); RECT rc = BoxToRect(b); + (void)elementRecord; /* * Don't draw the thumb if we are disabled. @@ -680,7 +685,7 @@ static void PbarElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) { - ElementData *elementData = clientData; + ElementData *elementData = (ElementData *)clientData; int nBars = 3; GenericElementSize(clientData, elementRecord, tkwin, @@ -720,9 +725,10 @@ static void TabElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, unsigned int state) { - ElementData *elementData = clientData; + ElementData *elementData = (ElementData *)clientData; int partId = elementData->info->partId; RECT rc = BoxToRect(b); + (void)elementRecord; if (!InitElementData(elementData, tkwin, d)) return; @@ -791,7 +797,7 @@ static Ttk_ElementSpec TreeIndicatorElementSpec = TreeIndicatorElementDraw }; -#if BROKEN_TEXT_ELEMENT +#ifdef BROKEN_TEXT_ELEMENT /* *---------------------------------------------------------------------- @@ -838,7 +844,7 @@ static void TextElementSize( Ttk_StateTableLookup(elementData->info->statemap, 0), Tcl_GetUnicode(element->textObj), -1, - DT_LEFT,// | DT_BOTTOM | DT_NOPREFIX, + DT_LEFT /* | DT_BOTTOM | DT_NOPREFIX */, NULL, &rc); @@ -871,7 +877,7 @@ static void TextElementDraw( Ttk_StateTableLookup(elementData->info->statemap, state), Tcl_GetUnicode(element->textObj), -1, - DT_LEFT,// | DT_BOTTOM | DT_NOPREFIX, + DT_LEFT /* | DT_BOTTOM | DT_NOPREFIX */, (state & TTK_STATE_DISABLED) ? DTT_GRAYED : 0, &rc); FreeElementData(elementData); @@ -1029,12 +1035,10 @@ static ElementInfo ElementInfoTable[] = { { "Spinbox.downarrow", &SpinboxArrowElementSpec, L"SPIN", SPNP_DOWN, spinbutton_statemap, NOPAD, PAD_MARGINS | ((SM_CXVSCROLL << 8) | SM_CYVSCROLL) }, - -#if BROKEN_TEXT_ELEMENT +#ifdef BROKEN_TEXT_ELEMENT { "Labelframe.text", &TextElementSpec, L"BUTTON", BP_GROUPBOX, groupbox_statemap, NOPAD,0 }, #endif - { 0,0,0,0,0,NOPAD,0 } }; #undef PAD @@ -1096,7 +1100,7 @@ Ttk_CreateVsapiElement( int objc, Tcl_Obj *const objv[]) { - XPThemeData *themeData = clientData; + XPThemeData *themeData = (XPThemeData *)clientData; ElementInfo *elementPtr = NULL; ClientData elementData; Tcl_UniChar *className; @@ -1227,7 +1231,7 @@ Ttk_CreateVsapiElement( elementPtr->flags = HEAP_ELEMENT | flags; /* set the element name to an allocated copy */ - name = ckalloc(strlen(elementName) + 1); + name = (char *)ckalloc(strlen(elementName) + 1); strcpy(name, elementName); elementPtr->elementName = name; |