summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornijtmans <nijtmans>2008-11-09 20:51:28 (GMT)
committernijtmans <nijtmans>2008-11-09 20:51:28 (GMT)
commitdf18c1fe67355d2bb0b36c28e8c9a66f1d5ae3c8 (patch)
treeb0eb47d8c31b341a93520b3ddc364fcb3e5077df
parent6bb91a5313a57dceb34e2cd3764971af61368408 (diff)
downloadtk-df18c1fe67355d2bb0b36c28e8c9a66f1d5ae3c8.zip
tk-df18c1fe67355d2bb0b36c28e8c9a66f1d5ae3c8.tar.gz
tk-df18c1fe67355d2bb0b36c28e8c9a66f1d5ae3c8.tar.bz2
make all Tk_CustomOption tables const and
remove unnecessary type cast
-rw-r--r--ChangeLog11
-rw-r--r--generic/tkCanvBmap.c12
-rw-r--r--generic/tkCanvImg.c12
-rw-r--r--generic/tkCanvPoly.c14
-rw-r--r--generic/tkCanvText.c8
-rw-r--r--generic/tkCanvWind.c12
-rw-r--r--generic/tkCanvas.c14
-rw-r--r--generic/tkRectOval.c27
-rw-r--r--generic/tkScrollbar.c8
9 files changed, 57 insertions, 61 deletions
diff --git a/ChangeLog b/ChangeLog
index a61cc41..918bd9f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-11-09 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkCanvas.c: make all Tk_CustomOption tables const and
+ * generic/tkCanvBmap.c: remove unnecessary type cast
+ * generic/tkCanvImg.c:
+ * generic/tkCanvPoly.c:
+ * generic/tkCanvText.c:
+ * generic/tkCanvWind.c:
+ * generic/tkRectOval.c:
+ * generic/tkScrollbar.c:
+
2008-11-06 Jan Nijtmans <nijtmans@users.sf.net>
* win/tcl.m4: add "-Wno-implicit-int" flag for gcc, as on UNIX
diff --git a/generic/tkCanvBmap.c b/generic/tkCanvBmap.c
index 72afa99..932e6ed 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.15 2008/04/27 22:38:55 dkf Exp $
+ * RCS: @(#) $Id: tkCanvBmap.c,v 1.16 2008/11/09 20:51:28 nijtmans Exp $
*/
#include <stdio.h>
@@ -43,13 +43,11 @@ typedef struct BitmapItem {
* Information used for parsing configuration specs:
*/
-static Tk_CustomOption stateOption = {
- (Tk_OptionParseProc *) TkStateParseProc,
- TkStatePrintProc, (ClientData) 2
+static const Tk_CustomOption stateOption = {
+ TkStateParseProc, TkStatePrintProc, (ClientData) 2
};
-static Tk_CustomOption tagsOption = {
- (Tk_OptionParseProc *) Tk_CanvasTagsParseProc,
- Tk_CanvasTagsPrintProc, (ClientData) NULL
+static const Tk_CustomOption tagsOption = {
+ Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, (ClientData) NULL
};
static Tk_ConfigSpec configSpecs[] = {
diff --git a/generic/tkCanvImg.c b/generic/tkCanvImg.c
index 02cce14..96a17e4 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.12 2008/04/27 22:38:55 dkf Exp $
+ * RCS: @(#) $Id: tkCanvImg.c,v 1.13 2008/11/09 20:51:28 nijtmans Exp $
*/
#include <stdio.h>
@@ -46,13 +46,11 @@ typedef struct ImageItem {
* Information used for parsing configuration specs:
*/
-static Tk_CustomOption stateOption = {
- (Tk_OptionParseProc *) TkStateParseProc,
- TkStatePrintProc, (ClientData) 2
+static const Tk_CustomOption stateOption = {
+ TkStateParseProc, TkStatePrintProc, (ClientData) 2
};
-static Tk_CustomOption tagsOption = {
- (Tk_OptionParseProc *) Tk_CanvasTagsParseProc,
- Tk_CanvasTagsPrintProc, (ClientData) NULL
+static const Tk_CustomOption tagsOption = {
+ Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, (ClientData) NULL
};
static Tk_ConfigSpec configSpecs[] = {
diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c
index c9c1e8d..e8a9f56 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.21 2008/11/01 16:14:30 dkf Exp $
+ * RCS: @(#) $Id: tkCanvPoly.c,v 1.22 2008/11/09 20:51:28 nijtmans Exp $
*/
#include <stdio.h>
@@ -57,23 +57,23 @@ typedef struct PolygonItem {
* Information used for parsing configuration specs:
*/
-static Tk_CustomOption smoothOption = {
+static const Tk_CustomOption smoothOption = {
TkSmoothParseProc, TkSmoothPrintProc, (ClientData) NULL
};
-static Tk_CustomOption stateOption = {
+static const Tk_CustomOption stateOption = {
TkStateParseProc, TkStatePrintProc, (ClientData) 2
};
-static Tk_CustomOption tagsOption = {
+static const Tk_CustomOption tagsOption = {
Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, (ClientData) NULL
};
-static Tk_CustomOption dashOption = {
+static const Tk_CustomOption dashOption = {
TkCanvasDashParseProc, TkCanvasDashPrintProc, (ClientData) NULL
};
-static Tk_CustomOption offsetOption = {
+static const Tk_CustomOption offsetOption = {
TkOffsetParseProc, TkOffsetPrintProc,
(ClientData) (TK_OFFSET_RELATIVE|TK_OFFSET_INDEX)
};
-static Tk_CustomOption pixelOption = {
+static const Tk_CustomOption pixelOption = {
TkPixelParseProc, TkPixelPrintProc, (ClientData) NULL
};
diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c
index bc0fe74..efa2b70 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.31 2008/11/01 16:14:30 dkf Exp $
+ * RCS: @(#) $Id: tkCanvText.c,v 1.32 2008/11/09 20:51:28 nijtmans Exp $
*/
#include <stdio.h>
@@ -84,13 +84,13 @@ typedef struct TextItem {
* Information used for parsing configuration specs:
*/
-static Tk_CustomOption stateOption = {
+static const Tk_CustomOption stateOption = {
TkStateParseProc, TkStatePrintProc, (ClientData) 2
};
-static Tk_CustomOption tagsOption = {
+static const Tk_CustomOption tagsOption = {
Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, (ClientData) NULL
};
-static Tk_CustomOption offsetOption = {
+static const Tk_CustomOption offsetOption = {
TkOffsetParseProc, TkOffsetPrintProc, (ClientData) (TK_OFFSET_RELATIVE)
};
diff --git a/generic/tkCanvWind.c b/generic/tkCanvWind.c
index 405c81e..a133898 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.17 2008/04/27 22:38:55 dkf Exp $
+ * RCS: @(#) $Id: tkCanvWind.c,v 1.18 2008/11/09 20:51:28 nijtmans Exp $
*/
#include <stdio.h>
@@ -40,13 +40,11 @@ typedef struct WindowItem {
* Information used for parsing configuration specs:
*/
-static Tk_CustomOption stateOption = {
- (Tk_OptionParseProc *) TkStateParseProc,
- TkStatePrintProc, (ClientData) 2
+static const Tk_CustomOption stateOption = {
+ TkStateParseProc, TkStatePrintProc, (ClientData) 2
};
-static Tk_CustomOption tagsOption = {
- (Tk_OptionParseProc *) Tk_CanvasTagsParseProc,
- Tk_CanvasTagsPrintProc, (ClientData) NULL
+static const Tk_CustomOption tagsOption = {
+ Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, (ClientData) NULL
};
static Tk_ConfigSpec configSpecs[] = {
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index bfdc2c8..a3a2bd9 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.56 2008/11/03 10:17:49 dkf Exp $
+ * RCS: @(#) $Id: tkCanvas.c,v 1.57 2008/11/09 20:51:28 nijtmans Exp $
*/
/* #define USE_OLD_TAG_SEARCH 1 */
@@ -102,15 +102,13 @@ typedef struct TagSearch {
* Custom option for handling "-state" and "-offset"
*/
-static Tk_CustomOption stateOption = {
- (Tk_OptionParseProc *) TkStateParseProc,
- TkStatePrintProc,
+static const Tk_CustomOption stateOption = {
+ TkStateParseProc, TkStatePrintProc,
(ClientData) NULL /* Only "normal" and "disabled". */
};
-static Tk_CustomOption offsetOption = {
- (Tk_OptionParseProc *) TkOffsetParseProc,
- TkOffsetPrintProc,
+static const Tk_CustomOption offsetOption = {
+ TkOffsetParseProc, TkOffsetPrintProc,
(ClientData) TK_OFFSET_RELATIVE
};
@@ -2007,7 +2005,7 @@ CanvasWidgetCmd(
}
FIRST_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto done);
if (itemPtr != NULL) {
- Tcl_SetObjResult(interp,
+ Tcl_SetObjResult(interp,
Tcl_NewStringObj(itemPtr->typePtr->name, -1));
}
break;
diff --git a/generic/tkRectOval.c b/generic/tkRectOval.c
index 00a8852..b9b79aa 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.18 2008/04/27 22:38:57 dkf Exp $
+ * RCS: @(#) $Id: tkRectOval.c,v 1.19 2008/11/09 20:51:28 nijtmans Exp $
*/
#include <stdio.h>
@@ -45,25 +45,20 @@ typedef struct RectOvalItem {
* Information used for parsing configuration specs:
*/
-static Tk_CustomOption stateOption = {
- (Tk_OptionParseProc *) TkStateParseProc,
- TkStatePrintProc, (ClientData) 2
+static const Tk_CustomOption stateOption = {
+ TkStateParseProc, TkStatePrintProc, (ClientData) 2
};
-static Tk_CustomOption tagsOption = {
- (Tk_OptionParseProc *) Tk_CanvasTagsParseProc,
- Tk_CanvasTagsPrintProc, (ClientData) NULL
+static const Tk_CustomOption tagsOption = {
+ Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, (ClientData) NULL
};
-static Tk_CustomOption dashOption = {
- (Tk_OptionParseProc *) TkCanvasDashParseProc,
- TkCanvasDashPrintProc, (ClientData) NULL
+static const Tk_CustomOption dashOption = {
+ TkCanvasDashParseProc, TkCanvasDashPrintProc, (ClientData) NULL
};
-static Tk_CustomOption offsetOption = {
- (Tk_OptionParseProc *) TkOffsetParseProc,
- TkOffsetPrintProc, (ClientData) TK_OFFSET_RELATIVE
+static const Tk_CustomOption offsetOption = {
+ TkOffsetParseProc, TkOffsetPrintProc, (ClientData) TK_OFFSET_RELATIVE
};
-static Tk_CustomOption pixelOption = {
- (Tk_OptionParseProc *) TkPixelParseProc,
- TkPixelPrintProc, (ClientData) NULL
+static const Tk_CustomOption pixelOption = {
+ TkPixelParseProc, TkPixelPrintProc, (ClientData) NULL
};
static Tk_ConfigSpec configSpecs[] = {
diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c
index 64bdc70..b751d33 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.16 2008/11/08 22:52:29 dkf Exp $
+ * RCS: @(#) $Id: tkScrollbar.c,v 1.17 2008/11/09 20:51:28 nijtmans Exp $
*/
#include "tkInt.h"
@@ -22,10 +22,8 @@
* Custom option for handling "-orient"
*/
-static Tk_CustomOption orientOption = {
- (Tk_OptionParseProc *) TkOrientParseProc,
- TkOrientPrintProc,
- NULL
+static const Tk_CustomOption orientOption = {
+ TkOrientParseProc, TkOrientPrintProc, (ClientData) NULL
};
/*