summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-12-09 22:41:52 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-12-09 22:41:52 (GMT)
commit06417a5bc8b38bc5b977583729e211b49107d727 (patch)
treea3c9e96e0beff9f5a6e9822510b654d0bb85d03b
parenta29e078d5ae9a283ef7404ccbbc548aa10bf8247 (diff)
downloadtk-06417a5bc8b38bc5b977583729e211b49107d727.zip
tk-06417a5bc8b38bc5b977583729e211b49107d727.tar.gz
tk-06417a5bc8b38bc5b977583729e211b49107d727.tar.bz2
Apply [Bug 2911570]'s patch to make color value hashing work on 64-bit.
-rw-r--r--ChangeLog4
-rw-r--r--generic/tkColor.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e3d0178..5c6b496 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
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).
+
* unix/tkUnixWm.c (TkpMakeMenuWindow): Improve the determining of what
* generic/tkMenu.c (ConfigureMenu): EWMH hint to use so that we
distinguish between dropdown menus (children of menubars) and what are
diff --git a/generic/tkColor.c b/generic/tkColor.c
index ccd46e7..2035ec4 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.21 2009/11/21 17:24:42 dkf Exp $
+ * RCS: @(#) $Id: tkColor.c,v 1.22 2009/12/09 22:41:52 dkf Exp $
*/
#include "tkInt.h"
@@ -301,8 +301,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;