Commit 01063160 authored by marko's avatar marko

branches/zip: Add explicit type casts to *.ic, because C++ does not allow

implicit type conversion from void*.  Inlining is enabled in ha_innodb.cc
since r1587.
parent 54113d6d
......@@ -117,7 +117,7 @@ buf_page_get_state(
/* out: state */
const buf_page_t* bpage) /* in: pointer to the control block */
{
enum buf_page_state state = bpage->state;
enum buf_page_state state = (enum buf_page_state) bpage->state;
#ifdef UNIV_DEBUG
switch (state) {
......@@ -279,7 +279,7 @@ buf_page_get_flush_type(
/* out: flush type */
const buf_page_t* bpage) /* in: buffer page */
{
enum buf_flush flush_type = bpage->flush_type;
enum buf_flush flush_type = (enum buf_flush) bpage->flush_type;
#ifdef UNIV_DEBUG
switch (flush_type) {
......@@ -331,7 +331,7 @@ buf_page_get_io_fix(
/* out: io_fix state */
const buf_page_t* bpage) /* in: pointer to the control block */
{
enum buf_io_fix io_fix = bpage->io_fix;
enum buf_io_fix io_fix = (enum buf_io_fix) bpage->io_fix;
#ifdef UNIV_DEBUG
switch (io_fix) {
case BUF_IO_NONE:
......@@ -646,7 +646,8 @@ buf_ptr_get_fsp_addr(
ulint* space, /* out: space id */
fil_addr_t* addr) /* out: page offset and byte offset */
{
const page_t* page = ut_align_down((void*) ptr, UNIV_PAGE_SIZE);
const page_t* page = (const page_t*) ut_align_down((void*) ptr,
UNIV_PAGE_SIZE);
*space = mach_read_from_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
addr->page = mach_read_from_4(page + FIL_PAGE_OFFSET);
......
......@@ -76,7 +76,8 @@ ha_chain_get_first(
hash_table_t* table, /* in: hash table */
ulint fold) /* in: fold value determining the chain */
{
return(hash_get_nth_cell(table, hash_calc_hash(fold, table))->node);
return((ha_node_t*)
hash_get_nth_cell(table, hash_calc_hash(fold, table))->node);
}
/*****************************************************************
......
......@@ -321,8 +321,8 @@ log_reserve_and_write_fast(
ut_memcpy(log->buf + log->buf_free, str, len);
log_block_set_data_len(ut_align_down(log->buf + log->buf_free,
OS_FILE_LOG_BLOCK_SIZE),
log_block_set_data_len((byte*) ut_align_down(log->buf + log->buf_free,
OS_FILE_LOG_BLOCK_SIZE),
data_len);
#ifdef UNIV_LOG_DEBUG
log->old_buf_free = log->buf_free;
......
......@@ -573,7 +573,7 @@ mem_strdup(
const char* str) /* in: string to be copied */
{
ulint len = strlen(str) + 1;
return(memcpy(mem_alloc(len), str, len));
return((char*) memcpy(mem_alloc(len), str, len));
}
/**************************************************************************
......@@ -587,9 +587,9 @@ mem_strdupl(
const char* str, /* in: string to be copied */
ulint len) /* in: length of str, in bytes */
{
char* s = mem_alloc(len + 1);
char* s = (char*) mem_alloc(len + 1);
s[len] = 0;
return(memcpy(s, str, len));
return((char*) memcpy(s, str, len));
}
/**************************************************************************
......@@ -604,7 +604,7 @@ mem_heap_strdupl(
const char* str, /* in: string to be copied */
ulint len) /* in: length of str, in bytes */
{
char* s = mem_heap_alloc(heap, len + 1);
char* s = (char*) mem_heap_alloc(heap, len + 1);
s[len] = 0;
return(memcpy(s, str, len));
return((char*) memcpy(s, str, len));
}
......@@ -85,7 +85,7 @@ mlog_catenate_ulint(
#if MLOG_8BYTES != 8
# error "MLOG_8BYTES != 8"
#endif
ptr = dyn_array_push(mlog, type);
ptr = (byte*) dyn_array_push(mlog, type);
if (type == MLOG_4BYTES) {
mach_write_to_4(ptr, val);
......@@ -171,7 +171,7 @@ mlog_write_initial_log_record_fast(
ut_ad(type <= MLOG_BIGGEST_TYPE);
ut_ad(ptr && log_ptr);
page = ut_align_down(ptr, UNIV_PAGE_SIZE);
page = (const byte*) ut_align_down(ptr, UNIV_PAGE_SIZE);
space = mach_read_from_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
offset = mach_read_from_4(page + FIL_PAGE_OFFSET);
......
......@@ -56,7 +56,7 @@ mtr_memo_push(
memo = &(mtr->memo);
slot = dyn_array_push(memo, sizeof(mtr_memo_slot_t));
slot = (mtr_memo_slot_t*) dyn_array_push(memo, sizeof *slot);
slot->object = object;
slot->type = type;
......@@ -103,7 +103,7 @@ mtr_release_s_latch_at_savepoint(
ut_ad(dyn_array_get_data_size(memo) > savepoint);
slot = dyn_array_get_element(memo, savepoint);
slot = (mtr_memo_slot_t*) dyn_array_get_element(memo, savepoint);
ut_ad(slot->object == lock);
ut_ad(slot->type == MTR_MEMO_S_LOCK);
......
......@@ -231,7 +231,7 @@ page_cur_tuple_insert(
+ (4 + REC_OFFS_HEADER_SIZE
+ dtuple_get_n_fields(tuple))
* sizeof *offsets);
rec = rec_convert_dtuple_to_rec(mem_heap_alloc(heap, size),
rec = rec_convert_dtuple_to_rec((byte*) mem_heap_alloc(heap, size),
index, tuple, n_ext);
offsets = rec_get_offsets(rec, index, NULL, ULINT_UNDEFINED, &heap);
......
......@@ -142,7 +142,7 @@ que_node_list_add_last(
que_common_t* cnode;
que_common_t* cnode2;
cnode = node;
cnode = (que_common_t*) node;
cnode->brother = NULL;
......@@ -151,10 +151,10 @@ que_node_list_add_last(
return(node);
}
cnode2 = node_list;
cnode2 = (que_common_t*) node_list;
while (cnode2->brother != NULL) {
cnode2 = cnode2->brother;
cnode2 = (que_common_t*) cnode2->brother;
}
cnode2->brother = node;
......@@ -183,15 +183,15 @@ que_node_list_get_len(
/* out: length, for NULL list 0 */
que_node_t* node_list) /* in: node list, or NULL */
{
que_common_t* cnode;
ulint len;
const que_common_t* cnode;
ulint len;
cnode = node_list;
cnode = (const que_common_t*) node_list;
len = 0;
while (cnode != NULL) {
len++;
cnode = cnode->brother;
cnode = (const que_common_t*) cnode->brother;
}
return(len);
......
......@@ -46,9 +46,9 @@ cmp_dfield_dfield(
type = dfield_get_type(dfield1);
return(cmp_data_data(type->mtype, type->prtype,
dfield_get_data(dfield1),
(const byte*) dfield_get_data(dfield1),
dfield_get_len(dfield1),
dfield_get_data(dfield2),
(const byte*) dfield_get_data(dfield2),
dfield_get_len(dfield2)));
}
......
......@@ -51,7 +51,7 @@ open_step(
ut_ad(thr);
node = thr->run_node;
node = (open_node_t*) thr->run_node;
ut_ad(que_node_get_type(node) == QUE_NODE_OPEN);
sel_node = node->cursor_def;
......
......@@ -25,11 +25,12 @@ upd_create(
{
upd_t* update;
update = mem_heap_alloc(heap, sizeof(upd_t));
update = (upd_t*) mem_heap_alloc(heap, sizeof(upd_t));
update->info_bits = 0;
update->n_fields = n;
update->fields = mem_heap_alloc(heap, sizeof(upd_field_t) * n);
update->fields = (upd_field_t*)
mem_heap_alloc(heap, sizeof(upd_field_t) * n);
return(update);
}
......
......@@ -237,7 +237,7 @@ trx_undo_page_get_prev_rec(
page_t* undo_page;
ulint start;
undo_page = ut_align_down(rec, UNIV_PAGE_SIZE);
undo_page = (page_t*) ut_align_down(rec, UNIV_PAGE_SIZE);
start = trx_undo_page_get_start(undo_page, page_no, offset);
......@@ -265,7 +265,7 @@ trx_undo_page_get_next_rec(
ulint end;
ulint next;
undo_page = ut_align_down(rec, UNIV_PAGE_SIZE);
undo_page = (page_t*) ut_align_down(rec, UNIV_PAGE_SIZE);
end = trx_undo_page_get_end(undo_page, page_no, offset);
......
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