]> www.ginac.de Git - ginac.git/blobdiff - ginac/archive.cpp
documentation update
[ginac.git] / ginac / archive.cpp
index f237231302c51b733b29f46365163d3cdc1630d0..849da9b7f71ae7147cdd8e69c2ab53cfa61b3645 100644 (file)
@@ -3,7 +3,7 @@
  *  Archiving of GiNaC expressions. */
 
 /*
- *  GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2001 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
@@ -29,9 +29,7 @@
 #include "config.h"
 #include "utils.h"
 
-#ifndef NO_NAMESPACE_GINAC
 namespace GiNaC {
-#endif // ndef NO_NAMESPACE_GINAC
 
 
 /** Archive an expression.
@@ -188,7 +186,9 @@ static unsigned int read_unsigned(std::istream &is)
        unsigned int ret = 0;
        unsigned int shift = 0;
        do {
-               is.get(b);
+        char b2;
+               is.get(b2);
+        b = b2;
                ret |= (b & 0x7f) << shift;
                shift += 7;
        } while (b & 0x80);
@@ -222,7 +222,7 @@ std::ostream &operator<<(std::ostream &os, const archive &ar)
        unsigned int num_atoms = ar.atoms.size();
        write_unsigned(os, num_atoms);
        for (unsigned int i=0; i<num_atoms; i++)
-               os << ar.atoms[i] << ends;
+               os << ar.atoms[i] << std::ends;
 
        // Write expressions
        unsigned int num_exprs = ar.exprs.size();
@@ -321,7 +321,7 @@ const std::string &archive::unatomize(archive_atom id) const
 
 /** Copy constructor of archive_node. */
 archive_node::archive_node(const archive_node &other)
-       : a(other.a), props(other.props), has_expression(other.has_expression), e(other.e)
+  : a(other.a), props(other.props), has_expression(other.has_expression), e(other.e)
 {
 }
 
@@ -341,7 +341,7 @@ const archive_node &archive_node::operator=(const archive_node &other)
 
 /** Recursively construct archive node from expression. */
 archive_node::archive_node(archive &ar, const ex &expr)
-       : a(ar), has_expression(true), e(expr)
+  : a(ar), has_expression(true), e(expr)
 {
        expr.bp->archive(*this);
 }
@@ -524,11 +524,11 @@ void archive::printraw(std::ostream &os) const
                std::vector<std::string>::const_iterator i = atoms.begin(), iend = atoms.end();
                archive_atom id = 0;
                while (i != iend) {
-                       os << " " << id << " " << *i << endl;
+                       os << " " << id << " " << *i << std::endl;
                        i++; id++;
                }
        }
-       os << endl;
+       os << std::endl;
 
        // Dump expressions
        os << "Expressions:\n";
@@ -536,11 +536,11 @@ void archive::printraw(std::ostream &os) const
                std::vector<archived_ex>::const_iterator i = exprs.begin(), iend = exprs.end();
                unsigned int index = 0;
                while (i != iend) {
-                       os << " " << index << " \"" << unatomize(i->name) << "\" root node " << i->root << endl;
+                       os << " " << index << " \"" << unatomize(i->name) << "\" root node " << i->root << std::endl;
                        i++; index++;
                }
        }
-       os << endl;
+       os << std::endl;
 
        // Dump nodes
        os << "Nodes:\n";
@@ -575,7 +575,7 @@ void archive_node::printraw(std::ostream &os) const
                        case PTYPE_NODE: os << "node"; break;
                        default: os << "<unknown>"; break;
                }
-               os << " \"" << a.unatomize(i->name) << "\" " << i->value << endl;
+               os << " \"" << a.unatomize(i->name) << "\" " << i->value << std::endl;
                i++;
        }
 }
@@ -589,6 +589,4 @@ archive* archive_node::dummy_ar_creator(void)
 }
 
 
-#ifndef NO_NAMESPACE_GINAC
 } // namespace GiNaC
-#endif // ndef NO_NAMESPACE_GINAC