]> www.ginac.de Git - cln.git/blobdiff - src/integer/conv/cl_I_from_L.cc
Avoid some "suggest explicit braces to avoid ambiguous ‘else’" warnings.
[cln.git] / src / integer / conv / cl_I_from_L.cc
index 3419d0c0bb88db0b8ea88ad8fa021985a1875e22..efc6887137cef8e600277aa97ff70cd95783b913 100644 (file)
@@ -1,28 +1,36 @@
 // L_to_I() helper.
 
 // General includes.
-#include "cl_sysdep.h"
+#include "base/cl_sysdep.h"
 
 // Specification.
-#include "cl_I.h"
+#include "integer/cl_I.h"
 
 
 // Implementation.
 
-#include "cl_number.h"
+#include "cln/number.h"
 
 #if (cl_value_len < 32)
 
-#include "cl_DS.h"
+#include "base/digitseq/cl_DS.h"
+
+namespace cln {
 
 cl_private_thing cl_I_constructor_from_L (sint32 wert)
 {
        var uint32 test = wert & minus_bit(cl_value_len-1);
-       // test enthält die Bits, die nicht in den Fixnum-Wert >= 0 reinpassen.
+       // test enthält die Bits, die nicht in den Fixnum-Wert >= 0 reinpassen.
        if ((test == 0) || (test == (uint32)minus_bit(cl_value_len-1)))
                { return (cl_private_thing)(cl_combine(cl_FN_tag,wert)); }
+       #if (intDsize==64)
+         // trivially generate a Bignum of length one digit
+         var cl_heap_bignum* ptr = allocate_bignum(1);
+         arrayLSref(ptr->data,1,0) = wert;
+         return (cl_private_thing)(ptr);
+       #else
        // Bignum erzeugen:
-       // (dessen Länge  bn_minlength <= n <= ceiling(32/intDsize)  erfüllt)
+       // (dessen Länge  bn_minlength <= n <= ceiling(32/intDsize)  erfüllt)
        if (bn_minlength == ceiling(32,intDsize)) {
                #if (intDsize==8)
                goto bignum4;
@@ -99,6 +107,10 @@ cl_private_thing cl_I_constructor_from_L (sint32 wert)
                #endif
                #undef IF_LENGTH
        }
+       #endif
+       NOTREACHED
 }
 
+}  // namespace cln
+
 #endif