summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2012-04-13 19:44:22 +0200
committerVladislav Vaintroub <wlad@montyprogram.com>2012-04-13 19:44:22 +0200
commit24516289237d5677f0624b1f37306ec505a6db8b (patch)
tree100a7d06edd3f5c08cec39256f45661a0a0d27a7
parent85a025f30c5196c22c5b1d7960912fe9b3f0d6c0 (diff)
downloadmariadb-git-24516289237d5677f0624b1f37306ec505a6db8b.tar.gz
Fixed some simple warnings on Windows.
-rw-r--r--dbug/tests.c5
-rw-r--r--extra/my_print_defaults.c6
-rw-r--r--sql-common/client.c13
-rw-r--r--sql/item_func.h2
-rw-r--r--sql/mysqld.cc2
-rw-r--r--sql/signal_handler.cc2
-rw-r--r--sql/slave.cc4
-rw-r--r--sql/sql_test.cc2
-rw-r--r--storage/innobase/CMakeLists.txt9
-rw-r--r--storage/maria/unittest/ma_control_file-t.c4
-rw-r--r--storage/maria/unittest/ma_test_loghandler_multithread-t.c2
-rw-r--r--storage/perfschema/pfs_instr_class.cc8
-rw-r--r--storage/perfschema/pfs_instr_class.h4
-rw-r--r--storage/sphinx/ha_sphinx.cc1
14 files changed, 30 insertions, 34 deletions
diff --git a/dbug/tests.c b/dbug/tests.c
index 5950c5fa583..657ed638a5a 100644
--- a/dbug/tests.c
+++ b/dbug/tests.c
@@ -38,10 +38,10 @@ int func1()
int main (int argc, char *argv[])
{
- int i;
#ifdef DBUG_OFF
return 1;
-#endif
+#else
+ int i;
if (argc == 1)
return 0;
@@ -83,4 +83,5 @@ int main (int argc, char *argv[])
DBUG_SET(""); /* to not have my_end() in the traces */
my_end(0);
return 0;
+#endif /* DBUG_OFF */
}
diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c
index a25381c4808..8a16e677cb9 100644
--- a/extra/my_print_defaults.c
+++ b/extra/my_print_defaults.c
@@ -67,7 +67,7 @@ static struct my_option my_long_options[] =
{"defaults-extra-file", 'e',
"Read this file after the global config file and before the config "
"file in the users home directory; should be the first option",
- &my_defaults_extra_file, &my_defaults_extra_file, 0,
+ (void *)&my_defaults_extra_file, (void *)&my_defaults_extra_file, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"defaults-group-suffix", 'g',
"In addition to the given groups, read also groups with this suffix",
@@ -75,8 +75,8 @@ static struct my_option my_long_options[] =
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"extra-file", 'e',
"Deprecated. Synonym for --defaults-extra-file.",
- &my_defaults_extra_file,
- &my_defaults_extra_file, 0, GET_STR,
+ (void *)&my_defaults_extra_file,
+ (void *)&my_defaults_extra_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"no-defaults", 'n', "Return an empty string (useful for scripts).",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
diff --git a/sql-common/client.c b/sql-common/client.c
index f6084d061b8..349d844ebd3 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -2969,10 +2969,6 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
const char *scramble_plugin;
ulong pkt_length;
NET *net= &mysql->net;
-#ifdef MYSQL_SERVER
- thr_alarm_t alarmed;
- ALARM alarm_buff;
-#endif
#ifdef __WIN__
HANDLE hPipe=INVALID_HANDLE_VALUE;
#endif
@@ -3181,17 +3177,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
my_snprintf(host_info=buff, sizeof(buff)-1, ER(CR_TCP_CONNECTION), host);
DBUG_PRINT("info",("Server name: '%s'. TCP sock: %d", host, port));
-#ifdef MYSQL_SERVER
- thr_alarm_init(&alarmed);
- thr_alarm(&alarmed, mysql->options.connect_timeout, &alarm_buff);
-#endif
-
DBUG_PRINT("info",("IP '%s'", "client"));
-#ifdef MYSQL_SERVER
- thr_end_alarm(&alarmed);
-#endif
-
memset(&hints, 0, sizeof(hints));
hints.ai_socktype= SOCK_STREAM;
hints.ai_protocol= IPPROTO_TCP;
diff --git a/sql/item_func.h b/sql/item_func.h
index f5c43360ee8..3b1a38cf447 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -150,7 +150,7 @@ public:
void count_only_length();
void count_real_length();
void count_decimal_length();
- inline bool get_arg0_date(MYSQL_TIME *ltime, uint fuzzy_date)
+ inline bool get_arg0_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
{
return (null_value=args[0]->get_date(ltime, fuzzy_date));
}
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index d6db9a4e230..5828cfbe873 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -2220,8 +2220,8 @@ static void network_init(void)
{
#ifdef HAVE_SYS_UN_H
struct sockaddr_un UNIXaddr;
-#endif
int arg;
+#endif
DBUG_ENTER("network_init");
if (MYSQL_CALLBACK_ELSE(thread_scheduler, init, (), 0))
diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc
index 3e194805dbc..37f28844a7c 100644
--- a/sql/signal_handler.cc
+++ b/sql/signal_handler.cc
@@ -167,7 +167,7 @@ extern "C" sig_handler handle_fatal_signal(int sig)
"where mysqld died. If you see no messages after this, something went\n"
"terribly wrong...\n");
my_print_stacktrace(thd ? (uchar*) thd->thread_stack : NULL,
- my_thread_stack_size);
+ (ulong)my_thread_stack_size);
}
if (thd)
{
diff --git a/sql/slave.cc b/sql/slave.cc
index 9f593b3075e..941a275cd84 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -4155,8 +4155,8 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
{
int error= 0;
String error_msg;
- ulong inc_pos;
- ulong event_pos;
+ ulonglong inc_pos;
+ ulonglong event_pos;
Relay_log_info *rli= &mi->rli;
mysql_mutex_t *log_lock= rli->relay_log.get_log_lock();
ulong s_id;
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index 46f27f184fa..25ab84fe4db 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -618,8 +618,8 @@ Open streams: %10lu\n",
(ulong) my_file_opened,
(ulong) my_stream_opened);
- ALARM_INFO alarm_info;
#ifndef DONT_USE_THR_ALARM
+ ALARM_INFO alarm_info;
thr_alarm_info(&alarm_info);
printf("\nAlarm status:\n\
Active alarms: %u\n\
diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt
index 04b5fd8d19d..e4455630bc8 100644
--- a/storage/innobase/CMakeLists.txt
+++ b/storage/innobase/CMakeLists.txt
@@ -214,6 +214,15 @@ IF (MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)
PROPERTIES COMPILE_FLAGS -Od)
ENDIF()
+IF(MSVC)
+ # Avoid "unreferenced label" warning in generated file
+ GET_FILENAME_COMPONENT(_SRC_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
+ SET_SOURCE_FILES_PROPERTIES(${_SRC_DIR}/pars/pars0grm.c
+ PROPERTIES COMPILE_FLAGS "/wd4102")
+ SET_SOURCE_FILES_PROPERTIES(${_SRC_DIR}/pars/lexyy.c
+ PROPERTIES COMPILE_FLAGS "/wd4003")
+ENDIF()
+
SET(INNOBASE_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
buf/buf0buddy.c buf/buf0buf.c buf/buf0flu.c buf/buf0lru.c buf/buf0rea.c
data/data0data.c data/data0type.c
diff --git a/storage/maria/unittest/ma_control_file-t.c b/storage/maria/unittest/ma_control_file-t.c
index 8533e461361..b4e757788c2 100644
--- a/storage/maria/unittest/ma_control_file-t.c
+++ b/storage/maria/unittest/ma_control_file-t.c
@@ -23,7 +23,9 @@
#include <my_global.h>
#include <my_sys.h>
#include <tap.h>
-
+#ifdef _WIN32
+#include <direct.h> /* rmdir */
+#endif
#ifndef WITH_ARIA_STORAGE_ENGINE
/*
If Aria is not compiled in, normally we don't come to building this test.
diff --git a/storage/maria/unittest/ma_test_loghandler_multithread-t.c b/storage/maria/unittest/ma_test_loghandler_multithread-t.c
index 5933059263a..18fbaeace5a 100644
--- a/storage/maria/unittest/ma_test_loghandler_multithread-t.c
+++ b/storage/maria/unittest/ma_test_loghandler_multithread-t.c
@@ -289,7 +289,7 @@ int main(int argc __attribute__((unused)),
fprintf(stderr, "End of memory\n");
exit(1);
}
- for (i= 0; i < (LONG_BUFFER_SIZE + 7 * 2 + 2); i++)
+ for (i= 0; i < (uint32)(LONG_BUFFER_SIZE + 7 * 2 + 2); i++)
long_buffer[i]= (i & 0xFF);
#ifndef DBUG_OFF
diff --git a/storage/perfschema/pfs_instr_class.cc b/storage/perfschema/pfs_instr_class.cc
index d99ca4d513c..8bad6e99b3a 100644
--- a/storage/perfschema/pfs_instr_class.cc
+++ b/storage/perfschema/pfs_instr_class.cc
@@ -823,16 +823,14 @@ const char *sanitize_table_schema_name(const char *unsafe)
intptr first= (intptr) &table_share_array[0];
intptr last= (intptr) &table_share_array[table_share_max];
- PFS_table_share dummy;
/* Check if unsafe points inside table_share_array[] */
if (likely((first <= ptr) && (ptr < last)))
{
intptr offset= (ptr - first) % sizeof(PFS_table_share);
intptr from= my_offsetof(PFS_table_share, m_key.m_hash_key);
- intptr len= sizeof(dummy.m_key.m_hash_key);
/* Check if unsafe points inside PFS_table_share::m_key::m_hash_key */
- if (likely((from <= offset) && (offset < from + len)))
+ if (likely((from <= offset) && (offset < from + PFS_TABLESHARE_HASHKEY_SIZE)))
{
PFS_table_share *base= (PFS_table_share*) (ptr - offset);
/* Check if unsafe really is the schema name */
@@ -849,16 +847,14 @@ const char *sanitize_table_object_name(const char *unsafe)
intptr first= (intptr) &table_share_array[0];
intptr last= (intptr) &table_share_array[table_share_max];
- PFS_table_share dummy;
/* Check if unsafe points inside table_share_array[] */
if (likely((first <= ptr) && (ptr < last)))
{
intptr offset= (ptr - first) % sizeof(PFS_table_share);
intptr from= my_offsetof(PFS_table_share, m_key.m_hash_key);
- intptr len= sizeof(dummy.m_key.m_hash_key);
/* Check if unsafe points inside PFS_table_share::m_key::m_hash_key */
- if (likely((from <= offset) && (offset < from + len)))
+ if (likely((from <= offset) && (offset < from + PFS_TABLESHARE_HASHKEY_SIZE)))
{
PFS_table_share *base= (PFS_table_share*) (ptr - offset);
/* Check if unsafe really is the table name */
diff --git a/storage/perfschema/pfs_instr_class.h b/storage/perfschema/pfs_instr_class.h
index 107db628226..b84691ccde5 100644
--- a/storage/perfschema/pfs_instr_class.h
+++ b/storage/perfschema/pfs_instr_class.h
@@ -128,6 +128,8 @@ struct PFS_thread_class
bool m_enabled;
};
+#define PFS_TABLESHARE_HASHKEY_SIZE (NAME_LEN + 1 + NAME_LEN + 1)
+
/** Key identifying a table share. */
struct PFS_table_share_key
{
@@ -137,7 +139,7 @@ struct PFS_table_share_key
the format is "<schema_name><0x00><object_name><0x00>"
@see create_table_def_key
*/
- char m_hash_key[NAME_LEN + 1 + NAME_LEN + 1];
+ char m_hash_key[PFS_TABLESHARE_HASHKEY_SIZE];
/** Length in bytes of @c m_hash_key. */
uint m_key_length;
};
diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc
index 4d6b729196c..27a463bf61f 100644
--- a/storage/sphinx/ha_sphinx.cc
+++ b/storage/sphinx/ha_sphinx.cc
@@ -50,7 +50,6 @@
#else
// Windows-specific
#include <io.h>
- #define strcasecmp stricmp
#define snprintf _snprintf
#define RECV_FLAGS 0