diff options
author | nijtmans <nijtmans> | 2009-12-16 22:00:30 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2009-12-16 22:00:30 (GMT) |
commit | 5a94ed5e36c396971c0dc7a1c193c734c799233c (patch) | |
tree | 8230caa2b08bf3c9ea41bd365636a69852c3c8a1 /unix/tkUnixKey.c | |
parent | 4e49c034fea39f59a67ca7461b12f3d936aa5f95 (diff) | |
download | tk-5a94ed5e36c396971c0dc7a1c193c734c799233c.zip tk-5a94ed5e36c396971c0dc7a1c193c734c799233c.tar.gz tk-5a94ed5e36c396971c0dc7a1c193c734c799233c.tar.bz2 |
CONSTify return values of TkKeysymToString,
TkFindStateString, TkpGetString, TkpGetChar,
which are all not supposed to be modified by
the caller. In tkUtil.c this gets rid of a
dangerous type cast.
Diffstat (limited to 'unix/tkUnixKey.c')
-rw-r--r-- | unix/tkUnixKey.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c index 77e782f..49ee3e0 100644 --- a/unix/tkUnixKey.c +++ b/unix/tkUnixKey.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: tkUnixKey.c,v 1.15 2008/11/26 15:56:37 dkf Exp $ + * RCS: @(#) $Id: tkUnixKey.c,v 1.16 2009/12/16 22:00:30 nijtmans Exp $ */ #include "tkInt.h" @@ -90,7 +90,7 @@ Tk_SetCaretPos( * *---------------------------------------------------------------------- */ -static char * +static const char * TkpGetChar( XEvent *eventPtr, /* KeyPress or KeyRelease event */ Tcl_DString *dsPtr) /* Initialized, empty string to hold result. */ @@ -135,7 +135,7 @@ TkpGetChar( *---------------------------------------------------------------------- */ -char * +const char * TkpGetString( TkWindow *winPtr, /* Window where event occurred */ XEvent *eventPtr, /* X keyboard event. */ @@ -161,7 +161,7 @@ TkpGetString( Tcl_DStringSetLength(dsPtr, len); len = Xutf8LookupString(winPtr->inputContext, &eventPtr->xkey, - Tcl_DStringValue(dsPtr), Tcl_DStringLength(dsPtr), + Tcl_DStringValue(dsPtr), Tcl_DStringLength(dsPtr), NULL, &status); } if ((status != XLookupChars) && (status != XLookupBoth)) { |