Fix wrong argument order in std::copy invocations

This commit is contained in:
fwcd 2019-04-06 18:09:22 +02:00
commit 98669ef129
4 changed files with 6 additions and 6 deletions

View file

@ -1091,7 +1091,7 @@ bool stripzeroesnum(_Inout_ PNUMBER pnum, int32_t starting)
if ( fstrip ) if ( fstrip )
{ {
// Remove them. // Remove them.
copy(pmant, pnum->mant.begin(), cdigits); copy(pmant, pmant + cdigits, pnum->mant.begin());
// And adjust exponent and digit count accordingly. // And adjust exponent and digit count accordingly.
pnum->exp += ( pnum->cdigit - cdigits ); pnum->exp += ( pnum->cdigit - cdigits );
pnum->cdigit = cdigits; pnum->cdigit = cdigits;

View file

@ -459,7 +459,7 @@ void _divnum( PNUMBER *pa, PNUMBER b, uint32_t radix, int32_t precision)
if (c->mant.begin() != ++ptrc) if (c->mant.begin() != ++ptrc)
{ {
copy(ptrc, c->mant.begin(), cdigits); copy(ptrc, ptrc + cdigits, c->mant.begin());
} }
// Cleanup table structure // Cleanup table structure

View file

@ -211,7 +211,7 @@ _destroynum(x),(x)=nullptr
int32_t trim = (x)->cdigit - precision-g_ratio;\ int32_t trim = (x)->cdigit - precision-g_ratio;\
if ( trim > 1 ) \ if ( trim > 1 ) \
{ \ { \
std::copy((x)->mant.begin() + trim, (x)->mant.begin(), (x)->cdigit-trim);\ std::copy((x)->mant.begin() + trim, (x)->mant.begin() + (x)->cdigit, (x)->mant.begin());\
(x)->cdigit -= trim; \ (x)->cdigit -= trim; \
(x)->exp += trim; \ (x)->exp += trim; \
} \ } \
@ -221,7 +221,7 @@ std::copy((x)->mant.begin() + trim, (x)->mant.begin(), (x)->cdigit-trim);\
int32_t trim = (x)->pp->cdigit - (precision/g_ratio) - 2;\ int32_t trim = (x)->pp->cdigit - (precision/g_ratio) - 2;\
if ( trim > 1 ) \ if ( trim > 1 ) \
{ \ { \
std::copy((x)->pp->mant.begin() + trim, (x)->pp->mant.begin(), ((x)->pp->cdigit-trim)); \ std::copy((x)->pp->mant.begin() + trim, (x)->pp->mant.begin() + (x)->pp->cdigit, (x)->pp->mant.begin()); \
(x)->pp->cdigit -= trim; \ (x)->pp->cdigit -= trim; \
(x)->pp->exp += trim; \ (x)->pp->exp += trim; \
} \ } \

View file

@ -695,7 +695,7 @@ void trimit( PRAT *px, int32_t precision)
} }
else else
{ {
copy(pp->mant.begin() + (trim-pp->exp), pp->mant.begin(), pp->cdigit-trim+pp->exp); copy(pp->mant.begin() + (trim-pp->exp), pp->mant.begin() + pp->cdigit, pp->mant.begin());
pp->cdigit -= trim-pp->exp; pp->cdigit -= trim-pp->exp;
pp->exp = 0; pp->exp = 0;
} }
@ -706,7 +706,7 @@ void trimit( PRAT *px, int32_t precision)
} }
else else
{ {
copy(pq->mant.begin() + (trim-pq->exp), pq->mant.begin(), pq->cdigit-trim+pq->exp); copy(pq->mant.begin() + (trim-pq->exp), pq->mant.begin() + pq->cdigit, pq->mant.begin());
pq->cdigit -= trim-pq->exp; pq->cdigit -= trim-pq->exp;
pq->exp = 0; pq->exp = 0;
} }