@@ -111,7 +111,7 @@ struct UInt(size_t size)
111111
112112 static if (size == 128 )
113113 // /
114- version (mir_test ) @safe pure @nogc unittest
114+ version (mir_bignum_test ) @safe pure @nogc unittest
115115 {
116116 import mir.math.constant: PI ;
117117 UInt! 256 integer = " 34010447314490204552169750449563978034784726557588085989975288830070948234680" ; // constructor
@@ -265,14 +265,14 @@ struct UInt(size_t size)
265265 }
266266
267267 // / ditto
268- auto opCmp (ulong rhs) const
268+ auto opCmp (ulong rhs) const scope
269269 {
270270 return opCmp (UInt! size(rhs));
271271 }
272272
273273 /+ +
274274 +/
275- ref UInt! size opAssign (ulong rhs) return
275+ ref UInt! size opAssign (ulong rhs) scope return
276276 @safe pure nothrow @nogc
277277 {
278278 this .data = UInt! size(rhs).data;
@@ -283,15 +283,15 @@ struct UInt(size_t size)
283283 `bool overflow = a += b ` and `bool overflow = a -= b` operations.
284284 +/
285285 bool opOpAssign (string op)(UInt! size rhs, bool overflow = false )
286- @safe pure nothrow @nogc
286+ @safe pure nothrow @nogc scope
287287 if (op == " +" || op == " -" )
288288 {
289289 return view.opOpAssign! op(rhs.view, overflow);
290290 }
291291
292292 // / ditto
293293 bool opOpAssign (string op)(size_t rhs)
294- @safe pure nothrow @nogc
294+ @safe pure nothrow @nogc scope
295295 if (op == " +" || op == " -" )
296296 {
297297 return view.opOpAssign! op(rhs);
@@ -300,15 +300,15 @@ struct UInt(size_t size)
300300 static if (size_t .sizeof < ulong .sizeof)
301301 // / ditto
302302 bool opOpAssign (string op)(ulong rhs)
303- @safe pure nothrow @nogc
303+ @safe pure nothrow @nogc scope
304304 if (op == " +" || op == " -" )
305305 {
306306 return opOpAssign! op(UInt! size(rhs));
307307 }
308308
309309 // / ditto
310310 bool opOpAssign (string op, size_t rsize)(UInt! rsize rhs, bool overflow = false )
311- @safe pure nothrow @nogc
311+ @safe pure nothrow @nogc scope
312312 if ((op == " +" || op == " -" ) && rsize < size)
313313 {
314314 return opOpAssign! op(rhs.toSize! size, overflow);
@@ -318,15 +318,15 @@ struct UInt(size_t size)
318318 Returns: overflow value of multiplication
319319 +/
320320 size_t opOpAssign (string op : " *" )(size_t rhs, size_t carry = 0 )
321- @safe pure nothrow @nogc
321+ @safe pure nothrow @nogc scope
322322 {
323323 return view.opOpAssign! op(rhs, carry);
324324 }
325325
326326 static if (size_t .sizeof == 4 )
327327 // / ditto
328328 auto opOpAssign (string op : " *" )(ulong rhs)
329- @safe pure nothrow @nogc
329+ @safe pure nothrow @nogc scope
330330 {
331331 return opOpAssign! op(UInt! 64 (rhs));
332332 }
@@ -336,7 +336,7 @@ struct UInt(size_t size)
336336 Returns: overflow value of multiplication
337337 +/
338338 void opOpAssign (string op : " *" , size_t rhsSize)(UInt! rhsSize rhs)
339- @safe pure nothrow @nogc
339+ @safe pure nothrow @nogc scope
340340 if (rhsSize <= size)
341341 {
342342 this = extendedMul(this , rhs).toSize! size;
@@ -352,7 +352,7 @@ struct UInt(size_t size)
352352 unsigned remainder value (evaluated overflow)
353353 +/
354354 uint opOpAssign (string op : " /" )(uint rhs, uint overflow = 0 )
355- @safe pure nothrow @nogc
355+ @safe pure nothrow @nogc scope
356356 {
357357 assert (overflow < rhs);
358358 auto work = view.normalized;
@@ -382,7 +382,7 @@ struct UInt(size_t size)
382382 }
383383
384384 // /
385- ref UInt! size opOpAssign (string op)(size_t rhs) nothrow return
385+ ref UInt! size opOpAssign (string op)(size_t rhs) nothrow return scope
386386 if (op == " ^" || op == " |" || op == " &" )
387387 {
388388 mixin (` view.leastSignificantFirst[0] ` ~ op ~ ` = rhs;` );
@@ -392,7 +392,7 @@ struct UInt(size_t size)
392392 static if (size_t .sizeof < ulong .sizeof)
393393 // / ditto
394394 ref opOpAssign (string op)(ulong rhs) return
395- @safe pure nothrow @nogc
395+ @safe pure nothrow @nogc scope
396396 if (op == " ^" || op == " |" || op == " &" )
397397 {
398398 return opOpAssign! op(UInt! size(rhs));
@@ -805,7 +805,7 @@ UInt!sizeB extendedMulHigh(size_t sizeA, size_t sizeB)(UInt!sizeA a, UInt!sizeB
805805
806806/+ +
807807+/
808- UInt! (sizeA + sizeB) extendedMul(size_t sizeA, size_t sizeB)(UInt! sizeA a, UInt! sizeB b)
808+ UInt! (sizeA + sizeB) extendedMul(size_t sizeA, size_t sizeB)(UInt! sizeA a, UInt! sizeB b) @safe
809809{
810810 UInt! (sizeA + sizeB) ret;
811811 enum al = a.data.length;
@@ -827,7 +827,7 @@ UInt!(sizeA + sizeB) extendedMul(size_t sizeA, size_t sizeB)(UInt!sizeA a, UInt!
827827
828828// / ditto
829829UInt! (size + size_t .sizeof * 8 )
830- extendedMul(size_t size)(UInt! size a, size_t b)
830+ extendedMul(size_t size)(UInt! size a, size_t b) @safe
831831{
832832 size_t overflow = a.view *= b;
833833 auto ret = a.toSize! (size + size_t .sizeof * 8 );
@@ -873,7 +873,6 @@ UInt!64 extendedMul()(uint a, uint b)
873873
874874// /
875875version (mir_bignum_test)
876- version (mir_bignum_test)
877876@safe pure @nogc
878877unittest
879878{
0 commit comments