Skip to content

Commit 8886fc6

Browse files
committed
Fix -Wswitch warnings in BurpTasks
+ constexpr/const
1 parent a5d0af8 commit 8886fc6

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/burp/BurpTasks.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace Burp
3939
{
4040

4141
// IO buffer should fit at least one blob segment, two is better.
42-
const FB_SIZE_T MIN_IO_BUFFER_SIZE = 128 * 1024;
42+
constexpr FB_SIZE_T MIN_IO_BUFFER_SIZE = 128 * 1024;
4343

4444
/// class IOBuffer
4545

@@ -826,10 +826,10 @@ void RestoreRelationTask::verbRecs(FB_UINT64& records, bool total)
826826
if (records < verb && !total)
827827
return;
828828

829-
FB_UINT64 newRecs = m_records.exchangeAdd(records) + records;
829+
const FB_UINT64 newRecs = m_records.exchangeAdd(records) + records;
830830
records = 0;
831831

832-
FB_UINT64 newVerb = (newRecs / m_masterGbl->verboseInterval) * m_masterGbl->verboseInterval;
832+
const FB_UINT64 newVerb = (newRecs / m_masterGbl->verboseInterval) * m_masterGbl->verboseInterval;
833833
if (newVerb > m_verbRecs)
834834
{
835835
m_verbRecs = newVerb;
@@ -993,7 +993,7 @@ IOBuffer* RestoreRelationTask::getCleanBuffer()
993993

994994
if (m_cleanBuffers.hasData())
995995
{
996-
const FB_SIZE_T idx = 0;
996+
constexpr FB_SIZE_T idx = 0;
997997
buf = m_cleanBuffers[idx];
998998
m_cleanBuffers.remove(idx);
999999
}
@@ -1094,7 +1094,7 @@ IOBuffer* RestoreRelationTask::getDirtyBuffer()
10941094
return NULL;
10951095
}
10961096

1097-
const FB_SIZE_T idx = 0;
1097+
constexpr FB_SIZE_T idx = 0;
10981098
buf = m_dirtyBuffers[idx];
10991099
m_dirtyBuffers.remove(idx);
11001100
}
@@ -1121,7 +1121,7 @@ RestoreRelationTask::Item::EnsureUnlockBuffer::~EnsureUnlockBuffer()
11211121

11221122
void RestoreRelationTask::ExcReadDone::stuffByException(StaticStatusVector& status) const noexcept
11231123
{
1124-
ISC_STATUS sv[] = {isc_arg_gds, isc_random, isc_arg_string,
1124+
const ISC_STATUS sv[] = {isc_arg_gds, isc_random, isc_arg_string,
11251125
(ISC_STATUS)(IPTR) "Unexpected call to RestoreRelationTask::ExcReadDone::stuffException()", isc_arg_end};
11261126

11271127
try

src/burp/BurpTasks.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,9 @@ class BurpTask : public Firebird::Task
278278
case ACT_backup_split:
279279
case ACT_backup_fini:
280280
return true;
281+
default:
282+
return false;
281283
}
282-
return false;
283284
}
284285

285286
bool isRestore() const
@@ -289,8 +290,9 @@ class BurpTask : public Firebird::Task
289290
case ACT_restore:
290291
case ACT_restore_join:
291292
return true;
293+
default:
294+
return false;
292295
}
293-
return false;
294296
}
295297

296298
protected:

0 commit comments

Comments
 (0)