]> www.ginac.de Git - cln.git/blobdiff - src/rational/misc/cl_RA_as.cc
Replace unused macro with cl_unused.
[cln.git] / src / rational / misc / cl_RA_as.cc
index 57c8783d54e9cc0674c3576b3e780a074cdc94ea..540c660263c4675efaab6723b751597304f091cc 100644 (file)
@@ -1,7 +1,7 @@
-// as_cl_RA().
+// cl_RA_As().
 
 // General includes.
-#include "cl_sysdep.h"
+#include "base/cl_sysdep.h"
 
 // Specification.
 #include "cln/rational.h"
@@ -9,34 +9,34 @@
 
 // Implementation.
 
-#include "cl_N.h"
+#include "base/cl_N.h"
 
 namespace cln {
 
 // Cf. cl_RA_p in cl_RA_ring.cc.
 // But here, for better inlining in g++, it is preferrable to finish every
-// alternative with either "return cl_true;" or "return cl_false;".
+// alternative with either "return true;" or "return false;".
 
-inline cl_boolean cl_RA_p (const cl_number& x)
+inline bool cl_RA_p (const cl_number& x)
 {
        if (!x.pointer_p())
                switch (x.nonpointer_tag()) {
                case cl_FN_tag:
-                       return cl_true;
+                       return true;
                }
        else
                if (x.pointer_type()->flags & cl_class_flags_subclass_rational)
-                       return cl_true;
-       return cl_false;
+                       return true;
+       return false;
 }
 
-const cl_RA& as_cl_RA (const cl_number& x, const char * filename, int line)
+const cl_RA& cl_RA_As (const cl_number& x, const char * filename, int line)
 {
        if (cl_RA_p(x)) {
                DeclareType(cl_RA,x);
                return x;
        } else
-               cl_as_error(x,"a rational number",filename,line);
+               throw as_exception(x,"a rational number",filename,line);
 }
 
 }  // namespace cln