~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/mem/mem0mem.cc

  • Committer: Monty Taylor
  • Date: 2010-12-26 00:22:34 UTC
  • mto: This revision was merged to the branch mainline in revision 2038.
  • Revision ID: mordred@inaugust.com-20101226002234-2sb62sm2gs0iftuy
Fixing some of the innodb c++ casting issues.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
*************************************************************************/
25
25
 
26
26
#include "mem0mem.h"
 
27
 
27
28
#ifdef UNIV_NONINL
28
29
#include "mem0mem.ic"
29
30
#endif
108
109
        mem_heap_t*     heap,   /*!< in: memory heap where string is allocated */
109
110
        const char*     str)    /*!< in: string to be copied */
110
111
{
111
 
        return(mem_heap_dup(heap, str, strlen(str) + 1));
 
112
        return(static_cast<char *>(mem_heap_dup(heap, str, strlen(str) + 1)));
112
113
}
113
114
 
114
115
/**********************************************************************//**
140
141
        ulint   s1_len = strlen(s1);
141
142
        ulint   s2_len = strlen(s2);
142
143
 
143
 
        s = mem_heap_alloc(heap, s1_len + s2_len + 1);
 
144
        s = static_cast<char *>(mem_heap_alloc(heap, s1_len + s2_len + 1));
144
145
 
145
146
        memcpy(s, s1, s1_len);
146
147
        memcpy(s + s1_len, s2, s2_len);
285
286
        va_end(ap);
286
287
 
287
288
        /* Now create it for real. */
288
 
        str = mem_heap_alloc(heap, len);
 
289
        str = static_cast<char *>(mem_heap_alloc(heap, len));
289
290
        va_start(ap, format);
290
291
        mem_heap_printf_low(str, format, ap);
291
292
        va_end(ap);
330
331
 
331
332
                ut_ad(type == MEM_HEAP_DYNAMIC || n <= MEM_MAX_ALLOC_IN_BUF);
332
333
 
333
 
                block = mem_area_alloc(&len, mem_comm_pool);
 
334
                block = static_cast<mem_block_info_t *>(mem_area_alloc(&len, mem_comm_pool));
334
335
        } else {
335
336
                len = UNIV_PAGE_SIZE;
336
337
 
339
340
                        buffer pool, but must get the free block from
340
341
                        the heap header free block field */
341
342
 
342
 
                        buf_block = heap->free_block;
 
343
                        buf_block = static_cast<buf_block_t *>(heap->free_block);
343
344
                        heap->free_block = NULL;
344
345
 
345
346
                        if (UNIV_UNLIKELY(!buf_block)) {
469
470
        ulint           type;
470
471
        ulint           len;
471
472
#ifndef UNIV_HOTBACKUP
472
 
        buf_block_t*    buf_block       = block->buf_block;
 
473
        buf_block_t*    buf_block       = static_cast<buf_block_t *>(block->buf_block);
473
474
#endif /* !UNIV_HOTBACKUP */
474
475
 
475
476
        if (block->magic_n != MEM_BLOCK_MAGIC_N) {
536
537
{
537
538
        if (UNIV_LIKELY_NULL(heap->free_block)) {
538
539
 
539
 
                buf_block_free(heap->free_block);
 
540
                buf_block_free(static_cast<buf_block_t *>(heap->free_block));
540
541
 
541
542
                heap->free_block = NULL;
542
543
        }