]> www.ginac.de Git - ginac.git/blobdiff - ginac/constant.cpp
- New tinfo mechanism
[ginac.git] / ginac / constant.cpp
index e0ccf54428902d3e3d72b7e531bb28b8e538ab59..35f5ea02f308c6dc76559958d387f1663f9ce0c9 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of GiNaC's constant types and some special constants. */
 
 /*
- *  GiNaC Copyright (C) 1999-2003 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2006 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
@@ -17,7 +17,7 @@
  *
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #include <string>
@@ -44,7 +44,7 @@ GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(constant, basic,
 
 // public
 
-constant::constant() : basic(TINFO_constant), ef(0), serial(next_serial++)
+constant::constant() : basic(&constant::tinfo_static), ef(0), serial(next_serial++)
 {
        setflag(status_flags::evaluated | status_flags::expanded);
 }
@@ -56,7 +56,7 @@ constant::constant() : basic(TINFO_constant), ef(0), serial(next_serial++)
 // public
 
 constant::constant(const std::string & initname, evalffunctype efun, const std::string & texname)
-  : basic(TINFO_constant), name(initname), ef(efun), serial(next_serial++)
+  : basic(&constant::tinfo_static), name(initname), ef(efun), serial(next_serial++)
 {
        if (texname.empty())
                TeX_name = "\\mbox{" + name + "}";
@@ -66,7 +66,7 @@ constant::constant(const std::string & initname, evalffunctype efun, const std::
 }
 
 constant::constant(const std::string & initname, const numeric & initnumber, const std::string & texname)
-  : basic(TINFO_constant), name(initname), ef(0), number(initnumber), serial(next_serial++)
+  : basic(&constant::tinfo_static), name(initname), ef(0), number(initnumber), serial(next_serial++)
 {
        if (texname.empty())
                TeX_name = "\\mbox{" + name + "}";
@@ -177,7 +177,7 @@ bool constant::is_equal_same_type(const basic & other) const
 
 unsigned constant::calchash() const
 {
-       hashvalue = golden_ratio_hash(tinfo() ^ serial);
+       hashvalue = golden_ratio_hash((unsigned)tinfo() ^ serial);
 
        setflag(status_flags::hash_calculated);