summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <kaa@polly.local>2007-05-28 15:33:22 +0400
committerunknown <kaa@polly.local>2007-05-28 15:33:22 +0400
commit088cb9ddc41b7dfb8d6ff3c92d949c326dcaabb1 (patch)
tree41b3d2be6f1791c5130fbb13683a7df7638076ed
parent8358a0c7c7915d0cc2913833e600f2e591deaab5 (diff)
downloadmariadb-git-088cb9ddc41b7dfb8d6ff3c92d949c326dcaabb1.tar.gz
Some Windows-related fixes to make Microsoft compilers happy. This is for bug #28128.
include/m_string.h: Reduced the number of elements in log_10[] and log_01[] to not exceed DBL_MAX. sql/field.cc: Avoid the warning on Windows. strings/strtod.c: Reduced the number of elements in log_10[] and log_01[] to not exceed DBL_MAX.
-rw-r--r--include/m_string.h4
-rw-r--r--sql/field.cc2
-rw-r--r--strings/strtod.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/include/m_string.h b/include/m_string.h
index 773326e9b7d..f28cda529f5 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -106,8 +106,8 @@ extern char NEAR _dig_vec_upper[];
extern char NEAR _dig_vec_lower[];
/* Defined in strtod.c */
-extern const double log_10[310];
-extern const double log_01[310];
+extern const double log_10[309];
+extern const double log_01[309];
#ifdef BAD_STRING_COMPILER
#define strmov(A,B) (memccpy(A,B,0,INT_MAX)-1)
diff --git a/sql/field.cc b/sql/field.cc
index 8989f601b74..3eb5bcab723 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -3676,7 +3676,7 @@ int Field_float::store(const char *from,uint len,CHARSET_INFO *cs)
int Field_float::store(double nr)
{
int error= truncate(&nr, FLT_MAX);
- float j= nr;
+ float j= (float)nr;
#ifdef WORDS_BIGENDIAN
if (table->s->db_low_byte_first)
diff --git a/strings/strtod.c b/strings/strtod.c
index 0ada423f373..2d807520d77 100644
--- a/strings/strtod.c
+++ b/strings/strtod.c
@@ -63,7 +63,7 @@ const double log_10[] = {
1e270, 1e271, 1e272, 1e273, 1e274, 1e275, 1e276, 1e277, 1e278, 1e279,
1e280, 1e281, 1e282, 1e283, 1e284, 1e285, 1e286, 1e287, 1e288, 1e289,
1e290, 1e291, 1e292, 1e293, 1e294, 1e295, 1e296, 1e297, 1e298, 1e299,
- 1e300, 1e301, 1e302, 1e303, 1e304, 1e305, 1e306, 1e307, 1e308, 1e309
+ 1e300, 1e301, 1e302, 1e303, 1e304, 1e305, 1e306, 1e307, 1e308
};
const double log_01[] = {
@@ -97,7 +97,7 @@ const double log_01[] = {
1e-270,1e-271,1e-272,1e-273,1e-274,1e-275,1e-276,1e-277,1e-278,1e-279,
1e-280,1e-281,1e-282,1e-283,1e-284,1e-285,1e-286,1e-287,1e-288,1e-289,
1e-290,1e-291,1e-292,1e-293,1e-294,1e-295,1e-296,1e-297,1e-298,1e-299,
- 1e-300,1e-301,1e-302,1e-303,1e-304,1e-305,1e-306,1e-307,1e-308,1e-309
+ 1e-300,1e-301,1e-302,1e-303,1e-304,1e-305,1e-306,1e-307,1e-308
};
/*