Skip to content

Commit c93290a

Browse files
committed
fix: Resolve compiler warnings in result_sorter and query_cache_test
Address CI/compiler warnings with targeted fixes: - src/query/result_sorter.cpp: Replace PRIu64 macro with static_cast<unsigned long long> for uint64_t formatting to fix CI format warnings. Remove <cinttypes> include as it's no longer needed. - tests/cache/query_cache_test.cpp: Remove unused atomic variable thread1_released_lock from ABAProofLockUpgrade test to eliminate compiler warnings. Both changes resolve warning-level issues identified in CI builds without affecting functionality.
1 parent b9fe658 commit c93290a

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/query/result_sorter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ std::string ResultSorter::GetSortKey(DocId doc_id, const storage::DocumentStore&
5353
// NOLINTBEGIN(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays)
5454
char buf[kNumericBufferSize];
5555
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg,cppcoreguidelines-pro-bounds-array-to-pointer-decay)
56-
snprintf(buf, sizeof(buf), "%020llu", num);
56+
snprintf(buf, sizeof(buf), "%020llu", static_cast<unsigned long long>(num));
5757
// NOLINTEND(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays)
5858
return {buf}; // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
5959
} catch (const std::exception&) {

tests/cache/query_cache_test.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,6 @@ TEST(QueryCacheTest, ABAProofLockUpgrade) {
726726
cache.Insert(key1, result1, meta, 5.0);
727727

728728
// Create a scenario where ABA could occur
729-
std::atomic<bool> thread1_released_lock{false};
730729
std::atomic<bool> thread2_replaced_entry{false};
731730
std::atomic<int> thread1_access_count{0};
732731

0 commit comments

Comments
 (0)