diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2011-08-16 13:03:43 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2011-08-16 13:03:43 (GMT) |
commit | 3876ba4df3e26ded567937787afa2068b9815626 (patch) | |
tree | c4452046a4a872fb20c9437f5719b664baca41d7 /win/tkWinColor.c | |
parent | af28c015d3494e872c4094934f33251157662310 (diff) | |
parent | 664a327665c85de251423f7a679879e8382041c8 (diff) | |
download | tk-3876ba4df3e26ded567937787afa2068b9815626.zip tk-3876ba4df3e26ded567937787afa2068b9815626.tar.gz tk-3876ba4df3e26ded567937787afa2068b9815626.tar.bz2 |
[Bug 3388350] mingw64 compiler warnings
Diffstat (limited to 'win/tkWinColor.c')
-rw-r--r-- | win/tkWinColor.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/win/tkWinColor.c b/win/tkWinColor.c index f4181b5..234c736 100644 --- a/win/tkWinColor.c +++ b/win/tkWinColor.c @@ -386,13 +386,13 @@ 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, (ClientData)refCount); + Tcl_SetHashValue(entryPtr, INT2PTR(refCount)); } else { /* * Determine what color will actually be used on non-colormap systems. @@ -452,11 +452,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); @@ -474,7 +474,7 @@ XFreeColors( } Tcl_DeleteHashEntry(entryPtr); } else { - Tcl_SetHashValue(entryPtr, (ClientData)refCount); + Tcl_SetHashValue(entryPtr, INT2PTR(refCount)); } } } @@ -535,9 +535,9 @@ 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); - Tcl_SetHashValue(hashPtr, (ClientData)1); + hashPtr = Tcl_CreateHashEntry(&cmap->refCounts, INT2PTR(PALETTERGB( + entryPtr->peRed, entryPtr->peGreen, entryPtr->peBlue)), &new); + Tcl_SetHashValue(hashPtr, INT2PTR(1)); } return (Colormap)cmap; |