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 | |
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
-rw-r--r-- | generic/tkCanvUtil.c | 2 | ||||
-rw-r--r-- | generic/tkImgPhoto.c | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXWm.c | 8 | ||||
-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 | ||||
-rw-r--r-- | xlib/xcolors.c | 6 |
12 files changed, 50 insertions, 46 deletions
diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c index bbf8bea..420e11a 100644 --- a/generic/tkCanvUtil.c +++ b/generic/tkCanvUtil.c @@ -757,7 +757,7 @@ TkSmoothParseProc( } /* - * Backward compatability hack. + * Backward compatibility hack. */ if (strncmp(value, "bezier", length) == 0) { diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index ffe4a3f..aaea896 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -6069,7 +6069,7 @@ ImgPhotoPostscript( * * Tk_PhotoPutBlock_NoComposite, Tk_PhotoPutZoomedBlock_NoComposite -- * - * These backward-compatability functions just exist to fill slots in stubs + * These backward-compatibility functions just exist to fill slots in stubs * table. For the behaviour of *_NoComposite, refer to the corresponding * function without the extra suffix, except that the compositing rule is * always "overlay" and the function always panics on memory-allocation @@ -6110,7 +6110,7 @@ Tk_PhotoPutZoomedBlock_NoComposite( * Tk_PhotoExpand_Panic, Tk_PhotoPutBlock_Panic, * Tk_PhotoPutZoomedBlock_Panic, Tk_PhotoSetSize_Panic * - * Backward compatability functions for preserving the old behaviour (i.e. + * Backward compatibility functions for preserving the old behaviour (i.e. * panic on memory allocation failure) so that extensions do not need to be * significantly updated to take account of TIP #116. These call the new * interface (i.e. the interface without the extra suffix), but panic if an diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index be7bf47..f4cc084 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -1568,7 +1568,7 @@ WmColormapwindowsCmd( wmPtr->cmapCount = windowObjc; /* - * On the Macintosh all of this is just an excercise in compatability as + * On the Macintosh all of this is just an excercise in compatibility as * we don't support colormaps. If we did they would be installed here. */ @@ -4677,7 +4677,7 @@ TkWmAddToColormapWindows( topPtr->wmInfoPtr->cmapCount = count+1; /* - * On the Macintosh all of this is just an excercise in compatability as + * On the Macintosh all of this is just an excercise in compatibility as * we don't support colormaps. If we did they would be installed here. */ } @@ -5965,7 +5965,7 @@ TkpChangeFocus( [win makeKeyAndOrderFront:NSApp]; } } - + /* * Remember the current serial number for the X server and issue a dummy * server request. This marks the position at which we changed the focus, @@ -6447,7 +6447,7 @@ TkMacOSXMakeFullscreen( [window setStyleMask: NSBorderlessWindowMask]; [NSApp setPresentationOptions: NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar]; - + #endif /*TK_GOT_AT_LEAST_SNOW_LEOPARD*/ } else { wmPtr->flags &= ~WM_FULLSCREEN; 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; diff --git a/xlib/xcolors.c b/xlib/xcolors.c index 7b7223c..b5fdd5d 100644 --- a/xlib/xcolors.c +++ b/xlib/xcolors.c @@ -347,14 +347,14 @@ XParseColor( /* * If *p does not point to the end of the string, there were invalid - * digits in the spec. Ergo, it is not a vailid color string. + * digits in the spec. Ergo, it is not a valid color string. * (Bug f0188aca9e) */ - + if (*p != '\0') { return 0; } - + switch ((int)(p-spec)) { case 3: colorPtr->red = US(((value >> 8) & 0xf) * 0x1111); |