From f06592376fcd14fe9693af3c0e702e1828bc8c43 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Sun, 12 Mar 2017 12:35:50 +0000 Subject: [PATCH] changed: some return values has been cleaned in ttmathuint.h (eclipse builtin parser reported errors but actually the code was correct) git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@1050 e52654a7-88a9-db11-a3e9-0013d4bc506e --- ttmath/ttmathuint.h | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/ttmath/ttmathuint.h b/ttmath/ttmathuint.h index 43d68c1..7c5341a 100644 --- a/ttmath/ttmathuint.h +++ b/ttmath/ttmathuint.h @@ -955,17 +955,20 @@ public: switch( algorithm ) { case 1: - return Mul1Big(ss2, result); + Mul1Big(ss2, result); + break; case 2: - return Mul2Big(ss2, result); + Mul2Big(ss2, result); + break; case 3: - return Mul3Big(ss2, result); + Mul3Big(ss2, result); + break; case 100: default: - return MulFastestBig(ss2, result); + MulFastestBig(ss2, result); } } @@ -1501,7 +1504,10 @@ public: void MulFastestBig(const UInt & ss2, UInt & result) { if( value_size < TTMATH_USE_KARATSUBA_MULTIPLICATION_FROM_SIZE ) - return Mul2Big(ss2, result); + { + Mul2Big(ss2, result); + return; + } uint x1size = value_size, x2size = value_size; uint x1start = 0, x2start = 0; @@ -1523,9 +1529,12 @@ public: uint distancex2 = x2size - x2start; if( distancex1 < 3 || distancex2 < 3 ) + { // either 'this' or 'ss2' have only 2 (or 1) items different from zero (side by side) // (this condition in the future can be improved) - return Mul2Big3(table, ss2.table, result, x1start, x1size, x2start, x2size); + Mul2Big3(table, ss2.table, result, x1start, x1size, x2start, x2size); + return; + } // Karatsuba multiplication