From: Dmitry Y. <di...@us...> - 2002-04-29 15:05:15
|
Update of /cvsroot/firebird/firebird2/src/jrd In directory usw-pr-cvs1:/tmp/cvs-serv32731 Modified Files: blb.cpp cch.cpp pio.h tra.cpp winnt.cpp Log Message: Cleanup Index: blb.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/jrd/blb.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -U3 -r1.7 -r1.8 --- blb.cpp 4 Apr 2002 07:10:40 -0000 1.7 +++ blb.cpp 29 Apr 2002 15:05:11 -0000 1.8 @@ -2053,7 +2053,7 @@ for (i = 0; i < dbb->dbb_prefetch_pages && sequence <= blob->blb_max_sequence;) pages[i++] = - vector->vcl_long[sequence++]; + (*vector)[sequence++]; CCH_PREFETCH(tdbb, pages, i); } Index: cch.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/jrd/cch.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -U3 -r1.8 -r1.9 --- cch.cpp 29 Apr 2002 11:11:02 -0000 1.8 +++ cch.cpp 29 Apr 2002 15:05:11 -0000 1.9 @@ -1389,7 +1389,9 @@ DBB dbb; register BCB bcb_ = 0; SLONG count; - //EVENT event; +#ifdef CACHE_READER + EVENT event; +#endif SET_TDBB(tdbb); dbb = tdbb->tdbb_database; @@ -1454,7 +1456,9 @@ event = dbb->dbb_reader_event; ISC_event_init(event, 0, 0); count = ISC_event_clear(event); - if (gds_thread_start((FPTR_INT) cache_reader, dbb, THREAD_high, 0, 0)) + if (gds__thread_start + (reinterpret_cast < FPTR_INT_VOID_PTR > (cache_reader), dbb, + THREAD_high, 0, 0)) ERR_bugcheck_msg("cannot start thread"); THREAD_EXIT; @@ -1840,7 +1844,7 @@ DBB dbb; BCB bcb; SLONG page, first_page, *end; - struct plb *old_pool; + JrdMemoryPool *old_pool; SET_TDBB(tdbb); dbb = tdbb->tdbb_database; @@ -4786,7 +4790,7 @@ for (i = 0; i < prefetch->prf_max_prefetch; i++) { if (*next_bdb) { page = (*next_bdb)->bdb_buffer; - if (next_buffer != page) + if (next_buffer != reinterpret_cast<char*>(page)) MOVE_FASTER(next_buffer, (SCHAR *) page, (ULONG) dbb->dbb_page_size); if (page->pag_checksum == CCH_checksum(*next_bdb)) { @@ -4927,7 +4931,7 @@ directly to database buffers. */ if (prefetch->prf_page_count == 1 && (bdb = prefetch->prf_bdbs[0])) - prefetch->prf_io_buffer = bdb->bdb_buffer; + prefetch->prf_io_buffer = reinterpret_cast<char*>(bdb->bdb_buffer); else prefetch->prf_io_buffer = prefetch->prf_aligned_buffer; Index: pio.h =================================================================== RCS file: /cvsroot/firebird/firebird2/src/jrd/pio.h,v retrieving revision 1.2 retrieving revision 1.3 diff -U3 -r1.2 -r1.3 --- pio.h 24 Dec 2001 02:50:52 -0000 1.2 +++ pio.h 29 Apr 2002 15:05:11 -0000 1.3 @@ -141,7 +141,7 @@ int *fil_trace; /* Trace file, if any */ MUTX_T fil_mutex[1]; #ifdef SUPERSERVER_V2 - SLONG fil_io_events[MAX_FILE_IO]; /* Overlapped I/O events */ + void* fil_io_events[MAX_FILE_IO]; /* Overlapped I/O events */ #endif USHORT fil_flags; USHORT fil_length; /* Length of expanded file name */ Index: tra.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/jrd/tra.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -U3 -r1.8 -r1.9 --- tra.cpp 4 Apr 2002 07:10:40 -0000 1.8 +++ tra.cpp 29 Apr 2002 15:05:11 -0000 1.9 @@ -303,7 +303,7 @@ if (tip->tip_next) *byte |= tra_committed << shift; else - *byte | = tra_active << shift; + *byte |= tra_active << shift; } } #endif @@ -1327,7 +1327,7 @@ else { THREAD_EXIT; THREAD_ENTER; - tip = CCH_FETCH(tdbb, &window, LCK_write, pag_transactions); + tip = reinterpret_cast<TIP>(CCH_FETCH(tdbb, &window, LCK_write, pag_transactions)); if (generation == tip->tip_header.pag_generation) CCH_MARK_MUST_WRITE(tdbb, &window); CCH_RELEASE(tdbb, &window); @@ -2190,7 +2190,8 @@ journal.jrndh_nti = header->hdr_bumped_transaction; journal.jrndh_oit = dbb->dbb_oldest_transaction; journal.jrndh_oat = dbb->dbb_oldest_active; - CCH_journal_record(tdbb, window, &journal, JRNDH_SIZE, 0, 0); + CCH_journal_record(tdbb, window, + reinterpret_cast<unsigned char*>(&journal), JRNDH_SIZE, 0, 0); CCH_RELEASE(tdbb, window); } } Index: winnt.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/jrd/winnt.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -U3 -r1.8 -r1.9 --- winnt.cpp 3 Apr 2002 08:39:57 -0000 1.8 +++ winnt.cpp 29 Apr 2002 15:05:11 -0000 1.9 @@ -158,7 +158,7 @@ MaybeCloseFile(&file->fil_force_write_desc)) { #ifdef SUPERSERVER_V2 - for (i = 0; i < MAX_FILE_IO; i++) + for (int i = 0; i < MAX_FILE_IO; i++) { if (file->fil_io_events[i]) { @@ -595,10 +595,8 @@ dbb = bdb->bdb_dbb; size = dbb->dbb_page_size; - file = seek_file(file, bdb, status_vector, &overlapped, &overlapped_ptr); - if (!file) { + if (!(file = seek_file(file, bdb, status_vector, &overlapped, &overlapped_ptr))) return FALSE; - } desc = (HANDLE) ((file->fil_flags & FIL_force_write) ? file->fil_force_write_desc : file->fil_desc); @@ -641,15 +639,12 @@ return nt_error("GetOverlappedResult", file, isc_io_read_err, status_vector); } - else #else - { - if (ostype == OS_CHICAGO) { - THD_MUTEX_UNLOCK(file->fil_mutex); - } - return nt_error("ReadFile", file, isc_io_read_err, - status_vector); + if (ostype == OS_CHICAGO) { + THD_MUTEX_UNLOCK(file->fil_mutex); } + return nt_error("ReadFile", file, isc_io_read_err, + status_vector); #endif } } @@ -744,7 +739,7 @@ } else if (piob && !pages) { piob->piob_flags = PIOB_pending; - piob->piob_desc = desc; + piob->piob_desc = reinterpret_cast<long>(desc); piob->piob_file = file; piob->piob_io_length = segmented_length; } @@ -858,27 +853,28 @@ else #endif { - if (WriteFile(desc, page, size, &actual_length, overlapped_ptr) && - actual_length == size); + if (!WriteFile(desc, page, size, &actual_length, overlapped_ptr) && + actual_length == size) + { #ifdef SUPERSERVER_V2 - else if (!GetOverlappedResult( desc, + if (!GetOverlappedResult( desc, overlapped_ptr, &actual_length, TRUE) || actual_length != size) - { - release_io_event(file, overlapped_ptr); - return nt_error("GetOverlappedResult", file, isc_io_write_err, - status_vector); - } + { + release_io_event(file, overlapped_ptr); + return nt_error("GetOverlappedResult", file, isc_io_write_err, + status_vector); + } #else - else { - if (ostype == OS_CHICAGO) + if (ostype == OS_CHICAGO) { THD_MUTEX_UNLOCK(file->fil_mutex); + } return nt_error("WriteFile", file, isc_io_write_err, status_vector); - } #endif + } } #ifdef SUPERSERVER_V2 @@ -1067,6 +1063,9 @@ reinterpret_cast<SLONG>(INVALID_HANDLE_VALUE); file->fil_length = file_length; file->fil_max_page = -1; +#ifdef SUPERSERVER_V2 + memset(file->fil_io_events, 0, MAX_FILE_IO * sizeof(SLONG)); +#endif MOVE_FAST(file_name, file->fil_string, file_length); file->fil_string[file_length] = 0; THD_MUTEX_INIT(file->fil_mutex); |