diff options
Diffstat (limited to 'win/tkWinColor.c')
-rw-r--r-- | win/tkWinColor.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/win/tkWinColor.c b/win/tkWinColor.c index 47e0cbd..c559d87 100644 --- a/win/tkWinColor.c +++ b/win/tkWinColor.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: tkWinColor.c,v 1.18 2010/11/19 14:48:00 nijtmans Exp $ + * RCS: @(#) $Id: tkWinColor.c,v 1.19 2010/11/29 09:07:13 nijtmans Exp $ */ #include "tkWinInt.h" @@ -368,11 +368,11 @@ XAllocColor( color->pixel = PALETTERGB(entry.peRed, entry.peGreen, entry.peBlue); entryPtr = Tcl_CreateHashEntry(&cmap->refCounts, - (char *) color->pixel, &new); + INT2PTR(color->pixel), &new); if (new) { refCount = 1; } else { - refCount = ((int) Tcl_GetHashValue(entryPtr)) + 1; + refCount = (PTR2INT(Tcl_GetHashValue(entryPtr))) + 1; } Tcl_SetHashValue(entryPtr, INT2PTR(refCount)); } else { @@ -434,11 +434,11 @@ XFreeColors( */ for (i = 0; i < npixels; i++) { - entryPtr = Tcl_FindHashEntry(&cmap->refCounts, (char *) pixels[i]); + entryPtr = Tcl_FindHashEntry(&cmap->refCounts, INT2PTR(pixels[i])); if (!entryPtr) { Tcl_Panic("Tried to free a color that isn't allocated"); } - refCount = (int) Tcl_GetHashValue(entryPtr) - 1; + refCount = PTR2INT(Tcl_GetHashValue(entryPtr)) - 1; if (refCount == 0) { cref = pixels[i] & 0x00ffffff; index = GetNearestPaletteIndex(cmap->palette, cref); @@ -517,8 +517,8 @@ XCreateColormap( Tcl_InitHashTable(&cmap->refCounts, TCL_ONE_WORD_KEYS); for (i = 0; i < logPalettePtr->palNumEntries; i++) { entryPtr = logPalettePtr->palPalEntry + i; - hashPtr = Tcl_CreateHashEntry(&cmap->refCounts, (char*) PALETTERGB( - entryPtr->peRed, entryPtr->peGreen, entryPtr->peBlue), &new); + hashPtr = Tcl_CreateHashEntry(&cmap->refCounts, INT2PTR(PALETTERGB( + entryPtr->peRed, entryPtr->peGreen, entryPtr->peBlue)), &new); Tcl_SetHashValue(hashPtr, INT2PTR(1)); } |