X-Git-Url: https://ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Farchive.cpp;h=b3eea2bef7c541c34ce30d9376a58a18999f2dfc;hb=da3cc1d79533680f0722be73abe95aedcac96b72;hp=d25c804a49045e2f8fd737c4d2065f4df59d83f0;hpb=cca88b51436e4b654d16a4d60cd0d1c66fcf5dd6;p=ginac.git diff --git a/ginac/archive.cpp b/ginac/archive.cpp index d25c804a..b3eea2be 100644 --- a/ginac/archive.cpp +++ b/ginac/archive.cpp @@ -3,7 +3,7 @@ * Archiving of GiNaC expressions. */ /* - * GiNaC Copyright (C) 1999-2014 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2015 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 @@ -27,7 +27,6 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "tostring.h" #include "version.h" #include @@ -268,11 +267,11 @@ std::istream &operator>>(std::istream &is, archive &ar) is.get(c1); is.get(c2); is.get(c3); is.get(c4); if (c1 != 'G' || c2 != 'A' || c3 != 'R' || c4 != 'C') throw (std::runtime_error("not a GiNaC archive (signature not found)")); - static const unsigned max_version = GINACLIB_ARCHIVE_VERSION; - static const unsigned min_version = GINACLIB_ARCHIVE_VERSION - GINACLIB_ARCHIVE_AGE; + constexpr unsigned max_version = GINACLIB_ARCHIVE_VERSION; + constexpr unsigned min_version = GINACLIB_ARCHIVE_VERSION - GINACLIB_ARCHIVE_AGE; unsigned version = read_unsigned(is); if ((version > max_version) || (version < min_version)) - throw (std::runtime_error("archive version " + ToString(version) + " cannot be read by this GiNaC library (which supports versions " + ToString(min_version) + " thru " + ToString(max_version))); + throw (std::runtime_error("archive version " + std::to_string(version) + " cannot be read by this GiNaC library (which supports versions " + std::to_string(min_version) + " thru " + std::to_string(max_version))); // Read atoms unsigned num_atoms = read_unsigned(is); @@ -320,7 +319,7 @@ archive_atom archive::atomize(const std::string &s) const const std::string &archive::unatomize(archive_atom id) const { if (id >= atoms.size()) - throw (std::range_error("archive::unatomizee(): atom ID out of range")); + throw (std::range_error("archive::unatomize(): atom ID out of range")); return atoms[id]; } @@ -673,13 +672,5 @@ void archive_node::printraw(std::ostream &os) const } } -/** Create a dummy archive. The intention is to fill archive_node's default - * ctor, which is currently a Cint-requirement. */ -archive* archive_node::dummy_ar_creator() -{ - static archive* some_ar = new archive; - return some_ar; -} - } // namespace GiNaC