diff options
39 files changed, 295 insertions, 315 deletions
diff --git a/generic/tkAtom.c b/generic/tkAtom.c index a9503c7..57e6923 100644 --- a/generic/tkAtom.c +++ b/generic/tkAtom.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkAtom.c,v 1.11 2008/10/30 23:18:59 nijtmans Exp $ + * RCS: @(#) $Id: tkAtom.c,v 1.12 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -145,7 +145,7 @@ Tk_GetAtomName( char *mustFree = NULL; handler = Tk_CreateErrorHandler(dispPtr->display, BadAtom, -1, -1, - NULL, (ClientData) NULL); + NULL, NULL); name = mustFree = XGetAtomName(dispPtr->display, atom); if (name == NULL) { name = "?bad atom?"; diff --git a/generic/tkBind.c b/generic/tkBind.c index 2277917..1dafaa2 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkBind.c,v 1.58 2009/12/16 22:00:31 nijtmans Exp $ + * RCS: @(#) $Id: tkBind.c,v 1.59 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -1622,8 +1622,8 @@ Tk_BindEvent( Tcl_Panic("Tk_BindEvent: missing command"); } if (sourcePtr->eventProc == EvalTclBinding) { - ExpandPercents(winPtr, (char *) sourcePtr->clientData, - eventPtr, detail.keySym, &scripts); + ExpandPercents(winPtr, sourcePtr->clientData, eventPtr, + detail.keySym, &scripts); } else { if (matchCount >= matchSpace) { PendingBinding *newPtr; diff --git a/generic/tkBitmap.c b/generic/tkBitmap.c index 14b4985..f7f648f 100644 --- a/generic/tkBitmap.c +++ b/generic/tkBitmap.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkBitmap.c,v 1.27 2009/11/21 17:24:42 dkf Exp $ + * RCS: @(#) $Id: tkBitmap.c,v 1.28 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -309,7 +309,7 @@ GetBitmap( Pixmap bitmap; int isNew, width, height, dummy2; TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!dispPtr->bitmapInit) { @@ -483,7 +483,7 @@ Tk_DefineBitmap( int isNew; Tcl_HashEntry *predefHashPtr; TkPredefBitmap *predefPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* @@ -679,7 +679,7 @@ Tk_FreeBitmap( if (idHashPtr == NULL) { Tcl_Panic("Tk_FreeBitmap received unknown bitmap argument"); } - FreeBitmap((TkBitmap *) Tcl_GetHashValue(idHashPtr)); + FreeBitmap(Tcl_GetHashValue(idHashPtr)); } /* @@ -838,7 +838,7 @@ Tk_GetBitmapFromData( char string[16 + TCL_INTEGER_SPACE]; char *name; TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!tsdPtr->initialized) { @@ -1030,7 +1030,7 @@ BitmapInit( * or NULL if unavailable. */ { Tcl_Interp *dummy; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* @@ -1208,7 +1208,7 @@ TkDebugBitmap( Tcl_HashTable * TkGetBitmapPredefTable(void) { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); return &tsdPtr->predefBitmapTable; diff --git a/generic/tkButton.c b/generic/tkButton.c index a0968bc..70b77d0 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkButton.c,v 1.35 2009/06/29 14:35:01 das Exp $ + * RCS: @(#) $Id: tkButton.c,v 1.36 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -633,7 +633,7 @@ ButtonCreate( TkButton *butPtr; Tk_OptionTable optionTable; Tk_Window tkwin; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!tsdPtr->defaultsInitialized) { @@ -1336,9 +1336,7 @@ TkButtonWorldChanged( XGCValues gcValues; GC newGC; unsigned long mask; - TkButton *butPtr; - - butPtr = (TkButton *) instanceData; + TkButton *butPtr = instanceData; /* * Recompute GCs. diff --git a/generic/tkCanvImg.c b/generic/tkCanvImg.c index 5cf3b6c..afcc3a5 100644 --- a/generic/tkCanvImg.c +++ b/generic/tkCanvImg.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvImg.c,v 1.14 2009/02/03 23:55:47 nijtmans Exp $ + * RCS: @(#) $Id: tkCanvImg.c,v 1.15 2010/01/02 22:52:38 dkf Exp $ */ #include <stdio.h> @@ -321,7 +321,7 @@ ConfigureImage( } if (imgPtr->imageString != NULL) { image = Tk_GetImage(interp, tkwin, imgPtr->imageString, - ImageChangedProc, (ClientData) imgPtr); + ImageChangedProc, imgPtr); if (image == NULL) { return TCL_ERROR; } @@ -334,7 +334,7 @@ ConfigureImage( imgPtr->image = image; if (imgPtr->activeImageString != NULL) { image = Tk_GetImage(interp, tkwin, imgPtr->activeImageString, - ImageChangedProc, (ClientData) imgPtr); + ImageChangedProc, imgPtr); if (image == NULL) { return TCL_ERROR; } @@ -347,7 +347,7 @@ ConfigureImage( imgPtr->activeImage = image; if (imgPtr->disabledImageString != NULL) { image = Tk_GetImage(interp, tkwin, imgPtr->disabledImageString, - ImageChangedProc, (ClientData) imgPtr); + ImageChangedProc, imgPtr); if (image == NULL) { return TCL_ERROR; } @@ -851,7 +851,7 @@ ImageChangedProc( * 0). */ int imgWidth, int imgHeight)/* New dimensions of image. */ { - ImageItem *imgPtr = (ImageItem *) clientData; + ImageItem *imgPtr = clientData; /* * If the image's size changed and it's not anchored at its northwest diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c index 0856927..9c8e576 100644 --- a/generic/tkCanvUtil.c +++ b/generic/tkCanvUtil.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvUtil.c,v 1.26 2009/06/23 05:16:59 nijtmans Exp $ + * RCS: @(#) $Id: tkCanvUtil.c,v 1.27 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -716,7 +716,7 @@ SmoothMethodCleanupProc( int TkSmoothParseProc( - ClientData clientData, /* some flags.*/ + ClientData clientData, /* Ignored. */ Tcl_Interp *interp, /* Used for reporting errors. */ Tk_Window tkwin, /* Window containing canvas widget. */ const char *value, /* Value of option. */ diff --git a/generic/tkCanvWind.c b/generic/tkCanvWind.c index 850586c..bf5555c 100644 --- a/generic/tkCanvWind.c +++ b/generic/tkCanvWind.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvWind.c,v 1.19 2009/02/03 23:55:47 nijtmans Exp $ + * RCS: @(#) $Id: tkCanvWind.c,v 1.20 2010/01/02 22:52:38 dkf Exp $ */ #include <stdio.h> @@ -328,8 +328,8 @@ ConfigureWinItem( if (oldWindow != winItemPtr->tkwin) { if (oldWindow != NULL) { Tk_DeleteEventHandler(oldWindow, StructureNotifyMask, - WinItemStructureProc, (ClientData) winItemPtr); - Tk_ManageGeometry(oldWindow, NULL, (ClientData) NULL); + WinItemStructureProc, winItemPtr); + Tk_ManageGeometry(oldWindow, NULL, NULL); Tk_UnmaintainGeometry(oldWindow, canvasTkwin); Tk_UnmapWindow(oldWindow); } @@ -349,25 +349,19 @@ ConfigureWinItem( if (ancestor == parent) { break; } - if (((Tk_FakeWin *) (ancestor))->flags & TK_TOP_HIERARCHY) { - badWindow: - Tcl_AppendResult(interp, "can't use ", - Tk_PathName(winItemPtr->tkwin), - " in a window item of this canvas", NULL); - winItemPtr->tkwin = NULL; - return TCL_ERROR; + if (((Tk_FakeWin *) ancestor)->flags & TK_TOP_HIERARCHY) { + goto badWindow; } } - if (((Tk_FakeWin *) (winItemPtr->tkwin))->flags & TK_TOP_HIERARCHY) { + if (((Tk_FakeWin *) winItemPtr->tkwin)->flags & TK_TOP_HIERARCHY){ goto badWindow; } if (winItemPtr->tkwin == canvasTkwin) { goto badWindow; } Tk_CreateEventHandler(winItemPtr->tkwin, StructureNotifyMask, - WinItemStructureProc, (ClientData) winItemPtr); - Tk_ManageGeometry(winItemPtr->tkwin, &canvasGeomType, - (ClientData) winItemPtr); + WinItemStructureProc, winItemPtr); + Tk_ManageGeometry(winItemPtr->tkwin, &canvasGeomType, winItemPtr); } } if ((winItemPtr->tkwin != NULL) @@ -380,8 +374,13 @@ ConfigureWinItem( } ComputeWindowBbox(canvas, winItemPtr); - return TCL_OK; + + badWindow: + Tcl_AppendResult(interp, "can't use ", Tk_PathName(winItemPtr->tkwin), + " in a window item of this canvas", NULL); + winItemPtr->tkwin = NULL; + return TCL_ERROR; } /* @@ -412,9 +411,8 @@ DeleteWinItem( if (winItemPtr->tkwin != NULL) { Tk_DeleteEventHandler(winItemPtr->tkwin, StructureNotifyMask, - WinItemStructureProc, (ClientData) winItemPtr); - Tk_ManageGeometry(winItemPtr->tkwin, NULL, - (ClientData) NULL); + WinItemStructureProc, winItemPtr); + Tk_ManageGeometry(winItemPtr->tkwin, NULL, NULL); if (canvasTkwin != Tk_Parent(winItemPtr->tkwin)) { Tk_UnmaintainGeometry(winItemPtr->tkwin, canvasTkwin); } @@ -878,7 +876,7 @@ CanvasPsWindow( #ifdef X_GetImage handle = Tk_CreateErrorHandler(Tk_Display(tkwin), BadMatch, - X_GetImage, -1, xerrorhandler, (ClientData) tkwin); + X_GetImage, -1, xerrorhandler, tkwin); #endif /* @@ -999,7 +997,7 @@ WinItemStructureProc( ClientData clientData, /* Pointer to record describing window item. */ XEvent *eventPtr) /* Describes what just happened. */ { - WindowItem *winItemPtr = (WindowItem *) clientData; + WindowItem *winItemPtr = clientData; if (eventPtr->type == DestroyNotify) { winItemPtr->tkwin = NULL; @@ -1029,7 +1027,7 @@ WinItemRequestProc( ClientData clientData, /* Pointer to record for window item. */ Tk_Window tkwin) /* Window that changed its desired size. */ { - WindowItem *winItemPtr = (WindowItem *) clientData; + WindowItem *winItemPtr = clientData; ComputeWindowBbox(winItemPtr->canvas, winItemPtr); diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 3a8ea99..f14d2d0 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvas.c,v 1.60 2009/11/19 22:28:12 ferrieux Exp $ + * RCS: @(#) $Id: tkCanvas.c,v 1.61 2010/01/02 22:52:38 dkf Exp $ */ /* #define USE_OLD_TAG_SEARCH 1 */ @@ -911,7 +911,7 @@ CanvasWidgetCmd( * tag). */ - object = 0; + object = NULL; #ifdef USE_OLD_TAG_SEARCH if (isdigit(UCHAR(Tcl_GetString(objv[2])[0]))) { int id; @@ -928,7 +928,7 @@ CanvasWidgetCmd( object = itemPtr; } - if (object == 0) { + if (object == NULL) { Tcl_AppendResult(interp, "item \"", Tcl_GetString(objv[2]), "\" doesn't exist", NULL); result = TCL_ERROR; @@ -3216,7 +3216,7 @@ NextItem( static SearchUids * GetStaticUids(void) { - SearchUids *searchUids = (SearchUids *) + SearchUids *searchUids = Tcl_GetThreadData(&dataKey, sizeof(SearchUids)); if (searchUids->allUid == NULL) { @@ -5105,8 +5105,8 @@ CanvasDoEvent( if (numObjects <= NUM_STATIC) { objectPtr = staticObjects; } else { - objectPtr = (ClientData *) ckalloc((unsigned) - (numObjects * sizeof(ClientData))); + objectPtr = (ClientData *) + ckalloc((unsigned) numObjects * sizeof(ClientData)); } #ifdef USE_OLD_TAG_SEARCH objectPtr[0] = (ClientData) Tk_GetUid("all"); diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c index 138a528..e2064c1 100644 --- a/generic/tkClipboard.c +++ b/generic/tkClipboard.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkClipboard.c,v 1.23 2009/01/02 23:20:32 nijtmans Exp $ + * RCS: @(#) $Id: tkClipboard.c,v 1.24 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -599,7 +599,7 @@ Tk_ClipboardObjCmd( Tcl_DStringInit(&selBytes); result = Tk_GetSelection(interp, tkwin, selection, target, - ClipboardGetProc, (ClientData) &selBytes); + ClipboardGetProc, &selBytes); if (result == TCL_OK) { Tcl_DStringResult(interp, &selBytes); } else { diff --git a/generic/tkCmds.c b/generic/tkCmds.c index c6ed614..b93c27b 100644 --- a/generic/tkCmds.c +++ b/generic/tkCmds.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCmds.c,v 1.50 2009/02/03 23:55:47 nijtmans Exp $ + * RCS: @(#) $Id: tkCmds.c,v 1.51 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -101,7 +101,7 @@ Tk_BellObjCmd( "-displayof", "-nice", NULL }; enum options { TK_BELL_DISPLAYOF, TK_BELL_NICE }; - Tk_Window tkwin = (Tk_Window) clientData; + Tk_Window tkwin = clientData; int i, index, nice = 0; if (objc > 4) { @@ -162,7 +162,7 @@ Tk_BindObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - Tk_Window tkwin = (Tk_Window) clientData; + Tk_Window tkwin = clientData; TkWindow *winPtr; ClientData object; const char *string; @@ -186,7 +186,7 @@ Tk_BindObjCmd( } object = (ClientData) winPtr->pathName; } else { - winPtr = (TkWindow *) clientData; + winPtr = clientData; object = (ClientData) Tk_GetUid(string); } @@ -200,9 +200,8 @@ Tk_BindObjCmd( if (objc == 4) { int append = 0; unsigned long mask; - const char *sequence, *script; - sequence = Tcl_GetString(objv[2]); - script = Tcl_GetString(objv[3]); + const char *sequence = Tcl_GetString(objv[2]); + const char *script = Tcl_GetString(objv[3]); /* * If the script is null, just delete the binding. @@ -285,8 +284,8 @@ TkBindEventProc( */ if (winPtr->numTags > MAX_OBJS) { - objPtr = (ClientData *) ckalloc((unsigned) - (winPtr->numTags * sizeof(ClientData))); + objPtr = (ClientData *) + ckalloc((unsigned) winPtr->numTags * sizeof(ClientData)); } for (i = 0; i < winPtr->numTags; i++) { p = winPtr->tagPtr[i]; @@ -348,7 +347,7 @@ Tk_BindtagsObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - Tk_Window tkwin = (Tk_Window) clientData; + Tk_Window tkwin = clientData; TkWindow *winPtr, *winPtr2; int i, length; const char *p; @@ -402,8 +401,8 @@ Tk_BindtagsObjCmd( } winPtr->numTags = length; - winPtr->tagPtr = (ClientData *) ckalloc((unsigned) - (length * sizeof(ClientData))); + winPtr->tagPtr = (ClientData *) + ckalloc((unsigned) length * sizeof(ClientData)); for (i = 0; i < length; i++) { p = Tcl_GetString(tags[i]); if (p[0] == '.') { @@ -416,7 +415,7 @@ Tk_BindtagsObjCmd( * is one. */ - copy = (char *) ckalloc((unsigned) (strlen(p) + 1)); + copy = ckalloc((unsigned) strlen(p) + 1); strcpy(copy, p); winPtr->tagPtr[i] = (ClientData) copy; } else { @@ -492,7 +491,7 @@ Tk_DestroyObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window window; - Tk_Window tkwin = (Tk_Window) clientData; + Tk_Window tkwin = clientData; int i; for (i = 1; i < objc; i++) { @@ -539,7 +538,7 @@ Tk_LowerObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - Tk_Window mainwin = (Tk_Window) clientData; + Tk_Window mainwin = clientData; Tk_Window tkwin, other; if ((objc != 2) && (objc != 3)) { @@ -593,7 +592,7 @@ Tk_RaiseObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - Tk_Window mainwin = (Tk_Window) clientData; + Tk_Window mainwin = clientData; Tk_Window tkwin, other; if ((objc != 2) && (objc != 3)) { @@ -639,7 +638,9 @@ Tk_RaiseObjCmd( */ int -TkInitTkCmd(Tcl_Interp *interp, ClientData clientData) +TkInitTkCmd( + Tcl_Interp *interp, + ClientData clientData) { TkMakeEnsemble(interp, "::", "tk", clientData, tkCmdMap); #if defined(__WIN32__) || defined(MAC_OSX_TK) @@ -803,8 +804,7 @@ ScalingCmd( double d; if (Tcl_IsSafe(interp)) { - Tcl_SetResult(interp, - "scaling not accessible in a safe interpreter", + Tcl_SetResult(interp, "scaling not accessible in a safe interpreter", TCL_STATIC); return TCL_ERROR; } @@ -835,8 +835,7 @@ ScalingCmd( WidthMMOfScreen(screenPtr) = width; HeightMMOfScreen(screenPtr) = height; } else { - Tcl_WrongNumArgs(interp, 1, objv, - "?-displayof window? ?factor?"); + Tcl_WrongNumArgs(interp, 1, objv, "?-displayof window? ?factor?"); return TCL_ERROR; } return TCL_OK; @@ -990,7 +989,7 @@ Tk_TkwaitObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - Tk_Window tkwin = (Tk_Window) clientData; + Tk_Window tkwin = clientData; int done, index; int code = TCL_OK; static const char *const optionStrings[] = { @@ -1014,7 +1013,7 @@ Tk_TkwaitObjCmd( case TKWAIT_VARIABLE: if (Tcl_TraceVar(interp, Tcl_GetString(objv[2]), TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - WaitVariableProc, (ClientData) &done) != TCL_OK) { + WaitVariableProc, &done) != TCL_OK) { return TCL_ERROR; } done = 0; @@ -1027,7 +1026,7 @@ Tk_TkwaitObjCmd( } Tcl_UntraceVar(interp, Tcl_GetString(objv[2]), TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - WaitVariableProc, (ClientData) &done); + WaitVariableProc, &done); break; case TKWAIT_VISIBILITY: { @@ -1039,7 +1038,7 @@ Tk_TkwaitObjCmd( } Tk_CreateEventHandler(window, VisibilityChangeMask|StructureNotifyMask, - WaitVisibilityProc, (ClientData) &done); + WaitVisibilityProc, &done); done = 0; while (!done) { if (Tcl_Canceled(interp, TCL_LEAVE_ERR_MSG) == TCL_ERROR) { @@ -1061,7 +1060,7 @@ Tk_TkwaitObjCmd( } Tk_DeleteEventHandler(window, VisibilityChangeMask|StructureNotifyMask, - WaitVisibilityProc, (ClientData) &done); + WaitVisibilityProc, &done); break; } @@ -1073,7 +1072,7 @@ Tk_TkwaitObjCmd( return TCL_ERROR; } Tk_CreateEventHandler(window, StructureNotifyMask, - WaitWindowProc, (ClientData) &done); + WaitWindowProc, &done); done = 0; while (!done) { if (Tcl_Canceled(interp, TCL_LEAVE_ERR_MSG) == TCL_ERROR) { @@ -1084,15 +1083,14 @@ Tk_TkwaitObjCmd( } /* - * Note: normally there's no need to delete the event handler. It was deleted - * automatically when the window was destroyed; however, if the wait operation - * was canceled, we need to delete it. + * Note: normally there's no need to delete the event handler. It was + * deleted automatically when the window was destroyed; however, if + * the wait operation was canceled, we need to delete it. */ if (done == 0) { - Tk_DeleteEventHandler(window, - StructureNotifyMask, - WaitWindowProc, (ClientData) &done); + Tk_DeleteEventHandler(window, StructureNotifyMask, + WaitWindowProc, &done); } break; } @@ -1119,7 +1117,7 @@ WaitVariableProc( const char *name2, /* Second part of variable name. */ int flags) /* Information about what happened. */ { - int *donePtr = (int *) clientData; + int *donePtr = clientData; *donePtr = 1; return NULL; @@ -1131,7 +1129,7 @@ WaitVisibilityProc( ClientData clientData, /* Pointer to integer to set to 1. */ XEvent *eventPtr) /* Information about event (not used). */ { - int *donePtr = (int *) clientData; + int *donePtr = clientData; if (eventPtr->type == VisibilityNotify) { *donePtr = 1; @@ -1146,7 +1144,7 @@ WaitWindowProc( ClientData clientData, /* Pointer to integer to set to 1. */ XEvent *eventPtr) /* Information about event. */ { - int *donePtr = (int *) clientData; + int *donePtr = clientData; if (eventPtr->type == DestroyNotify) { *donePtr = 1; @@ -1279,7 +1277,7 @@ Tk_WinfoObjCmd( int index, x, y, width, height, useX, useY, class, skip; const char *string; TkWindow *winPtr; - Tk_Window tkwin; + Tk_Window tkwin = clientData; static const TkStateMap visualMap[] = { {PseudoColor, "pseudocolor"}, @@ -1329,8 +1327,6 @@ Tk_WinfoObjCmd( WIN_VISUALSAVAILABLE }; - tkwin = (Tk_Window) clientData; - if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "option ?arg?"); return TCL_ERROR; @@ -2009,7 +2005,7 @@ Tk_WmObjCmd( updateGeom: if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) { - Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr); + Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr); wmPtr->flags |= WM_UPDATE_PENDING; } return TCL_OK; diff --git a/generic/tkConsole.c b/generic/tkConsole.c index 79f16f0..a2d348d 100644 --- a/generic/tkConsole.c +++ b/generic/tkConsole.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkConsole.c,v 1.39 2009/09/07 07:29:03 das Exp $ + * RCS: @(#) $Id: tkConsole.c,v 1.40 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -673,10 +673,11 @@ ConsoleObjCmd( Tcl_Obj *const objv[]) /* Argument objects */ { int index, result; - static const char *const options[] = {"eval", "hide", "show", "title", NULL}; + static const char *const options[] = { + "eval", "hide", "show", "title", NULL}; enum option {CON_EVAL, CON_HIDE, CON_SHOW, CON_TITLE}; Tcl_Obj *cmd = NULL; - ConsoleInfo *info = (ConsoleInfo *) clientData; + ConsoleInfo *info = clientData; Tcl_Interp *consoleInterp = info->consoleInterp; if (objc < 2) { diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 8bc738f..c5181f8 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkEntry.c,v 1.58 2009/02/03 23:55:47 nijtmans Exp $ + * RCS: @(#) $Id: tkEntry.c,v 1.59 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -1391,7 +1391,7 @@ EntryWorldChanged( unsigned long mask; Tk_3DBorder border; XColor *colorPtr; - Entry *entryPtr = (Entry *) instanceData; + Entry *entryPtr = instanceData; entryPtr->avgWidth = Tk_TextWidth(entryPtr->tkfont, "0", 1); if (entryPtr->avgWidth == 0) { diff --git a/generic/tkEvent.c b/generic/tkEvent.c index fd5c129..08f2f85 100644 --- a/generic/tkEvent.c +++ b/generic/tkEvent.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkEvent.c,v 1.41 2010/01/02 11:07:56 dkf Exp $ + * RCS: @(#) $Id: tkEvent.c,v 1.42 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -869,7 +869,7 @@ Tk_DeleteEventHandler( register InProgress *ipPtr; TkEventHandler *prevPtr; register TkWindow *winPtr = (TkWindow *) token; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* @@ -941,7 +941,7 @@ Tk_CreateGenericHandler( ClientData clientData) /* One-word value to pass to proc. */ { GenericHandler *handlerPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); handlerPtr = (GenericHandler *) ckalloc(sizeof(GenericHandler)); @@ -982,7 +982,7 @@ Tk_DeleteGenericHandler( ClientData clientData) { GenericHandler * handler; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); for (handler=tsdPtr->genericList ; handler ; handler=handler->nextPtr) { @@ -1015,7 +1015,7 @@ Tk_CreateClientMessageHandler( Tk_ClientMessageProc *proc) /* Function to call on event. */ { GenericHandler *handlerPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* @@ -1061,7 +1061,7 @@ Tk_DeleteClientMessageHandler( Tk_ClientMessageProc *proc) { GenericHandler * handler; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); for (handler=tsdPtr->cmList ; handler!=NULL ; handler=handler->nextPtr) { @@ -1092,7 +1092,7 @@ Tk_DeleteClientMessageHandler( void TkEventInit(void) { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); tsdPtr->handlersActive = 0; @@ -1127,9 +1127,8 @@ TkXErrorHandler( ClientData clientData, /* Pointer to flag we set. */ XErrorEvent *errEventPtr) /* X error info. */ { - int *error; + int *error = clientData; - error = (int *) clientData; *error = 1; return 0; } @@ -1170,7 +1169,7 @@ ParentXId( gotXError = 0; handler = Tk_CreateErrorHandler(display, -1, -1, -1, - TkXErrorHandler, (ClientData) (&gotXError)); + TkXErrorHandler, &gotXError); /* * Get the parent window. @@ -1414,7 +1413,7 @@ TkEventDeadWindow( { register TkEventHandler *handlerPtr; register InProgress *ipPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* @@ -1463,7 +1462,7 @@ TkCurrentTime( TkDisplay *dispPtr) /* Display for which the time is desired. */ { register XEvent *eventPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (tsdPtr->pendingPtr == NULL) { @@ -1517,7 +1516,7 @@ Tk_RestrictEvents( * argument. */ { Tk_RestrictProc *prev; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); prev = tsdPtr->restrictProc; @@ -1638,7 +1637,7 @@ Tk_QueueWindowEvent( Tcl_QueueEvent(&dispPtr->delayedMotionPtr->header, position); dispPtr->delayedMotionPtr = NULL; - Tcl_CancelIdleCall(DelayedMotionProc, (ClientData) dispPtr); + Tcl_CancelIdleCall(DelayedMotionProc, dispPtr); } } @@ -1656,7 +1655,7 @@ Tk_QueueWindowEvent( Tcl_Panic("Tk_QueueWindowEvent found unexpected delayed motion event"); } dispPtr->delayedMotionPtr = wevPtr; - Tcl_DoWhenIdle(DelayedMotionProc, (ClientData) dispPtr); + Tcl_DoWhenIdle(DelayedMotionProc, dispPtr); } else { Tcl_QueueEvent(&wevPtr->header, position); } @@ -1732,7 +1731,7 @@ WindowEventProc( { TkWindowEvent *wevPtr = (TkWindowEvent *) evPtr; Tk_RestrictAction result; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!(flags & TCL_WINDOW_EVENTS)) { @@ -1831,7 +1830,7 @@ DelayedMotionProc( ClientData clientData) /* Pointer to display containing a delayed * motion event to be serviced. */ { - TkDisplay *dispPtr = (TkDisplay *) clientData; + TkDisplay *dispPtr = clientData; if (dispPtr->delayedMotionPtr == NULL) { Tcl_Panic("DelayedMotionProc found no delayed mouse motion event"); @@ -1959,7 +1958,7 @@ TkCreateThreadExitHandler( ClientData clientData) /* Arbitrary value to pass to proc. */ { ExitHandler *exitPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); exitPtr = (ExitHandler *) ckalloc(sizeof(ExitHandler)); @@ -2000,7 +1999,7 @@ TkDeleteThreadExitHandler( ClientData clientData) /* Arbitrary value to pass to proc. */ { ExitHandler *exitPtr, *prevPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); for (prevPtr = NULL, exitPtr = tsdPtr->firstExitPtr; exitPtr != NULL; @@ -2088,7 +2087,7 @@ TkFinalizeThread( ClientData clientData) /* Arbitrary value to pass to proc. */ { ExitHandler *exitPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_DeleteThreadExitHandler(TkFinalizeThread, NULL); diff --git a/generic/tkFont.c b/generic/tkFont.c index 21368fc..749f64b 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkFont.c,v 1.61 2009/11/21 17:24:42 dkf Exp $ + * RCS: @(#) $Id: tkFont.c,v 1.62 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -475,7 +475,7 @@ Tk_FontObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { int index; - Tk_Window tkwin; + Tk_Window tkwin = clientData; TkFontInfo *fiPtr; static const char *const optionStrings[] = { "actual", "configure", "create", "delete", @@ -487,7 +487,6 @@ Tk_FontObjCmd( FONT_FAMILIES, FONT_MEASURE, FONT_METRICS, FONT_NAMES }; - tkwin = (Tk_Window) clientData; fiPtr = ((TkWindow *) tkwin)->mainPtr->fontInfoPtr; if (objc < 2) { diff --git a/generic/tkFrame.c b/generic/tkFrame.c index 67c0fab..c204742 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkFrame.c,v 1.38 2009/02/03 23:55:47 nijtmans Exp $ + * RCS: @(#) $Id: tkFrame.c,v 1.39 2010/01/02 22:52:38 dkf Exp $ */ #include "default.h" @@ -450,7 +450,7 @@ CreateFrame( int objc, /* Number of arguments. */ Tcl_Obj *const objv[], /* Argument objects. */ enum FrameType type, /* What widget type to create. */ - const char *appName) /* Should only be non-NULL if there are no + const char *appName) /* Should only be non-NULL if there are no * Main window associated with the * interpreter. Gives the base name to use for * the new application. */ @@ -986,7 +986,7 @@ ConfigureFrame( if (oldWindow != NULL) { Tk_DeleteEventHandler(oldWindow, StructureNotifyMask, FrameStructureProc, framePtr); - Tk_ManageGeometry(oldWindow, NULL, (ClientData) NULL); + Tk_ManageGeometry(oldWindow, NULL, NULL); Tk_UnmaintainGeometry(oldWindow, framePtr->tkwin); Tk_UnmapWindow(oldWindow); } @@ -1805,7 +1805,7 @@ TkInstallFrameMenu( TkWindow *winPtr = (TkWindow *) tkwin; if (winPtr->mainPtr != NULL) { - Frame *framePtr = (Frame *) winPtr->instanceData; + Frame *framePtr = winPtr->instanceData; if (framePtr == NULL) { Tcl_Panic("TkInstallFrameMenu couldn't get frame pointer"); @@ -1928,7 +1928,7 @@ void TkMapTopFrame( Tk_Window tkwin) { - Frame *framePtr = ((TkWindow*)tkwin)->instanceData; + Frame *framePtr = ((TkWindow *) tkwin)->instanceData; Tk_OptionTable optionTable; if (Tk_IsTopLevel(tkwin) && framePtr->type == TYPE_FRAME) { diff --git a/generic/tkGC.c b/generic/tkGC.c index a591b64..07f6014 100644 --- a/generic/tkGC.c +++ b/generic/tkGC.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkGC.c,v 1.10 2007/12/13 15:24:14 dgp Exp $ + * RCS: @(#) $Id: tkGC.c,v 1.11 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -220,7 +220,7 @@ Tk_GetGC( valueHashPtr = Tcl_CreateHashEntry(&dispPtr->gcValueTable, (char *) &valueKey, &isNew); if (!isNew) { - gcPtr = (TkGC *) Tcl_GetHashValue(valueHashPtr); + gcPtr = Tcl_GetHashValue(valueHashPtr); gcPtr->refCount++; return gcPtr->gc; } @@ -313,7 +313,7 @@ Tk_FreeGC( if (idHashPtr == NULL) { Tcl_Panic("Tk_FreeGC received unknown gc argument"); } - gcPtr = (TkGC *) Tcl_GetHashValue(idHashPtr); + gcPtr = Tcl_GetHashValue(idHashPtr); gcPtr->refCount--; if (gcPtr->refCount == 0) { Tk_FreeXId(gcPtr->display, (XID) XGContextFromGC(gcPtr->gc)); @@ -351,7 +351,7 @@ TkGCCleanup( for (entryPtr = Tcl_FirstHashEntry(&dispPtr->gcIdTable, &search); entryPtr != NULL; entryPtr = Tcl_NextHashEntry(&search)) { - gcPtr = (TkGC *) Tcl_GetHashValue(entryPtr); + gcPtr = Tcl_GetHashValue(entryPtr); /* * This call is not needed, as it is only used on Unix to restore the diff --git a/generic/tkGet.c b/generic/tkGet.c index de6b5fe..ad0de63 100644 --- a/generic/tkGet.c +++ b/generic/tkGet.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkGet.c,v 1.15 2008/10/17 23:18:37 nijtmans Exp $ + * RCS: @(#) $Id: tkGet.c,v 1.16 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -489,7 +489,7 @@ static void FreeUidThreadExitProc( ClientData clientData) /* Not used. */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_DeleteHashTable(&tsdPtr->uidTable); @@ -523,7 +523,7 @@ Tk_GetUid( const char *string) /* String to convert. */ { int dummy; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_HashTable *tablePtr = &tsdPtr->uidTable; diff --git a/generic/tkGrid.c b/generic/tkGrid.c index 2ea78c0..b5a439a 100644 --- a/generic/tkGrid.c +++ b/generic/tkGrid.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkGrid.c,v 1.54 2009/09/18 22:35:00 pspjuth Exp $ + * RCS: @(#) $Id: tkGrid.c,v 1.55 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -664,7 +664,7 @@ GridForgetRemoveCommand( slavePtr->flags = 0; slavePtr->sticky = 0; } - Tk_ManageGeometry(slave, NULL, (ClientData) NULL); + Tk_ManageGeometry(slave, NULL, NULL); if (slavePtr->masterPtr->tkwin != Tk_Parent(slavePtr->tkwin)) { Tk_UnmaintainGeometry(slavePtr->tkwin, slavePtr->masterPtr->tkwin); @@ -2410,7 +2410,7 @@ GetGrid( hPtr = Tcl_CreateHashEntry(&dispPtr->gridHashTable, (char*) tkwin, &isNew); if (!isNew) { - return (Gridder *) Tcl_GetHashValue(hPtr); + return Tcl_GetHashValue(hPtr); } gridPtr = (Gridder *) ckalloc(sizeof(Gridder)); gridPtr->tkwin = tkwin; diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c index 167b252..1dd736e 100644 --- a/generic/tkImgBmap.c +++ b/generic/tkImgBmap.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkImgBmap.c,v 1.28 2008/12/09 21:22:56 dgp Exp $ + * RCS: @(#) $Id: tkImgBmap.c,v 1.29 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -179,7 +179,7 @@ ImgBmapCreate( int argc, /* Number of arguments. */ Tcl_Obj *const argv[], /* Argument objects for options (doesn't * include image name or type). */ - const Tk_ImageType *typePtr, /* Pointer to our type record (not used). */ + const Tk_ImageType *typePtr,/* Pointer to our type record (not used). */ Tk_ImageMaster master, /* Token for image, to be used by us in later * callbacks. */ ClientData *clientDataPtr) /* Store manager's token for image here; it diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index f133de2..353d57a 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -17,7 +17,7 @@ * Department of Computer Science, * Australian National University. * - * RCS: @(#) $Id: tkImgPhoto.c,v 1.92 2009/09/25 08:46:07 dkf Exp $ + * RCS: @(#) $Id: tkImgPhoto.c,v 1.93 2010/01/02 22:52:38 dkf Exp $ */ #include "tkImgPhoto.h" @@ -330,11 +330,11 @@ static int ImgPhotoCreate( Tcl_Interp *interp, /* Interpreter for application containing * image. */ - const char *name, /* Name to use for image. */ + const char *name, /* Name to use for image. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[], /* Argument objects for options (doesn't * include image name or type). */ - const Tk_ImageType *typePtr, /* Pointer to our type record (not used). */ + const Tk_ImageType *typePtr,/* Pointer to our type record (not used). */ Tk_ImageMaster master, /* Token for image, to be used by us in later * callbacks. */ ClientData *clientDataPtr) /* Store manager's token for image here; it @@ -3858,9 +3858,9 @@ PhotoOptionCleanupProc( OptionAssocData *list = clientData; while (list != NULL) { - register OptionAssocData *ptr; + register OptionAssocData *ptr = list; - list = (ptr = list)->nextPtr; + list = list->nextPtr; ckfree((char *) ptr); } } diff --git a/generic/tkListbox.c b/generic/tkListbox.c index bd2400e..1f23531 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkListbox.c,v 1.56 2009/12/16 21:12:24 nijtmans Exp $ + * RCS: @(#) $Id: tkListbox.c,v 1.57 2010/01/02 22:52:38 dkf Exp $ */ #include "default.h" @@ -497,7 +497,7 @@ Tk_ListboxObjCmd( */ Tcl_SetAssocData(interp, "ListboxOptionTables", - DestroyListboxOptionTables, (ClientData) optionTables); + DestroyListboxOptionTables, optionTables); /* * Create the listbox option table and the listbox item option table. @@ -522,8 +522,8 @@ Tk_ListboxObjCmd( listPtr->display = Tk_Display(tkwin); listPtr->interp = interp; listPtr->widgetCmd = Tcl_CreateObjCommand(interp, - Tk_PathName(listPtr->tkwin), ListboxWidgetObjCmd, - (ClientData) listPtr, ListboxCmdDeletedProc); + Tk_PathName(listPtr->tkwin), ListboxWidgetObjCmd, listPtr, + ListboxCmdDeletedProc); listPtr->optionTable = optionTables->listboxOptionTable; listPtr->itemAttrOptionTable = optionTables->itemAttrOptionTable; listPtr->selection = (Tcl_HashTable *) @@ -548,15 +548,15 @@ Tk_ListboxObjCmd( * otherwise Tk might free it while we still need it. */ - Tcl_Preserve((ClientData) listPtr->tkwin); + Tcl_Preserve(listPtr->tkwin); Tk_SetClass(listPtr->tkwin, "Listbox"); - Tk_SetClassProcs(listPtr->tkwin, &listboxClass, (ClientData) listPtr); + Tk_SetClassProcs(listPtr->tkwin, &listboxClass, listPtr); Tk_CreateEventHandler(listPtr->tkwin, ExposureMask|StructureNotifyMask|FocusChangeMask, - ListboxEventProc, (ClientData) listPtr); + ListboxEventProc, listPtr); Tk_CreateSelHandler(listPtr->tkwin, XA_PRIMARY, XA_STRING, - ListboxFetchSelection, (ClientData) listPtr, XA_STRING); + ListboxFetchSelection, listPtr, XA_STRING); if (Tk_InitOptions(interp, (char *)listPtr, optionTables->listboxOptionTable, tkwin) != TCL_OK) { Tk_DestroyWindow(listPtr->tkwin); @@ -597,7 +597,7 @@ ListboxWidgetObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Arguments as Tcl_Obj's. */ { - register Listbox *listPtr = (Listbox *) clientData; + register Listbox *listPtr = clientData; int cmdIndex, index; int result = TCL_OK; @@ -617,7 +617,7 @@ ListboxWidgetObjCmd( return result; } - Tcl_Preserve((ClientData)listPtr); + Tcl_Preserve(listPtr); /* * The subcommand was valid, so continue processing. @@ -673,7 +673,7 @@ ListboxWidgetObjCmd( break; } - objPtr = Tk_GetOptionValue(interp, (char *)listPtr, + objPtr = Tk_GetOptionValue(interp, (char *) listPtr, listPtr->optionTable, objv[2], listPtr->tkwin); if (objPtr == NULL) { result = TCL_ERROR; @@ -883,7 +883,7 @@ ListboxWidgetObjCmd( attrPtr = ListboxGetItemAttributes(interp, listPtr, index); - objPtr = Tk_GetOptionValue(interp, (char *)attrPtr, + objPtr = Tk_GetOptionValue(interp, (char *) attrPtr, listPtr->itemAttrOptionTable, objv[3], listPtr->tkwin); if (objPtr == NULL) { result = TCL_ERROR; @@ -919,7 +919,7 @@ ListboxWidgetObjCmd( attrPtr = ListboxGetItemAttributes(interp, listPtr, index); if (objc <= 4) { - objPtr = Tk_GetOptionInfo(interp, (char *)attrPtr, + objPtr = Tk_GetOptionInfo(interp, (char *) attrPtr, listPtr->itemAttrOptionTable, (objc == 4) ? objv[3] : NULL, listPtr->tkwin); if (objPtr == NULL) { @@ -1048,7 +1048,7 @@ ListboxWidgetObjCmd( result = ListboxYviewSubCmd(interp, listPtr, objc, objv); break; } - Tcl_Release((ClientData)listPtr); + Tcl_Release(listPtr); return result; } @@ -1397,8 +1397,9 @@ ListboxGetItemAttributes( Tk_InitOptions(interp, (char *)attrs, listPtr->itemAttrOptionTable, listPtr->tkwin); Tcl_SetHashValue(entry, attrs); + } else { + attrs = Tcl_GetHashValue(entry); } - attrs = (ItemAttr *)Tcl_GetHashValue(entry); return attrs; } @@ -1440,7 +1441,7 @@ DestroyListbox( if (listPtr->listVarName != NULL) { Tcl_UntraceVar(listPtr->interp, listPtr->listVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - ListboxListVarProc, (ClientData) listPtr); + ListboxListVarProc, listPtr); } /* @@ -1448,7 +1449,7 @@ DestroyListbox( */ Tcl_DeleteHashTable(listPtr->selection); - ckfree((char *)listPtr->selection); + ckfree((char *) listPtr->selection); /* * Free the item attribute hash table. @@ -1456,10 +1457,10 @@ DestroyListbox( for (entry = Tcl_FirstHashEntry(listPtr->itemAttrTable, &search); entry != NULL; entry = Tcl_NextHashEntry(&search)) { - ckfree((char *)Tcl_GetHashValue(entry)); + ckfree(Tcl_GetHashValue(entry)); } Tcl_DeleteHashTable(listPtr->itemAttrTable); - ckfree((char *)listPtr->itemAttrTable); + ckfree((char *) listPtr->itemAttrTable); /* * Free up all the stuff that requires special handling, then let @@ -1476,9 +1477,9 @@ DestroyListbox( Tk_FreeBitmap(Tk_Display(listPtr->tkwin), listPtr->gray); } - Tk_FreeConfigOptions((char *)listPtr, listPtr->optionTable, + Tk_FreeConfigOptions((char *) listPtr, listPtr->optionTable, listPtr->tkwin); - Tcl_Release((ClientData) listPtr->tkwin); + Tcl_Release(listPtr->tkwin); listPtr->tkwin = NULL; ckfree((char *) listPtr); } @@ -1548,7 +1549,7 @@ ConfigureListbox( if (listPtr->listVarName != NULL) { Tcl_UntraceVar(interp, listPtr->listVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - ListboxListVarProc, (ClientData) listPtr); + ListboxListVarProc, listPtr); } for (error = 0; error <= 1; error++) { @@ -1591,8 +1592,8 @@ ConfigureListbox( if (listPtr->exportSelection && !oldExport && (listPtr->numSelected != 0)) { - Tk_OwnSelection(listPtr->tkwin, XA_PRIMARY, ListboxLostSelection, - (ClientData) listPtr); + Tk_OwnSelection(listPtr->tkwin, XA_PRIMARY, + ListboxLostSelection, listPtr); } /* @@ -1644,7 +1645,7 @@ ConfigureListbox( listPtr->listObj = listVarObj; Tcl_TraceVar(listPtr->interp, listPtr->listVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - ListboxListVarProc, (ClientData) listPtr); + ListboxListVarProc, listPtr); } else if (listPtr->listObj == NULL) { listPtr->listObj = Tcl_NewObj(); } @@ -1668,10 +1669,9 @@ ConfigureListbox( Tcl_SetObjResult(interp, errorResult); Tcl_DecrRefCount(errorResult); return TCL_ERROR; - } else { - ListboxWorldChanged((ClientData) listPtr); - return TCL_OK; } + ListboxWorldChanged(listPtr); + return TCL_OK; } /* @@ -1748,9 +1748,7 @@ ListboxWorldChanged( XGCValues gcValues; GC gc; unsigned long mask; - Listbox *listPtr; - - listPtr = (Listbox *) instanceData; + Listbox *listPtr = instanceData; if (listPtr->state & STATE_NORMAL) { gcValues.foreground = listPtr->fgColorPtr->pixel; @@ -1821,7 +1819,7 @@ static void DisplayListbox( ClientData clientData) /* Information about window. */ { - register Listbox *listPtr = (Listbox *) clientData; + register Listbox *listPtr = clientData; register Tk_Window tkwin = listPtr->tkwin; GC gc; int i, limit, x, y, prevSelected, freeGC, stringLen; @@ -1849,23 +1847,23 @@ DisplayListbox( listPtr->flags |= UPDATE_H_SCROLLBAR; } - Tcl_Preserve((ClientData) listPtr); + Tcl_Preserve(listPtr); if (listPtr->flags & UPDATE_V_SCROLLBAR) { ListboxUpdateVScrollbar(listPtr); if ((listPtr->flags & LISTBOX_DELETED) || !Tk_IsMapped(tkwin)) { - Tcl_Release((ClientData) listPtr); + Tcl_Release(listPtr); return; } } if (listPtr->flags & UPDATE_H_SCROLLBAR) { ListboxUpdateHScrollbar(listPtr); if ((listPtr->flags & LISTBOX_DELETED) || !Tk_IsMapped(tkwin)) { - Tcl_Release((ClientData) listPtr); + Tcl_Release(listPtr); return; } } listPtr->flags &= ~(REDRAW_PENDING|UPDATE_V_SCROLLBAR|UPDATE_H_SCROLLBAR); - Tcl_Release((ClientData) listPtr); + Tcl_Release(listPtr); #ifndef TK_NO_DOUBLE_BUFFERING /* @@ -1939,7 +1937,7 @@ DisplayListbox( */ if (entry != NULL) { - attrs = (ItemAttr *)Tcl_GetHashValue(entry); + attrs = Tcl_GetHashValue(entry); /* * Default GC has the values from the widget at large. @@ -2021,7 +2019,7 @@ DisplayListbox( */ if (entry != NULL) { - attrs = (ItemAttr *)Tcl_GetHashValue(entry); + attrs = Tcl_GetHashValue(entry); gcValues.foreground = listPtr->fgColorPtr->pixel; gcValues.font = Tk_FontId(listPtr->tkfont); gcValues.graphics_exposures = False; @@ -2582,7 +2580,7 @@ ListboxEventProc( ClientData clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { - Listbox *listPtr = (Listbox *) clientData; + Listbox *listPtr = clientData; if (eventPtr->type == Expose) { EventuallyRedrawRange(listPtr, @@ -2657,7 +2655,7 @@ static void ListboxCmdDeletedProc( ClientData clientData) /* Pointer to widget record for widget. */ { - Listbox *listPtr = (Listbox *) clientData; + Listbox *listPtr = clientData; /* * This procedure could be invoked either because the window was destroyed @@ -2924,7 +2922,7 @@ ListboxScanTo( * scan started. */ - newOffset = listPtr->scanMarkXOffset - (10*(x - listPtr->scanMarkX)); + newOffset = listPtr->scanMarkXOffset - 10*(x - listPtr->scanMarkX); if (newOffset > maxOffset) { newOffset = listPtr->scanMarkXOffset = maxOffset; listPtr->scanMarkX = x; @@ -3058,8 +3056,8 @@ ListboxSelect( } if ((oldCount == 0) && (listPtr->numSelected > 0) && (listPtr->exportSelection)) { - Tk_OwnSelection(listPtr->tkwin, XA_PRIMARY, ListboxLostSelection, - (ClientData) listPtr); + Tk_OwnSelection(listPtr->tkwin, XA_PRIMARY, + ListboxLostSelection, listPtr); } return TCL_OK; } @@ -3096,7 +3094,7 @@ ListboxFetchSelection( * not including terminating NULL * character. */ { - register Listbox *listPtr = (Listbox *) clientData; + register Listbox *listPtr = clientData; Tcl_DString selection; int length, count, needNewline, stringLen, i; Tcl_Obj *curElement; @@ -3172,7 +3170,7 @@ static void ListboxLostSelection( ClientData clientData) /* Information about listbox widget. */ { - register Listbox *listPtr = (Listbox *) clientData; + register Listbox *listPtr = clientData; if ((listPtr->exportSelection) && (listPtr->nElements > 0)) { ListboxSelect(listPtr, 0, listPtr->nElements-1, 0); @@ -3216,7 +3214,7 @@ EventuallyRedrawRange( return; } listPtr->flags |= REDRAW_PENDING; - Tcl_DoWhenIdle(DisplayListbox, (ClientData) listPtr); + Tcl_DoWhenIdle(DisplayListbox, listPtr); } /* @@ -3371,7 +3369,7 @@ ListboxListVarProc( const char *name2, /* Not used. */ int flags) /* Information about what happened. */ { - Listbox *listPtr = (Listbox *)clientData; + Listbox *listPtr = clientData; Tcl_Obj *oldListObj, *varListObj; int oldLength, i; Tcl_HashEntry *entry; diff --git a/generic/tkMacWinMenu.c b/generic/tkMacWinMenu.c index 54ab1dd..4f467b3 100644 --- a/generic/tkMacWinMenu.c +++ b/generic/tkMacWinMenu.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacWinMenu.c,v 1.6 2007/12/13 15:24:15 dgp Exp $ + * RCS: @(#) $Id: tkMacWinMenu.c,v 1.7 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -45,10 +45,10 @@ PreprocessMenu( TkMenu *menuPtr) { int index, result, finished; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - Tcl_Preserve((ClientData) menuPtr); + Tcl_Preserve(menuPtr); /* * First, let's process the post command on ourselves. If this command @@ -93,7 +93,7 @@ PreprocessMenu( } while (!finished); done: - Tcl_Release((ClientData) menuPtr); + Tcl_Release(menuPtr); return result; } @@ -131,7 +131,7 @@ int TkPreprocessMenu( TkMenu *menuPtr) { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); tsdPtr->postCommandGeneration++; diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 7c95f32..4c0cd41 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenu.c,v 1.54 2009/12/30 00:24:27 patthoyts Exp $ + * RCS: @(#) $Id: tkMenu.c,v 1.55 2010/01/02 22:52:38 dkf Exp $ */ /* @@ -1613,7 +1613,7 @@ ConfigureMenu( } tkwin = parent; } - if (((TkMenu*) tkwin)->menuType == MENUBAR) { + if (((TkMenu *) tkwin)->menuType == MENUBAR) { typeFlag = TK_MAKE_MENU_DROPDOWN; } diff --git a/generic/tkMenuDraw.c b/generic/tkMenuDraw.c index a86c067..41f5075 100644 --- a/generic/tkMenuDraw.c +++ b/generic/tkMenuDraw.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenuDraw.c,v 1.11 2009/09/14 23:41:42 hobbs Exp $ + * RCS: @(#) $Id: tkMenuDraw.c,v 1.12 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -434,7 +434,7 @@ TkEventuallyRecomputeMenu( { if (!(menuPtr->menuFlags & RESIZE_PENDING)) { menuPtr->menuFlags |= RESIZE_PENDING; - Tcl_DoWhenIdle(ComputeMenuGeometry, (ClientData) menuPtr); + Tcl_DoWhenIdle(ComputeMenuGeometry, menuPtr); } } @@ -460,8 +460,8 @@ TkRecomputeMenu( TkMenu *menuPtr) { if (menuPtr->menuFlags & RESIZE_PENDING) { - Tcl_CancelIdleCall(ComputeMenuGeometry, (ClientData) menuPtr); - ComputeMenuGeometry((ClientData) menuPtr); + Tcl_CancelIdleCall(ComputeMenuGeometry, menuPtr); + ComputeMenuGeometry(menuPtr); } } @@ -505,7 +505,7 @@ TkEventuallyRedrawMenu( || (menuPtr->menuFlags & REDRAW_PENDING)) { return; } - Tcl_DoWhenIdle(DisplayMenu, (ClientData) menuPtr); + Tcl_DoWhenIdle(DisplayMenu, menuPtr); menuPtr->menuFlags |= REDRAW_PENDING; } @@ -532,7 +532,7 @@ static void ComputeMenuGeometry( ClientData clientData) /* Structure describing menu. */ { - TkMenu *menuPtr = (TkMenu *) clientData; + TkMenu *menuPtr = clientData; if (menuPtr->tkwin == NULL) { return; @@ -588,12 +588,12 @@ TkMenuSelectImageProc( * <=0). */ int imgWidth, int imgHeight)/* New dimensions of image. */ { - register TkMenuEntry *mePtr = (TkMenuEntry *) clientData; + register TkMenuEntry *mePtr = clientData; if ((mePtr->entryFlags & ENTRY_SELECTED) && !(mePtr->menuPtr->menuFlags & REDRAW_PENDING)) { mePtr->menuPtr->menuFlags |= REDRAW_PENDING; - Tcl_DoWhenIdle(DisplayMenu, (ClientData) mePtr->menuPtr); + Tcl_DoWhenIdle(DisplayMenu, mePtr->menuPtr); } } @@ -617,7 +617,7 @@ static void DisplayMenu( ClientData clientData) /* Information about widget. */ { - register TkMenu *menuPtr = (TkMenu *) clientData; + register TkMenu *menuPtr = clientData; register TkMenuEntry *mePtr; register Tk_Window tkwin = menuPtr->tkwin; int index, strictMotif; @@ -747,7 +747,7 @@ TkMenuEventProc( ClientData clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { - TkMenu *menuPtr = (TkMenu *) clientData; + TkMenu *menuPtr = clientData; if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) { TkEventuallyRedrawMenu(menuPtr, NULL); @@ -774,14 +774,14 @@ TkMenuEventProc( menuPtr->widgetCmd = NULL; } if (menuPtr->menuFlags & REDRAW_PENDING) { - Tcl_CancelIdleCall(DisplayMenu, (ClientData) menuPtr); + Tcl_CancelIdleCall(DisplayMenu, menuPtr); menuPtr->menuFlags &= ~REDRAW_PENDING; } if (menuPtr->menuFlags & RESIZE_PENDING) { - Tcl_CancelIdleCall(ComputeMenuGeometry, (ClientData) menuPtr); + Tcl_CancelIdleCall(ComputeMenuGeometry, menuPtr); menuPtr->menuFlags &= ~RESIZE_PENDING; } - Tcl_EventuallyFree((ClientData) menuPtr, TCL_DYNAMIC); + Tcl_EventuallyFree(menuPtr, TCL_DYNAMIC); } } @@ -812,11 +812,11 @@ TkMenuImageProc( * <=0). */ int imgWidth, int imgHeight)/* New dimensions of image. */ { - register TkMenu *menuPtr = ((TkMenuEntry *)clientData)->menuPtr; + register TkMenu *menuPtr = ((TkMenuEntry *) clientData)->menuPtr; if ((menuPtr->tkwin != NULL) && !(menuPtr->menuFlags & RESIZE_PENDING)) { menuPtr->menuFlags |= RESIZE_PENDING; - Tcl_DoWhenIdle(ComputeMenuGeometry, (ClientData) menuPtr); + Tcl_DoWhenIdle(ComputeMenuGeometry, menuPtr); } } diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c index 0ea3b42..e94fdd1 100644 --- a/generic/tkMenubutton.c +++ b/generic/tkMenubutton.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenubutton.c,v 1.25 2009/04/10 16:07:54 das Exp $ + * RCS: @(#) $Id: tkMenubutton.c,v 1.26 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -767,6 +767,7 @@ MenuButtonEventProc( XEvent *eventPtr) /* Information about event. */ { TkMenuButton *mbPtr = clientData; + if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) { goto redraw; } else if (eventPtr->type == ConfigureNotify) { diff --git a/generic/tkMessage.c b/generic/tkMessage.c index 760c144..e4ee15b 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMessage.c,v 1.22 2008/10/17 23:18:37 nijtmans Exp $ + * RCS: @(#) $Id: tkMessage.c,v 1.23 2010/01/02 22:52:38 dkf Exp $ */ #include "default.h" @@ -527,9 +527,7 @@ MessageWorldChanged( XGCValues gcValues; GC gc = None; Tk_FontMetrics fm; - Message *msgPtr; - - msgPtr = (Message *) instanceData; + Message *msgPtr = instanceData; if (msgPtr->border != NULL) { Tk_SetBackgroundFromBorder(msgPtr->tkwin, msgPtr->border); diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 061e041..edb5e41 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkPanedWindow.c,v 1.38 2009/02/03 23:55:47 nijtmans Exp $ + * RCS: @(#) $Id: tkPanedWindow.c,v 1.39 2010/01/02 22:52:38 dkf Exp $ */ #include "default.h" @@ -1589,7 +1589,8 @@ PanedWindowReqProc( * window. */ { Slave *slavePtr = clientData; - PanedWindow *pwPtr = (PanedWindow *) (slavePtr->masterPtr); + PanedWindow *pwPtr = (PanedWindow *) slavePtr->masterPtr; + if (Tk_IsMapped(pwPtr->tkwin)) { if (!(pwPtr->flags & RESIZE_PENDING)) { pwPtr->flags |= RESIZE_PENDING; diff --git a/generic/tkPlace.c b/generic/tkPlace.c index 3169ba2..3586014 100644 --- a/generic/tkPlace.c +++ b/generic/tkPlace.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkPlace.c,v 1.28 2008/11/08 22:52:29 dkf Exp $ + * RCS: @(#) $Id: tkPlace.c,v 1.29 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -319,7 +319,7 @@ Tk_PlaceObjCmd( (char *) tkwin)); Tk_DeleteEventHandler(tkwin, StructureNotifyMask, SlaveStructureProc, slavePtr); - Tk_ManageGeometry(tkwin, NULL, (ClientData) NULL); + Tk_ManageGeometry(tkwin, NULL, NULL); Tk_UnmapWindow(tkwin); FreeSlave(slavePtr); break; @@ -385,7 +385,7 @@ CreateSlave( hPtr = Tcl_CreateHashEntry(&dispPtr->slaveTable, (char *) tkwin, &isNew); if (!isNew) { - return (Slave *) Tcl_GetHashValue(hPtr); + return Tcl_GetHashValue(hPtr); } /* @@ -453,16 +453,14 @@ static Slave * FindSlave( Tk_Window tkwin) /* Token for desired slave. */ { - Tcl_HashEntry *hPtr; - register Slave *slavePtr; + register Tcl_HashEntry *hPtr; TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr; hPtr = Tcl_FindHashEntry(&dispPtr->slaveTable, (char *) tkwin); if (hPtr == NULL) { return NULL; } - slavePtr = (Slave *) Tcl_GetHashValue(hPtr); - return slavePtr; + return Tcl_GetHashValue(hPtr); } /* @@ -548,9 +546,9 @@ CreateMaster( masterPtr->flags = 0; Tcl_SetHashValue(hPtr, masterPtr); Tk_CreateEventHandler(masterPtr->tkwin, StructureNotifyMask, - MasterStructureProc, (ClientData) masterPtr); + MasterStructureProc, masterPtr); } else { - masterPtr = (Master *) Tcl_GetHashValue(hPtr); + masterPtr = Tcl_GetHashValue(hPtr); } return masterPtr; } @@ -578,16 +576,14 @@ static Master * FindMaster( Tk_Window tkwin) /* Token for desired master. */ { - Tcl_HashEntry *hPtr; - register Master *masterPtr; + register Tcl_HashEntry *hPtr; TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr; hPtr = Tcl_FindHashEntry(&dispPtr->masterTable, (char *) tkwin); if (hPtr == NULL) { return NULL; } - masterPtr = (Master *) Tcl_GetHashValue(hPtr); - return masterPtr; + return Tcl_GetHashValue(hPtr); } /* @@ -853,7 +849,6 @@ RecomputePlacement( int x, y, width, height, tmp; int masterWidth, masterHeight, masterX, masterY; double x1, y1, x2, y2; - int abort; /* May get set to non-zero to abort this * placement operation. */ diff --git a/generic/tkPointer.c b/generic/tkPointer.c index 8a41775..dc97f33 100644 --- a/generic/tkPointer.c +++ b/generic/tkPointer.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkPointer.c,v 1.12 2009/04/10 16:20:00 das Exp $ + * RCS: @(#) $Id: tkPointer.c,v 1.13 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -140,7 +140,7 @@ GenerateEnterLeave( int state) /* State flags. */ { int crossed = 0; /* 1 if mouse crossed a window boundary */ - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); TkWindow *restrictWinPtr = tsdPtr->restrictWinPtr; TkWindow *lastWinPtr = tsdPtr->lastWinPtr; @@ -233,7 +233,7 @@ Tk_UpdatePointer( int x, int y, /* Pointer location in root coords. */ int state) /* Modifier state mask. */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); TkWindow *winPtr = (TkWindow *)tkwin; TkWindow *targetWinPtr; @@ -438,7 +438,7 @@ XGrabPointer( Cursor cursor, Time time) { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); display->request++; @@ -473,7 +473,7 @@ XUngrabPointer( Display *display, Time time) { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); display->request++; @@ -503,7 +503,7 @@ void TkPointerDeadWindow( TkWindow *winPtr) { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (winPtr == tsdPtr->lastWinPtr) { @@ -542,7 +542,7 @@ UpdateCursor( TkWindow *winPtr) { Cursor cursor = None; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* @@ -587,8 +587,8 @@ XDefineCursor( Window w, Cursor cursor) { - TkWindow *winPtr = (TkWindow *)Tk_IdToWindow(display, w); - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + TkWindow *winPtr = (TkWindow *) Tk_IdToWindow(display, w); + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (tsdPtr->cursorWinPtr == winPtr) { diff --git a/generic/tkScale.c b/generic/tkScale.c index 542fc82..816bf54 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -16,7 +16,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkScale.c,v 1.33 2008/11/08 22:52:29 dkf Exp $ + * RCS: @(#) $Id: tkScale.c,v 1.34 2010/01/02 22:52:38 dkf Exp $ */ #include "default.h" @@ -1004,7 +1004,7 @@ ScaleEventProc( if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) { TkEventuallyRedrawScale(scalePtr, REDRAW_ALL); } else if (eventPtr->type == DestroyNotify) { - DestroyScale((char *) clientData); + DestroyScale(clientData); } else if (eventPtr->type == ConfigureNotify) { ComputeScaleGeometry(scalePtr); TkEventuallyRedrawScale(scalePtr, REDRAW_ALL); diff --git a/generic/tkSelect.c b/generic/tkSelect.c index f79d541..c2277c6 100644 --- a/generic/tkSelect.c +++ b/generic/tkSelect.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkSelect.c,v 1.30 2009/07/23 22:21:35 dkf Exp $ + * RCS: @(#) $Id: tkSelect.c,v 1.31 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -193,9 +193,9 @@ Tk_CreateSelHandler( */ unsigned cmdInfoLen = sizeof(CommandInfo) + - ((CommandInfo*)clientData)->cmdLength - 3; + ((CommandInfo *) clientData)->cmdLength - 3; - selPtr->clientData = (ClientData) ckalloc(cmdInfoLen); + selPtr->clientData = ckalloc(cmdInfoLen); memcpy(selPtr->clientData, clientData, cmdInfoLen); } else { selPtr->clientData = clientData; @@ -243,7 +243,7 @@ Tk_DeleteSelHandler( TkWindow *winPtr = (TkWindow *) tkwin; register TkSelHandler *selPtr, *prevPtr; register TkSelInProgress *ipPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* @@ -384,7 +384,7 @@ Tk_OwnSelection( } } if (infoPtr == NULL) { - infoPtr = (TkSelectionInfo*) ckalloc(sizeof(TkSelectionInfo)); + infoPtr = (TkSelectionInfo *) ckalloc(sizeof(TkSelectionInfo)); infoPtr->selection = selection; infoPtr->nextPtr = dispPtr->selectionInfoPtr; dispPtr->selectionInfoPtr = infoPtr; @@ -558,7 +558,7 @@ Tk_GetSelection( TkWindow *winPtr = (TkWindow *) tkwin; TkDisplay *dispPtr = winPtr->dispPtr; TkSelectionInfo *infoPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (dispPtr->multipleAtom == None) { @@ -1036,7 +1036,7 @@ Tk_SelectionObjCmd( TkSelInProgress * TkSelGetInProgress(void) { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); return tsdPtr->pendingPtr; @@ -1063,7 +1063,7 @@ void TkSelSetInProgress( TkSelInProgress *pendingPtr) { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); tsdPtr->pendingPtr = pendingPtr; @@ -1093,7 +1093,7 @@ TkSelDeadWindow( register TkSelHandler *selPtr; register TkSelInProgress *ipPtr; TkSelectionInfo *infoPtr, *prevPtr, *nextPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* diff --git a/generic/tkStyle.c b/generic/tkStyle.c index a3262bf..fb17b53 100644 --- a/generic/tkStyle.c +++ b/generic/tkStyle.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkStyle.c,v 1.11 2008/11/08 18:44:40 dkf Exp $ + * RCS: @(#) $Id: tkStyle.c,v 1.12 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -64,7 +64,7 @@ typedef struct StyleEngine { StyledElement *elements; /* Table of widget element descriptors. Each * element is indexed by a unique system-wide * ID. Table grows dynamically as new elements - * are registered. Malloc'd*/ + * are registered. Malloc'd. */ struct StyleEngine *parentPtr; /* Parent engine. Engines may be layered to * form a fallback chain, terminated by the diff --git a/generic/tkText.c b/generic/tkText.c index c1cc433..a7d966a 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkText.c,v 1.92 2009/10/22 21:36:24 dkf Exp $ + * RCS: @(#) $Id: tkText.c,v 1.93 2010/01/02 22:52:38 dkf Exp $ */ #include "default.h" @@ -1914,7 +1914,7 @@ DestroyText( for (hPtr = Tcl_FirstHashEntry(&sharedTextPtr->windowTable, &search); hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) { TkTextEmbWindowClient *loop; - TkTextSegment *ewPtr = (TkTextSegment *) Tcl_GetHashValue(hPtr); + TkTextSegment *ewPtr = Tcl_GetHashValue(hPtr); loop = ewPtr->body.ew.clients; if (loop->textPtr == textPtr) { @@ -1946,7 +1946,7 @@ DestroyText( for (hPtr = Tcl_FirstHashEntry(&sharedTextPtr->tagTable, &search); hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) { - tagPtr = (TkTextTag *) Tcl_GetHashValue(hPtr); + tagPtr = Tcl_GetHashValue(hPtr); /* * No need to use 'TkTextDeleteTag' since we've already removed @@ -3024,7 +3024,7 @@ DeleteIndexRange( for (i=0, hPtr=Tcl_FirstHashEntry(&sharedTextPtr->tagTable, &search); hPtr != NULL; i++, hPtr = Tcl_NextHashEntry(&search)) { - TkTextTag *tagPtr = (TkTextTag *) Tcl_GetHashValue(hPtr); + TkTextTag *tagPtr = Tcl_GetHashValue(hPtr); TkBTreeTag(&index1, &index2, tagPtr, 0); } @@ -6422,9 +6422,8 @@ GetLineStartEnd( if (linePtr == NULL) { return Tcl_NewObj(); - } else { - return Tcl_NewIntObj(1+TkBTreeLinesTo(NULL, linePtr)); } + return Tcl_NewIntObj(1 + TkBTreeLinesTo(NULL, linePtr)); } /* @@ -6589,9 +6588,9 @@ TkpTesttextCmd( return TCL_ERROR; } if (info.isNativeObjectProc) { - textPtr = (TkText *) info.objClientData; + textPtr = info.objClientData; } else { - textPtr = (TkText *) info.clientData; + textPtr = info.clientData; } len = strlen(argv[2]); if (strncmp(argv[2], "byteindex", len) == 0) { diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c index 3d2efac..be8d0e9 100644 --- a/generic/tkTextBTree.c +++ b/generic/tkTextBTree.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextBTree.c,v 1.30 2009/09/07 07:29:04 das Exp $ + * RCS: @(#) $Id: tkTextBTree.c,v 1.31 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -3774,7 +3774,7 @@ TkBTreeCheck( for (entryPtr=Tcl_FirstHashEntry(&treePtr->sharedTextPtr->tagTable,&search); entryPtr != NULL ; entryPtr = Tcl_NextHashEntry(&search)) { - tagPtr = (TkTextTag *) Tcl_GetHashValue(entryPtr); + tagPtr = Tcl_GetHashValue(entryPtr); nodePtr = tagPtr->tagRootPtr; if (nodePtr == NULL) { if (tagPtr->toggleCount != 0) { diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 9a6b819..be9dd3b 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextDisp.c,v 1.75 2009/09/07 07:29:04 das Exp $ + * RCS: @(#) $Id: tkTextDisp.c,v 1.76 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -933,7 +933,7 @@ GetStyle( hPtr = Tcl_CreateHashEntry(&textPtr->dInfoPtr->styleTable, (char *) &styleValues, &isNew); if (!isNew) { - stylePtr = (TextStyle *) Tcl_GetHashValue(hPtr); + stylePtr = Tcl_GetHashValue(hPtr); stylePtr->refCount++; return stylePtr; } diff --git a/generic/tkTextImage.c b/generic/tkTextImage.c index d0572b0..ff2abbb 100644 --- a/generic/tkTextImage.c +++ b/generic/tkTextImage.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextImage.c,v 1.26 2009/02/06 08:12:07 das Exp $ + * RCS: @(#) $Id: tkTextImage.c,v 1.27 2010/01/02 22:52:38 dkf Exp $ */ #include "tkPort.h" @@ -99,8 +99,7 @@ static const Tk_OptionSpec optionSpecs[] = { TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END} }; - - + /* *-------------------------------------------------------------- * @@ -292,7 +291,7 @@ TkTextImageCmd( } return TCL_ERROR; } - + /* *-------------------------------------------------------------- * @@ -345,7 +344,7 @@ EmbImageConfigure( if (eiPtr->body.ei.imageString != NULL) { image = Tk_GetImage(textPtr->interp, textPtr->tkwin, - eiPtr->body.ei.imageString, EmbImageProc, (ClientData) eiPtr); + eiPtr->body.ei.imageString, EmbImageProc, eiPtr); if (image == NULL) { return TCL_ERROR; } @@ -420,7 +419,7 @@ EmbImageConfigure( return TCL_OK; } - + /* *-------------------------------------------------------------- * @@ -478,7 +477,7 @@ EmbImageDeleteProc( ckfree((char *) eiPtr); return 0; } - + /* *-------------------------------------------------------------- * @@ -504,7 +503,7 @@ EmbImageCleanupProc( eiPtr->body.ei.linePtr = linePtr; return eiPtr; } - + /* *-------------------------------------------------------------- * @@ -588,11 +587,11 @@ EmbImageLayoutProc( chunkPtr->width = width; chunkPtr->breakIndex = -1; chunkPtr->breakIndex = 1; - chunkPtr->clientData = (ClientData) eiPtr; + chunkPtr->clientData = eiPtr; eiPtr->body.ei.chunkCount += 1; return 1; } - + /* *-------------------------------------------------------------- * @@ -624,7 +623,7 @@ EmbImageCheckProc( eiPtr->size); } } - + /* *-------------------------------------------------------------- * @@ -660,7 +659,7 @@ EmbImageDisplayProc( int screenY) /* Y-coordinate in text window that * corresponds to y. */ { - TkTextSegment *eiPtr = (TkTextSegment *) chunkPtr->clientData; + TkTextSegment *eiPtr = chunkPtr->clientData; int lineX, imageX, imageY, width, height; Tk_Image image; @@ -683,7 +682,7 @@ EmbImageDisplayProc( Tk_RedrawImage(image, 0, 0, width, height, dst, imageX, imageY); } - + /* *-------------------------------------------------------------- * @@ -724,7 +723,7 @@ EmbImageBboxProc( int *heightPtr) /* Gets filled in with height of image, in * pixels. */ { - TkTextSegment *eiPtr = (TkTextSegment *) chunkPtr->clientData; + TkTextSegment *eiPtr = chunkPtr->clientData; Tk_Image image; image = eiPtr->body.ei.image; @@ -752,7 +751,7 @@ EmbImageBboxProc( break; } } - + /* *-------------------------------------------------------------- * @@ -785,13 +784,13 @@ TkTextImageIndex( if (hPtr == NULL) { return 0; } - eiPtr = (TkTextSegment *) Tcl_GetHashValue(hPtr); + eiPtr = Tcl_GetHashValue(hPtr); indexPtr->tree = textPtr->sharedTextPtr->tree; indexPtr->linePtr = eiPtr->body.ei.linePtr; indexPtr->byteIndex = TkTextSegToOffset(eiPtr, indexPtr->linePtr); return 1; } - + /* *-------------------------------------------------------------- * @@ -819,7 +818,7 @@ EmbImageProc( int imgWidth, int imgHeight)/* New dimensions of image. */ { - TkTextSegment *eiPtr = (TkTextSegment *) clientData; + TkTextSegment *eiPtr = clientData; TkTextIndex index; index.tree = eiPtr->body.ei.sharedTextPtr->tree; @@ -836,7 +835,7 @@ EmbImageProc( TkTextInvalidateLineMetrics(eiPtr->body.ei.sharedTextPtr, NULL, index.linePtr, 0, TK_TEXT_INVALIDATE_ONLY); } - + /* * Local Variables: * mode: c diff --git a/generic/tkTextMark.c b/generic/tkTextMark.c index 0a0dd2d..4fe035d 100644 --- a/generic/tkTextMark.c +++ b/generic/tkTextMark.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextMark.c,v 1.24 2009/02/03 23:55:47 nijtmans Exp $ + * RCS: @(#) $Id: tkTextMark.c,v 1.25 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -541,7 +541,7 @@ MarkLayoutProc( */ chunkPtr->breakIndex = -1; - chunkPtr->clientData = (ClientData) textPtr; + chunkPtr->clientData = textPtr; return 1; } @@ -582,7 +582,7 @@ TkTextInsertDisplayProc( * We have no need for the clientData. */ - /* TkText *textPtr = (TkText *) chunkPtr->clientData; */ + /* TkText *textPtr = chunkPtr->clientData; */ TkTextIndex index; int halfWidth = textPtr->insertWidth/2; int rightSideWidth; diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index 93a7a55..1e1757b 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextTag.c,v 1.32 2009/09/07 07:29:04 das Exp $ + * RCS: @(#) $Id: tkTextTag.c,v 1.33 2010/01/02 22:52:38 dkf Exp $ */ #include "default.h" @@ -353,7 +353,7 @@ TkTextTagCmd( } else { int result = TCL_OK; - if (Tk_SetOptions(interp, (char*)tagPtr, tagPtr->optionTable, + if (Tk_SetOptions(interp, (char *) tagPtr, tagPtr->optionTable, objc-4, objv+4, textPtr->tkwin, NULL, NULL) != TCL_OK) { return TCL_ERROR; } diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c index 7787cc6..aed117d 100644 --- a/generic/tkTextWind.c +++ b/generic/tkTextWind.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextWind.c,v 1.26 2008/12/09 21:22:56 dgp Exp $ + * RCS: @(#) $Id: tkTextWind.c,v 1.27 2010/01/02 22:52:38 dkf Exp $ */ #include "tkPort.h" @@ -218,7 +218,7 @@ TkTextWindowCmd( } if (objc <= 5) { TkTextEmbWindowClient *client; - Tcl_Obj* objPtr; + Tcl_Obj *objPtr; /* * Copy over client specific value before querying. @@ -410,8 +410,8 @@ EmbWinConfigure( &textPtr->sharedTextPtr->windowTable, Tk_PathName(oldWindow))); Tk_DeleteEventHandler(oldWindow, StructureNotifyMask, - EmbWinStructureProc, (ClientData) client); - Tk_ManageGeometry(oldWindow, NULL, (ClientData) NULL); + EmbWinStructureProc, client); + Tk_ManageGeometry(oldWindow, NULL, NULL); if (textPtr->tkwin != Tk_Parent(oldWindow)) { Tk_UnmaintainGeometry(oldWindow, textPtr->tkwin); } else { @@ -476,10 +476,9 @@ EmbWinConfigure( * event handler to find out when it is deleted. */ - Tk_ManageGeometry(ewPtr->body.ew.tkwin, &textGeomType, - (ClientData) client); + Tk_ManageGeometry(ewPtr->body.ew.tkwin, &textGeomType, client); Tk_CreateEventHandler(ewPtr->body.ew.tkwin, StructureNotifyMask, - EmbWinStructureProc, (ClientData) client); + EmbWinStructureProc, client); /* * Special trick! Must enter into the hash table *after* calling @@ -520,7 +519,7 @@ EmbWinStructureProc( ClientData clientData, /* Pointer to record describing window item. */ XEvent *eventPtr) /* Describes what just happened. */ { - TkTextEmbWindowClient *client = (TkTextEmbWindowClient*)clientData; + TkTextEmbWindowClient *client = clientData; TkTextSegment *ewPtr = client->parent; TkTextIndex index; Tcl_HashEntry *hPtr; @@ -573,7 +572,7 @@ EmbWinRequestProc( ClientData clientData, /* Pointer to record for window item. */ Tk_Window tkwin) /* Window that changed its desired size. */ { - TkTextEmbWindowClient *client = (TkTextEmbWindowClient*)clientData; + TkTextEmbWindowClient *client = clientData; TkTextSegment *ewPtr = client->parent; TkTextIndex index; @@ -610,15 +609,15 @@ EmbWinLostSlaveProc( Tk_Window tkwin) /* Window that was claimed away by another * geometry manager. */ { - TkTextEmbWindowClient *client = (TkTextEmbWindowClient*)clientData; + TkTextEmbWindowClient *client = clientData; TkTextSegment *ewPtr = client->parent; TkTextIndex index; Tcl_HashEntry *hPtr; TkTextEmbWindowClient *loop; Tk_DeleteEventHandler(client->tkwin, StructureNotifyMask, - EmbWinStructureProc, (ClientData) client); - Tcl_CancelIdleCall(EmbWinDelayedUnmap, (ClientData) client); + EmbWinStructureProc, client); + Tcl_CancelIdleCall(EmbWinDelayedUnmap, client); if (client->textPtr->tkwin != Tk_Parent(tkwin)) { Tk_UnmaintainGeometry(tkwin, client->textPtr->tkwin); } else { @@ -700,10 +699,10 @@ TkTextWinFreeClient( if (client->tkwin != NULL) { Tk_DeleteEventHandler(client->tkwin, StructureNotifyMask, - EmbWinStructureProc, (ClientData) client); + EmbWinStructureProc, client); Tk_DestroyWindow(client->tkwin); } - Tcl_CancelIdleCall(EmbWinDelayedUnmap, (ClientData) client); + Tcl_CancelIdleCall(EmbWinDelayedUnmap, client); /* * Free up this client. @@ -960,10 +959,9 @@ EmbWinLayoutProc( } client->tkwin = ewPtr->body.ew.tkwin; - Tk_ManageGeometry(client->tkwin, &textGeomType, - (ClientData) client); + Tk_ManageGeometry(client->tkwin, &textGeomType, client); Tk_CreateEventHandler(client->tkwin, StructureNotifyMask, - EmbWinStructureProc, (ClientData) client); + EmbWinStructureProc, client); /* * Special trick! Must enter into the hash table *after* calling @@ -1015,7 +1013,7 @@ EmbWinLayoutProc( chunkPtr->width = width; chunkPtr->breakIndex = -1; chunkPtr->breakIndex = 1; - chunkPtr->clientData = (ClientData) ewPtr; + chunkPtr->clientData = ewPtr; if (client != NULL) { client->chunkCount += 1; } @@ -1091,7 +1089,7 @@ TkTextEmbWinDisplayProc( { int lineX, windowX, windowY, width, height; Tk_Window tkwin; - TkTextSegment *ewPtr = (TkTextSegment*) chunkPtr->clientData; + TkTextSegment *ewPtr = chunkPtr->clientData; TkTextEmbWindowClient *client = EmbWinGetClient(textPtr, ewPtr); if (client == NULL) { @@ -1167,7 +1165,7 @@ EmbWinUndisplayProc( TkText *textPtr, /* Overall information about text widget. */ TkTextDispChunk *chunkPtr) /* Chunk that is about to be freed. */ { - TkTextSegment *ewPtr = (TkTextSegment*) chunkPtr->clientData; + TkTextSegment *ewPtr = chunkPtr->clientData; TkTextEmbWindowClient *client = EmbWinGetClient(textPtr, ewPtr); if (client == NULL) { @@ -1185,7 +1183,7 @@ EmbWinUndisplayProc( */ client->displayed = 0; - Tcl_DoWhenIdle(EmbWinDelayedUnmap, (ClientData) client); + Tcl_DoWhenIdle(EmbWinDelayedUnmap, client); } } @@ -1230,7 +1228,7 @@ EmbWinBboxProc( * pixels. */ { Tk_Window tkwin; - TkTextSegment *ewPtr = (TkTextSegment *) chunkPtr->clientData; + TkTextSegment *ewPtr = chunkPtr->clientData; TkTextEmbWindowClient *client = EmbWinGetClient(textPtr, ewPtr); if (client == NULL) { @@ -1292,7 +1290,7 @@ static void EmbWinDelayedUnmap( ClientData clientData) /* Token for the window to be unmapped. */ { - TkTextEmbWindowClient *client = (TkTextEmbWindowClient*) clientData; + TkTextEmbWindowClient *client = clientData; if (!client->displayed && (client->tkwin != NULL)) { if (client->textPtr->tkwin != Tk_Parent(client->tkwin)) { @@ -1336,7 +1334,7 @@ TkTextWindowIndex( return 0; } - ewPtr = (TkTextSegment *) Tcl_GetHashValue(hPtr); + ewPtr = Tcl_GetHashValue(hPtr); indexPtr->tree = textPtr->sharedTextPtr->tree; indexPtr->linePtr = ewPtr->body.ew.linePtr; indexPtr->byteIndex = TkTextSegToOffset(ewPtr, indexPtr->linePtr); |