From 446b4eda61d180e6fcb3e7ffe0b14899b33a6261 Mon Sep 17 00:00:00 2001 From: xq9mend Date: Mon, 22 Jun 2026 07:41:46 +0000 Subject: [PATCH] fix: replace NULL with nullptr in fake_notificationconsumer constructors NULL is an integer literal (0) which is ambiguous when the member type is std::unique_ptr (introduced in sonic-swss-common PR #1212). nullptr has type std::nullptr_t and is unambiguous for both raw pointer and unique_ptr, making this change forward-compatible. Signed-off-by: xq9mend --- orchagent/p4orch/tests/fake_notificationconsumer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/orchagent/p4orch/tests/fake_notificationconsumer.cpp b/orchagent/p4orch/tests/fake_notificationconsumer.cpp index d0c88a59fec..cdd4591a2fd 100644 --- a/orchagent/p4orch/tests/fake_notificationconsumer.cpp +++ b/orchagent/p4orch/tests/fake_notificationconsumer.cpp @@ -5,7 +5,7 @@ namespace swss NotificationConsumer::NotificationConsumer(swss::DBConnector *db, const std::string &channel, int pri, size_t popBatchSize) - : Selectable(pri), POP_BATCH_SIZE(popBatchSize), m_db(db), m_subscribe(NULL), m_channel(channel), + : Selectable(pri), POP_BATCH_SIZE(popBatchSize), m_db(db), m_subscribe(nullptr), m_channel(channel), m_queue(std::make_unique()) { SWSS_LOG_ENTER(); @@ -13,7 +13,7 @@ NotificationConsumer::NotificationConsumer(swss::DBConnector *db, const std::str NotificationConsumer::NotificationConsumer(swss::DBConnector *db, const std::string &channel, int pri, size_t popBatchSize, NotificationQueuePolicy policy) - : Selectable(pri), POP_BATCH_SIZE(popBatchSize), m_db(db), m_subscribe(NULL), m_channel(channel), + : Selectable(pri), POP_BATCH_SIZE(popBatchSize), m_db(db), m_subscribe(nullptr), m_channel(channel), m_queue(policy == NotificationQueuePolicy::LruDedup ? std::unique_ptr(std::make_unique(channel)) : std::unique_ptr(std::make_unique()))