X-Git-Url: https://ginac.de/CLN/cln.git//cln.git?a=blobdiff_plain;f=src%2Finteger%2Finput%2Fcl_I_read.cc;h=320d5f5151a0f5563e65f464d0b797d28a538970;hb=8169a19b38c42588b39b21dae5bdb964e2f6b8c6;hp=645b9b5d1db425fcb798a7f5df97a80d6fc48414;hpb=541905ab439d15b52a915b4deeeb7c370443b6da;p=cln.git diff --git a/src/integer/input/cl_I_read.cc b/src/integer/input/cl_I_read.cc index 645b9b5..320d5f5 100644 --- a/src/integer/input/cl_I_read.cc +++ b/src/integer/input/cl_I_read.cc @@ -3,7 +3,7 @@ // It does not pull in all the rational number code. // General includes. -#include "cl_sysdep.h" +#include "base/cl_sysdep.h" // Specification. #include "cln/integer_io.h" @@ -12,10 +12,10 @@ // Implementation. #include +#include #include "cln/input.h" #include "cln/integer.h" -#include "cl_I.h" -#include "cln/abort.h" +#include "integer/cl_I.h" namespace cln { @@ -47,7 +47,7 @@ static const char * skip_digits (const char * ptr, const char * string_limit, un if (end_of_parse) \ { *end_of_parse = (ptr); } \ else \ - { if ((ptr) != string_limit) { read_number_junk((ptr),string,string_limit); } } + { if ((ptr) != string_limit) { throw read_number_junk_exception((ptr),string,string_limit); } } const cl_I read_integer (const cl_read_flags& flags, const char * string, const char * string_limit, const char * * end_of_parse) { @@ -81,12 +81,12 @@ const cl_I read_integer (const cl_read_flags& flags, const char * string, const goto not_integer_syntax; var cl_I base = read_integer(10,0,ptr,0,base_end_ptr-ptr); if (!((base >= 2) && (base <= 36))) { - 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(); + std::ostringstream buf; + fprint(buf, "Base must be an integer in the range from 2 to 36, not "); + fprint(buf, base); + throw runtime_exception(buf.str()); } - rational_base = FN_to_UL(base); ptr = base_end_ptr; + rational_base = FN_to_UV(base); ptr = base_end_ptr; break; } ptr++; @@ -127,7 +127,7 @@ not_integer_syntax: *end_of_parse = string; return 0; // dummy return } - read_number_bad_syntax(string,string_limit); + throw read_number_bad_syntax_exception(string,string_limit); } } // namespace cln