From 6e23e2d63290008732eb45f4e87c0f4bdeec7c9d Mon Sep 17 00:00:00 2001 From: Michael Engel Date: Fri, 9 Aug 2024 16:48:38 +0200 Subject: [PATCH] Fixed code linting issues due to updated build-base image In the new build-base image, a newer clang version with an updated set of checks is detecting issues. The issues - bugprone-multi-level-implicit-pointerconversion - cppcoreguidelines-macro-to-enum have been added to the ignore list while others have been fixed. Signed-off-by: Michael Engel --- .clang-tidy | 4 +++- src/agent/agent.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 301b31cd59..c076058c73 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -25,7 +25,9 @@ Checks: > -modernize-macro-to-enum, -llvm-else-after-return, -readability-else-after-return, - -misc-include-cleaner + -misc-include-cleaner, + -bugprone-multi-level-implicit-pointer-conversion, + -cppcoreguidelines-macro-to-enum CheckOptions: - key: readability-function-cognitive-complexity.Threshold diff --git a/src/agent/agent.c b/src/agent/agent.c index c2ad36c747..0b94a99ec4 100644 --- a/src/agent/agent.c +++ b/src/agent/agent.c @@ -1384,7 +1384,7 @@ static int agent_method_subscribe(sd_bus_message *m, void *userdata, UNUSED sd_b } agent->wildcard_subscription_active = true; - AgentUnitInfo info = { NULL, (char *) unit, true, true, -1, NULL }; + AgentUnitInfo info = { NULL, (char *) unit, true, true, _UNIT_ACTIVE_STATE_INVALID, NULL }; agent_emit_unit_new(agent, &info, "virtual"); return sd_bus_reply_method_return(m, "");