#include "cl_sysdep.h"
// Specification.
-#include "cl_integer_io.h"
+#include "cln/integer_io.h"
// Implementation.
-#include <string.h>
-#include "cl_input.h"
-#include "cl_integer.h"
+#include <cstring>
+#include "cln/input.h"
+#include "cln/integer.h"
#include "cl_I.h"
-#include "cl_abort.h"
+#include "cln/abort.h"
-#undef floor
-#include <math.h>
-#define floor cln_floor
+namespace cln {
// Step forward over all digits, to the end of string or to the next non-digit.
static const char * skip_digits (const char * ptr, const char * string_limit, unsigned int base)
ASSERT((flags.syntax & ~(syntax_integer|syntax_maybe_bad)) == 0);
// If no string_limit is given, it defaults to the end of the string.
if (!string_limit)
- string_limit = string + strlen(string);
+ string_limit = string + ::strlen(string);
if (flags.syntax & syntax_integer) {
// Check for integer syntax.
var unsigned int rational_base = flags.rational_base;
goto not_integer_syntax;
var cl_I base = read_integer(10,0,ptr,0,base_end_ptr-ptr);
if (!((base >= 2) && (base <= 36))) {
- fprint(cl_stderr, "Base must be an integer in the range from 2 to 36, not ");
- fprint(cl_stderr, base);
- fprint(cl_stderr, "\n");
+ fprint(std::cerr, "Base must be an integer in the range from 2 to 36, not ");
+ fprint(std::cerr, base);
+ fprint(std::cerr, "\n");
cl_abort();
}
rational_base = FN_to_UL(base); ptr = base_end_ptr;
}
}
not_integer_syntax:
-bad_syntax:
if (flags.syntax & syntax_maybe_bad) {
ASSERT(end_of_parse);
*end_of_parse = string;
}
read_number_bad_syntax(string,string_limit);
}
+
+} // namespace cln