[Commits] Rev 3370: Fixed some simple warnings on Windows. in file:///H:/bzr/5.5/

Vladislav Vaintroub wlad at montyprogram.com
Fri Apr 13 20:44:50 EEST 2012


At file:///H:/bzr/5.5/

------------------------------------------------------------
revno: 3370
revision-id: wlad at montyprogram.com-20120413174422-596v99i0oliol1xf
parent: wlad at montyprogram.com-20120411234044-o1drdcpni36ncsvg
committer: Vladislav Vaintroub <wlad at montyprogram.com>
branch nick: 5.5
timestamp: Fri 2012-04-13 19:44:22 +0200
message:
  Fixed  some simple warnings on Windows.
-------------- next part --------------
=== modified file 'dbug/tests.c'
--- a/dbug/tests.c	2012-01-13 14:50:02 +0000
+++ b/dbug/tests.c	2012-04-13 17:44:22 +0000
@@ -38,10 +38,10 @@
 
 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 @@
   DBUG_SET(""); /* to not have my_end() in the traces */
   my_end(0);
   return 0;
+#endif /* DBUG_OFF */
 }

=== modified file 'extra/my_print_defaults.c'
--- a/extra/my_print_defaults.c	2012-01-13 14:50:02 +0000
+++ b/extra/my_print_defaults.c	2012-04-13 17:44:22 +0000
@@ -67,7 +67,7 @@
   {"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 @@
    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},

=== modified file 'sql-common/client.c'
--- a/sql-common/client.c	2012-02-23 14:42:21 +0000
+++ b/sql-common/client.c	2012-04-13 17:44:22 +0000
@@ -2969,10 +2969,6 @@
   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 @@
 
     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;

=== modified file 'sql/item_func.h'
--- a/sql/item_func.h	2012-01-13 14:50:02 +0000
+++ b/sql/item_func.h	2012-04-13 17:44:22 +0000
@@ -150,7 +150,7 @@
   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));
   }

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2012-04-10 06:28:13 +0000
+++ b/sql/mysqld.cc	2012-04-13 17:44:22 +0000
@@ -2220,8 +2220,8 @@
 {
 #ifdef HAVE_SYS_UN_H
   struct sockaddr_un	UNIXaddr;
+  int	arg;
 #endif
-  int	arg;
   DBUG_ENTER("network_init");
 
   if (MYSQL_CALLBACK_ELSE(thread_scheduler, init, (), 0))

=== modified file 'sql/signal_handler.cc'
--- a/sql/signal_handler.cc	2012-04-10 06:28:13 +0000
+++ b/sql/signal_handler.cc	2012-04-13 17:44:22 +0000
@@ -167,7 +167,7 @@
       "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)
   {

=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2012-04-10 06:28:13 +0000
+++ b/sql/slave.cc	2012-04-13 17:44:22 +0000
@@ -4155,8 +4155,8 @@
 {
   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;

=== modified file 'sql/sql_test.cc'
--- a/sql/sql_test.cc	2012-01-13 14:50:02 +0000
+++ b/sql/sql_test.cc	2012-04-13 17:44:22 +0000
@@ -618,8 +618,8 @@
 	 (ulong) my_file_opened,
 	 (ulong) my_stream_opened);
 
+#ifndef DONT_USE_THR_ALARM
   ALARM_INFO alarm_info;
-#ifndef DONT_USE_THR_ALARM
   thr_alarm_info(&alarm_info);
   printf("\nAlarm status:\n\
 Active alarms:   %u\n\

=== modified file 'storage/innobase/CMakeLists.txt'
--- a/storage/innobase/CMakeLists.txt	2012-02-03 10:46:40 +0000
+++ b/storage/innobase/CMakeLists.txt	2012-04-13 17:44:22 +0000
@@ -214,6 +214,15 @@
 				    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

=== modified file 'storage/maria/unittest/ma_control_file-t.c'
--- a/storage/maria/unittest/ma_control_file-t.c	2011-10-19 19:45:18 +0000
+++ b/storage/maria/unittest/ma_control_file-t.c	2012-04-13 17:44:22 +0000
@@ -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.

=== modified file 'storage/maria/unittest/ma_test_loghandler_multithread-t.c'
--- a/storage/maria/unittest/ma_test_loghandler_multithread-t.c	2012-03-13 12:29:44 +0000
+++ b/storage/maria/unittest/ma_test_loghandler_multithread-t.c	2012-04-13 17:44:22 +0000
@@ -289,7 +289,7 @@
     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

=== modified file 'storage/perfschema/pfs_instr_class.cc'
--- a/storage/perfschema/pfs_instr_class.cc	2010-11-11 11:34:46 +0000
+++ b/storage/perfschema/pfs_instr_class.cc	2012-04-13 17:44:22 +0000
@@ -823,16 +823,14 @@
   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 @@
   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 */

=== modified file 'storage/perfschema/pfs_instr_class.h'
--- a/storage/perfschema/pfs_instr_class.h	2010-11-11 11:34:46 +0000
+++ b/storage/perfschema/pfs_instr_class.h	2012-04-13 17:44:22 +0000
@@ -128,6 +128,8 @@
   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 @@
     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;
 };

=== modified file 'storage/sphinx/ha_sphinx.cc'
--- a/storage/sphinx/ha_sphinx.cc	2012-03-13 12:31:21 +0000
+++ b/storage/sphinx/ha_sphinx.cc	2012-04-13 17:44:22 +0000
@@ -50,7 +50,6 @@
 #else
 	// Windows-specific
 	#include <io.h>
-	#define strcasecmp	stricmp
 	#define snprintf	_snprintf
 
 	#define	RECV_FLAGS	0



More information about the commits mailing list