diff options
author | marc_culler <marc.culler@gmail.com> | 2020-12-16 20:57:46 (GMT) |
---|---|---|
committer | marc_culler <marc.culler@gmail.com> | 2020-12-16 20:57:46 (GMT) |
commit | 59d5e464aca4d537b556e7d2e2a6f51267652347 (patch) | |
tree | 3ae4e3625b1b93155416b67b0eabf796022ccc68 | |
parent | 1015fa89c934c0680ab3ae7feba0bac896e12b55 (diff) | |
parent | d689479c933e288ddeafe93bd23e08836b79507e (diff) | |
download | tk-59d5e464aca4d537b556e7d2e2a6f51267652347.zip tk-59d5e464aca4d537b556e7d2e2a6f51267652347.tar.gz tk-59d5e464aca4d537b556e7d2e2a6f51267652347.tar.bz2 |
Code cleanup - patch from Christopher Chavez.
-rw-r--r-- | generic/tkMain.c | 8 | ||||
-rw-r--r-- | generic/ttk/ttkCache.c | 1 | ||||
-rw-r--r-- | generic/ttk/ttkElements.c | 1 | ||||
-rw-r--r-- | generic/ttk/ttkImage.c | 1 | ||||
-rw-r--r-- | generic/ttk/ttkInit.c | 1 | ||||
-rw-r--r-- | generic/ttk/ttkLayout.c | 1 | ||||
-rw-r--r-- | generic/ttk/ttkManager.c | 1 | ||||
-rw-r--r-- | generic/ttk/ttkNotebook.c | 3 | ||||
-rw-r--r-- | generic/ttk/ttkPanedwindow.c | 1 | ||||
-rw-r--r-- | generic/ttk/ttkProgress.c | 1 | ||||
-rw-r--r-- | generic/ttk/ttkScale.c | 2 | ||||
-rw-r--r-- | generic/ttk/ttkState.c | 1 | ||||
-rw-r--r-- | generic/ttk/ttkTagSet.c | 1 | ||||
-rw-r--r-- | generic/ttk/ttkTreeview.c | 2 | ||||
-rw-r--r-- | generic/ttk/ttkWidget.c | 1 | ||||
-rw-r--r-- | macosx/tkMacOSXColor.c | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXCursor.c | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXImage.c | 10 | ||||
-rw-r--r-- | macosx/tkMacOSXKeyEvent.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXNotify.c | 2 | ||||
-rw-r--r-- | macosx/ttkMacOSXTheme.c | 3 | ||||
-rw-r--r-- | tests/butGeom2.tcl | 2 | ||||
-rw-r--r-- | unix/tkUnixRFont.c | 1 |
23 files changed, 13 insertions, 41 deletions
diff --git a/generic/tkMain.c b/generic/tkMain.c index 32006b3..953a54f 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -15,14 +15,6 @@ */ #include "tkInt.h" -#include <ctype.h> -#include <stdio.h> -#include <string.h> -#ifdef NO_STDLIB_H -# include "../compat/stdlib.h" -#else -# include <stdlib.h> -#endif extern int TkCygwinMainEx(int, char **, Tcl_AppInitProc *, Tcl_Interp *); diff --git a/generic/ttk/ttkCache.c b/generic/ttk/ttkCache.c index e7f885f..c29007c 100644 --- a/generic/ttk/ttkCache.c +++ b/generic/ttk/ttkCache.c @@ -28,7 +28,6 @@ * but this will be a transient effect. */ -#include <stdio.h> /* for sprintf */ #include "tkInt.h" #include "ttkTheme.h" diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index c4469dc..4dd2adb 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -6,7 +6,6 @@ */ #include "tkInt.h" -#include <string.h> #include "ttkTheme.h" #include "ttkWidget.h" diff --git a/generic/ttk/ttkImage.c b/generic/ttk/ttkImage.c index 5c2a55f..2ef30e0 100644 --- a/generic/ttk/ttkImage.c +++ b/generic/ttk/ttkImage.c @@ -10,7 +10,6 @@ * [style map]. */ -#include <string.h> #include "tkInt.h" #include "ttkTheme.h" diff --git a/generic/ttk/ttkInit.c b/generic/ttk/ttkInit.c index f1b6e26..0bda18b 100644 --- a/generic/ttk/ttkInit.c +++ b/generic/ttk/ttkInit.c @@ -4,7 +4,6 @@ * Ttk package: initialization routine and miscellaneous utilities. */ -#include <string.h> #include "tkInt.h" #include "ttkTheme.h" #include "ttkWidget.h" diff --git a/generic/ttk/ttkLayout.c b/generic/ttk/ttkLayout.c index fdbeacf..ed61a1c 100644 --- a/generic/ttk/ttkLayout.c +++ b/generic/ttk/ttkLayout.c @@ -6,7 +6,6 @@ * Copyright (c) 2003 Joe English. Freely redistributable. */ -#include <string.h> #include "tkInt.h" #include "ttkThemeInt.h" diff --git a/generic/ttk/ttkManager.c b/generic/ttk/ttkManager.c index 8cad58c..a47d8dc 100644 --- a/generic/ttk/ttkManager.c +++ b/generic/ttk/ttkManager.c @@ -4,7 +4,6 @@ * Support routines for geometry managers. */ -#include <string.h> #include "tkInt.h" #include "ttkManager.h" diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 83075bc..ea82ef1 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -3,9 +3,6 @@ */ #include "tkInt.h" -#include <string.h> -#include <ctype.h> -#include <stdio.h> #include "ttkTheme.h" #include "ttkWidget.h" diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c index fa0d5c8..4fbbf94 100644 --- a/generic/ttk/ttkPanedwindow.c +++ b/generic/ttk/ttkPanedwindow.c @@ -6,7 +6,6 @@ * TODO: track active/pressed sash. */ -#include <string.h> #include "tkInt.h" #include "ttkManager.h" #include "ttkTheme.h" diff --git a/generic/ttk/ttkProgress.c b/generic/ttk/ttkProgress.c index 42da84d..f65cb08 100644 --- a/generic/ttk/ttkProgress.c +++ b/generic/ttk/ttkProgress.c @@ -4,7 +4,6 @@ * ttk::progressbar widget. */ -#include <math.h> #include "tkInt.h" #include "ttkTheme.h" #include "ttkWidget.h" diff --git a/generic/ttk/ttkScale.c b/generic/ttk/ttkScale.c index 4d05f97..a4b2a4e 100644 --- a/generic/ttk/ttkScale.c +++ b/generic/ttk/ttkScale.c @@ -4,8 +4,6 @@ * ttk::scale widget. */ -#include <string.h> -#include <stdio.h> #include "tkInt.h" #include "ttkTheme.h" #include "ttkWidget.h" diff --git a/generic/ttk/ttkState.c b/generic/ttk/ttkState.c index d37f7f6..9e5cf4b 100644 --- a/generic/ttk/ttkState.c +++ b/generic/ttk/ttkState.c @@ -5,7 +5,6 @@ * */ -#include <string.h> #include "tkInt.h" #include "ttkTheme.h" diff --git a/generic/ttk/ttkTagSet.c b/generic/ttk/ttkTagSet.c index fc026cb..0ce5cea 100644 --- a/generic/ttk/ttkTagSet.c +++ b/generic/ttk/ttkTagSet.c @@ -4,7 +4,6 @@ * Copyright (C) 2005, Joe English. Freely redistributable. */ -#include <string.h> /* for memset() */ #include "tkInt.h" #include "ttkTheme.h" diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 0a156a5..41b05e5 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -4,8 +4,6 @@ * ttk::treeview widget implementation. */ -#include <string.h> -#include <stdio.h> #include "tkInt.h" #include "ttkTheme.h" #include "ttkWidget.h" diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c index 9992d27..0cfc119 100644 --- a/generic/ttk/ttkWidget.c +++ b/generic/ttk/ttkWidget.c @@ -4,7 +4,6 @@ * Core widget utilities. */ -#include <string.h> #include "tkInt.h" #include "ttkTheme.h" #include "ttkWidget.h" diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index 99606e0..edcd5d3 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.c @@ -547,7 +547,7 @@ TkMacOSXSetColorInContext( CGColorRef cgColor = nil; SystemColorDatum *entry = GetEntryFromPixel(pixel); CGRect rect; - HIThemeBackgroundDrawInfo info = {0, kThemeStateActive, 0};; + HIThemeBackgroundDrawInfo info = {0, kThemeStateActive, 0}; if (entry) { switch (entry->type) { @@ -619,7 +619,7 @@ TkpGetColor( Colormap colormap = tkwin ? Tk_Colormap(tkwin) : noColormap; NSView *view = nil; static Bool initialized = NO; - static NSColorSpace* sRGB = NULL; + static NSColorSpace* sRGB = nil; if (!initialized) { initialized = YES; diff --git a/macosx/tkMacOSXCursor.c b/macosx/tkMacOSXCursor.c index 4b2de7f..191aa7e 100644 --- a/macosx/tkMacOSXCursor.c +++ b/macosx/tkMacOSXCursor.c @@ -271,7 +271,7 @@ FindCursorByName( break; case IMAGEBITMAP: { unsigned char *bitmap = (unsigned char *)(cursorNames[idx].id1); - NSBitmapImageRep *bitmapImageRep = NULL; + NSBitmapImageRep *bitmapImageRep = nil; CGImageRef img = NULL, mask = NULL, maskedImg = NULL; static const CGFloat decodeWB[] = {1, 0}; CGColorSpaceRef colorspace = CGColorSpaceCreateWithName( @@ -466,7 +466,7 @@ TkpFreeCursor( TkMacOSXCursor *macCursorPtr = (TkMacOSXCursor *) cursorPtr; [macCursorPtr->macCursor release]; - macCursorPtr->macCursor = NULL; + macCursorPtr->macCursor = nil; if (macCursorPtr == gCurrentCursor) { gCurrentCursor = NULL; } diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c index 2604dfa..74c0115 100644 --- a/macosx/tkMacOSXImage.c +++ b/macosx/tkMacOSXImage.c @@ -414,7 +414,7 @@ XPutImage( int dest_x, /* Destination X & Y. */ int dest_y, unsigned int width, /* Same width & height for both */ - unsigned int height) /* distination and source. */ + unsigned int height) /* destination and source. */ { TkMacOSXDrawingContext dc; MacDrawable *macDraw = (MacDrawable *)drawable; @@ -529,8 +529,8 @@ CreateCGImageFromDrawableRect( MacDrawable *mac_drawable = (MacDrawable *)drawable; CGContextRef cg_context = NULL; CGImageRef cg_image = NULL, result = NULL; - NSBitmapImageRep *bitmapRep = NULL; - NSView *view = NULL; + NSBitmapImageRep *bitmapRep = nil; + NSView *view = nil; if (mac_drawable->flags & TK_IS_PIXMAP) { /* * This MacDrawable is a bitmap, so its view is NULL. @@ -544,7 +544,7 @@ CreateCGImageFromDrawableRect( result = CGImageCreateWithImageInRect(cg_image, image_rect); CGImageRelease(cg_image); } - } else if (TkMacOSXGetNSViewForDrawable(mac_drawable) != NULL) { + } else if (TkMacOSXGetNSViewForDrawable(mac_drawable) != nil) { /* * Convert Tk top-left to NSView bottom-left coordinates. @@ -642,7 +642,7 @@ XGetImage( unsigned long plane_mask, int format) { - NSBitmapImageRep* bitmapRep = NULL; + NSBitmapImageRep* bitmapRep = nil; NSUInteger bitmap_fmt = 0; XImage* imagePtr = NULL; char* bitmap = NULL; diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index fdf4e66..1dc3982 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -268,7 +268,7 @@ static NSUInteger textInputModifiers; @implementation TKContentView @synthesize tkDirtyRect = _tkDirtyRect; -@synthesize tkNeedsDisplay = _tkNeedsDisplay;; +@synthesize tkNeedsDisplay = _tkNeedsDisplay; /* * Implementation of the NSTextInputClient protocol. diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index b32c635..343c245 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -333,7 +333,7 @@ TkMacOSXNotifyExitHandler( * None. * * Side effects: - * Parts of windows my get redrawn. + * Parts of windows may get redrawn. * *---------------------------------------------------------------------- */ diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index a723408..ea65e2d 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -31,7 +31,6 @@ #include "tkMacOSXPrivate.h" #include "ttk/ttkTheme.h" -#include <math.h> /* * Macros for handling drawing contexts. @@ -2886,7 +2885,7 @@ static Ttk_ElementSpec ToolbarBackgroundElementSpec = { * +++ Field elements -- * * Used for the Treeview widget. This is like the BackgroundElement - * except that the fieldbackground color is configureable. + * except that the fieldbackground color is configurable. */ typedef struct { diff --git a/tests/butGeom2.tcl b/tests/butGeom2.tcl index 096225c..844f912 100644 --- a/tests/butGeom2.tcl +++ b/tests/butGeom2.tcl @@ -8,7 +8,7 @@ wm iconname .t "Button Geometry" wm geom .t +0+0 wm minsize .t 1 1 -label .t.l -text {This screen exercises the color options for various flavors of buttons. Select display options below, and they will be applied to the appropiate button widgets.} -wraplength 5i +label .t.l -text {This screen exercises the color options for various flavors of buttons. Select display options below, and they will be applied to the appropriate button widgets.} -wraplength 5i pack .t.l -side top -fill both button .t.quit -text Quit -command {destroy .t} diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index 340b5a9..226445c 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -12,7 +12,6 @@ #include "tkUnixInt.h" #include "tkFont.h" #include <X11/Xft/Xft.h> -#include <ctype.h> #define MAX_CACHED_COLORS 16 |