summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2011-03-24 12:30:03 +0100
committerVladislav Vaintroub <wlad@montyprogram.com>2011-03-24 12:30:03 +0100
commit8250ceced6aab95347e00e2ff1c02730da0be4fe (patch)
treea9c92cf8c685457bf79b580ab6109e6331e8c300 /sql-common
parenta85ccfedcf91f7ad2c578ec60e69d127f199d079 (diff)
downloadmariadb-git-8250ceced6aab95347e00e2ff1c02730da0be4fe.tar.gz
Fix compilation on Windows:
- Fixes for type-conversion (time_t is not interchangeable with my_time_t on Windows as time_t s 64 bit while my_time_t is long) - BIGENDIAN-> ARCH_BIGENDIAN . BIGENDIAN constant is defined in winsock2.h (as 0) - added explicit cast for longlong->double conversion in sql/item.h (fixed many warnings) Also, HAVE_SNPRINTF is now defined and snprintf is defined to _snprintf in config-win.h
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/my_time.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index f05f1fe835b..d9d53107b8b 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -1245,7 +1245,7 @@ int number_to_time(double nr, MYSQL_TIME *ltime, int *was_cut)
ltime->hour = tmp/100/100;
ltime->minute= tmp/100%100;
ltime->second= tmp%100;
- ltime->second_part= (nr-tmp)*1e6;
+ ltime->second_part= (ulong)((nr-tmp)*1e6);
if (ltime->minute < 60 && ltime->second < 60)
return 0;
@@ -1363,7 +1363,7 @@ MYSQL_TIME *unpack_time(longlong packed, MYSQL_TIME *my_time)
get_one(my_time->hour, 24ULL);
get_one(my_time->day, 32ULL);
get_one(my_time->month, 13ULL);
- my_time->year= packed;
+ my_time->year= (uint)packed;
my_time->time_type= MYSQL_TIMESTAMP_DATETIME;
return my_time;
}