summaryrefslogtreecommitdiff
path: root/sql/my_decimal.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/my_decimal.h')
-rw-r--r--sql/my_decimal.h23
1 files changed, 7 insertions, 16 deletions
diff --git a/sql/my_decimal.h b/sql/my_decimal.h
index c661579ea66..800ae23425b 100644
--- a/sql/my_decimal.h
+++ b/sql/my_decimal.h
@@ -40,6 +40,7 @@ C_MODE_END
/* the number of digits that my_decimal can possibly contain */
#define DECIMAL_MAX_POSSIBLE_PRECISION (DECIMAL_BUFF_LENGTH * 9)
+
/*
maximum guaranteed precision of number in decimal digits (number of our
digits * number of decimal digits in one our big digit - number of decimal
@@ -114,7 +115,7 @@ public:
#ifndef DBUG_OFF
void print_decimal(const my_decimal *dec);
-void print_decimal_buff(const my_decimal *dec, const byte* ptr, int length);
+void print_decimal_buff(const my_decimal *dec, const uchar* ptr, int length);
const char *dbug_decimal_as_string(char *buff, const my_decimal *val);
#else
#define dbug_decimal_as_string(A) NULL
@@ -204,16 +205,15 @@ void my_decimal2decimal(const my_decimal *from, my_decimal *to)
}
-int my_decimal2binary(uint mask, const my_decimal *d, char *bin, int prec,
+int my_decimal2binary(uint mask, const my_decimal *d, uchar *bin, int prec,
int scale);
inline
-int binary2my_decimal(uint mask, const char *bin, my_decimal *d, int prec,
+int binary2my_decimal(uint mask, const uchar *bin, my_decimal *d, int prec,
int scale)
{
- return check_result(mask, bin2decimal((char *)bin, (decimal_t*) d, prec,
- scale));
+ return check_result(mask, bin2decimal(bin, (decimal_t*) d, prec, scale));
}
@@ -395,20 +395,11 @@ int my_decimal_cmp(const my_decimal *a, const my_decimal *b)
inline
int my_decimal_intg(const my_decimal *a)
{
- return decimal_intg((decimal_t*) a);
+ return decimal_intg((decimal_t*) a);
}
-inline
-void my_decimal_trim(ulong *precision, uint *scale)
-{
- if (!(*precision) && !(*scale))
- {
- *precision= 10;
- *scale= 0;
- return;
- }
-}
+void my_decimal_trim(ulong *precision, uint *scale);
#endif /*my_decimal_h*/