summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-10-01 18:27:32 +0300
committerMichael Widenius <monty@askmonty.org>2010-10-01 18:27:32 +0300
commitca672e6b61d8e8f4d1c092a1f8a9c0e4f3f19027 (patch)
treeb8c1cf4e76aa783227756dab2c18d611424e5878 /strings
parentf715c9c205a99c1d97cb0f9630fc52e1a916a78d (diff)
parent255187b2793e313cb50c1e0f1fe22272b76d3ec3 (diff)
downloadmariadb-git-ca672e6b61d8e8f4d1c092a1f8a9c0e4f3f19027.tar.gz
Automatic merge
Diffstat (limited to 'strings')
-rw-r--r--strings/decimal.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/strings/decimal.c b/strings/decimal.c
index 236b62b9296..1f879fbe9ad 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -346,7 +346,7 @@ int decimal2string(decimal_t *from, char *to, int *to_len,
char *s=to;
dec1 *buf, *buf0=from->buf, tmp;
- DBUG_ASSERT(*to_len >= 2+from->sign);
+ DBUG_ASSERT(*to_len >= 2+ (int) from->sign);
/* removing leading zeroes */
buf0= remove_leading_zeroes(from, &intg);
@@ -1801,7 +1801,8 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to)
int intg1=ROUND_UP(from1->intg), intg2=ROUND_UP(from2->intg),
frac1=ROUND_UP(from1->frac), frac2=ROUND_UP(from2->frac);
int frac0=max(frac1, frac2), error;
- dec1 *buf1, *buf2, *buf0, *stop1, *stop2, *start1, *start2, carry=0;
+ dec1 *buf1, *buf2, *buf0, *stop1, *stop2, *start1, *start2;
+ my_bool carry=0;
/* let carry:=1 if from2 > from1 */
start1=buf1=from1->buf; stop1=buf1+intg1;
@@ -1869,7 +1870,7 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to)
swap_variables(dec1 *,start1, start2);
swap_variables(int,intg1,intg2);
swap_variables(int,frac1,frac2);
- to->sign= 1 - to->sign;
+ to->sign= !to->sign;
}
FIX_INTG_FRAC_ERROR(to->len, intg1, frac0, error);