Skip to content

Commit 1a51e51

Browse files
committed
CBD-6348: Fixes required to upgrade clang-analyze to clang-18.1.8
Change-Id: Id30db1722af1919b4e99d0009a55e8b8ad444066 Reviewed-on: https://review.couchbase.org/c/kv_engine/+/235185 Tested-by: Trond Norbye <[email protected]> Reviewed-by: Faizan Alam <[email protected]> Well-Formed: Restriction Checker
1 parent 9388d10 commit 1a51e51

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
lines changed

engines/default_engine/assoc.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,17 +172,16 @@ static void assoc_expand() {
172172
return;
173173
}
174174

175-
int ret = 0;
176175
cb_thread_t tid;
177176

178177
global_assoc->hashpower++;
179178
global_assoc->expanding = true;
180179
global_assoc->expand_bucket = 0;
181180

182181
/* start a thread to do the expansion */
183-
if ((ret = cb_create_named_thread(&tid, assoc_maintenance_thread,
184-
nullptr, 1, "mc:assoc_maint")) != 0)
185-
{
182+
if (cb_create_named_thread(
183+
&tid, assoc_maintenance_thread, nullptr, 1, "mc:assoc_maint") !=
184+
0) {
186185
LOG_ERROR("Can't create thread for rebalance assoc table: {}",
187186
cb_strerror());
188187
global_assoc->hashpower--;

engines/ep/src/connhandler.cc

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -340,19 +340,7 @@ void ConnHandler::addStats(const AddStatFn& add_stat, const CookieIface* c) {
340340
}
341341
}
342342
const auto priority = engine_.getDCPPriority(cookie);
343-
const char* priString = "<INVALID>";
344-
switch (priority) {
345-
case ConnectionPriority::High:
346-
priString = "high";
347-
break;
348-
case ConnectionPriority::Medium:
349-
priString = "medium";
350-
break;
351-
case ConnectionPriority::Low:
352-
priString = "low";
353-
break;
354-
}
355-
addStat("priority", priString, add_stat, c);
343+
addStat("priority", format_as(priority), add_stat, c);
356344
addStat(DcpControlKeys::FlatBuffersSystemEvents,
357345
areFlatBuffersSystemEventsEnabled(),
358346
add_stat,

engines/ep/tests/ep_testsuite_common.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ TestCaseV2::TestCaseV2(const char *_name,
6868
engine_test_t* BaseTestCase::getTest() {
6969
engine_test_t *ret = &test;
7070

71-
std::string nm(name);
71+
std::string nm(name == nullptr ? "" : name);
7272
std::stringstream ss;
7373

7474
if (cfg != nullptr) {

0 commit comments

Comments
 (0)