diff options
author | nijtmans <nijtmans> | 2010-11-29 09:07:12 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2010-11-29 09:07:12 (GMT) |
commit | 8ccebbf9fc50bab1c1a3fa148f9632f059296bd2 (patch) | |
tree | f4a05b05f4420db2757c9b6934a169d18c4d0bf0 | |
parent | 13fd371fb175d2dc12a9ec83a2cd45f540086857 (diff) | |
download | tk-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
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | generic/tkAtom.c | 20 | ||||
-rw-r--r-- | generic/tkSelect.c | 8 | ||||
-rw-r--r-- | win/stubs.c | 4 | ||||
-rw-r--r-- | win/tkWinButton.c | 6 | ||||
-rw-r--r-- | win/tkWinColor.c | 14 | ||||
-rw-r--r-- | win/tkWinPixmap.c | 4 | ||||
-rw-r--r-- | win/tkWinScrlbr.c | 6 | ||||
-rw-r--r-- | win/ttkWinMonitor.c | 4 |
9 files changed, 44 insertions, 33 deletions
@@ -1,3 +1,14 @@ +2010-11-29 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tkAtom.c: Fix various 64-bit gcc(-4.5.2) warnings: cast from pointer + * generic/tkSelect.c: to integer of different size. + * win/stubs.c + * win/tkWinButton.c + * win/tkWinColor.c + * win/tkWinPixmap.c + * win/tkWinScrlbr.c + * win/ttkWinMonitor.c + 2010-11-24 Jan Nijtmans <nijtmans@users.sf.net> * win/tkWinDialog.c: [Bug #3071836]: Crash/Tcl_Panic on WinXP saving file to C:\ diff --git a/generic/tkAtom.c b/generic/tkAtom.c index 57e6923..43995e6 100644 --- a/generic/tkAtom.c +++ b/generic/tkAtom.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkAtom.c,v 1.12 2010/01/02 22:52:38 dkf Exp $ + * RCS: @(#) $Id: tkAtom.c,v 1.13 2010/11/29 09:07:13 nijtmans Exp $ */ #include "tkInt.h" @@ -95,11 +95,11 @@ Tk_InternAtom( Atom atom; atom = XInternAtom(dispPtr->display, name, False); - Tcl_SetHashValue(hPtr, atom); - hPtr2 = Tcl_CreateHashEntry(&dispPtr->atomTable, (char*) atom, &isNew); + Tcl_SetHashValue(hPtr, INT2PTR(atom)); + hPtr2 = Tcl_CreateHashEntry(&dispPtr->atomTable, INT2PTR(atom), &isNew); Tcl_SetHashValue(hPtr2, Tcl_GetHashKey(&dispPtr->nameTable, hPtr)); } - return (Atom) Tcl_GetHashValue(hPtr); + return (Atom)PTR2INT(Tcl_GetHashValue(hPtr)); } /* @@ -137,7 +137,7 @@ Tk_GetAtomName( AtomInit(dispPtr); } - hPtr = Tcl_FindHashEntry(&dispPtr->atomTable, (char *) atom); + hPtr = Tcl_FindHashEntry(&dispPtr->atomTable, INT2PTR(atom)); if (hPtr == NULL) { const char *name; Tk_ErrorHandler handler; @@ -152,12 +152,12 @@ Tk_GetAtomName( } Tk_DeleteErrorHandler(handler); hPtr = Tcl_CreateHashEntry(&dispPtr->nameTable, name, &isNew); - Tcl_SetHashValue(hPtr, atom); + Tcl_SetHashValue(hPtr, INT2PTR(atom)); if (mustFree) { XFree(mustFree); } name = Tcl_GetHashKey(&dispPtr->nameTable, hPtr); - hPtr = Tcl_CreateHashEntry(&dispPtr->atomTable, (char *) atom, &isNew); + hPtr = Tcl_CreateHashEntry(&dispPtr->atomTable, INT2PTR(atom), &isNew); Tcl_SetHashValue(hPtr, name); } return Tcl_GetHashValue(hPtr); @@ -194,16 +194,16 @@ AtomInit( const char *name; int isNew; - hPtr = Tcl_FindHashEntry(&dispPtr->atomTable, (char *) atom); + hPtr = Tcl_FindHashEntry(&dispPtr->atomTable, INT2PTR(atom)); if (hPtr != NULL) { continue; } name = atomNameArray[atom - 1]; hPtr = Tcl_CreateHashEntry(&dispPtr->nameTable, name, &isNew); - Tcl_SetHashValue(hPtr, atom); + Tcl_SetHashValue(hPtr, INT2PTR(atom)); name = Tcl_GetHashKey(&dispPtr->nameTable, hPtr); - hPtr = Tcl_CreateHashEntry(&dispPtr->atomTable, (char *) atom, &isNew); + hPtr = Tcl_CreateHashEntry(&dispPtr->atomTable, INT2PTR(atom), &isNew); Tcl_SetHashValue(hPtr, name); } } diff --git a/generic/tkSelect.c b/generic/tkSelect.c index c2277c6..beebe12 100644 --- a/generic/tkSelect.c +++ b/generic/tkSelect.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: tkSelect.c,v 1.31 2010/01/02 22:52:38 dkf Exp $ + * RCS: @(#) $Id: tkSelect.c,v 1.32 2010/11/29 09:07:13 nijtmans Exp $ */ #include "tkInt.h" @@ -170,7 +170,7 @@ Tk_CreateSelHandler( selPtr->size = 32; } - if ((target == XA_STRING) && (winPtr->dispPtr->utf8Atom != (Atom) NULL)) { + if ((target == XA_STRING) && (winPtr->dispPtr->utf8Atom != (Atom) 0)) { /* * If the user asked for a STRING handler and we understand * UTF8_STRING, we implicitly create a UTF8_STRING handler for them. @@ -283,7 +283,7 @@ Tk_DeleteSelHandler( prevPtr->nextPtr = selPtr->nextPtr; } - if ((target == XA_STRING) && (winPtr->dispPtr->utf8Atom != (Atom) NULL)) { + if ((target == XA_STRING) && (winPtr->dispPtr->utf8Atom != (Atom) 0)) { /* * If the user asked for a STRING handler and we understand * UTF8_STRING, we may have implicitly created a UTF8_STRING handler @@ -1192,7 +1192,7 @@ TkSelInit( #if !defined(__WIN32__) dispPtr->utf8Atom = Tk_InternAtom(tkwin, "UTF8_STRING"); #else - dispPtr->utf8Atom = (Atom) NULL; + dispPtr->utf8Atom = (Atom) 0; #endif } diff --git a/win/stubs.c b/win/stubs.c index cf0983f..7e26d4b 100644 --- a/win/stubs.c +++ b/win/stubs.c @@ -29,7 +29,7 @@ XStringListToTextProperty( int count, XTextProperty *text_prop_return) { - return (Status) NULL; + return (Status) 0; } /* @@ -148,7 +148,7 @@ XGetWMColormapWindows( Window **windows_return, int *count_return) { - return (Status) NULL; + return (Status) 0; } int diff --git a/win/tkWinButton.c b/win/tkWinButton.c index 3c89ebc..4fabf5b 100644 --- a/win/tkWinButton.c +++ b/win/tkWinButton.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: tkWinButton.c,v 1.41 2010/04/29 15:28:04 nijtmans Exp $ + * RCS: @(#) $Id: tkWinButton.c,v 1.42 2010/11/29 09:07:12 nijtmans Exp $ */ #define OEMRESOURCE @@ -260,7 +260,7 @@ CreateProc( SetWindowPos(butPtr->hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); butPtr->oldProc = (WNDPROC)SetWindowLongPtr(butPtr->hwnd, GWLP_WNDPROC, - (INT_PTR) ButtonProc); + (LONG_PTR) ButtonProc); window = Tk_AttachHWND(tkwin, butPtr->hwnd); return window; @@ -290,7 +290,7 @@ TkpDestroyButton( HWND hwnd = winButPtr->hwnd; if (hwnd) { - SetWindowLongPtr(hwnd, GWLP_WNDPROC, (INT_PTR) winButPtr->oldProc); + SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) winButPtr->oldProc); } } 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)); } diff --git a/win/tkWinPixmap.c b/win/tkWinPixmap.c index 60ce7c2..3827b3b 100644 --- a/win/tkWinPixmap.c +++ b/win/tkWinPixmap.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: tkWinPixmap.c,v 1.12 2010/10/06 14:33:29 nijtmans Exp $ + * RCS: @(#) $Id: tkWinPixmap.c,v 1.13 2010/11/29 09:07:13 nijtmans Exp $ */ #include "tkWinInt.h" @@ -61,7 +61,7 @@ Tk_GetPixmap( screen = &display->screens[0]; planes = 1; if (depth == screen->root_depth) { - planes = (int) screen->ext_data; + planes = PTR2INT(screen->ext_data); depth /= planes; } newTwdPtr->bitmap.handle = diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c index f5f691d..87edb75 100644 --- a/win/tkWinScrlbr.c +++ b/win/tkWinScrlbr.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: tkWinScrlbr.c,v 1.22 2010/06/19 16:18:41 jenglish Exp $ + * RCS: @(#) $Id: tkWinScrlbr.c,v 1.23 2010/11/29 09:07:13 nijtmans Exp $ */ #include "tkWinInt.h" @@ -248,7 +248,7 @@ CreateProc( scrollPtr->lastVertical = scrollPtr->info.vertical; scrollPtr->oldProc = (WNDPROC)SetWindowLongPtr(scrollPtr->hwnd, - GWLP_WNDPROC, (INT_PTR) ScrollbarProc); + GWLP_WNDPROC, (LONG_PTR) ScrollbarProc); window = Tk_AttachHWND(tkwin, scrollPtr->hwnd); UpdateScrollbar(scrollPtr); @@ -293,7 +293,7 @@ TkpDisplayScrollbar( if (scrollPtr->lastVertical != scrollPtr->info.vertical) { HWND hwnd = Tk_GetHWND(Tk_WindowId(tkwin)); - SetWindowLongPtr(hwnd, GWLP_WNDPROC, (INT_PTR) scrollPtr->oldProc); + SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) scrollPtr->oldProc); DestroyWindow(hwnd); CreateProc(tkwin, Tk_WindowId(Tk_Parent(tkwin)), diff --git a/win/ttkWinMonitor.c b/win/ttkWinMonitor.c index c208245..573faf6 100644 --- a/win/ttkWinMonitor.c +++ b/win/ttkWinMonitor.c @@ -1,4 +1,4 @@ -/* $Id: ttkWinMonitor.c,v 1.17 2010/04/29 15:28:04 nijtmans Exp $ +/* $Id: ttkWinMonitor.c,v 1.18 2010/11/29 09:07:13 nijtmans Exp $ */ #ifdef _MSC_VER @@ -95,7 +95,7 @@ CreateThemeMonitorWindow(HINSTANCE hinst, Tcl_Interp *interp) hwnd = CreateWindow( name, title, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hinst, NULL ); - SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG)interp); + SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) interp); ShowWindow(hwnd, SW_HIDE); UpdateWindow(hwnd); } |