]> www.ginac.de Git - cln.git/blobdiff - src/real/input/cl_R_read_stream.cc
* src/integer/input/cl_I_read_stream.cc (read_integer): Fix a bug
[cln.git] / src / real / input / cl_R_read_stream.cc
index c7983580c592fa17d54932fb144b6b28884dcf0d..e75221d48380a950e74e45cef608fc9b4664ff41 100644 (file)
@@ -6,14 +6,16 @@
 #include "cl_sysdep.h"
 
 // Specification.
-#include "cl_real_io.h"
+#include "cln/real_io.h"
 
 
 // Implementation.
 
-#include "cl_io.h"
+#include "cln/io.h"
 #include "cl_spushstring.h"
-#include "cl_input.h"
+#include "cln/input.h"
+
+namespace cln {
 
 // We read an entire token (or even more, if it begins with #C) into a
 // buffer and then call read_real() on the buffer.
@@ -38,7 +40,7 @@ static cl_boolean number_char_p (char c)
        }
 }
 
-const cl_R read_real (cl_istream stream, const cl_read_flags& flags)
+const cl_R read_real (std::istream& stream, const cl_read_flags& flags)
 {
        // One pre-allocated buffer. This reduces the allocation/free cost.
        static pushstring_hack buffer;
@@ -72,7 +74,6 @@ const cl_R read_real (cl_istream stream, const cl_read_flags& flags)
                }
                if (!(((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z'))))
                        goto syntax1;
-               buffer.push(c);
                c = freadchar(stream);
                if (c == cl_EOF) goto eof;
        }
@@ -102,3 +103,5 @@ syntax1:    buffer.push(c);
        // Handle premature EOF.
 eof:   read_number_eof();
 }
+
+}  // namespace cln