]> www.ginac.de Git - cln.git/blobdiff - src/modinteger/cl_MI_std.h
Replace unused macro with cl_unused.
[cln.git] / src / modinteger / cl_MI_std.h
index 04fd37bb0c84457d439ce68b5c7e3b7431ddd57d..007ed27b92aaebbf0c040ed815bb33c2cec05406 100644 (file)
@@ -21,7 +21,7 @@ static const _cl_MI std_canonhom (cl_heap_modint_ring* R, const cl_I& x)
 
 static const cl_I std_retract (cl_heap_modint_ring* R, const _cl_MI& x)
 {
-       unused R;
+       cl_unused R;
        return x.rep;
 }
 
@@ -35,9 +35,9 @@ static const _cl_MI std_zero (cl_heap_modint_ring* R)
        return _cl_MI(R, 0);
 }
 
-static cl_boolean std_zerop (cl_heap_modint_ring* R, const _cl_MI& x)
+static bool std_zerop (cl_heap_modint_ring* R, const _cl_MI& x)
 {
-       unused R;
+       cl_unused R;
        return zerop(x.rep);
 }
 
@@ -82,7 +82,7 @@ static const cl_MI_x std_recip (cl_heap_modint_ring* R, const _cl_MI& x)
        if (eq(g,1))
                return cl_MI(R, (minusp(u) ? u + R->modulus : u));
        if (zerop(xr))
-               cl_error_division_by_0();
+               throw division_by_0_exception();
        return cl_notify_composite(R,xr);
 }
 
@@ -95,7 +95,7 @@ static const cl_MI_x std_div (cl_heap_modint_ring* R, const _cl_MI& x, const _cl
        if (eq(g,1))
                return cl_MI(R, mod(x.rep * (minusp(u) ? u + R->modulus : u), R->modulus));
        if (zerop(yr))
-               cl_error_division_by_0();
+               throw division_by_0_exception();
        return cl_notify_composite(R,yr);
 }
 
@@ -208,7 +208,7 @@ static const _cl_MI std_expt_pos (cl_heap_modint_ring* R, const _cl_MI& x, const
                {
                        var const uintD* n_LSDptr;
                        var const uintD* n_MSDptr;
-                       I_to_NDS_nocopy(n, n_MSDptr=,,n_LSDptr=,cl_false,);
+                       I_to_NDS_nocopy(n, n_MSDptr=,,n_LSDptr=,false,);
                        var const uintL k_mask = bit(k)-1;
                        var uintD carry = 0;
                        var unsigned int carrybits = 0;
@@ -258,7 +258,7 @@ static const _cl_MI std_expt_pos (cl_heap_modint_ring* R, const _cl_MI& x, const
                // Compute a = x^n_digits[nnk-1].
                {
                        var uintL d = n_digits[nnk-1];
-                       if (d == 0) cl_abort();
+                       if (d == 0) throw runtime_exception();
                        var uintL d2;
                        if (k <= 8)
                                d2 = ord2_table[d];
@@ -271,7 +271,7 @@ static const _cl_MI std_expt_pos (cl_heap_modint_ring* R, const _cl_MI& x, const
                        if (d==0 && maxodd > 1 && d2>0) {
                                a = x2; d2--;
                        }
-                       if (!(d2 < k)) cl_abort();
+                       if (!(d2 < k)) throw runtime_exception();
                        for ( ; d2>0; d2--)
                                a = R->_square(a);
                }
@@ -292,7 +292,7 @@ static const _cl_MI std_expt_pos (cl_heap_modint_ring* R, const _cl_MI& x, const
                        } else
                                d2 = k;
                        // Square d2 times.
-                       if (!(d2 <= k)) cl_abort();
+                       if (!(d2 <= k)) throw runtime_exception();
                        for ( ; d2>0; d2--)
                                a = R->_square(a);
                }