]> www.ginac.de Git - ginac.git/blobdiff - ginac/basic.cpp
calchash(): work around broken RTTI.
[ginac.git] / ginac / basic.cpp
index 04f87df12a94d974f12da2443f4c9e6ef37522b6..f9f18f5ca13b8f6e0a82ba54b2a5a1ae4cba7991 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of GiNaC's ABC. */
 
 /*
- *  GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2009 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <iostream>
-#include <stdexcept>
-#include <typeinfo>
-
 #include "basic.h"
 #include "ex.h"
 #include "numeric.h"
 #include "wildcard.h"
 #include "archive.h"
 #include "utils.h"
+#include "hash_seed.h"
 #include "inifcns.h"
 
+#include <iostream>
+#include <stdexcept>
+#include <typeinfo>
+
 namespace GiNaC {
 
 GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(basic, void,
@@ -780,8 +781,7 @@ return_type_t basic::return_type_tinfo() const
  *  would all end up with the same hashvalue. */
 unsigned basic::calchash() const
 {
-       const void* this_tinfo = (const void*)typeid(*this).name();
-       unsigned v = golden_ratio_hash((p_int)this_tinfo);
+       unsigned v = make_hash_seed(typeid(*this));
        for (size_t i=0; i<nops(); i++) {
                v = rotate_left(v);
                v ^= this->op(i).gethash();