]> www.ginac.de Git - ginac.git/commit
calchash(): work around broken RTTI.
authorAlexei Sheplyakov <varg@metalica.kh.ua>
Mon, 23 Feb 2009 12:08:42 +0000 (14:08 +0200)
committerJens Vollinga <jensv@nikhef.nl>
Wed, 25 Feb 2009 11:44:20 +0000 (12:44 +0100)
commitee1ec9db30b446d2d6348df2ce758ed2ff62a310
tree99444218a9f0895b72dbf6075ccdc2310fc6d8cd
parent4cf514ec7a3d8dbb447eaa46747f31a9fc9cf159
calchash(): work around broken RTTI.

Due to the strange (although permitted by the standard) behaviour of C++
RTTI on woe32 calchash() returns different hash values for equal objects.
As a result automatic evaluation gets spectacularly broken:

examining clifford objects.....({1+t,2+x,3+y,4+z}) - ({1+t,2+x,3+y,4+z}) erroneously returned -{1+t,2+x,3+y,4+z}+{1+t,2+x,3+y,4+z} instead of 0
({1+t,2+x,3+y,4+z}) - ({1+t,2+x,3+y,4+z}) erroneously returned -{1+t,2+x,3+y,4+z}+{1+t,2+x,3+y,4+z} instead of 0
.({1+t,2+x,3+y,4+z}) - ({1+t,2+x,3+y,4+z}) erroneously returned -{1+t,2+x,3+y,4+z}+{1+t,2+x,3+y,4+z} instead of 0
({1+t,2+x,3+y,4+z}) - ({1+t,2+x,3+y,4+z}) erroneously returned {1+t,2+x,3+y,4+z}-{1+t,2+x,3+y,4+z} instead of 0
[skipped]
.......FAIL: exam_clifford.exe

This patch works around `features' of woe32 RTTI, so calchash() works
properly.
ginac/Makefile.am
ginac/basic.cpp
ginac/crc32.h [new file with mode: 0644]
ginac/expairseq.cpp
ginac/function.pl
ginac/hash_seed.h [new file with mode: 0644]
ginac/idx.cpp
ginac/relational.cpp
ginac/symbol.cpp
ginac/symmetry.cpp
ginac/wildcard.cpp