summaryrefslogtreecommitdiffstats
path: root/win/tkWinColor.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-11-29 09:07:12 (GMT)
committernijtmans <nijtmans>2010-11-29 09:07:12 (GMT)
commit8ccebbf9fc50bab1c1a3fa148f9632f059296bd2 (patch)
treef4a05b05f4420db2757c9b6934a169d18c4d0bf0 /win/tkWinColor.c
parent13fd371fb175d2dc12a9ec83a2cd45f540086857 (diff)
downloadtk-8ccebbf9fc50bab1c1a3fa148f9632f059296bd2.zip
tk-8ccebbf9fc50bab1c1a3fa148f9632f059296bd2.tar.gz
tk-8ccebbf9fc50bab1c1a3fa148f9632f059296bd2.tar.bz2
Fix various 64-bit gcc(-4.5.2) warnings: cast from pointer to integer of different size
Diffstat (limited to 'win/tkWinColor.c')
-rw-r--r--win/tkWinColor.c14
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));
}