From 847d9d111ee2c7852777b3c6fda5f336dc60c931 Mon Sep 17 00:00:00 2001 From: CCG Date: Thu, 30 Jul 2026 07:04:16 -0300 Subject: [PATCH] Fix Bazel warnings --- src/agents/inference_agent/InferenceAgent.cc | 3 ++- src/agents/link_creation_agent/LinkCreationAgent.cc | 2 +- .../link_creation_agent/LinkCreationRequestProcessor.cc | 2 +- src/atomdb/redis_mongodb/RedisMongoDB.cc | 2 +- src/commons/Utils.h | 1 + src/db_adapter/AtomPersister.cc | 2 +- src/db_adapter/sql/postgres/PostgresWrapper.cc | 2 +- src/tests/cpp/profiling_test.cc | 5 ++--- 8 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/agents/inference_agent/InferenceAgent.cc b/src/agents/inference_agent/InferenceAgent.cc index ce941f28c..d9f322ad7 100644 --- a/src/agents/inference_agent/InferenceAgent.cc +++ b/src/agents/inference_agent/InferenceAgent.cc @@ -1,10 +1,11 @@ +#define LOG_LEVEL DEBUG_LEVEL #include "InferenceAgent.h" #include #include #include -#define LOG_LEVEL DEBUG_LEVEL + #include "AtomDBSingleton.h" #include "AttentionBrokerClient.h" #include "InferenceContext.h" diff --git a/src/agents/link_creation_agent/LinkCreationAgent.cc b/src/agents/link_creation_agent/LinkCreationAgent.cc index 81c1d594e..d5211335f 100644 --- a/src/agents/link_creation_agent/LinkCreationAgent.cc +++ b/src/agents/link_creation_agent/LinkCreationAgent.cc @@ -1,10 +1,10 @@ +#define LOG_LEVEL DEBUG_LEVEL #include "LinkCreationAgent.h" #include #include "LinkCreateTemplate.h" #include "LinkProcessor.h" -#define LOG_LEVEL DEBUG_LEVEL #include "Logger.h" #include "expression_hasher.h" diff --git a/src/agents/link_creation_agent/LinkCreationRequestProcessor.cc b/src/agents/link_creation_agent/LinkCreationRequestProcessor.cc index 1db329279..b27c5ed0e 100644 --- a/src/agents/link_creation_agent/LinkCreationRequestProcessor.cc +++ b/src/agents/link_creation_agent/LinkCreationRequestProcessor.cc @@ -1,7 +1,7 @@ +#define LOG_LEVEL DEBUG_LEVEL #include "LinkCreationRequestProcessor.h" #include "LinkCreationRequestProxy.h" -#define LOG_LEVEL DEBUG_LEVEL #include "Logger.h" using namespace link_creation_agent; diff --git a/src/atomdb/redis_mongodb/RedisMongoDB.cc b/src/atomdb/redis_mongodb/RedisMongoDB.cc index 8a9bc47b3..24f5d890b 100644 --- a/src/atomdb/redis_mongodb/RedisMongoDB.cc +++ b/src/atomdb/redis_mongodb/RedisMongoDB.cc @@ -955,7 +955,7 @@ vector RedisMongoDB::add_links(const vector& links, mongodb_doc.emplace(link, *this); } - if (ctx->get_pending_commands_count() >= REDIS_CHUNK_SIZE) { + if (static_cast(ctx->get_pending_commands_count()) >= REDIS_CHUNK_SIZE) { LOG_DEBUG("Flushing Redis commands batch START"); ctx->flush_commands(); LOG_DEBUG("Flushing Redis commands batch END"); diff --git a/src/commons/Utils.h b/src/commons/Utils.h index 674bbc485..76d3a8506 100644 --- a/src/commons/Utils.h +++ b/src/commons/Utils.h @@ -168,6 +168,7 @@ class Utils { { \ LOG_ERROR(string(msg) + StackTrace::to_string()); \ Utils::error(msg, true, false); \ + __builtin_unreachable(); \ } #ifdef LOG_LEVEL diff --git a/src/db_adapter/AtomPersister.cc b/src/db_adapter/AtomPersister.cc index 18c9331bd..1accfa5f4 100644 --- a/src/db_adapter/AtomPersister.cc +++ b/src/db_adapter/AtomPersister.cc @@ -189,7 +189,7 @@ void AtomPersister::send_batch(vector> atoms, timer_success.stop(); - this->total_count.fetch_add(static_cast(atoms.size())) + static_cast(atoms.size()); + this->total_count.fetch_add(static_cast(atoms.size())); this->batches_completed.fetch_add(1); diff --git a/src/db_adapter/sql/postgres/PostgresWrapper.cc b/src/db_adapter/sql/postgres/PostgresWrapper.cc index 2c9dd35ca..90a042536 100644 --- a/src/db_adapter/sql/postgres/PostgresWrapper.cc +++ b/src/db_adapter/sql/postgres/PostgresWrapper.cc @@ -495,7 +495,7 @@ SqlRow PostgresWrapper::build_sql_row(const pqxx::row& row, const Table& table, sql_row.table_name = table.name; sql_row.primary_key = ColumnValue{columns[0], row[0].c_str()}; - for (size_t i = 1; i < columns.size() && i < row.size(); i++) { + for (size_t i = 1; i < columns.size() && i < static_cast(row.size()); i++) { auto field = row[i]; if (field.is_null()) continue; diff --git a/src/tests/cpp/profiling_test.cc b/src/tests/cpp/profiling_test.cc index f2c648c53..1e28bbb1e 100644 --- a/src/tests/cpp/profiling_test.cc +++ b/src/tests/cpp/profiling_test.cc @@ -1,8 +1,7 @@ -#include "Utils.h" -#include "gtest/gtest.h" - #define LOG_LEVEL DEBUG_LEVEL #include "Logger.h" +#include "Utils.h" +#include "gtest/gtest.h" using namespace commons; using namespace std;