diff options
author | Michael Widenius <monty@askmonty.org> | 2010-01-14 18:51:00 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2010-01-14 18:51:00 +0200 |
commit | d121e6630519a66eec7c953ee0eae623f592ce87 (patch) | |
tree | d0e61d2ccd45fdbd82d57737ebb45ec388aee20a | |
parent | e4535de11fe8eaba8ee5013b9bd5fe3b4b713b55 (diff) | |
download | mariadb-git-d121e6630519a66eec7c953ee0eae623f592ce87.tar.gz |
Fix for compiler warnings on windows
Fix wrong cast of time()
include/my_pthread.h:
Safety fix that also removes compiler warnings
sql/handler.h:
Changed timestamp columns to be of type time_t
storage/maria/ma_check.c:
Removed wrong cast
storage/maria/ma_create.c:
Removed wrong cast
storage/myisam/mi_check.c:
Removed wrong cast
storage/myisam/mi_create.c:
Removed wrong cast
storage/xtradb/handler/ha_innodb.cc:
Removed compiler warning on windows
-rw-r--r-- | include/my_pthread.h | 6 | ||||
-rw-r--r-- | sql/handler.h | 12 | ||||
-rw-r--r-- | storage/maria/ma_check.c | 2 | ||||
-rw-r--r-- | storage/maria/ma_create.c | 2 | ||||
-rw-r--r-- | storage/myisam/mi_check.c | 2 | ||||
-rw-r--r-- | storage/myisam/mi_create.c | 2 | ||||
-rw-r--r-- | storage/xtradb/handler/ha_innodb.cc | 2 |
7 files changed, 15 insertions, 13 deletions
diff --git a/include/my_pthread.h b/include/my_pthread.h index 98d843f54d1..d7a5a30bd73 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -543,9 +543,9 @@ void safe_mutex_free_deadlock_data(safe_mutex_t *mp); #else #define my_pthread_mutex_init(A,B,C,D) pthread_mutex_init((A),(B)) #define my_pthread_mutex_lock(A,B) pthread_mutex_lock(A) -#define safe_mutex_assert_owner(mp) -#define safe_mutex_assert_not_owner(mp) -#define safe_mutex_free_deadlock_data(mp) +#define safe_mutex_assert_owner(mp) do {} while(0) +#define safe_mutex_assert_not_owner(mp) do {} while(0) +#define safe_mutex_free_deadlock_data(mp) do {} while(0) #endif /* SAFE_MUTEX */ #if defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX) diff --git a/sql/handler.h b/sql/handler.h index db3fb8035f2..d03264a23db 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -891,9 +891,9 @@ typedef struct { ulonglong delete_length; ha_rows records; ulong mean_rec_length; - ulong create_time; - ulong check_time; - ulong update_time; + time_t create_time; + time_t check_time; + time_t update_time; ulonglong check_sum; } PARTITION_INFO; @@ -1060,9 +1060,9 @@ public: ha_rows records; ha_rows deleted; /* Deleted records */ ulong mean_rec_length; /* physical reclength */ - ulong create_time; /* When table was created */ - ulong check_time; - ulong update_time; + time_t create_time; /* When table was created */ + time_t check_time; + time_t update_time; uint block_size; /* index block size */ ha_statistics(): diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index 3314a21871a..4f93bf812a3 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -6018,7 +6018,7 @@ int maria_update_state_info(HA_CHECK *param, MARIA_HA *info,uint update) { if (update & UPDATE_TIME) { - share->state.check_time= (long) time((time_t*) 0); + share->state.check_time= time((time_t*) 0); if (!share->state.create_time) share->state.create_time= share->state.check_time; } diff --git a/storage/maria/ma_create.c b/storage/maria/ma_create.c index 05b11929d0a..6886dc8f291 100644 --- a/storage/maria/ma_create.c +++ b/storage/maria/ma_create.c @@ -772,7 +772,7 @@ int maria_create(const char *name, enum data_file_type datafile_type, share.base.min_block_length= share.base.pack_reclength; if (! (flags & HA_DONT_TOUCH_DATA)) - share.state.create_time= (long) time((time_t*) 0); + share.state.create_time= time((time_t*) 0); pthread_mutex_lock(&THR_LOCK_maria); diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 5939e7ea786..9fe954273fe 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -4447,7 +4447,7 @@ int update_state_info(HA_CHECK *param, MI_INFO *info,uint update) { if (update & UPDATE_TIME) { - share->state.check_time= (long) time((time_t*) 0); + share->state.check_time= time((time_t*) 0); if (!share->state.create_time) share->state.create_time=share->state.check_time; } diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c index 3e7045d35a4..1b92d64d529 100644 --- a/storage/myisam/mi_create.c +++ b/storage/myisam/mi_create.c @@ -575,7 +575,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, max(share.base.pack_reclength,MI_MIN_BLOCK_LENGTH) : MI_EXTEND_BLOCK_LENGTH; if (! (flags & HA_DONT_TOUCH_DATA)) - share.state.create_time= (long) time((time_t*) 0); + share.state.create_time= time((time_t*) 0); pthread_mutex_lock(&THR_LOCK_myisam); diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index cbcb5651c2e..f723a58c6d9 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -61,7 +61,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma implementation // gcc: Class implementation #endif +#ifndef MYSQL_SERVER #define MYSQL_SERVER +#endif #include <mysql_priv.h> #ifdef MYSQL_SERVER |