~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/sync/sync0arr.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:
238
238
        ut_a(n_cells > 0);
239
239
 
240
240
        /* Allocate memory for the data structures */
241
 
        arr = ut_malloc(sizeof(sync_array_t));
 
241
        arr = static_cast<sync_array_t *>(ut_malloc(sizeof(sync_array_t)));
242
242
        memset(arr, 0x0, sizeof(*arr));
243
243
 
244
244
        sz = sizeof(sync_cell_t) * n_cells;
245
 
        arr->array = ut_malloc(sz);
 
245
        arr->array = static_cast<sync_cell_t *>(ut_malloc(sz));
246
246
        memset(arr->array, 0x0, sz);
247
247
 
248
248
        arr->n_cells = n_cells;
372
372
                        cell->wait_object = object;
373
373
 
374
374
                        if (type == SYNC_MUTEX) {
375
 
                                cell->old_wait_mutex = object;
 
375
                                cell->old_wait_mutex = static_cast<mutex_struct *>(object);
376
376
                        } else {
377
 
                                cell->old_wait_rw_lock = object;
 
377
                                cell->old_wait_rw_lock = static_cast<rw_lock_struct *>(object);
378
378
                        }
379
379
 
380
380
                        cell->request_type = type;
783
783
 
784
784
        if (cell->request_type == SYNC_MUTEX) {
785
785
 
786
 
                mutex = cell->wait_object;
 
786
                mutex = static_cast<mutex_t *>(cell->wait_object);
787
787
 
788
788
                if (mutex_get_lock_word(mutex) == 0) {
789
789
 
792
792
 
793
793
        } else if (cell->request_type == RW_LOCK_EX) {
794
794
 
795
 
                lock = cell->wait_object;
 
795
                lock = static_cast<rw_lock_t *>(cell->wait_object);
796
796
 
797
797
                if (lock->lock_word > 0) {
798
798
                /* Either unlocked or only read locked. */
802
802
 
803
803
        } else if (cell->request_type == RW_LOCK_WAIT_EX) {
804
804
 
805
 
                lock = cell->wait_object;
 
805
                lock = static_cast<rw_lock_t *>(cell->wait_object);
806
806
 
807
807
                /* lock_word == 0 means all readers have left */
808
808
                if (lock->lock_word == 0) {
810
810
                        return(TRUE);
811
811
                }
812
812
        } else if (cell->request_type == RW_LOCK_SHARED) {
813
 
                lock = cell->wait_object;
 
813
                lock = static_cast<rw_lock_t *>(cell->wait_object);
814
814
 
815
815
                /* lock_word > 0 means no writer or reserved writer */
816
816
                if (lock->lock_word > 0) {