From 06417a5bc8b38bc5b977583729e211b49107d727 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 9 Dec 2009 22:41:52 +0000 Subject: Apply [Bug 2911570]'s patch to make color value hashing work on 64-bit. --- ChangeLog | 4 ++++ generic/tkColor.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e3d0178..5c6b496 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-12-09 Donal K. Fellows + * 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; -- cgit v0.12