]> www.ginac.de Git - ginac.git/blobdiff - ginac/archive.cpp
- Inserted some more std:: to make it compile under GCC2.96.
[ginac.git] / ginac / archive.cpp
index d249f2971a427c9d6399220099ad5113ebe3efe1..ff8e755fd5094a54d08772ebd8f63f3ce306801d 100644 (file)
@@ -188,7 +188,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);
@@ -205,7 +207,7 @@ std::ostream &operator<<(std::ostream &os, const archive_node &n)
                write_unsigned(os, n.props[i].type | (n.props[i].name << 3));
                write_unsigned(os, n.props[i].value);
        }
-    return os;
+       return os;
 }
 
 /** Write archive to binary data stream. */
@@ -222,7 +224,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();
@@ -237,7 +239,7 @@ std::ostream &operator<<(std::ostream &os, const archive &ar)
        write_unsigned(os, num_nodes);
        for (unsigned int i=0; i<num_nodes; i++)
                os << ar.nodes[i];
-    return os;
+       return os;
 }
 
 /** Read archive_node from binary data stream. */
@@ -252,7 +254,7 @@ std::istream &operator>>(std::istream &is, archive_node &n)
                n.props[i].name = name_type >> 3;
                n.props[i].value = read_unsigned(is);
        }
-    return is;
+       return is;
 }
 
 /** Read archive from binary data stream. */
@@ -287,7 +289,7 @@ std::istream &operator>>(std::istream &is, archive &ar)
        ar.nodes.resize(num_nodes, ar);
        for (unsigned int i=0; i<num_nodes; i++)
                is >> ar.nodes[i];
-    return is;
+       return is;
 }
 
 
@@ -321,7 +323,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 +343,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 +526,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 +538,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 +577,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++;
        }
 }
@@ -584,8 +586,8 @@ void archive_node::printraw(std::ostream &os) const
  *  ctor, which is currently a Cint-requirement. */
 archive* archive_node::dummy_ar_creator(void)
 {
-    static archive* some_ar = new archive;
-    return some_ar;
+       static archive* some_ar = new archive;
+       return some_ar;
 }