~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/ibuf/ibuf0ibuf.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:
516
516
        page_t*         header_page;
517
517
        ulint           error;
518
518
 
519
 
        ibuf = static_cast<ibuf_t *>(mem_alloc(sizeof(ibuf_t)));
 
519
        ibuf = mem_alloc(sizeof(ibuf_t));
520
520
 
521
521
        memset(ibuf, 0, sizeof(*ibuf));
522
522
 
643
643
ibuf_parse_bitmap_init(
644
644
/*===================*/
645
645
        byte*           ptr,    /*!< in: buffer */
646
 
        byte*           /*end_ptr __attribute__((unused))*/, /*!< in: buffer end */
 
646
        byte*           end_ptr __attribute__((unused)), /*!< in: buffer end */
647
647
        buf_block_t*    block,  /*!< in: block or NULL */
648
648
        mtr_t*          mtr)    /*!< in: mtr or NULL */
649
649
{
669
669
                                0 for uncompressed pages */
670
670
        ulint           bit,    /*!< in: IBUF_BITMAP_FREE,
671
671
                                IBUF_BITMAP_BUFFERED, ... */
672
 
        mtr_t*          /*mtr __attribute__((unused))*/)
 
672
        mtr_t*          mtr __attribute__((unused)))
673
673
                                /*!< in: mtr containing an
674
674
                                x-latch to the bitmap page */
675
675
{
1794
1794
 
1795
1795
        field = dtuple_get_nth_field(tuple, 0);
1796
1796
 
1797
 
        buf = static_cast<byte *>(mem_heap_alloc(heap, 4));
 
1797
        buf = mem_heap_alloc(heap, 4);
1798
1798
 
1799
1799
        mach_write_to_4(buf, space);
1800
1800
 
1804
1804
 
1805
1805
        field = dtuple_get_nth_field(tuple, 1);
1806
1806
 
1807
 
        buf = static_cast<byte *>(mem_heap_alloc(heap, 1));
 
1807
        buf = mem_heap_alloc(heap, 1);
1808
1808
 
1809
1809
        /* We set the marker byte zero */
1810
1810
 
1816
1816
 
1817
1817
        field = dtuple_get_nth_field(tuple, 2);
1818
1818
 
1819
 
        buf = static_cast<byte *>(mem_heap_alloc(heap, 4));
 
1819
        buf = mem_heap_alloc(heap, 4);
1820
1820
 
1821
1821
        mach_write_to_4(buf, page_no);
1822
1822
 
1831
1831
                i = IBUF_REC_INFO_SIZE;
1832
1832
        }
1833
1833
 
1834
 
        ti = type_info = static_cast<byte *>(mem_heap_alloc(heap, i + n_fields
1835
 
                                        * DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE));
 
1834
        ti = type_info = mem_heap_alloc(heap, i + n_fields
 
1835
                                        * DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE);
1836
1836
 
1837
1837
        switch (i) {
1838
1838
        default:
1935
1935
 
1936
1936
        field = dtuple_get_nth_field(tuple, 0);
1937
1937
 
1938
 
        buf = static_cast<byte *>(mem_heap_alloc(heap, 4));
 
1938
        buf = mem_heap_alloc(heap, 4);
1939
1939
 
1940
1940
        mach_write_to_4(buf, page_no);
1941
1941
 
1970
1970
 
1971
1971
        field = dtuple_get_nth_field(tuple, 0);
1972
1972
 
1973
 
        buf = static_cast<byte *>(mem_heap_alloc(heap, 4));
 
1973
        buf = mem_heap_alloc(heap, 4);
1974
1974
 
1975
1975
        mach_write_to_4(buf, space);
1976
1976
 
1980
1980
 
1981
1981
        field = dtuple_get_nth_field(tuple, 1);
1982
1982
 
1983
 
        buf = static_cast<byte *>(mem_heap_alloc(heap, 1));
 
1983
        buf = mem_heap_alloc(heap, 1);
1984
1984
 
1985
1985
        mach_write_to_1(buf, 0);
1986
1986
 
1990
1990
 
1991
1991
        field = dtuple_get_nth_field(tuple, 2);
1992
1992
 
1993
 
        buf = static_cast<byte *>(mem_heap_alloc(heap, 4));
 
1993
        buf = mem_heap_alloc(heap, 4);
1994
1994
 
1995
1995
        mach_write_to_4(buf, page_no);
1996
1996
 
3272
3272
 
3273
3273
        /* Patch counter value in already built entry. */
3274
3274
        field = dtuple_get_nth_field(entry, 3);
3275
 
        data = static_cast<byte *>(dfield_get_data(field));
 
3275
        data = dfield_get_data(field);
3276
3276
 
3277
3277
        mach_write_to_2(data + IBUF_REC_OFFSET_COUNTER, counter);
3278
3278
 
3526
3526
                /* If this is the root page, update ibuf->empty. */
3527
3527
                if (UNIV_UNLIKELY(buf_block_get_page_no(block)
3528
3528
                                  == FSP_IBUF_TREE_ROOT_PAGE_NO)) {
3529
 
                        const page_t*   page_root = buf_block_get_frame(block);
 
3529
                        const page_t*   root = buf_block_get_frame(block);
3530
3530
 
3531
 
                        ut_ad(page_get_space_id(page_root) == IBUF_SPACE_ID);
3532
 
                        ut_ad(page_get_page_no(page_root)
 
3531
                        ut_ad(page_get_space_id(root) == IBUF_SPACE_ID);
 
3532
                        ut_ad(page_get_page_no(root)
3533
3533
                              == FSP_IBUF_TREE_ROOT_PAGE_NO);
3534
3534
 
3535
 
                        ibuf->empty = (page_get_n_recs(page_root) == 0);
 
3535
                        ibuf->empty = (page_get_n_recs(root) == 0);
3536
3536
                }
3537
3537
        } else {
3538
3538
                ut_ad(mode == BTR_MODIFY_TREE);