mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 20:03:02 +01:00
Reduce warnings
This commit is contained in:
parent
c31517b4c7
commit
0fe3c2611c
@ -25,3 +25,4 @@ Only ones mentioned in this document could be used, but as necessities appears,
|
||||
- [static_assert](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html)
|
||||
- [decltype](https://en.cppreference.com/w/cpp/language/decltype)
|
||||
- [std::is_convertible](https://en.cppreference.com/w/cpp/types/is_convertible)
|
||||
- [final specifier](https://en.cppreference.com/w/cpp/language/final)
|
||||
|
@ -1909,9 +1909,11 @@ static void gen_emodify( const act* action, int column)
|
||||
gen_name(s2, reference, true);
|
||||
if (field->fld_dtype == dtype_varying && field->fld_sub_type == dsc_text_type_fixed)
|
||||
{
|
||||
fprintf(gpreGlob.out_file, "memcpy (&%s, &%s, %d);", s2, s1, field->fld_length + sizeof(USHORT));
|
||||
const int length = field->fld_length + sizeof(USHORT);
|
||||
fprintf(gpreGlob.out_file, "memcpy (&%s, &%s, %d);", s2, s1, length);
|
||||
}
|
||||
else if (field->fld_dtype > dtype_cstring || (field->fld_sub_type == dsc_text_type_fixed && field->fld_length == 1))
|
||||
else if (field->fld_dtype > dtype_cstring ||
|
||||
(field->fld_sub_type == dsc_text_type_fixed && field->fld_length == 1))
|
||||
{
|
||||
fprintf(gpreGlob.out_file, "%s = %s;", s2, s1);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ namespace Jrd {
|
||||
|
||||
class Attachment;
|
||||
|
||||
class EventManager : public Firebird::GlobalStorage, public Firebird::IpcObject
|
||||
class EventManager final : public Firebird::GlobalStorage, public Firebird::IpcObject
|
||||
{
|
||||
const int PID;
|
||||
|
||||
|
@ -238,10 +238,11 @@ void ChangeLog::Segment::truncate()
|
||||
unmapHeader();
|
||||
|
||||
#ifdef WIN_NT
|
||||
chsize(m_handle, length);
|
||||
if (chsize(m_handle, length))
|
||||
#else
|
||||
ftruncate(m_handle, length);
|
||||
if (ftruncate(m_handle, length))
|
||||
#endif
|
||||
raiseError("Log file %s truncate failed (error %d)", m_filename.c_str(), ERRNO);
|
||||
|
||||
mapHeader();
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ namespace Replication
|
||||
TablePermissionMap m_tables;
|
||||
};
|
||||
|
||||
class Manager : public Firebird::GlobalStorage
|
||||
class Manager final : public Firebird::GlobalStorage
|
||||
{
|
||||
struct SyncReplica
|
||||
{
|
||||
|
@ -39,8 +39,8 @@ Replicator::Replicator(MemoryPool& pool,
|
||||
bool cleanupTransactions)
|
||||
: PermanentStorage(pool),
|
||||
m_manager(manager),
|
||||
m_guid(guid),
|
||||
m_config(manager->getConfig()),
|
||||
m_guid(guid),
|
||||
m_user(user),
|
||||
m_transactions(pool),
|
||||
m_generators(pool),
|
||||
|
@ -293,8 +293,7 @@ namespace Jrd {
|
||||
|
||||
class thread_db;
|
||||
|
||||
class LockManager : public Firebird::GlobalStorage,
|
||||
public Firebird::IpcObject
|
||||
class LockManager final : public Firebird::GlobalStorage, public Firebird::IpcObject
|
||||
{
|
||||
class LockTableGuard
|
||||
{
|
||||
|
@ -229,7 +229,8 @@ namespace
|
||||
m_data.db_sequence = db_sequence;
|
||||
|
||||
lseek(m_handle, 0, SEEK_SET);
|
||||
write(m_handle, &m_data, sizeof(Data));
|
||||
if (write(m_handle, &m_data, sizeof(Data)) != sizeof(Data))
|
||||
raiseError("Control file write failed (error: %d)", ERRNO);
|
||||
flush();
|
||||
}
|
||||
|
||||
@ -257,8 +258,10 @@ namespace
|
||||
const ULONG txn_size = m_data.txn_count * sizeof(ActiveTransaction);
|
||||
|
||||
lseek(m_handle, 0, SEEK_SET);
|
||||
write(m_handle, &m_data, sizeof(Data));
|
||||
write(m_handle, transactions.begin(), txn_size);
|
||||
if (write(m_handle, &m_data, sizeof(Data)) != sizeof(Data))
|
||||
raiseError("Control file write failed (error: %d)", ERRNO);
|
||||
if (write(m_handle, transactions.begin(), txn_size) != txn_size)
|
||||
raiseError("Control file write failed (error: %d)", ERRNO);
|
||||
flush();
|
||||
}
|
||||
}
|
||||
@ -275,8 +278,10 @@ namespace
|
||||
const ULONG txn_size = m_data.txn_count * sizeof(ActiveTransaction);
|
||||
|
||||
lseek(m_handle, 0, SEEK_SET);
|
||||
write(m_handle, &m_data, sizeof(Data));
|
||||
write(m_handle, transactions.begin(), txn_size);
|
||||
if (write(m_handle, &m_data, sizeof(Data)) != sizeof(Data))
|
||||
raiseError("Control file write failed (error: %d)", ERRNO);
|
||||
if (write(m_handle, transactions.begin(), txn_size) != txn_size)
|
||||
raiseError("Control file write failed (error: %d)", ERRNO);
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user