From f0961c7f17ed3a60bdd32c4c34f693dcda768e92 Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Fri, 12 May 2023 15:32:05 +0200 Subject: [PATCH] MT#57423 NULL used in arithmetic (DBRegAgent.cpp) This commit takes care of this: DBRegAgent.cpp: In member function 'bool DBRegAgent::loadRegistrations()': DBRegAgent.cpp:293:24: warning: NULL used in arithmetic [-Wpointer-arith] 293 | if (object_id == NULL || object_id == 0) { It makes no sense to compare the `object_id` of type long against the NULL. Change-Id: I60cdde2dd459dbfa9c7c942cd8f0d111096411e7 --- apps/db_reg_agent/DBRegAgent.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/db_reg_agent/DBRegAgent.cpp b/apps/db_reg_agent/DBRegAgent.cpp index 782f2e72..56423609 100644 --- a/apps/db_reg_agent/DBRegAgent.cpp +++ b/apps/db_reg_agent/DBRegAgent.cpp @@ -290,8 +290,8 @@ bool DBRegAgent::loadRegistrations() { string type = TYPE_SUBSCRIBER; long object_id = row[COLNAME_SUBSCRIBER_ID]; - if (object_id == NULL || object_id == 0) { - WARN("REGISTER: object_id is NULL or 0 for this subscriber, skipping..\n"); + if (object_id == 0) { + WARN("REGISTER: object_id is 0 for this subscriber, skipping..\n"); continue; } @@ -415,7 +415,7 @@ bool DBRegAgent::loadRegistrationsPeerings() { string type = TYPE_PEERING; long object_id = row[COLNAME_PEER_ID]; - if (object_id == NULL || object_id == 0) { + if (object_id == 0) { WARN("REGISTER: object_id is NULL or 0 for this peering, skipping..\n"); continue; }