]> www.ginac.de Git - cln.git/blobdiff - src/integer/conv/cl_I_from_NDS.cc
Fix linking problems on some platforms caused by inline/non-inline versions
[cln.git] / src / integer / conv / cl_I_from_NDS.cc
index e358573dada415b85a1605b83494285aad4668fd..6a5abf45b875a5910465e9ff7739e82a07a71128 100644 (file)
 
 namespace cln {
 
-MAYBE_INLINE
-const cl_I NDS_to_I (const uintD* MSDptr, uintC len)
+CL_INLINE const cl_I CL_INLINE_DECL(NDS_to_I) (const uintD* MSDptr, uintC len)
 {
       // Mehr als bn_minlength Digits -> Bignum.
       // Weniger als bn_minlength Digits -> Fixnum.
       // Genau bn_minlength Digits -> Bignum oder Fixnum.
       if (len < bn_minlength)
-        { // 0..bn_minlength-1 Digits, paßt in ein Fixnum:
+        { // 0..bn_minlength-1 Digits, paßt in ein Fixnum:
           if (bn_minlength>1 ? (len==0) : TRUE)
             // 0 Digits
             { return 0; }
@@ -47,6 +46,7 @@ const cl_I NDS_to_I (const uintD* MSDptr, uintC len)
             // 5 Digits
             len_5:
             { wert = get_sint4D_Dptr(MSDptr mspop 5); }
+          return L_to_FN(wert);
           #else // (cl_word_size==64)
           var sint64 wert;
           #if (intDsize==32)
@@ -60,19 +60,19 @@ const cl_I NDS_to_I (const uintD* MSDptr, uintC len)
             { wert = ((sint64)(sintD)mspref(MSDptr,0) << intDsize) | (uint64)(uintD)mspref(MSDptr,1); }
           #endif
           #if (intDsize==64)
-          if (TRUE)
+          if (FALSE)
             // 1 Digit
             len_1:
             { wert = (sintD)mspref(MSDptr,0); }
           #endif
+          return cl_I_from_word(cl_combine(cl_FN_tag,wert));
           #endif
-          return L_to_FN(wert);
         }
       #if (cl_value_len > (bn_minlength-1)*intDsize)
       if (len == bn_minlength)
         // bn_minlength Digits, also (incl. Vorzeichen) zwischen
         // (bn_minlength-1)*intDsize+1 und bn_minlength*intDsize Bits.
-        // Höchstens cl_value_len Bits -> paßt in ein Fixnum:
+        // Höchstens cl_value_len Bits -> paßt in ein Fixnum:
         { if (  (mspref(MSDptr,0) <= (uintD)(bit(cl_value_len-1-(bn_minlength-1)*intDsize)-1)) // Fixnum >=0 ?
               ||(mspref(MSDptr,0) >= (uintD)(-bit(cl_value_len-1-(bn_minlength-1)*intDsize))) // Fixnum <0 ?
              )
@@ -95,7 +95,7 @@ const cl_I NDS_to_I (const uintD* MSDptr, uintC len)
       #endif
       // mindestens bn_minlength Digits, mache ein Bignum
       { var Bignum result = allocate_bignum(len);
-        // neues Bignum mit dem Inhalt der NDS füllen:
+        // neues Bignum mit dem Inhalt der NDS füllen:
         copy_loop_msp(MSDptr,arrayMSDptr(result->data,len),len);
         return result;
       }