summaryrefslogtreecommitdiffstats
path: root/generic/tkUtil.c
diff options
context:
space:
mode:
authordas <das>2007-10-15 07:24:47 (GMT)
committerdas <das>2007-10-15 07:24:47 (GMT)
commitefc99bc15db0e9e7a9b41476cff1119112348d7b (patch)
tree67915c083365997a60c6f2e4622f437540598f6d /generic/tkUtil.c
parent95b981bcce4ffe3ed7b5b3bf8f48e366955ee383 (diff)
downloadtk-efc99bc15db0e9e7a9b41476cff1119112348d7b.zip
tk-efc99bc15db0e9e7a9b41476cff1119112348d7b.tar.gz
tk-efc99bc15db0e9e7a9b41476cff1119112348d7b.tar.bz2
* generic/tkArgv.c: Fix gcc warnings about 'cast to/from
* generic/tkCanvUtil.c: pointer from/to integer of different * generic/tkCanvas.c: size' on 64-bit platforms by casting * generic/tkCursor.c: to intermediate types * generic/tkInt.h: intptr_t/uintptr_t via new PTR2INT(), * generic/tkListbox.c: INT2PTR(), PTR2UINT() and UINT2PTR() * generic/tkObj.c: macros. * generic/tkStyle.c: * generic/tkTextIndex.c: * generic/tkUtil.c: * generic/ttk/ttkTheme.h: * generic/ttk/ttkTreeview.c: * unix/tkUnixMenu.c: * unix/configure.in: * unix/configure: autoconf-2.59 * unix/tkConfig.h.in: autoheader-2.59
Diffstat (limited to 'generic/tkUtil.c')
-rw-r--r--generic/tkUtil.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/generic/tkUtil.c b/generic/tkUtil.c
index b41f4c3..162d7ad 100644
--- a/generic/tkUtil.c
+++ b/generic/tkUtil.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: tkUtil.c,v 1.19 2007/09/08 16:01:20 dkf Exp $
+ * RCS: @(#) $Id: tkUtil.c,v 1.20 2007/10/15 07:24:49 das Exp $
*/
#include "tkInt.h"
@@ -56,7 +56,7 @@ TkStateParseProc(
int offset) /* Offset into item. */
{
int c;
- int flags = (int)clientData;
+ int flags = PTR2INT(clientData);
size_t length;
register Tk_State *statePtr = (Tk_State *) (widgRec + offset);
@@ -277,7 +277,7 @@ TkOffsetParseProc(
switch(value[0]) {
case '#':
- if (((int)clientData) & TK_OFFSET_RELATIVE) {
+ if (PTR2INT(clientData) & TK_OFFSET_RELATIVE) {
tsoffset.flags = TK_OFFSET_RELATIVE;
p++;
break;
@@ -339,7 +339,7 @@ TkOffsetParseProc(
goto goodTSOffset;
}
if ((q = strchr(p,',')) == NULL) {
- if (((int)clientData) & TK_OFFSET_INDEX) {
+ if (PTR2INT(clientData) & TK_OFFSET_INDEX) {
if (Tcl_GetInt(interp, (char *) p, &tsoffset.flags) != TCL_OK) {
Tcl_ResetResult(interp);
goto badTSOffset;
@@ -373,10 +373,10 @@ TkOffsetParseProc(
badTSOffset:
Tcl_AppendResult(interp, "bad offset \"", value,
"\": expected \"x,y\"", NULL);
- if (((int) clientData) & TK_OFFSET_RELATIVE) {
+ if (PTR2INT(clientData) & TK_OFFSET_RELATIVE) {
Tcl_AppendResult(interp, ", \"#x,y\"", NULL);
}
- if (((int) clientData) & TK_OFFSET_INDEX) {
+ if (PTR2INT(clientData) & TK_OFFSET_INDEX) {
Tcl_AppendResult(interp, ", <index>", NULL);
}
Tcl_AppendResult(interp, ", n, ne, e, se, s, sw, w, nw, or center", NULL);
@@ -938,7 +938,7 @@ TkFindStateNumObj(
if ((keyPtr->typePtr == &tkStateKeyObjType)
&& (keyPtr->internalRep.twoPtrValue.ptr1 == mapPtr)) {
- return (int) keyPtr->internalRep.twoPtrValue.ptr2;
+ return PTR2INT(keyPtr->internalRep.twoPtrValue.ptr2);
}
/*
@@ -953,7 +953,7 @@ TkFindStateNumObj(
(*typePtr->freeIntRepProc)(keyPtr);
}
keyPtr->internalRep.twoPtrValue.ptr1 = (void *) mapPtr;
- keyPtr->internalRep.twoPtrValue.ptr2 = (void *) mPtr->numKey;
+ keyPtr->internalRep.twoPtrValue.ptr2 = INT2PTR(mPtr->numKey);
keyPtr->typePtr = &tkStateKeyObjType;
return mPtr->numKey;
}