[wx-dev] (64 bit) hashmap/long long problem in HEAD and 2.7.2

Vadim Zeitlin vadim at wxwindows.org
Wed Nov 1 06:25:43 PST 2006


On Wed, 1 Nov 2006 14:21:02 +0000 Michael Wetherell <mike.wetherell at ntlworld.com> wrote:

MW> >  So I do not think this is a problem.
MW> 
MW> Yes it is the problem, long is 64-bit on that OS.

 But so what? As I wrote, wxLongLong_t is still a separate type so we
should allow defining hashes with wxLongLong_t type keys, shouldn't we?
Even if they're the same as long on this platform, they could be different
on another one.

MW> The function longlongHash is an implementation helper for the 
MW> wxLongLong_t overloads of operator(), which should only be defined when 
MW> long is not long long.

 Why? I.e. I though these operator()s had to be defined for all types which
can be used as hash keys.

MW> > but it is 8 under Windows. So I guess it's 
MW> > better to use wxUint32 explicitly here even though it's still wrong
MW> > for sizeof(size_t) == 8.
MW> 
MW> No, it's only used when long is 4 bytes anyhow.

 Supposing we define it when sizeof(long) is 8, of course.

MW> >  Anyhow, please let me know if you still have any problems with the
MW> > revision 1.61 of wx/hashmap.h.
MW> 
MW> Suggest you revert, why change it when it's been well tested by the 
MW> HashesTestCase though all of 2.6.x?

 It doesn't test wxLongLong_t keys in the hashes though if wxLongLongIsLong
is defined. Could it be because it doesn't work? And, if so, once again,
shouldn't it work?

 Thanks,
VZ





More information about the wx-dev mailing list