summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog20
-rw-r--r--generic/tkColor.c19
2 files changed, 24 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index ce353fb..59b6a50 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,17 @@
+2009-12-09 Donal K. Fellows <dkf@users.sf.net>
+
+ * generic/tkColor.c (Tk_GetColorByValue): [Bug 2911570]: Ensure that
+ hash keys of color values are zeroed first, so that they hash properly
+ on 64-bit systems (where X structures are not tightly packed).
+
2009-12-08 Pat Thoyts <patthoyts@users.sourceforge.net>
- * unix/tkUnixWm.c: [Bug 2864685] backported window manager hinting
+ * unix/tkUnixWm.c: [Bug 2864685]: Backported window manager hinting
update from HEAD
2009-12-06 Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
- * macosx/tkMacOSXFont.c (GetFontFamilyName): [Bug #2548661] Merge fix
+ * macosx/tkMacOSXFont.c (GetFontFamilyName): [Bug 2548661]: Merge fix
from HEAD (1.44).
2009-12-03 Pat Thoyts <patthoyts@users.sourceforge.net>
@@ -15,11 +21,11 @@
2009-12-02 Jan Nijtmans <nijtmans@users.sf.net>
- * doc/GetHINSTANCE.3 correct mentioned header file
- * win/tkWinInt.h make TkWinChildProc available in private
- * generic/tkInt.decls stub table. [Bug #220600] and [Bug #220690].
- * generic/tkIntPlatDecls.h (regenerated)
- * generic/tkStubInit.c (regenerated)
+ * doc/GetHINSTANCE.3: Correct mentioned header file
+ * win/tkWinInt.h: [Bugs 220600, 220690]: Make TkWinChildProc
+ * generic/tkInt.decls: available in private stub table.
+ * generic/tkIntPlatDecls.h: (regenerated)
+ * generic/tkStubInit.c: (regenerated)
2009-11-25 Stuart Cassoff <stwo@users.sf.net>
diff --git a/generic/tkColor.c b/generic/tkColor.c
index 85593ac..d17b393 100644
--- a/generic/tkColor.c
+++ b/generic/tkColor.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkColor.c,v 1.16 2007/12/13 15:24:13 dgp Exp $
+ * RCS: @(#) $Id: tkColor.c,v 1.16.2.1 2009/12/09 22:38:22 dkf Exp $
*/
#include "tkInt.h"
@@ -129,8 +129,8 @@ Tk_AllocColorFromObj(
*/
if (tkColPtr != NULL) {
- TkColor *firstColorPtr = (TkColor *)
- Tcl_GetHashValue(tkColPtr->hashPtr);
+ TkColor *firstColorPtr = Tcl_GetHashValue(tkColPtr->hashPtr);
+
FreeColorObjProc(objPtr);
for (tkColPtr = firstColorPtr; tkColPtr != NULL;
tkColPtr = tkColPtr->nextPtr) {
@@ -204,7 +204,7 @@ Tk_GetColor(
nameHashPtr = Tcl_CreateHashEntry(&dispPtr->colorNameTable, name, &isNew);
if (!isNew) {
- existingColPtr = (TkColor *) Tcl_GetHashValue(nameHashPtr);
+ existingColPtr = Tcl_GetHashValue(nameHashPtr);
for (tkColPtr = existingColPtr; tkColPtr != NULL;
tkColPtr = tkColPtr->nextPtr) {
if ((tkColPtr->screen == Tk_Screen(tkwin))
@@ -300,8 +300,11 @@ Tk_GetColorByValue(
/*
* First, check to see if there's already a mapping for this color name.
+ * Must clear the structure first; it's not tightly packed on 64-bit
+ * systems. [Bug 2911570]
*/
+ memset(&valueKey, 0, sizeof(ValueKey));
valueKey.red = colorPtr->red;
valueKey.green = colorPtr->green;
valueKey.blue = colorPtr->blue;
@@ -310,7 +313,7 @@ Tk_GetColorByValue(
valueHashPtr = Tcl_CreateHashEntry(&dispPtr->colorValueTable,
(char *) &valueKey, &isNew);
if (!isNew) {
- tkColPtr = (TkColor *) Tcl_GetHashValue(valueHashPtr);
+ tkColPtr = Tcl_GetHashValue(valueHashPtr);
tkColPtr->resourceRefCount++;
return &tkColPtr->color;
}
@@ -474,7 +477,7 @@ Tk_FreeColor(
}
TkpFreeColor(tkColPtr);
- prevPtr = (TkColor *) Tcl_GetHashValue(tkColPtr->hashPtr);
+ prevPtr = Tcl_GetHashValue(tkColPtr->hashPtr);
if (prevPtr == tkColPtr) {
if (tkColPtr->nextPtr == NULL) {
Tcl_DeleteHashEntry(tkColPtr->hashPtr);
@@ -664,7 +667,7 @@ Tk_GetColorFromObj(
if (hashPtr == NULL) {
goto error;
}
- for (tkColPtr = (TkColor *) Tcl_GetHashValue(hashPtr);
+ for (tkColPtr = Tcl_GetHashValue(hashPtr);
(tkColPtr != NULL); tkColPtr = tkColPtr->nextPtr) {
if ((Tk_Screen(tkwin) == tkColPtr->screen)
&& (Tk_Colormap(tkwin) == tkColPtr->colormap)) {
@@ -780,7 +783,7 @@ TkDebugColor(
resultPtr = Tcl_NewObj();
hashPtr = Tcl_FindHashEntry(&dispPtr->colorNameTable, name);
if (hashPtr != NULL) {
- TkColor *tkColPtr = (TkColor *) Tcl_GetHashValue(hashPtr);
+ TkColor *tkColPtr = Tcl_GetHashValue(hashPtr);
if (tkColPtr == NULL) {
Tcl_Panic("TkDebugColor found empty hash table entry");