diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-06-25 21:27:04 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-06-25 21:27:04 (GMT) |
commit | fdf8a62f8c24e498f5444a5a110fb51c3b01b8c8 (patch) | |
tree | 5bd30b34c8a4c32bbec36f3ad458b295430934e5 | |
parent | a3129322d24fa7319ca3ad4ec44b37a5ab4f4ec0 (diff) | |
download | tk-fdf8a62f8c24e498f5444a5a110fb51c3b01b8c8.zip tk-fdf8a62f8c24e498f5444a5a110fb51c3b01b8c8.tar.gz tk-fdf8a62f8c24e498f5444a5a110fb51c3b01b8c8.tar.bz2 |
CONST -> const. Eliminate unnecessary type-casts and end-of-line spacing
-rw-r--r-- | generic/tkCanvPs.c | 2 | ||||
-rw-r--r-- | generic/tkCanvas.c | 4 | ||||
-rw-r--r-- | generic/tkPlace.c | 2 | ||||
-rw-r--r-- | generic/tkStyle.c | 2 | ||||
-rw-r--r-- | generic/tkText.c | 2 | ||||
-rw-r--r-- | generic/tkTextDisp.c | 4 | ||||
-rw-r--r-- | generic/tkTextIndex.c | 18 | ||||
-rw-r--r-- | generic/tkWindow.c | 2 | ||||
-rw-r--r-- | library/text.tcl | 2 | ||||
-rw-r--r-- | macosx/README | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXHLEvents.c | 8 | ||||
-rw-r--r-- | macosx/tkMacOSXInit.c | 34 | ||||
-rw-r--r-- | macosx/tkMacOSXPrivate.h | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXServices.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXTest.c | 3 | ||||
-rw-r--r-- | unix/tkUnix3d.c | 2 | ||||
-rw-r--r-- | unix/tkUnixColor.c | 2 |
17 files changed, 46 insertions, 47 deletions
diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c index 2bfdcc5..4e41a2a 100644 --- a/generic/tkCanvPs.c +++ b/generic/tkCanvPs.c @@ -381,7 +381,7 @@ TkCanvPostscriptCmd( */ psInfo.chan = Tcl_GetChannel(interp, psInfo.channelName, &mode); - if (psInfo.chan == (Tcl_Channel) NULL) { + if (psInfo.chan == NULL) { result = TCL_ERROR; goto cleanup; } diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 414c6fb..4d260dc 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -698,7 +698,7 @@ Tk_CanvasObjCmd( canvasPtr->textInfo.cursorOn = 0; canvasPtr->insertOnTime = 0; canvasPtr->insertOffTime = 0; - canvasPtr->insertBlinkHandler = (Tcl_TimerToken) NULL; + canvasPtr->insertBlinkHandler = NULL; canvasPtr->xOrigin = canvasPtr->yOrigin = 0; canvasPtr->drawableXOrigin = canvasPtr->drawableYOrigin = 0; canvasPtr->bindingTable = NULL; @@ -5307,7 +5307,7 @@ CanvasFocusProc( } else { canvasPtr->textInfo.gotFocus = 0; canvasPtr->textInfo.cursorOn = 0; - canvasPtr->insertBlinkHandler = (Tcl_TimerToken) NULL; + canvasPtr->insertBlinkHandler = NULL; } EventuallyRedrawItem(canvasPtr, canvasPtr->textInfo.focusItemPtr); if (canvasPtr->highlightWidth > 0) { diff --git a/generic/tkPlace.c b/generic/tkPlace.c index 7aa9b04..59b8a2b 100644 --- a/generic/tkPlace.c +++ b/generic/tkPlace.c @@ -616,7 +616,7 @@ ConfigureSlave( Tk_SavedOptions savedOptions; int mask; Slave *slavePtr; - Tk_Window masterWin = (Tk_Window) NULL; + Tk_Window masterWin = NULL; TkWindow *master; if (Tk_TopWinHierarchy(tkwin)) { diff --git a/generic/tkStyle.c b/generic/tkStyle.c index e7401df..d9299d1 100644 --- a/generic/tkStyle.c +++ b/generic/tkStyle.c @@ -1360,7 +1360,7 @@ Tk_GetStyle( "style \"%s\" doesn't exist", name)); Tcl_SetErrorCode(interp, "TK", "LOOKUP", "STYLE", name, NULL); } - return (Tk_Style) NULL; + return NULL; } stylePtr = Tcl_GetHashValue(entryPtr); diff --git a/generic/tkText.c b/generic/tkText.c index ab06089..7c62621 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -4927,7 +4927,7 @@ DumpLine( TkTextEmbWindow *ewPtr = &segPtr->body.ew; const char *pathname; - if (ewPtr->tkwin == (Tk_Window) NULL) { + if (ewPtr->tkwin == NULL) { pathname = ""; } else { pathname = Tk_PathName(ewPtr->tkwin); diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index fcefb9a..c848fd2 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -626,7 +626,7 @@ static void AsyncUpdateLineMetrics(ClientData clientData); static void GenerateWidgetViewSyncEvent(TkText *textPtr, Bool InSync); static void AsyncUpdateYScrollbar(ClientData clientData); static int IsStartOfNotMergedLine(TkText *textPtr, - CONST TkTextIndex *indexPtr); + const TkTextIndex *indexPtr); /* * Result values returned by TextGetScrollInfoObj: @@ -6988,7 +6988,7 @@ FindDLine( static int IsStartOfNotMergedLine( TkText *textPtr, /* Widget record for text widget. */ - CONST TkTextIndex *indexPtr) /* Index to check. */ + const TkTextIndex *indexPtr) /* Index to check. */ { TkTextIndex indexPtr2; diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index 582e1a8..7430197 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -40,9 +40,9 @@ static const char * StartEnd(TkText *textPtr, const char *string, static int GetIndex(Tcl_Interp *interp, TkSharedText *sharedPtr, TkText *textPtr, const char *string, TkTextIndex *indexPtr, int *canCachePtr); -static int IndexCountBytesOrdered(CONST TkText *textPtr, - CONST TkTextIndex *indexPtr1, - CONST TkTextIndex *indexPtr2); +static int IndexCountBytesOrdered(const TkText *textPtr, + const TkTextIndex *indexPtr1, + const TkTextIndex *indexPtr2); /* * The "textindex" Tcl_Obj definition: @@ -1636,9 +1636,9 @@ TkTextIndexForwChars( int TkTextIndexCountBytes( - CONST TkText *textPtr, - CONST TkTextIndex *indexPtr1, /* Index describing one location. */ - CONST TkTextIndex *indexPtr2) /* Index describing second location. */ + const TkText *textPtr, + const TkTextIndex *indexPtr1, /* Index describing one location. */ + const TkTextIndex *indexPtr2) /* Index describing second location. */ { int compare = TkTextIndexCmp(indexPtr1, indexPtr2); @@ -1653,11 +1653,11 @@ TkTextIndexCountBytes( static int IndexCountBytesOrdered( - CONST TkText *textPtr, - CONST TkTextIndex *indexPtr1, + const TkText *textPtr, + const TkTextIndex *indexPtr1, /* Index describing location of character from * which to count. */ - CONST TkTextIndex *indexPtr2) + const TkTextIndex *indexPtr2) /* Index describing location of last character * at which to stop the count. */ { diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 917d3bd..ee8e1a9 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -852,7 +852,7 @@ TkCreateMainWindow( * Create the basic TkWindow structure. */ - tkwin = CreateTopLevelWindow(interp, (Tk_Window) NULL, baseName, + tkwin = CreateTopLevelWindow(interp, NULL, baseName, screenName, /* flags */ 0); if (tkwin == NULL) { return NULL; diff --git a/library/text.tcl b/library/text.tcl index d53aa32..7d12e18 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -1212,6 +1212,6 @@ proc ::tk::TextScanDrag {w x y} { } if {[info exists Priv(mouseMoved)] && $Priv(mouseMoved)} { $w scan dragto $x $y - } + } } diff --git a/macosx/README b/macosx/README index f35c128..7df4893 100644 --- a/macosx/README +++ b/macosx/README @@ -702,7 +702,7 @@ that LaunchServices is launching the correct Wish.app. Instructions for doing this are provided below. The command line tool which manages the LaunchServices database has -an amazingly unwieldy path name. So, first, run this command: +an amazingly unwieldy path name. So, first, run this command: alias lsregister='/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister' diff --git a/macosx/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c index d2843a8..0f63ea6 100644 --- a/macosx/tkMacOSXHLEvents.c +++ b/macosx/tkMacOSXHLEvents.c @@ -126,7 +126,7 @@ static int ReallyKillMe(Tcl_Event *eventPtr, int flags); - (void) handlePrintDocumentsEvent: (NSAppleEventDescriptor *)event withReplyEvent: (NSAppleEventDescriptor *)replyEvent { - + NSString* file = [[event paramDescriptorForKeyword:keyDirectObject] stringValue]; const char *printFile=[file UTF8String]; @@ -134,7 +134,7 @@ static int ReallyKillMe(Tcl_Event *eventPtr, int flags); Tcl_DStringInit(&print); if (Tcl_FindCommand(_eventInterp, "::tk::mac::PrintDocument", NULL, 0)) { Tcl_DStringAppend(&print, "::tk::mac::PrintDocument", -1); - } + } Tcl_DStringAppendElement(&print, printFile); int tclErr = Tcl_EvalEx(_eventInterp, Tcl_DStringValue(&print), Tcl_DStringLength(&print), TCL_EVAL_GLOBAL); @@ -272,7 +272,7 @@ static int ReallyKillMe(Tcl_Event *eventPtr, int flags); Tcl_DStringInit(&launch); if (Tcl_FindCommand(_eventInterp, "::tk::mac::LaunchURL", NULL, 0)) { Tcl_DStringAppend(&launch, "::tk::mac::LaunchURL", -1); - } + } Tcl_DStringAppendElement(&launch, cURL); int tclErr = Tcl_EvalEx(_eventInterp, Tcl_DStringValue(&launch), Tcl_DStringLength(&launch), TCL_EVAL_GLOBAL); @@ -454,7 +454,7 @@ TkMacOSXInitAppleEvents( [aeManager setEventHandler:NSApp andSelector:@selector(handleURLEvent:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL]; - + } } diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index 3efe0c6..bf0b9f2 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -388,14 +388,14 @@ TkpInit( TkMacOSXRegisterServiceWidgetObjCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "::tk::mac::iconBitmap", TkMacOSXIconBitmapObjCmd, NULL, NULL); - Tcl_CreateObjCommand(interp, "::tk::mac::GetAppPath", TkMacOSXGetAppPath,(ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); + Tcl_CreateObjCommand(interp, "::tk::mac::GetAppPath", TkMacOSXGetAppPath, NULL, NULL); /* * Initialize the NSServices object here. Apple's docs say to do this - * in applicationDidFinishLaunching, but the Tcl interpreter is not - * initialized until this function call. + * in applicationDidFinishLaunching, but the Tcl interpreter is not + * initialized until this function call. */ - + TkMacOSXServices_Init(interp); return TCL_OK; @@ -457,28 +457,28 @@ int TkMacOSXGetAppPath( ClientData cd, Tcl_Interp *ip, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { CFURLRef mainBundleURL = CFBundleCopyBundleURL(CFBundleGetMainBundle()); - - /* - * Convert the URL reference into a string reference. + + /* + * Convert the URL reference into a string reference. */ - + CFStringRef appPath = CFURLCopyFileSystemPath(mainBundleURL, kCFURLPOSIXPathStyle); - - /* - * Get the system encoding method. + + /* + * Get the system encoding method. */ - + CFStringEncoding encodingMethod = CFStringGetSystemEncoding(); - - /* - * Convert the string reference into a C string. + + /* + * Convert the string reference into a C string. */ - + char *path = (char *) CFStringGetCStringPtr(appPath, encodingMethod); Tcl_SetResult(ip, path, NULL); diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index a67f894..98ee54f 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -431,7 +431,7 @@ VISIBILITY_HIDDEN #endif /* _TKMACPRIV */ -int TkMacOSXGetAppPath(ClientData cd, Tcl_Interp *ip, int objc, Tcl_Obj *CONST objv[]); +int TkMacOSXGetAppPath(ClientData cd, Tcl_Interp *ip, int objc, Tcl_Obj *const objv[]); /* * Local Variables: diff --git a/macosx/tkMacOSXServices.c b/macosx/tkMacOSXServices.c index 6ecb12d..809c708 100644 --- a/macosx/tkMacOSXServices.c +++ b/macosx/tkMacOSXServices.c @@ -158,7 +158,7 @@ TkMacOSXRegisterServiceWidgetObjCmd( ClientData cd, Tcl_Interp *ip, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { /* * Need proper number of args. diff --git a/macosx/tkMacOSXTest.c b/macosx/tkMacOSXTest.c index eabc14e..f109b7a 100644 --- a/macosx/tkMacOSXTest.c +++ b/macosx/tkMacOSXTest.c @@ -50,8 +50,7 @@ TkplatformtestInit( */ #if MAC_OS_X_VERSION_MAX_ALLOWED < 1080 - Tcl_CreateObjCommand(interp, "debugger", DebuggerObjCmd, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); + Tcl_CreateObjCommand(interp, "debugger", DebuggerObjCmd, NULL, NULL); #endif return TCL_OK; diff --git a/unix/tkUnix3d.c b/unix/tkUnix3d.c index 2969de1..7ea67a1 100644 --- a/unix/tkUnix3d.c +++ b/unix/tkUnix3d.c @@ -443,7 +443,7 @@ TkpGetShadows( } if (borderPtr->shadow == None) { - borderPtr->shadow = Tk_GetBitmap((Tcl_Interp *) NULL, tkwin, + borderPtr->shadow = Tk_GetBitmap(NULL, tkwin, Tk_GetUid("gray50")); if (borderPtr->shadow == None) { Tcl_Panic("TkpGetShadows couldn't allocate bitmap for border"); diff --git a/unix/tkUnixColor.c b/unix/tkUnixColor.c index 43500ad..ccc6f33 100644 --- a/unix/tkUnixColor.c +++ b/unix/tkUnixColor.c @@ -157,7 +157,7 @@ TkpGetColor( } if (strlen(name) > 99) { /* Don't bother to parse this. [Bug 2809525]*/ - return (TkColor *) NULL; + return NULL; } else if (XAllocNamedColor(display, colormap, name, &screen, &color) != 0) { DeleteStressedCmap(display, colormap); } else { |