Commit ed18169c authored by marko's avatar marko

Merge changes from MySQL AB:

ChangeSet@1.2452, 2007-02-23 13:13:55+02:00, monty@mysql.com +177 -0
  Fixed compiler warnings
  ...
  Fixed compiler warnings detected on windows64
parent 47e17218
...@@ -253,7 +253,7 @@ dict_build_table_def_step( ...@@ -253,7 +253,7 @@ dict_build_table_def_step(
error = fil_create_new_single_table_tablespace( error = fil_create_new_single_table_tablespace(
&space, path_or_name, is_path, &space, path_or_name, is_path,
FIL_IBD_FILE_INITIAL_SIZE); FIL_IBD_FILE_INITIAL_SIZE);
table->space = space; table->space = (unsigned int) space;
if (error != DB_SUCCESS) { if (error != DB_SUCCESS) {
...@@ -792,7 +792,7 @@ dict_truncate_index_tree( ...@@ -792,7 +792,7 @@ dict_truncate_index_tree(
root_page_no = btr_create(type, space, index_id, comp, mtr); root_page_no = btr_create(type, space, index_id, comp, mtr);
if (index) { if (index) {
index->page = root_page_no; index->page = (unsigned int) root_page_no;
} else { } else {
ut_print_timestamp(stderr); ut_print_timestamp(stderr);
fprintf(stderr, fprintf(stderr,
......
...@@ -1403,7 +1403,7 @@ dict_index_add_to_cache( ...@@ -1403,7 +1403,7 @@ dict_index_add_to_cache(
dict_index_get_nth_field(new_index, i)->col->ord_part = 1; dict_index_get_nth_field(new_index, i)->col->ord_part = 1;
} }
new_index->page = page_no; new_index->page = (unsigned int) page_no;
rw_lock_create(&new_index->lock, SYNC_INDEX_TREE); rw_lock_create(&new_index->lock, SYNC_INDEX_TREE);
if (!UNIV_UNLIKELY(new_index->type & DICT_UNIVERSAL)) { if (!UNIV_UNLIKELY(new_index->type & DICT_UNIVERSAL)) {
...@@ -1515,10 +1515,10 @@ dict_index_add_col( ...@@ -1515,10 +1515,10 @@ dict_index_add_col(
field = dict_index_get_nth_field(index, index->n_def - 1); field = dict_index_get_nth_field(index, index->n_def - 1);
field->col = col; field->col = col;
field->fixed_len = dict_col_get_fixed_size(col); field->fixed_len = (unsigned int) dict_col_get_fixed_size(col);
if (prefix_len && field->fixed_len > prefix_len) { if (prefix_len && field->fixed_len > prefix_len) {
field->fixed_len = prefix_len; field->fixed_len = (unsigned int) prefix_len;
} }
/* Long fixed-length fields that need external storage are treated as /* Long fixed-length fields that need external storage are treated as
...@@ -1718,7 +1718,7 @@ dict_index_build_internal_clust( ...@@ -1718,7 +1718,7 @@ dict_index_build_internal_clust(
break; break;
} }
new_index->trx_id_offset += fixed_size; new_index->trx_id_offset += (unsigned int) fixed_size;
} }
} }
...@@ -3032,7 +3032,7 @@ dict_create_foreign_constraints_low( ...@@ -3032,7 +3032,7 @@ dict_create_foreign_constraints_low(
foreign->foreign_table_name = mem_heap_strdup(foreign->heap, foreign->foreign_table_name = mem_heap_strdup(foreign->heap,
table->name); table->name);
foreign->foreign_index = index; foreign->foreign_index = index;
foreign->n_fields = i; foreign->n_fields = (unsigned int) i;
foreign->foreign_col_names = mem_heap_alloc(foreign->heap, foreign->foreign_col_names = mem_heap_alloc(foreign->heap,
i * sizeof(void*)); i * sizeof(void*));
for (i = 0; i < foreign->n_fields; i++) { for (i = 0; i < foreign->n_fields; i++) {
......
...@@ -831,7 +831,7 @@ dict_load_table( ...@@ -831,7 +831,7 @@ dict_load_table(
table = dict_mem_table_create(name, space, n_cols & ~0x80000000UL, table = dict_mem_table_create(name, space, n_cols & ~0x80000000UL,
flags); flags);
table->ibd_file_missing = ibd_file_missing; table->ibd_file_missing = (unsigned int) ibd_file_missing;
ut_a(name_of_col_is(sys_tables, sys_index, 3, "ID")); ut_a(name_of_col_is(sys_tables, sys_index, 3, "ID"));
...@@ -1160,8 +1160,8 @@ dict_load_foreign( ...@@ -1160,8 +1160,8 @@ dict_load_foreign(
/* We store the type in the bits 24..29 of n_fields_and_type. */ /* We store the type in the bits 24..29 of n_fields_and_type. */
foreign->type = n_fields_and_type >> 24; foreign->type = (unsigned int) (n_fields_and_type >> 24);
foreign->n_fields = n_fields_and_type & 0x3FFUL; foreign->n_fields = (unsigned int) (n_fields_and_type & 0x3FFUL);
foreign->id = mem_heap_strdup(foreign->heap, id); foreign->id = mem_heap_strdup(foreign->heap, id);
......
...@@ -50,14 +50,14 @@ dict_mem_table_create( ...@@ -50,14 +50,14 @@ dict_mem_table_create(
table->heap = heap; table->heap = heap;
table->flags = flags; table->flags = (unsigned int) flags;
table->name = mem_heap_strdup(heap, name); table->name = mem_heap_strdup(heap, name);
table->dir_path_of_temp_table = NULL; table->dir_path_of_temp_table = NULL;
table->space = space; table->space = (unsigned int) space;
table->ibd_file_missing = FALSE; table->ibd_file_missing = FALSE;
table->tablespace_discarded = FALSE; table->tablespace_discarded = FALSE;
table->n_def = 0; table->n_def = 0;
table->n_cols = n_cols + DATA_N_SYS_COLS; table->n_cols = (unsigned int) (n_cols + DATA_N_SYS_COLS);
table->n_mysql_handles_opened = 0; table->n_mysql_handles_opened = 0;
table->n_foreign_key_checks_running = 0; table->n_foreign_key_checks_running = 0;
...@@ -208,14 +208,14 @@ dict_mem_table_add_col( ...@@ -208,14 +208,14 @@ dict_mem_table_add_col(
col->ind = table->n_def - 1; col->ind = table->n_def - 1;
col->ord_part = 0; col->ord_part = 0;
col->mtype = mtype; col->mtype = (unsigned int) mtype;
col->prtype = prtype; col->prtype = (unsigned int) prtype;
col->len = len; col->len = (unsigned int) len;
dtype_get_mblen(mtype, prtype, &mbminlen, &mbmaxlen); dtype_get_mblen(mtype, prtype, &mbminlen, &mbmaxlen);
col->mbminlen = mbminlen; col->mbminlen = (unsigned int) mbminlen;
col->mbmaxlen = mbmaxlen; col->mbmaxlen = (unsigned int) mbmaxlen;
} }
/************************************************************************** /**************************************************************************
...@@ -245,13 +245,13 @@ dict_mem_index_create( ...@@ -245,13 +245,13 @@ dict_mem_index_create(
index->heap = heap; index->heap = heap;
index->type = type; index->type = type;
index->space = space; index->space = (unsigned int) space;
index->page = 0; index->page = 0;
index->name = mem_heap_strdup(heap, index_name); index->name = mem_heap_strdup(heap, index_name);
index->table_name = table_name; index->table_name = table_name;
index->table = NULL; index->table = NULL;
index->n_def = index->n_nullable = 0; index->n_def = index->n_nullable = 0;
index->n_fields = n_fields; index->n_fields = (unsigned int) n_fields;
index->fields = mem_heap_alloc(heap, 1 + n_fields index->fields = mem_heap_alloc(heap, 1 + n_fields
* sizeof(dict_field_t)); * sizeof(dict_field_t));
/* The '1 +' above prevents allocation /* The '1 +' above prevents allocation
...@@ -326,7 +326,7 @@ dict_mem_index_add_field( ...@@ -326,7 +326,7 @@ dict_mem_index_add_field(
field = dict_index_get_nth_field(index, index->n_def - 1); field = dict_index_get_nth_field(index, index->n_def - 1);
field->name = name; field->name = name;
field->prefix_len = prefix_len; field->prefix_len = (unsigned int) prefix_len;
} }
/************************************************************************** /**************************************************************************
......
...@@ -194,7 +194,7 @@ for_step( ...@@ -194,7 +194,7 @@ for_step(
loop_var_value = eval_node_get_int_val(node->loop_start_limit); loop_var_value = eval_node_get_int_val(node->loop_start_limit);
node->loop_end_value node->loop_end_value
= eval_node_get_int_val(node->loop_end_limit); = (int) eval_node_get_int_val(node->loop_end_limit);
} }
/* Check if we should do another loop */ /* Check if we should do another loop */
......
...@@ -794,7 +794,7 @@ innobase_convert_from_table_id( ...@@ -794,7 +794,7 @@ innobase_convert_from_table_id(
uint errors; uint errors;
strconvert(current_thd->charset(), from, strconvert(current_thd->charset(), from,
&my_charset_filename, to, len, &errors); &my_charset_filename, to, (uint) len, &errors);
} }
/********************************************************************** /**********************************************************************
...@@ -813,7 +813,7 @@ innobase_convert_from_id( ...@@ -813,7 +813,7 @@ innobase_convert_from_id(
uint errors; uint errors;
strconvert(current_thd->charset(), from, strconvert(current_thd->charset(), from,
system_charset_info, to, len, &errors); system_charset_info, to, (uint) len, &errors);
} }
/********************************************************************** /**********************************************************************
...@@ -938,8 +938,9 @@ innobase_convert_string( ...@@ -938,8 +938,9 @@ innobase_convert_string(
CHARSET_INFO* from_cs, CHARSET_INFO* from_cs,
uint* errors) uint* errors)
{ {
return(copy_and_convert((char*)to, to_length, to_cs, return(copy_and_convert((char*)to, (uint32) to_length, to_cs,
(const char*)from, from_length, from_cs, errors)); (const char*)from, (uint32) from_length, from_cs,
errors));
} }
/************************************************************************* /*************************************************************************
...@@ -1297,9 +1298,9 @@ innobase_print_identifier( ...@@ -1297,9 +1298,9 @@ innobase_print_identifier(
output strings buffers must not be shared. The function output strings buffers must not be shared. The function
only produces more output when the name contains other only produces more output when the name contains other
characters than [0-9A-Z_a-z]. */ characters than [0-9A-Z_a-z]. */
char* temp_name = my_malloc(namelen + 1, MYF(MY_WME)); char* temp_name = my_malloc((uint) namelen + 1, MYF(MY_WME));
uint qnamelen = namelen uint qnamelen = (uint) (namelen
+ (1 + sizeof srv_mysql50_table_name_prefix); + (1 + sizeof srv_mysql50_table_name_prefix));
if (temp_name) { if (temp_name) {
qname = my_malloc(qnamelen, MYF(MY_WME)); qname = my_malloc(qnamelen, MYF(MY_WME));
...@@ -2952,7 +2953,8 @@ ha_innobase::store_key_val_for_row( ...@@ -2952,7 +2953,8 @@ ha_innobase::store_key_val_for_row(
true_len = (ulint) cs->cset->well_formed_len(cs, true_len = (ulint) cs->cset->well_formed_len(cs,
(const char *) data, (const char *) data,
(const char *) data + len, (const char *) data + len,
key_len / cs->mbmaxlen, (uint) (key_len /
cs->mbmaxlen),
&error); &error);
} }
...@@ -3021,7 +3023,8 @@ ha_innobase::store_key_val_for_row( ...@@ -3021,7 +3023,8 @@ ha_innobase::store_key_val_for_row(
(const char *) blob_data, (const char *) blob_data,
(const char *) blob_data (const char *) blob_data
+ blob_len, + blob_len,
key_len / cs->mbmaxlen, (uint) (key_len /
cs->mbmaxlen),
&error); &error);
} }
...@@ -3093,7 +3096,8 @@ ha_innobase::store_key_val_for_row( ...@@ -3093,7 +3096,8 @@ ha_innobase::store_key_val_for_row(
(const char *)src_start, (const char *)src_start,
(const char *)src_start (const char *)src_start
+ key_len, + key_len,
key_len / cs->mbmaxlen, (uint) (key_len /
cs->mbmaxlen),
&error); &error);
} }
} }
......
...@@ -390,8 +390,8 @@ ut_bit_set_nth( ...@@ -390,8 +390,8 @@ ut_bit_set_nth(
# error "TRUE != 1" # error "TRUE != 1"
#endif #endif
if (val) { if (val) {
return((1 << n) | a); return(((ulint) 1 << n) | a);
} else { } else {
return(~(1 << n) & a); return(~((ulint) 1 << n) & a);
} }
} }
...@@ -170,5 +170,5 @@ ut_2_exp( ...@@ -170,5 +170,5 @@ ut_2_exp(
/* out: 2 to power n */ /* out: 2 to power n */
ulint n) /* in: number */ ulint n) /* in: number */
{ {
return(1 << n); return((ulint) 1 << n);
} }
...@@ -529,7 +529,7 @@ mlog_parse_index( ...@@ -529,7 +529,7 @@ mlog_parse_index(
ind = dict_mem_index_create("LOG_DUMMY", "LOG_DUMMY", ind = dict_mem_index_create("LOG_DUMMY", "LOG_DUMMY",
DICT_HDR_SPACE, 0, n); DICT_HDR_SPACE, 0, n);
ind->table = table; ind->table = table;
ind->n_uniq = n_uniq; ind->n_uniq = (unsigned int) n_uniq;
if (n_uniq != n) { if (n_uniq != n) {
ind->type = DICT_CLUSTERED; ind->type = DICT_CLUSTERED;
} }
......
...@@ -109,7 +109,7 @@ BOUND_ID \$[a-z_A-Z0-9]+ ...@@ -109,7 +109,7 @@ BOUND_ID \$[a-z_A-Z0-9]+
yylval = sym_tab_add_bound_lit(pars_sym_tab_global, yylval = sym_tab_add_bound_lit(pars_sym_tab_global,
yytext + 1, &type); yytext + 1, &type);
return(type); return((int) type);
} }
{BOUND_ID} { {BOUND_ID} {
......
...@@ -597,7 +597,7 @@ cmp_dtuple_rec_with_match( ...@@ -597,7 +597,7 @@ cmp_dtuple_rec_with_match(
dtuple_byte = cmp_collate(dtuple_byte); dtuple_byte = cmp_collate(dtuple_byte);
} }
ret = dtuple_byte - rec_byte; ret = (int) (dtuple_byte - rec_byte);
if (UNIV_UNLIKELY(ret)) { if (UNIV_UNLIKELY(ret)) {
if (ret < 0) { if (ret < 0) {
ret = -1; ret = -1;
......
...@@ -3421,7 +3421,7 @@ row_delete_constraint_low( ...@@ -3421,7 +3421,7 @@ row_delete_constraint_low(
pars_info_add_str_literal(info, "id", id); pars_info_add_str_literal(info, "id", id);
return(que_eval_sql(info, return((int) que_eval_sql(info,
"PROCEDURE DELETE_CONSTRAINT () IS\n" "PROCEDURE DELETE_CONSTRAINT () IS\n"
"BEGIN\n" "BEGIN\n"
"DELETE FROM SYS_FOREIGN_COLS WHERE ID = :id;\n" "DELETE FROM SYS_FOREIGN_COLS WHERE ID = :id;\n"
...@@ -3460,7 +3460,7 @@ row_delete_constraint( ...@@ -3460,7 +3460,7 @@ row_delete_constraint(
err = row_delete_constraint_low(id, trx); err = row_delete_constraint_low(id, trx);
} }
return(err); return((int) err);
} }
/************************************************************************* /*************************************************************************
......
...@@ -2116,7 +2116,7 @@ row_fetch_store_uint4( ...@@ -2116,7 +2116,7 @@ row_fetch_store_uint4(
ut_a(len == 4); ut_a(len == 4);
tmp = mach_read_from_4(dfield_get_data(dfield)); tmp = mach_read_from_4(dfield_get_data(dfield));
*val = tmp; *val = (ib_uint32_t) tmp;
return(NULL); return(NULL);
} }
......
...@@ -127,7 +127,7 @@ rw_lock_create_func( ...@@ -127,7 +127,7 @@ rw_lock_create_func(
lock->magic_n = RW_LOCK_MAGIC_N; lock->magic_n = RW_LOCK_MAGIC_N;
lock->cfile_name = cfile_name; lock->cfile_name = cfile_name;
lock->cline = cline; lock->cline = (unsigned int) cline;
lock->last_s_file_name = "not yet reserved"; lock->last_s_file_name = "not yet reserved";
lock->last_x_file_name = "not yet reserved"; lock->last_x_file_name = "not yet reserved";
...@@ -355,7 +355,7 @@ rw_lock_x_lock_low( ...@@ -355,7 +355,7 @@ rw_lock_x_lock_low(
file_name, line); file_name, line);
#endif #endif
lock->last_x_file_name = file_name; lock->last_x_file_name = file_name;
lock->last_x_line = line; lock->last_x_line = (unsigned int) line;
/* Locking succeeded, we may return */ /* Locking succeeded, we may return */
return(RW_LOCK_EX); return(RW_LOCK_EX);
...@@ -392,7 +392,7 @@ rw_lock_x_lock_low( ...@@ -392,7 +392,7 @@ rw_lock_x_lock_low(
#endif #endif
lock->last_x_file_name = file_name; lock->last_x_file_name = file_name;
lock->last_x_line = line; lock->last_x_line = (unsigned int) line;
/* Locking succeeded, we may return */ /* Locking succeeded, we may return */
return(RW_LOCK_EX); return(RW_LOCK_EX);
...@@ -414,7 +414,7 @@ rw_lock_x_lock_low( ...@@ -414,7 +414,7 @@ rw_lock_x_lock_low(
#endif #endif
lock->last_x_file_name = file_name; lock->last_x_file_name = file_name;
lock->last_x_line = line; lock->last_x_line = (unsigned int) line;
/* Locking succeeded, we may return */ /* Locking succeeded, we may return */
return(RW_LOCK_EX); return(RW_LOCK_EX);
......
...@@ -1985,7 +1985,7 @@ trx_recover_for_mysql( ...@@ -1985,7 +1985,7 @@ trx_recover_for_mysql(
(ulong) count); (ulong) count);
} }
return (count); return ((int) count);
} }
/*********************************************************************** /***********************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment