List:Commits« Previous MessageNext Message »
From:vasil.dimov Date:October 26 2010 6:20am
Subject:bzr commit into mysql-next-mr-innodb branch (vasil.dimov:3265)
View as plain text  
#At file:///usr/local/devel/bzrroot/server/mysql-next-mr-innodb/ based on revid:sunny.bains@stripped

 3265 Vasil Dimov	2010-10-26
      Fix compilation warnings on 32 bit Windows
      
      27>.\dict\dict0stats.c(969) : warning C4244: 'function' : conversion from 'ib_uint64_t' to 'ulint', possible loss of data
      27>.\dict\dict0stats.c(975) : warning C4244: 'function' : conversion from 'unsigned __int64' to 'ulint', possible loss of data
      27>.\dict\dict0stats.c(976) : warning C4244: 'function' : conversion from 'ib_uint64_t' to 'ulint', possible loss of data
      27>.\dict\dict0stats.c(1022) : warning C4244: 'function' : conversion from 'ib_uint64_t' to 'ulint', possible loss of data
      27>.\dict\dict0stats.c(1025) : warning C4244: 'function' : conversion from 'ib_uint64_t' to 'ulint', possible loss of data
      27>.\dict\dict0stats.c(1908) : warning C4244: '=' : conversion from 'ib_uint64_t' to 'ulint', possible loss of data
      27>.\dict\dict0stats.c(1911) : warning C4244: '=' : conversion from 'ib_uint64_t' to 'ulint', possible loss of data

    modified:
      storage/innobase/dict/dict0stats.c
      storage/innobase/include/ut0ut.h
=== modified file 'storage/innobase/dict/dict0stats.c'
--- a/storage/innobase/dict/dict0stats.c	revid:sunny.bains@stripped
+++ b/storage/innobase/dict/dict0stats.c	revid:vasil.dimov@stripped
@@ -966,13 +966,13 @@ dict_stats_analyze_index_for_n_prefix(
 	}
 
 	last_idx_on_level = *(ib_uint64_t*) dyn_array_get_element(boundaries,
-		(n_diff_for_this_prefix - 1) * sizeof(ib_uint64_t));
+		(ulint) ((n_diff_for_this_prefix - 1) * sizeof(ib_uint64_t)));
 
 	rec_idx = 0;
 
 	n_diff_sum_of_all_analyzed_pages = 0;
 
-	n_recs_to_dive_below = ut_min(srv_stats_persistent_sample_pages,
+	n_recs_to_dive_below = UT_MIN(srv_stats_persistent_sample_pages,
 				      n_diff_for_this_prefix);
 
 	for (i = 0; i < n_recs_to_dive_below; i++) {
@@ -1019,10 +1019,11 @@ dict_stats_analyze_index_for_n_prefix(
 		/* we do not pass (left, right) because we do not want to ask
 		ut_rnd_interval() to work with too big numbers since
 		ib_uint64_t could be bigger than ulint */
-		rnd = ut_rnd_interval(0, right - left);
+		rnd = ut_rnd_interval(0, (ulint) (right - left));
 
 		dive_below_idx = *(ib_uint64_t*) dyn_array_get_element(
-			boundaries, (left + rnd) * sizeof(ib_uint64_t));
+			boundaries, (ulint) ((left + rnd)
+					     * sizeof(ib_uint64_t)));
 
 #if 0
 		DEBUG_PRINTF("    %s(): dive below rec_idx=%llu\n",
@@ -1905,10 +1906,10 @@ dict_stats_fetch_index_stats_step(
 #define PFX	"n_diff_pfx"
 
 	if (strncasecmp("size", stat_name, stat_name_len) == 0) {
-		index->stat_index_size = stat_value;
+		index->stat_index_size = (ulint) stat_value;
 	} else if (strncasecmp("n_leaf_pages", stat_name, stat_name_len)
 		   == 0) {
-		index->stat_n_leaf_pages = stat_value;
+		index->stat_n_leaf_pages = (ulint) stat_value;
 	} else if (strncasecmp(PFX, stat_name,
 			       ut_min(strlen(PFX), stat_name_len)) == 0) {
 

=== modified file 'storage/innobase/include/ut0ut.h'
--- a/storage/innobase/include/ut0ut.h	revid:sunny.bains@stripped
+++ b/storage/innobase/include/ut0ut.h	revid:vasil.dimov@stripped
@@ -94,6 +94,10 @@ do {								\
 } while (0)
 #endif /* !UNIV_HOTBACKUP */
 
+/* beware of possible side effects like UT_MIN(x, y++); */
+#define UT_MIN(a, b)	((a) < (b) ? (a) : (b))
+#define UT_MAX(a, b)	((a) > (b) ? (a) : (b))
+
 /********************************************************//**
 Gets the high 32 bits in a ulint. That is makes a shift >> 32,
 but since there seem to be compiler bugs in both gcc and Visual C++,


Attachment: [text/bzr-bundle] bzr/vasil.dimov@oracle.com-20101026061847-2e67l5siuw44njof.bundle
Thread
bzr commit into mysql-next-mr-innodb branch (vasil.dimov:3265) vasil.dimov26 Oct