diff options
author | nijtmans <nijtmans> | 2008-10-30 21:39:16 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2008-10-30 21:39:16 (GMT) |
commit | bc7cc1de3c6e12a43abe48282f8eeb413b3bb22a (patch) | |
tree | 9b240e7e0a446a742160201af095d711ba73aa70 /generic/tkCanvArc.c | |
parent | c1f0473e3354fd5c7471d0389e6bcd9a200ec8c7 (diff) | |
download | tk-bc7cc1de3c6e12a43abe48282f8eeb413b3bb22a.zip tk-bc7cc1de3c6e12a43abe48282f8eeb413b3bb22a.tar.gz tk-bc7cc1de3c6e12a43abe48282f8eeb413b3bb22a.tar.bz2 |
[Bug 2190619] Warnings due to Tk_SmoothMethod
name constness change.
Although dkf's solution (simply adding a type cast)
is correct as well, changing the return value (as das
suggested) has the advantage that
all Tk_OptionPrintProc implementations don't
need a type cast any more in its code. This
makes all those functions robust against
the -Wwrite-strings warning option.
Further on, the customPtr field of Tk_ConfigSpec
can be a constant, without any danger of
source incompatibility.
Diffstat (limited to 'generic/tkCanvArc.c')
-rw-r--r-- | generic/tkCanvArc.c | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c index eb2217f..03496f0 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.17 2008/04/27 22:38:55 dkf Exp $ + * RCS: @(#) $Id: tkCanvArc.c,v 1.18 2008/10/30 21:39:16 nijtmans Exp $ */ #include <stdio.h> @@ -83,32 +83,26 @@ typedef struct ArcItem { static int StyleParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, const char *value, char *widgRec, int offset); -static char * StylePrintProc(ClientData clientData, Tk_Window tkwin, +static const char * StylePrintProc(ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); -static Tk_CustomOption stateOption = { - (Tk_OptionParseProc *) TkStateParseProc, - TkStatePrintProc, (ClientData) 2 +static const Tk_CustomOption stateOption = { + TkStateParseProc, TkStatePrintProc, (ClientData) 2 }; -static Tk_CustomOption styleOption = { - (Tk_OptionParseProc *) StyleParseProc, - StylePrintProc, (ClientData) NULL +static const Tk_CustomOption styleOption = { + StyleParseProc, StylePrintProc, (ClientData) NULL }; -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[] = { @@ -2061,7 +2055,7 @@ StyleParseProc( *-------------------------------------------------------------- */ -static char * +static const char * StylePrintProc( ClientData clientData, /* Ignored. */ Tk_Window tkwin, /* Ignored. */ |