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/tkCanvUtil.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/tkCanvUtil.c')
-rw-r--r-- | generic/tkCanvUtil.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c index 6d84ad2..8647975 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.21 2008/10/24 06:00:22 dkf Exp $ + * RCS: @(#) $Id: tkCanvUtil.c,v 1.22 2008/10/30 21:39:16 nijtmans Exp $ */ #include "tkInt.h" @@ -457,7 +457,7 @@ Tk_CanvasTagsParseProc( *-------------------------------------------------------------- */ -char * +const char * Tk_CanvasTagsPrintProc( ClientData clientData, /* Ignored. */ Tk_Window tkwin, /* Window containing canvas widget. */ @@ -475,7 +475,7 @@ Tk_CanvasTagsPrintProc( } if (itemPtr->numTags == 1) { *freeProcPtr = NULL; - return (char *) itemPtr->tagPtr[0]; + return (const char *) itemPtr->tagPtr[0]; } *freeProcPtr = TCL_DYNAMIC; return Tcl_Merge(itemPtr->numTags, (const char **) itemPtr->tagPtr); @@ -533,7 +533,7 @@ TkCanvasDashParseProc( *-------------------------------------------------------------- */ -char * +const char * TkCanvasDashPrintProc( ClientData clientData, /* Ignored. */ Tk_Window tkwin, /* Window containing canvas widget. */ @@ -809,7 +809,7 @@ TkSmoothParseProc( *-------------------------------------------------------------- */ -char * +const char * TkSmoothPrintProc( ClientData clientData, /* Ignored. */ Tk_Window tkwin, /* Window containing canvas widget. */ @@ -822,7 +822,7 @@ TkSmoothPrintProc( register const Tk_SmoothMethod *smoothPtr = * (Tk_SmoothMethod **) (widgRec + offset); - return smoothPtr ? (char *) smoothPtr->name : "0"; + return smoothPtr ? smoothPtr->name : "0"; } /* *-------------------------------------------------------------- |