~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/os/os0file.cc

  • Committer: Lee Bieber
  • Date: 2010-12-28 17:42:52 UTC
  • mfrom: (2023.3.32 innodb-cxx)
  • Revision ID: kalebral@gmail.com-20101228174252-fy2isiqdaphf2gl3
Merge Monty, move innobase from C to C++

Show diffs side-by-side

added added

removed removed

Lines of Context:
940
940
 
941
941
        strcpy(info->name, ent->d_name);
942
942
 
943
 
        full_path = ut_malloc(strlen(dirname) + strlen(ent->d_name) + 10);
 
943
        full_path = static_cast<char* >(ut_malloc(strlen(dirname) + strlen(ent->d_name) + 10));
944
944
 
945
945
        sprintf(full_path, "%s/%s", dirname, ent->d_name);
946
946
 
1297
1297
void
1298
1298
os_file_set_nocache(
1299
1299
/*================*/
1300
 
        int             fd              /*!< in: file descriptor to alter */
1301
 
        __attribute__((unused)),
1302
 
        const char*     file_name       /*!< in: used in the diagnostic message */
1303
 
        __attribute__((unused)),
1304
 
        const char*     operation_name __attribute__((unused)))
 
1300
        int             fd,             /*!< in: file descriptor to alter */
 
1301
        const char*     file_name,      /*!< in: used in the diagnostic message */
 
1302
        const char*     operation_name)
1305
1303
                                        /*!< in: "open" or "create"; used in the
1306
1304
                                        diagnostic message */
1307
1305
{
1939
1937
        /* Write up to 1 megabyte at a time. */
1940
1938
        buf_size = ut_min(64, (ulint) (desired_size / UNIV_PAGE_SIZE))
1941
1939
                * UNIV_PAGE_SIZE;
1942
 
        buf2 = ut_malloc(buf_size + UNIV_PAGE_SIZE);
 
1940
        buf2 = static_cast<unsigned char *>(ut_malloc(buf_size + UNIV_PAGE_SIZE));
1943
1941
 
1944
1942
        /* Align the buffer for possible raw i/o */
1945
 
        buf = ut_align(buf2, UNIV_PAGE_SIZE);
 
1943
        buf = static_cast<unsigned char *>(ut_align(buf2, UNIV_PAGE_SIZE));
1946
1944
 
1947
1945
        /* Write buffer full of zeros */
1948
1946
        memset(buf, 0, buf_size);
3222
3220
        ut_a(n > 0);
3223
3221
        ut_a(n_segments > 0);
3224
3222
 
3225
 
        array = ut_malloc(sizeof(os_aio_array_t));
 
3223
        array = static_cast<os_aio_array_t *>(ut_malloc(sizeof(os_aio_array_t)));
3226
3224
 
3227
3225
        array->mutex            = os_mutex_create();
3228
3226
        array->not_full         = os_event_create(NULL);
3234
3232
        array->n_segments       = n_segments;
3235
3233
        array->n_reserved       = 0;
3236
3234
        array->cur_seg          = 0;
3237
 
        array->slots            = ut_malloc(n * sizeof(os_aio_slot_t));
 
3235
        array->slots            = static_cast<os_aio_slot_t *>(ut_malloc(n * sizeof(os_aio_slot_t)));
3238
3236
#ifdef __WIN__
3239
3237
        array->handles          = ut_malloc(n * sizeof(HANDLE));
3240
3238
#endif
3412
3410
 
3413
3411
        os_aio_validate();
3414
3412
 
3415
 
        os_aio_segment_wait_events = ut_malloc(n_segments * sizeof(void*));
 
3413
        os_aio_segment_wait_events = static_cast<os_event_t *>(ut_malloc(n_segments * sizeof(void*)));
3416
3414
 
3417
3415
        for (i = 0; i < n_segments; i++) {
3418
3416
                os_aio_segment_wait_events[i] = os_event_create(NULL);
3704
3702
        slot->name     = name;
3705
3703
        slot->len      = len;
3706
3704
        slot->type     = type;
3707
 
        slot->buf      = buf;
 
3705
        slot->buf      = static_cast<unsigned char *>(buf);
3708
3706
        slot->offset   = offset;
3709
3707
        slot->offset_high = offset_high;
3710
3708
        slot->io_already_done = FALSE;
4799
4797
                combined_buf = slot->buf;
4800
4798
                combined_buf2 = NULL;
4801
4799
        } else {
4802
 
                combined_buf2 = ut_malloc(total_len + UNIV_PAGE_SIZE);
 
4800
                combined_buf2 = static_cast<unsigned char *>(ut_malloc(total_len + UNIV_PAGE_SIZE));
4803
4801
 
4804
4802
                ut_a(combined_buf2);
4805
4803
 
4806
 
                combined_buf = ut_align(combined_buf2, UNIV_PAGE_SIZE);
 
4804
                combined_buf = static_cast<unsigned char *>(ut_align(combined_buf2, UNIV_PAGE_SIZE));
4807
4805
        }
4808
4806
 
4809
4807
        /* We release the array mutex for the time of the i/o: NOTE that