diff --git a/builds/install/misc/firebird.conf.in b/builds/install/misc/firebird.conf.in index 444fa3b10b..5f350e0f2c 100644 --- a/builds/install/misc/firebird.conf.in +++ b/builds/install/misc/firebird.conf.in @@ -276,9 +276,9 @@ # ---------------------------- # Remove protection against opening databases on NFS mounted volumes on -# Linux/Unix and SMB/CIFS volumes on Windows +# Linux/Unix and SMB/CIFS volumes on Windows. # -# This also permits creating database shadows on mounted network volumes +# This also permits creating database shadows on mounted network volumes. # # ***WARNING*** ***WARNING*** ***WARNING*** ***WARNING*** # diff --git a/builds/posix/Makefile.in.firebird b/builds/posix/Makefile.in.firebird index 269c7e5141..e4b9e7cad1 100644 --- a/builds/posix/Makefile.in.firebird +++ b/builds/posix/Makefile.in.firebird @@ -482,7 +482,6 @@ rebuild_codes : - #___________________________________________________________________________ # diff --git a/src/common/classes/Hash.h b/src/common/classes/Hash.h index ec91e30b40..6c7d0e4900 100644 --- a/src/common/classes/Hash.h +++ b/src/common/classes/Hash.h @@ -30,7 +30,8 @@ #include "../common/classes/vector.h" -namespace Firebird { +namespace Firebird +{ template class DefaultHash { @@ -41,7 +42,7 @@ namespace Firebird { size_t val; const char* data = static_cast(value); - + while (length >= sizeof(size_t)) { memcpy(&val, data, sizeof(size_t)); @@ -75,7 +76,7 @@ namespace Firebird { const static size_t DEFAULT_SIZE = 97; // largest prime number < 100 }; - template ::DEFAULT_SIZE, typename K = C, // default key typename KeyOfValue = DefaultKeyValue, // default keygen @@ -88,9 +89,9 @@ namespace Firebird { class Entry; friend class Entry; + // This class is supposed to be used as a BASE class for class to be hashed class Entry { - // This class is supposed to be used as a BASE class for class to be hashed private: Entry** previousElement; Entry* nextElement; @@ -102,7 +103,7 @@ namespace Firebird { { unLink(); } - + void link(Entry** where) { unLink(); @@ -134,7 +135,7 @@ namespace Firebird { // ... and next pointer in previous element *previousElement = nextElement; // finally mark ourselves not linked - previousElement = 0; + previousElement = NULL; } } @@ -247,7 +248,7 @@ namespace Firebird { void next() { - while(!current) + while (!current) { if (++elem >= HASHSIZE) { @@ -301,7 +302,6 @@ namespace Firebird { return !(*this == h); } }; // class iterator - }; // class Hash } // namespace Firebird diff --git a/src/jrd/dfw.epp b/src/jrd/dfw.epp index a3b324896f..1ec9c9722a 100644 --- a/src/jrd/dfw.epp +++ b/src/jrd/dfw.epp @@ -154,7 +154,7 @@ typedef Hash< DeferredWork > DfwHash; -class DeferredWork : public pool_alloc, +class DeferredWork : public pool_alloc, public DfwHash::Entry { private: @@ -177,9 +177,9 @@ public: string dfw_name; // name of object public: - DeferredWork(MemoryPool& p, DeferredWork*** end, + DeferredWork(MemoryPool& p, DeferredWork*** end, enum dfw_t t, USHORT id, SLONG sn, const string& name) - : dfw_type(t), dfw_end(end), dfw_prev(dfw_end ? *dfw_end : NULL), + : dfw_type(t), dfw_end(end), dfw_prev(dfw_end ? *dfw_end : NULL), dfw_next(dfw_prev ? *dfw_prev : NULL), dfw_lock(NULL), dfw_args(p), dfw_sav_number(sn), dfw_id(id), dfw_count(1), dfw_name(p, name) { @@ -255,7 +255,7 @@ public: // hash interface bool isEqual(const DeferredWork& work) const { - if (dfw_type == work.dfw_type && + if (dfw_type == work.dfw_type && dfw_id == work.dfw_id && dfw_name == work.dfw_name && dfw_sav_number == work.dfw_sav_number) @@ -306,11 +306,7 @@ public: // hash interface bool isEqual(const SLONG& number) const { - if (dfw_sav_number == number) - { - return true; - } - return false; + return dfw_sav_number == number; } DfwSavePoint* get() { return this; } @@ -328,7 +324,7 @@ public: DeferredWork* work; DeferredWork** end; - DeferredJob() : work(0), end(&work) { } + DeferredJob() : work(NULL), end(&work) { } }; } // namespace Jrd @@ -538,13 +534,13 @@ void DFW_delete_deferred( jrd_tra* transaction, SLONG sav_number) * **************************************/ -// If there is no deferred work, just return + // If there is no deferred work, just return if (!transaction->tra_deferred_job) { return; } -// Remove deferred work and events which are to be rolled back + // Remove deferred work and events which are to be rolled back if (sav_number == -1) { @@ -952,8 +948,8 @@ DeferredWork* DFW_post_work_arg( jrd_tra* transaction, DeferredWork* work, const if (! arg) { - arg = FB_NEW(*transaction->tra_pool) - DeferredWork(*transaction->tra_pool, 0, type, id, 0, name); + arg = FB_NEW(*transaction->tra_pool) + DeferredWork(*transaction->tra_pool, 0, type, id, 0, name); work->dfw_args.add(arg); } @@ -4137,7 +4133,7 @@ static bool find_depend_in_dfw(thread_db* tdbb, break; } -// Look to see if an object of the desired type is being deleted. + // Look to see if an object of the desired type is being deleted. for (DeferredWork* work = transaction->tra_deferred_job->work; work; work = work->getNext()) { if ((work->dfw_type == dfw_type || @@ -5696,12 +5692,11 @@ static string get_string(const dsc* desc) { /************************************** * - *g e t _ s t r i n g + * g e t _ s t r i n g * ************************************** * - * Functional description - *Get string for a given descriptor. + * Get string for a given descriptor. * **************************************/ const char* str; @@ -5713,7 +5708,7 @@ static string get_string(const dsc* desc) } // Find the actual length of the string, searching until the claimed - // end of the string, or the terminating \0, whichever comes first + // end of the string, or the terminating \0, whichever comes first. USHORT length = MOV_make_string(desc, ttype_metadata, &str, &temp, sizeof(temp)); @@ -5732,4 +5727,3 @@ static string get_string(const dsc* desc) return string(str, length); } - diff --git a/src/jrd/grant.epp b/src/jrd/grant.epp index f24ca4bd55..4261eec60c 100644 --- a/src/jrd/grant.epp +++ b/src/jrd/grant.epp @@ -172,7 +172,8 @@ void GRANT_privileges(thread_db* tdbb, const Firebird::string& name, USHORT id, transaction); } } - else { + else + { finish_security_class(acl, public_priv); save_security_class(tdbb, s_class, acl, transaction); } diff --git a/src/jrd/grant_proto.h b/src/jrd/grant_proto.h index 6b73e30be7..3609fba2bd 100644 --- a/src/jrd/grant_proto.h +++ b/src/jrd/grant_proto.h @@ -34,4 +34,3 @@ namespace Jrd void GRANT_privileges(Jrd::thread_db*, const Firebird::string&, USHORT, Jrd::jrd_tra*); #endif // JRD_GRANT_PROTO_H - diff --git a/src/jrd/nbak.cpp b/src/jrd/nbak.cpp index a46c9ac29e..b76cc5b004 100644 --- a/src/jrd/nbak.cpp +++ b/src/jrd/nbak.cpp @@ -110,6 +110,7 @@ void NBackupStateLock::blockingAstHandler(thread_db* tdbb) CCH_flush_ast(tdbb); NBAK_TRACE_AST(("database FLUSHED")); } + GlobalRWLock::blockingAstHandler(tdbb); if (wasWrite && (cachedLock->lck_physical == LCK_read)) @@ -170,9 +171,11 @@ void BackupManager::openDelta() { fb_assert(!diff_file); diff_file = PIO_open(database, diff_name, diff_name, false); - if (database->dbb_flags & (DBB_force_write | DBB_no_fs_cache)) { - PIO_force_write(diff_file, - database->dbb_flags & DBB_force_write, + + if (database->dbb_flags & (DBB_force_write | DBB_no_fs_cache)) + { + PIO_force_write(diff_file, + database->dbb_flags & DBB_force_write, database->dbb_flags & DBB_no_fs_cache); } } @@ -213,11 +216,14 @@ void BackupManager::beginBackup(thread_db* tdbb) // Create file NBAK_TRACE(("Creating difference file %s", diff_name.c_str())); diff_file = PIO_create(database, diff_name, true, false, false); - if (database->dbb_flags & (DBB_force_write | DBB_no_fs_cache)) { - PIO_force_write(diff_file, - database->dbb_flags & DBB_force_write, + + if (database->dbb_flags & (DBB_force_write | DBB_no_fs_cache)) + { + PIO_force_write(diff_file, + database->dbb_flags & DBB_force_write, database->dbb_flags & DBB_no_fs_cache); } + #ifdef UNIX // adjust difference file access rights to make it match main DB ones if (diff_file && geteuid() == 0) @@ -240,6 +246,7 @@ void BackupManager::beginBackup(thread_db* tdbb) } } #endif + // Zero out first page (empty allocation table) BufferDesc temp_bdb; temp_bdb.bdb_page = 0; diff --git a/src/jrd/pcmet_proto.h b/src/jrd/pcmet_proto.h index fef9097a53..25766073e3 100644 --- a/src/jrd/pcmet_proto.h +++ b/src/jrd/pcmet_proto.h @@ -37,4 +37,3 @@ void PCMET_expression_index(Jrd::thread_db*, const Firebird::string&, USHORT, Jr void PCMET_lookup_index(Jrd::thread_db*, Jrd::jrd_rel*, Jrd::index_desc*); #endif // JRD_PCMET_PROTO_H - diff --git a/src/jrd/que.h b/src/jrd/que.h index af3a80179a..7342498a60 100644 --- a/src/jrd/que.h +++ b/src/jrd/que.h @@ -38,7 +38,6 @@ struct que typedef que* QUE; - inline void QUE_INIT(que& aque) { aque.que_backward = &aque; @@ -140,4 +139,3 @@ typedef srq *SRQ; #endif /* JRD_QUE_H */ - diff --git a/src/jrd/vio.cpp b/src/jrd/vio.cpp index f0eab5e690..93c69c52ac 100644 --- a/src/jrd/vio.cpp +++ b/src/jrd/vio.cpp @@ -1318,7 +1318,7 @@ void VIO_erase(thread_db* tdbb, record_param* rpb, jrd_tra* transaction) MET_lookup_partner(tdbb, r2, &idx, index_name) && (partner = MET_lookup_relation_id(tdbb, idx.idx_primary_relation, false)) ) { - DFW_post_work_arg(transaction, work, 0, partner->rel_id, + DFW_post_work_arg(transaction, work, 0, partner->rel_id, dfw_arg_partner_rel_id); } else diff --git a/src/lock/lock.cpp b/src/lock/lock.cpp index c93956c46b..c2dfd19a2d 100644 --- a/src/lock/lock.cpp +++ b/src/lock/lock.cpp @@ -1142,7 +1142,7 @@ void LockManager::acquire_shmem(SRQ_PTR owner_offset) bug(NULL, "map of lock file extent failed"); } } -#else //USE_SHMEM_EXT +#else //USE_SHMEM_EXT if (m_header->lhb_length > m_shmem.sh_mem_length_mapped #ifdef LOCK_DEBUG_REMAP @@ -1248,7 +1248,7 @@ UCHAR* LockManager::alloc(USHORT size, ISC_STATUS* status_vector) if (m_header->lhb_used + size > m_header->lhb_length) { #ifdef USE_SHMEM_EXT - // round up so next object starts at beginngin of next extent + // round up so next object starts at beginning of next extent block = m_header->lhb_used = m_header->lhb_length; if (newExtent()) { diff --git a/src/lock/print.cpp b/src/lock/print.cpp index 2c55efbb63..3f141b3163 100644 --- a/src/lock/print.cpp +++ b/src/lock/print.cpp @@ -499,7 +499,7 @@ int CLIB_ROUTINE main( int argc, char *argv[]) FPRINTF(outfile, "Insufficient memory for lock statistics.\n"); exit(FINI_OK); } - + memcpy((UCHAR*) buffer, LOCK_header, extentSize); for (ULONG extent = 1; extent < extentsCount; ++extent) @@ -610,7 +610,7 @@ int CLIB_ROUTINE main( int argc, char *argv[]) FPRINTF(outfile, "Insufficient memory for lock statistics.\n"); exit(FINI_OK); } - + memcpy(newBuf, LOCK_header, extentSize); buffer = newBuf; @@ -618,18 +618,18 @@ int CLIB_ROUTINE main( int argc, char *argv[]) { Firebird::PathName extName; extName.printf("%s.ext%d", filename.c_str(), extent); - + const int fd = open(extName.c_str(), O_RDONLY | O_BINARY); if (fd == -1) { - FPRINTF(outfile, "Unable to open lock file extent number %d, file %s.\n", + FPRINTF(outfile, "Unable to open lock file extent number %d, file %s.\n", extent, extName.c_str()); exit(FINI_OK); } if (read(fd, ((UCHAR*) buffer) + extent * extentSize, extentSize) != extentSize) { - FPRINTF(outfile, "Could not read lock file extent number %d, file %s.\n", + FPRINTF(outfile, "Could not read lock file extent number %d, file %s.\n", extent, extName.c_str()); exit(FINI_OK); } diff --git a/src/lock/reset.cpp b/src/lock/reset.cpp index ef7554f0dd..6f7ba75b8f 100644 --- a/src/lock/reset.cpp +++ b/src/lock/reset.cpp @@ -39,4 +39,3 @@ int main( int argc, char **argv) return; return semctl(semid, 0, IPC_RMID, 0); } -