X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Fwildcard.cpp;h=d45ffca038ab5ff98505464b4f5c70318f7d615f;hb=cd22e73d44e3320898f62a0accdbbe005b33d3e5;hp=9409938d1e6de86a9b61f9fc7d9b22376f14ba92;hpb=d327f3f00c66a79d42855939866047b3e8caa630;p=ginac.git diff --git a/ginac/wildcard.cpp b/ginac/wildcard.cpp index 9409938d..d45ffca0 100644 --- a/ginac/wildcard.cpp +++ b/ginac/wildcard.cpp @@ -3,7 +3,7 @@ * Implementation of GiNaC's wildcard objects. */ /* - * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2016 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 @@ -20,11 +20,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include - #include "wildcard.h" #include "archive.h" #include "utils.h" +#include "hash_seed.h" + +#include namespace GiNaC { @@ -106,8 +107,8 @@ unsigned wildcard::calchash() const // this is where the schoolbook method // (golden_ratio_hash(typeid(*this).name()) ^ label) // is not good enough yet... - const void* this_tinfo = (const void*)typeid(*this).name(); - hashvalue = golden_ratio_hash(golden_ratio_hash((p_int)this_tinfo) ^ label); + unsigned seed = make_hash_seed(typeid(*this)); + hashvalue = golden_ratio_hash(seed ^ label); setflag(status_flags::hash_calculated); return hashvalue; }