diff options
author | nijtmans <nijtmans> | 2010-06-15 11:16:02 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2010-06-15 11:16:02 (GMT) |
commit | 44e1474dff17602e83a2376713917e7a0d593257 (patch) | |
tree | 377b18f7cb439e3eb421010182cff5c13fb0d3f6 /generic | |
parent | a34bfada726e6875a00fb81a5d4f708c373e5bb3 (diff) | |
download | tk-44e1474dff17602e83a2376713917e7a0d593257.zip tk-44e1474dff17602e83a2376713917e7a0d593257.tar.gz tk-44e1474dff17602e83a2376713917e7a0d593257.tar.bz2 |
Eliminate many unnecessary (ClientData) type casts.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkCanvArc.c | 14 | ||||
-rw-r--r-- | generic/tkCanvBmap.c | 6 | ||||
-rw-r--r-- | generic/tkCanvImg.c | 6 | ||||
-rw-r--r-- | generic/tkCanvLine.c | 18 | ||||
-rw-r--r-- | generic/tkCanvPoly.c | 14 | ||||
-rw-r--r-- | generic/tkCanvText.c | 8 | ||||
-rw-r--r-- | generic/tkCanvWind.c | 6 | ||||
-rw-r--r-- | generic/tkCanvas.c | 7 | ||||
-rw-r--r-- | generic/tkRectOval.c | 12 | ||||
-rw-r--r-- | generic/tkScrollbar.c | 4 | ||||
-rw-r--r-- | generic/tkStyle.c | 5 | ||||
-rw-r--r-- | generic/tkTest.c | 21 |
12 files changed, 59 insertions, 62 deletions
diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c index 96bc03c..22ab653 100644 --- a/generic/tkCanvArc.c +++ b/generic/tkCanvArc.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: tkCanvArc.c,v 1.22 2010/02/17 19:21:16 nijtmans Exp $ + * RCS: @(#) $Id: tkCanvArc.c,v 1.23 2010/06/15 11:16:03 nijtmans Exp $ */ #include "tkInt.h" @@ -86,22 +86,22 @@ static const char * StylePrintProc(ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); static const Tk_CustomOption stateOption = { - TkStateParseProc, TkStatePrintProc, (ClientData) 2 + TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption styleOption = { - StyleParseProc, StylePrintProc, (ClientData) NULL + StyleParseProc, StylePrintProc, NULL }; static const Tk_CustomOption tagsOption = { - Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, (ClientData) NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_CustomOption dashOption = { - TkCanvasDashParseProc, TkCanvasDashPrintProc, (ClientData) NULL + TkCanvasDashParseProc, TkCanvasDashPrintProc, NULL }; static const Tk_CustomOption offsetOption = { - TkOffsetParseProc, TkOffsetPrintProc, (ClientData) (TK_OFFSET_RELATIVE) + TkOffsetParseProc, TkOffsetPrintProc, INT2PTR(TK_OFFSET_RELATIVE) }; static const Tk_CustomOption pixelOption = { - TkPixelParseProc, TkPixelPrintProc, (ClientData) NULL + TkPixelParseProc, TkPixelPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { diff --git a/generic/tkCanvBmap.c b/generic/tkCanvBmap.c index 256cc64..79f4110 100644 --- a/generic/tkCanvBmap.c +++ b/generic/tkCanvBmap.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: tkCanvBmap.c,v 1.19 2010/02/17 19:21:15 nijtmans Exp $ + * RCS: @(#) $Id: tkCanvBmap.c,v 1.20 2010/06/15 11:16:03 nijtmans Exp $ */ #include "tkInt.h" @@ -43,10 +43,10 @@ typedef struct BitmapItem { */ static const Tk_CustomOption stateOption = { - TkStateParseProc, TkStatePrintProc, (ClientData) 2 + TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, (ClientData) NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { diff --git a/generic/tkCanvImg.c b/generic/tkCanvImg.c index 5141dbe..ac97926 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.17 2010/02/17 19:21:16 nijtmans Exp $ + * RCS: @(#) $Id: tkCanvImg.c,v 1.18 2010/06/15 11:16:03 nijtmans Exp $ */ #include "tkInt.h" @@ -46,10 +46,10 @@ typedef struct ImageItem { */ static const Tk_CustomOption stateOption = { - TkStateParseProc, TkStatePrintProc, (ClientData) 2 + TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, (ClientData) NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c index 0752354..79d2c2b 100644 --- a/generic/tkCanvLine.c +++ b/generic/tkCanvLine.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: tkCanvLine.c,v 1.32 2010/02/17 19:21:16 nijtmans Exp $ + * RCS: @(#) $Id: tkCanvLine.c,v 1.33 2010/06/15 11:16:03 nijtmans Exp $ */ #include "tkInt.h" @@ -132,29 +132,29 @@ static void TranslateLine(Tk_Canvas canvas, */ static const Tk_CustomOption arrowShapeOption = { - ParseArrowShape, PrintArrowShape, (ClientData) NULL + ParseArrowShape, PrintArrowShape, NULL }; static const Tk_CustomOption arrowOption = { - ArrowParseProc, ArrowPrintProc, (ClientData) NULL + ArrowParseProc, ArrowPrintProc, NULL }; static const Tk_CustomOption smoothOption = { - TkSmoothParseProc, TkSmoothPrintProc, (ClientData) NULL + TkSmoothParseProc, TkSmoothPrintProc, NULL }; static const Tk_CustomOption stateOption = { - TkStateParseProc, TkStatePrintProc, (ClientData) 2 + TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, (ClientData) NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_CustomOption dashOption = { - TkCanvasDashParseProc, TkCanvasDashPrintProc, (ClientData) NULL + TkCanvasDashParseProc, TkCanvasDashPrintProc, NULL }; static const Tk_CustomOption offsetOption = { TkOffsetParseProc, TkOffsetPrintProc, - (ClientData) (TK_OFFSET_RELATIVE|TK_OFFSET_INDEX) + INT2PTR(TK_OFFSET_RELATIVE|TK_OFFSET_INDEX) }; static const Tk_CustomOption pixelOption = { - TkPixelParseProc, TkPixelPrintProc, (ClientData) NULL + TkPixelParseProc, TkPixelPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c index 9f09c3c..e777d60 100644 --- a/generic/tkCanvPoly.c +++ b/generic/tkCanvPoly.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: tkCanvPoly.c,v 1.26 2010/02/17 19:21:16 nijtmans Exp $ + * RCS: @(#) $Id: tkCanvPoly.c,v 1.27 2010/06/15 11:16:03 nijtmans Exp $ */ #include "tkInt.h" @@ -57,23 +57,23 @@ typedef struct PolygonItem { */ static const Tk_CustomOption smoothOption = { - TkSmoothParseProc, TkSmoothPrintProc, (ClientData) NULL + TkSmoothParseProc, TkSmoothPrintProc, NULL }; static const Tk_CustomOption stateOption = { - TkStateParseProc, TkStatePrintProc, (ClientData) 2 + TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, (ClientData) NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_CustomOption dashOption = { - TkCanvasDashParseProc, TkCanvasDashPrintProc, (ClientData) NULL + TkCanvasDashParseProc, TkCanvasDashPrintProc, NULL }; static const Tk_CustomOption offsetOption = { TkOffsetParseProc, TkOffsetPrintProc, - (ClientData) (TK_OFFSET_RELATIVE|TK_OFFSET_INDEX) + INT2PTR(TK_OFFSET_RELATIVE|TK_OFFSET_INDEX) }; static const Tk_CustomOption pixelOption = { - TkPixelParseProc, TkPixelPrintProc, (ClientData) NULL + TkPixelParseProc, TkPixelPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c index d5f1ae2..db81c79 100644 --- a/generic/tkCanvText.c +++ b/generic/tkCanvText.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: tkCanvText.c,v 1.38 2010/02/17 19:21:16 nijtmans Exp $ + * RCS: @(#) $Id: tkCanvText.c,v 1.39 2010/06/15 11:16:03 nijtmans Exp $ */ #include "tkInt.h" @@ -86,13 +86,13 @@ typedef struct TextItem { */ static const Tk_CustomOption stateOption = { - TkStateParseProc, TkStatePrintProc, (ClientData) 2 + TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, (ClientData) NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_CustomOption offsetOption = { - TkOffsetParseProc, TkOffsetPrintProc, (ClientData) (TK_OFFSET_RELATIVE) + TkOffsetParseProc, TkOffsetPrintProc, INT2PTR(TK_OFFSET_RELATIVE) }; static const Tk_ConfigSpec configSpecs[] = { diff --git a/generic/tkCanvWind.c b/generic/tkCanvWind.c index 031879f..c83860c 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.22 2010/02/17 19:21:16 nijtmans Exp $ + * RCS: @(#) $Id: tkCanvWind.c,v 1.23 2010/06/15 11:16:03 nijtmans Exp $ */ #include "tkInt.h" @@ -40,10 +40,10 @@ typedef struct WindowItem { */ static const Tk_CustomOption stateOption = { - TkStateParseProc, TkStatePrintProc, (ClientData) 2 + TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, (ClientData) NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 4e39367..275b97f 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.65 2010/02/17 19:21:16 nijtmans Exp $ + * RCS: @(#) $Id: tkCanvas.c,v 1.66 2010/06/15 11:16:03 nijtmans Exp $ */ /* #define USE_OLD_TAG_SEARCH 1 */ @@ -104,12 +104,11 @@ typedef struct TagSearch { static const Tk_CustomOption stateOption = { TkStateParseProc, TkStatePrintProc, - (ClientData) NULL /* Only "normal" and "disabled". */ + NULL /* Only "normal" and "disabled". */ }; static const Tk_CustomOption offsetOption = { - TkOffsetParseProc, TkOffsetPrintProc, - (ClientData) TK_OFFSET_RELATIVE + TkOffsetParseProc, TkOffsetPrintProc, INT2PTR(TK_OFFSET_RELATIVE) }; /* diff --git a/generic/tkRectOval.c b/generic/tkRectOval.c index d300259..adb36db 100644 --- a/generic/tkRectOval.c +++ b/generic/tkRectOval.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: tkRectOval.c,v 1.22 2010/02/17 19:21:16 nijtmans Exp $ + * RCS: @(#) $Id: tkRectOval.c,v 1.23 2010/06/15 11:16:03 nijtmans Exp $ */ #include "tkInt.h" @@ -45,19 +45,19 @@ typedef struct RectOvalItem { */ static const Tk_CustomOption stateOption = { - TkStateParseProc, TkStatePrintProc, (ClientData) 2 + TkStateParseProc, TkStatePrintProc, INT2PTR(2) }; static const Tk_CustomOption tagsOption = { - Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, (ClientData) NULL + Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, NULL }; static const Tk_CustomOption dashOption = { - TkCanvasDashParseProc, TkCanvasDashPrintProc, (ClientData) NULL + TkCanvasDashParseProc, TkCanvasDashPrintProc, NULL }; static const Tk_CustomOption offsetOption = { - TkOffsetParseProc, TkOffsetPrintProc, (ClientData) TK_OFFSET_RELATIVE + TkOffsetParseProc, TkOffsetPrintProc, INT2PTR(TK_OFFSET_RELATIVE) }; static const Tk_CustomOption pixelOption = { - TkPixelParseProc, TkPixelPrintProc, (ClientData) NULL + TkPixelParseProc, TkPixelPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c index fc93574..e6cd0d9 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.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: tkScrollbar.c,v 1.20 2010/02/17 19:21:16 nijtmans Exp $ + * RCS: @(#) $Id: tkScrollbar.c,v 1.21 2010/06/15 11:16:03 nijtmans Exp $ */ #include "tkInt.h" @@ -23,7 +23,7 @@ */ static const Tk_CustomOption orientOption = { - TkOrientParseProc, TkOrientPrintProc, (ClientData) NULL + TkOrientParseProc, TkOrientPrintProc, NULL }; /* non-const space for "-width" default value for scrollbars */ diff --git a/generic/tkStyle.c b/generic/tkStyle.c index fb17b53..fda6f7b 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.12 2010/01/02 22:52:38 dkf Exp $ + * RCS: @(#) $Id: tkStyle.c,v 1.13 2010/06/15 11:16:03 nijtmans Exp $ */ #include "tkInt.h" @@ -210,8 +210,7 @@ TkStylePkgInit( * Create the default system style. */ - Tk_CreateStyle(NULL, (Tk_StyleEngine) tsdPtr->defaultEnginePtr, - (ClientData) 0); + Tk_CreateStyle(NULL, (Tk_StyleEngine) tsdPtr->defaultEnginePtr, NULL); tsdPtr->nbInit++; } diff --git a/generic/tkTest.c b/generic/tkTest.c index 04cc8e8..4b693f0 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.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: tkTest.c,v 1.47 2010/02/22 23:38:53 nijtmans Exp $ + * RCS: @(#) $Id: tkTest.c,v 1.48 2010/06/15 11:16:03 nijtmans Exp $ */ #undef STATIC_BUILD @@ -249,8 +249,7 @@ Tktest_Init( return TCL_ERROR; } - Tcl_CreateObjCommand(interp, "square", SquareObjCmd, - (ClientData) NULL, NULL); + Tcl_CreateObjCommand(interp, "square", SquareObjCmd, NULL, NULL); Tcl_CreateCommand(interp, "testcbind", TestcbindCmd, (ClientData) Tk_MainWindow(interp), NULL); Tcl_CreateObjCommand(interp, "testbitmap", TestbitmapObjCmd, @@ -639,7 +638,7 @@ TestobjconfigObjCmd( CustomOptionGet, CustomOptionRestore, CustomOptionFree, - (ClientData) 1 + INT2PTR(1) }; Tk_Window mainWin = (Tk_Window) clientData; Tk_Window tkwin; @@ -1064,9 +1063,9 @@ TestobjconfigObjCmd( if (result == TCL_OK) { recordPtr->header.widgetCmd = Tcl_CreateObjCommand(interp, Tcl_GetString(objv[2]), TrivialConfigObjCmd, - (ClientData) recordPtr, TrivialCmdDeletedProc); + recordPtr, TrivialCmdDeletedProc); Tk_CreateEventHandler(tkwin, StructureNotifyMask, - TrivialEventProc, (ClientData) recordPtr); + TrivialEventProc, recordPtr); result = Tk_SetOptions(interp, (char *) recordPtr, optionTable, objc - 3, objv + 3, tkwin, NULL, NULL); if (result != TCL_OK) { @@ -1207,9 +1206,9 @@ TestobjconfigObjCmd( if (result == TCL_OK) { recordPtr->header.widgetCmd = Tcl_CreateObjCommand(interp, Tcl_GetString(objv[2]), TrivialConfigObjCmd, - (ClientData) recordPtr, TrivialCmdDeletedProc); + recordPtr, TrivialCmdDeletedProc); Tk_CreateEventHandler(tkwin, StructureNotifyMask, - TrivialEventProc, (ClientData) recordPtr); + TrivialEventProc, recordPtr); Tcl_SetObjResult(interp, objv[2]); } else { Tk_FreeConfigOptions((char *) recordPtr, @@ -1529,8 +1528,8 @@ ImageCreate( strcpy(timPtr->imageName, name); timPtr->varName = (char *) ckalloc((unsigned) (strlen(varName) + 1)); strcpy(timPtr->varName, varName); - Tcl_CreateCommand(interp, name, ImageCmd, (ClientData) timPtr, NULL); - *clientDataPtr = (ClientData) timPtr; + Tcl_CreateCommand(interp, name, ImageCmd, timPtr, NULL); + *clientDataPtr = timPtr; Tk_ImageChanged(master, 0, 0, 30, 15, 30, 15); return TCL_OK; } @@ -1630,7 +1629,7 @@ ImageGet( instPtr->fg = Tk_GetColor(timPtr->interp, tkwin, "#ff0000"); gcValues.foreground = instPtr->fg->pixel; instPtr->gc = Tk_GetGC(tkwin, GCForeground, &gcValues); - return (ClientData) instPtr; + return instPtr; } /* |