diff options
author | nijtmans <nijtmans@noemail.net> | 2009-12-16 22:00:29 (GMT) |
---|---|---|
committer | nijtmans <nijtmans@noemail.net> | 2009-12-16 22:00:29 (GMT) |
commit | 76d36288753cb09992deb1868e925c4c95d65689 (patch) | |
tree | 8230caa2b08bf3c9ea41bd365636a69852c3c8a1 /unix/tkUnixKey.c | |
parent | 57ce2908fc87e02e3e8bfe49a903a56b20d6bfbe (diff) | |
download | tk-76d36288753cb09992deb1868e925c4c95d65689.zip tk-76d36288753cb09992deb1868e925c4c95d65689.tar.gz tk-76d36288753cb09992deb1868e925c4c95d65689.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.
FossilOrigin-Name: 9350f0df9854870c0324e71ec0685efd08dd764e
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)) { |