[devel] [PATCH 0 of 1] Review Request for amfd: si-swap timeout during multiple switchover test [#2190]

2016-11-16 Thread Long HB Nguyen
Summary: amfd: si-swap timeout during multiple switchover test [#2190]
Review request for Trac Ticket(s): #2190
Peer Reviewer(s): AMF devs
Pull request to: AMF maintainers
Affected branch(es): 5.0, 5.1, 5.2
Development branch: 5.2


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesy
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 IMM jobs are put in a queue to be performed later.
 When a si-swap on safSi=SC-2N,safApp=OpenSAF is performed,
 there may be a chance that the return code for si-swap operation
 has not been returned before OI is disconnected. In that case,
 admin operation returns timeout (SA_AIS_ERR_TIMEOUT).

changeset 7a51e509f6b2ce2e2f0f63663f2e3d75d1bf4553
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Wed, 16 Nov 2016 17:32:59 +0700

amfd: fix si-swap timeout [#2190]


Complete diffstat:
--
 osaf/services/saf/amf/amfd/imm.cc|  22 ++
 osaf/services/saf/amf/amfd/include/imm.h |   2 ++
 osaf/services/saf/amf/amfd/role.cc   |   5 +
 3 files changed, 29 insertions(+), 0 deletions(-)


Testing Commands:
-
 As the ticket.


Testing, Expected Results:
--
 si-swap successfully.


Conditions of Submission:
-
 Ack from reviewers.


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] amfd: fix si-swap timeout [#2190]

2016-11-16 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/imm.cc|  22 ++
 osaf/services/saf/amf/amfd/include/imm.h |   2 ++
 osaf/services/saf/amf/amfd/role.cc   |   5 +
 3 files changed, 29 insertions(+), 0 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/imm.cc 
b/osaf/services/saf/amf/amfd/imm.cc
--- a/osaf/services/saf/amf/amfd/imm.cc
+++ b/osaf/services/saf/amf/amfd/imm.cc
@@ -423,6 +423,28 @@ AvdJobDequeueResultT Fifo::execute(const
return ret;
 }
 
+AvdJobDequeueResultT Fifo::executeAdminResp(const AVD_CL_CB *cb)
+{
+   Job *ajob;
+   AvdJobDequeueResultT ret = JOB_EXECUTED;
+
+   TRACE_ENTER();
+
+   while ((ajob = peek()) != nullptr) {
+   if (dynamic_cast(ajob) != nullptr) {
+   ret = ajob->exec(cb);
+   } else {
+   ajob = dequeue();
+   delete ajob;
+   ret = JOB_EXECUTED;
+   }
+   }
+
+   TRACE_LEAVE2("%d", ret);
+
+   return ret;
+}
+
 //
 void Fifo::empty()
 {
diff --git a/osaf/services/saf/amf/amfd/include/imm.h 
b/osaf/services/saf/amf/amfd/include/imm.h
--- a/osaf/services/saf/amf/amfd/include/imm.h
+++ b/osaf/services/saf/amf/amfd/include/imm.h
@@ -146,6 +146,8 @@ public:
 
 static AvdJobDequeueResultT execute(const AVD_CL_CB *cb);
 
+static AvdJobDequeueResultT executeAdminResp(const AVD_CL_CB *cb);
+
 static void empty();
 
static uint32_t size();
diff --git a/osaf/services/saf/amf/amfd/role.cc 
b/osaf/services/saf/amf/amfd/role.cc
--- a/osaf/services/saf/amf/amfd/role.cc
+++ b/osaf/services/saf/amf/amfd/role.cc
@@ -766,6 +766,11 @@ void avd_mds_qsd_role_evh(AVD_CL_CB *cb,
}
 
 try_again:
+   /* Execute admin op jobs before calling saImmOiImplementerClear to avoid
+* SA_AIS_ERR_TIMEOUT
+*/
+   Fifo::executeAdminResp(cb);
+
/* Take mutex here to sync with imm reinit thread.*/
osaf_mutex_lock_ordie(_reinit_mutex);
/* Give up IMM OI implementer role */

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] amfd: create node if not exist [#2150]

2016-11-01 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/ckpt_updt.cc |  14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/ckpt_updt.cc 
b/osaf/services/saf/amf/amfd/ckpt_updt.cc
--- a/osaf/services/saf/amf/amfd/ckpt_updt.cc
+++ b/osaf/services/saf/amf/amfd/ckpt_updt.cc
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 
 static char *action_name[] = {
const_cast("invalid"),
@@ -53,10 +54,14 @@ uint32_t avd_ckpt_node(AVD_CL_CB *cb, AV
 
osafassert (action == NCS_MBCSV_ACT_UPDATE);
 
-   if (nullptr == (node = avd_node_get(ckpt_node->name))) {
-   LOG_WA("avd_node_get FAILED for '%s'", ckpt_node->name.c_str());
-   rc = NCSCC_RC_FAILURE;
-   goto done;
+   node = avd_node_get(ckpt_node->name);
+   if (node == nullptr) {
+   TRACE("'%s' does not exist, creating it", 
ckpt_node->name.c_str());
+   node = avd_node_new(ckpt_node->name);
+   node->cluster = avd_cluster;
+   node->admin_ng = nullptr;
+   rc = node_name_db->insert(node->name, node);
+   osafassert(rc == NCSCC_RC_SUCCESS);
}
/* Update all runtime attributes */ 
node->saAmfNodeAdminState = ckpt_node->saAmfNodeAdminState;
@@ -72,7 +77,6 @@ uint32_t avd_ckpt_node(AVD_CL_CB *cb, AV
if (nullptr == avd_node_find_nodeid(ckpt_node->node_info.nodeId))
avd_node_add_nodeid(node);
 
-done:
TRACE_LEAVE2("%u", rc);
return rc;
 }

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for amfd: standby amfd crash while decoding node info during cold sync period [#2150]

2016-11-01 Thread Long HB Nguyen
Summary: amfd: standby amfd crash while decoding node info during cold sync 
period [#2150]
Review request for Trac Ticket(s): #2150
Peer Reviewer(s): AMF devs
Pull request to: AMF maintainers
Affected branch(es): 5.0, 5.1, default
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesy
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 When standby cold sync occurs, there may have a 
 chance that node creation information is missed in 
 standby node. Active node sending  node information to 
 standby node (checkpointing) will lead to a standby amfd crash.
 One way to get over this situation is to create node
 when the node is null.

changeset d6581422a29e371e1a468c2b444c56c94c4d5dd1
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 01 Nov 2016 19:00:35 +0700

amfd: create node if not exist [#2150]


Complete diffstat:
--
 osaf/services/saf/amf/amfd/ckpt_updt.cc |  14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)


Testing Commands:
-
 As described in the ticket


Testing, Expected Results:
--
 <>


Conditions of Submission:
-
 <>


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for Incorrect ER messages in syslog [#1897]

2016-10-09 Thread Long HB Nguyen
Summary: Incorrect ER messages in syslog [#1897]
Review request for Trac Ticket(s): #1897
Peer Reviewer(s): AMF devs
Pull request to: AMF maintainers
Affected branch(es): 5.0, 5.1, default
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesy
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 AMFD should use LOG_NO in si_swap() function
 in sg_2n_fsm.cc for the cases that it returns
 SA_AIS_ERR_TRY_AGAIN. The si_swap() function in
 sg_nway_fsm.cc also uses LOG_NO.

changeset d9773feff51b1016eb0cfba25952cb4f1fabecad
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Mon, 10 Oct 2016 10:58:00 +0700

amfd: fix incorrect ER messages in sg_2n_fsm.cc [#1897]


Complete diffstat:
--
 osaf/services/saf/amf/amfd/sg_2n_fsm.cc |  10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)


Testing Commands:
-
 <>


Testing, Expected Results:
--
 <>


Conditions of Submission:
-
 Ack from reviewers.


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for AMF: Existing PG tracking should not be stopped for CURRENT flag [#1991]

2016-09-15 Thread Long HB Nguyen
Summary: AMF: Existing PG tracking should not be stopped for CURRENT flag 
[#1991]
Review request for Trac Ticket(s): #1991
Peer Reviewer(s): AMF devs
Pull request to: AMF maintainers
Affected branch(es): 5.1, default
Development branch: <>


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 <>

changeset e65d42f22f602430a8b6b925de45a4348cfed267
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Fri, 16 Sep 2016 09:06:25 +0700

amfa: fix saAmfProtectionGroupTrackStop [#1991]


Complete diffstat:
--
 osaf/libs/agents/saf/amfa/ava_mds.cc |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Testing Commands:
-
 <>


Testing, Expected Results:
--
 <>


Conditions of Submission:
-
 ack from reviewers.


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] amfa: fix saAmfProtectionGroupTrackStop [#1991]

2016-09-15 Thread Long HB Nguyen
 osaf/libs/agents/saf/amfa/ava_mds.cc |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/osaf/libs/agents/saf/amfa/ava_mds.cc 
b/osaf/libs/agents/saf/amfa/ava_mds.cc
--- a/osaf/libs/agents/saf/amfa/ava_mds.cc
+++ b/osaf/libs/agents/saf/amfa/ava_mds.cc
@@ -1298,9 +1298,9 @@ void ava_fill_pg_stop_msg(AVSV_NDA_AVA_M
msg->type = AVSV_AVA_API_MSG;
msg->info.api_info.type = AVSV_AMF_PG_STOP;
msg->info.api_info.dest = dst;
-   msg->info.api_info.param.ha_get.hdl = hdl;
+   msg->info.api_info.param.pg_stop.hdl = hdl;
osaf_extended_name_alloc(osaf_extended_name_borrow(_name),
-   >info.api_info.param.ha_get.csi_name);
+   >info.api_info.param.pg_stop.csi_name);
 }
 void ava_fill_error_report_msg(AVSV_NDA_AVA_MSG* msg, MDS_DEST dst,
SaAmfHandleT hdl, SaNameT comp_name, SaTimeT time,

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] amf: Unit tests fail to build [#2019]

2016-09-12 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/tests/test_ckpt_enc_dec.cc |  15 +++
 1 files changed, 7 insertions(+), 8 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/tests/test_ckpt_enc_dec.cc 
b/osaf/services/saf/amf/amfd/tests/test_ckpt_enc_dec.cc
--- a/osaf/services/saf/amf/amfd/tests/test_ckpt_enc_dec.cc
+++ b/osaf/services/saf/amf/amfd/tests/test_ckpt_enc_dec.cc
@@ -350,19 +350,18 @@ TEST_F(CkptEncDecTest, testEncDecAvdNode
 avnd.node_info.nodeAddress.value + 64,
 std::back_inserter(decoded_address),
 [](int c){return c + '0';});
-
-  ASSERT_EQ(avnd.node_info.nodeId, 1);
+  ASSERT_EQ(avnd.node_info.nodeId, static_cast(1));
   ASSERT_EQ(avnd.node_info.nodeAddress.family, SA_CLM_AF_INET6);
-  ASSERT_EQ(avnd.node_info.nodeAddress.length, 64);
+  ASSERT_EQ(avnd.node_info.nodeAddress.length, static_cast(64));
   ASSERT_EQ(decoded_address, address);
   ASSERT_EQ(avnd.node_info.member, SA_TRUE);
-  ASSERT_EQ(avnd.node_info.bootTimestamp, 0x3322118877665544);
-  ASSERT_EQ(avnd.node_info.initialViewNumber, 0x8877665544332211);
+  ASSERT_EQ(avnd.node_info.bootTimestamp, 
static_cast(0x3322118877665544));
+  ASSERT_EQ(avnd.node_info.initialViewNumber, 
static_cast(0x8877665544332211));
   ASSERT_EQ(avnd.name, name);
-  ASSERT_EQ(avnd.adest, 0x4433221188776655);
+  ASSERT_EQ(avnd.adest, static_cast(0x4433221188776655));
   ASSERT_EQ(avnd.saAmfNodeAdminState, SA_AMF_ADMIN_UNLOCKED);
   ASSERT_EQ(avnd.saAmfNodeOperState, SA_AMF_OPERATIONAL_ENABLED);
   ASSERT_EQ(avnd.node_state, AVD_AVND_STATE_NCS_INIT);
-  ASSERT_EQ(avnd.rcv_msg_id, 0xA);
-  ASSERT_EQ(avnd.snd_msg_id, 0xB);
+  ASSERT_EQ(avnd.rcv_msg_id, static_cast(0xA));
+  ASSERT_EQ(avnd.snd_msg_id, static_cast(0xB));
 }

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for amf: Build failure on 32-bit system [#2018]

2016-09-12 Thread Long HB Nguyen
Summary: amf: Build failure on 32-bit system [#2018]
Review request for Trac Ticket(s): #2018
Peer Reviewer(s): AMF devs
Pull request to: Minh
Affected branch(es): 5.1, default
Development branch: <>


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 <>

changeset 1b8be66e427e282039893d88bdb1e54d5c6bae5c
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Mon, 12 Sep 2016 13:01:35 +0700

amf: Build failure on 32-bit system [#2018]


Complete diffstat:
--
 osaf/services/saf/amf/amfnd/comp.cc |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Testing Commands:
-
 <>


Testing, Expected Results:
--
 <>


Conditions of Submission:
-
 <>


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 y  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] amf: Build failure on 32-bit system [#2018]

2016-09-12 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/comp.cc |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/comp.cc 
b/osaf/services/saf/amf/amfnd/comp.cc
--- a/osaf/services/saf/amf/amfnd/comp.cc
+++ b/osaf/services/saf/amf/amfnd/comp.cc
@@ -3013,7 +3013,7 @@ void avnd_amf_pxied_comp_clean_cbk_fill(
  * @return uint32_t
  */
 uint32_t avnd_amfa_mds_info_evh(AVND_CB *cb, AVND_EVT *evt) {
-  TRACE_ENTER2("mds_dest :%lu, MDS version:%d",
+  TRACE_ENTER2("mds_dest :%" PRIx64 ", MDS version:%d",
 evt->info.amfa_mds_info.mds_dest, evt->info.amfa_mds_info.mds_version);
   agent_mds_ver_db[evt->info.amfa_mds_info.mds_dest] =  
evt->info.amfa_mds_info.mds_version;
   TRACE_LEAVE();

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for amf: protection group track non existing csi returns SA_AIS_ERR_INIT [#1998]

2016-09-05 Thread Long HB Nguyen
Summary: amf: protection group track non existing csi returns SA_AIS_ERR_INIT 
[#1998]
Review request for Trac Ticket(s): #1998
Peer Reviewer(s): AMF devs
Pull request to: Minh
Affected branch(es): 5.1, default
Development branch: <>


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  y
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 <>

changeset fc7a36b5dd7d1ece1a10556474253555d683c9f8
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Mon, 05 Sep 2016 17:04:45 +0700

amfa: fix pg track returns SA_AIS_ERR_INIT [#1998]


Complete diffstat:
--
 osaf/libs/agents/saf/amfa/include/ava_hdl.h |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)


Testing Commands:
-
 <>


Testing, Expected Results:
--
 <>


Conditions of Submission:
-
 ack from reviewers


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] amfnd: Incorrect ER messages in syslog [#1989]

2016-08-30 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/su.cc |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/su.cc 
b/osaf/services/saf/amf/amfnd/su.cc
--- a/osaf/services/saf/amf/amfnd/su.cc
+++ b/osaf/services/saf/amf/amfnd/su.cc
@@ -417,11 +417,11 @@ uint32_t avnd_evt_avd_info_su_si_assign_
} else {
if (osaf_extended_name_length(>si_name) > 0) {
if (avnd_su_si_rec_get(cb, info_su_name, 
Amf::to_string(>si_name)) == nullptr)
-   LOG_WA("susi_assign_evh: '%s' is not assigned 
to '%s'",
+   LOG_ER("susi_assign_evh: '%s' is not assigned 
to '%s'",

osaf_extended_name_borrow(>si_name), su->name.c_str());
} else {
if (m_NCS_DBLIST_FIND_FIRST(>si_list) == nullptr) {
-   LOG_ER("susi_assign_evh: '%s' has no 
assignments", su->name.c_str());
+   LOG_WA("susi_assign_evh: '%s' has no 
assignments", su->name.c_str());
/* Some times AMFD sends redundant message for 
removal of assignments.
   If removal of assignments is already done 
for the SU then complete
   the assignment process here.

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for amfnd: Incorrect ER messages in syslog [#1989]

2016-08-30 Thread Long HB Nguyen
Summary: amfnd: Incorrect ER messages in syslog [#1989]
Review request for Trac Ticket(s): #1989
Peer Reviewer(s): AMF devs
Pull request to: Minh
Affected branch(es): 5.1, default
Development branch: <>


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 Hans fixed this issue in ticket [#1911] (changeset: 7792:55500835c0a9).
 However, it has been reverted in [#1642] (changeset: 7927:abc37dbf39ff) 
 by mistake when the code was rebased.  

changeset 21cbc7d5f83d1f2e5f3c142bc305eae781c545a1
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Wed, 31 Aug 2016 11:25:28 +0700

amfnd: Incorrect ER messages in syslog [#1989]


Complete diffstat:
--
 osaf/services/saf/amf/amfnd/su.cc |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Testing Commands:
-
 <>


Testing, Expected Results:
--
 <>


Conditions of Submission:
-
 Ack from reviewers.


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for amfnd: cppcheck warnings with severity error [#1642]

2016-08-29 Thread Long HB Nguyen
Summary: amfnd: cppcheck warnings with severity error [#1642]
Review request for Trac Ticket(s): #1642
Peer Reviewer(s): AMF devs
Pull request to: Minh
Affected branch(es): default
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 <>

changeset d9165831a1a875a3a7f1955c355f2b5925c4f00a
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Mon, 29 Aug 2016 13:20:52 +0700

amfnd: cppcheck warnings with severity error [#1642]


Complete diffstat:
--
 osaf/services/saf/amf/amfnd/cbq.cc |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)


Testing Commands:
-
 <>


Testing, Expected Results:
--
 <>


Conditions of Submission:
-
 ack from reviewers.


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] amfnd: cppcheck warnings with severity error [#1642]

2016-08-29 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/cbq.cc |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/cbq.cc 
b/osaf/services/saf/amf/amfnd/cbq.cc
--- a/osaf/services/saf/amf/amfnd/cbq.cc
+++ b/osaf/services/saf/amf/amfnd/cbq.cc
@@ -599,8 +599,7 @@ uint32_t avnd_evt_tmr_cbk_resp_evh(AVND_
}
/* treat it as comp failure (determine the recommended 
recovery) */
if (AVSV_AMF_HC == rec->cbk_info->type) {
-   AVND_COMP_HC_REC tmp_hc_rec;
-   memset(_hc_rec, '\0', sizeof(AVND_COMP_HC_REC));
+   AVND_COMP_HC_REC tmp_hc_rec = {};
tmp_hc_rec.key = rec->cbk_info->param.hc.hc_key;
tmp_hc_rec.req_hdl = rec->cbk_info->hdl;
hc_rec = m_AVND_COMPDB_REC_HC_GET(*(rec->comp), 
tmp_hc_rec);

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for amfa: fix memory leak in protection group [#1642]

2016-08-26 Thread Long HB Nguyen
Summary: amfa: fix memory leak in protection group [#1642]
Review request for Trac Ticket(s): #1642
Peer Reviewer(s): AMF devs
Pull request to: AMF maintainers
Affected branch(es): default
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  y
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 <>

changeset a6b575f3bd98fef7255d63021a7c604fe87ac85e
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Fri, 26 Aug 2016 13:31:57 +0700

amfa: fix memory leak in protection group [#1642]


Complete diffstat:
--
 osaf/libs/agents/saf/amfa/amf_agent.cc |  17 ++---
 osaf/libs/agents/saf/amfa/ava_hdl.cc   |  16 +++-
 2 files changed, 21 insertions(+), 12 deletions(-)


Testing Commands:
-
 Test with amf_demo (2SU, 2SI, 3CSI/SI, 3COMP/SU)


Testing, Expected Results:
--
 <>


Conditions of Submission:
-
 Ack from reviewers


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] amfa: fix memory leak in protection group [#1642]

2016-08-26 Thread Long HB Nguyen
 osaf/libs/agents/saf/amfa/amf_agent.cc |  17 ++---
 osaf/libs/agents/saf/amfa/ava_hdl.cc   |  16 +++-
 2 files changed, 21 insertions(+), 12 deletions(-)


diff --git a/osaf/libs/agents/saf/amfa/amf_agent.cc 
b/osaf/libs/agents/saf/amfa/amf_agent.cc
--- a/osaf/libs/agents/saf/amfa/amf_agent.cc
+++ b/osaf/libs/agents/saf/amfa/amf_agent.cc
@@ -2457,11 +2457,18 @@ SaAisErrorT AmfAgent::ProtectionGroupTra
 /* create_momory is true, so let us create the memory for the Use, 
User has to free it. */
 buf->numberOfItems = rsp_buf->numberOfItems;
 if (buf->numberOfItems != 0) {
+   /*
+* NOTE: This buf->notification is allocated by Agent, 
it's
+* added sentinel element at the end so that it helps
+* to free LongDn in 
saAmfProtectionGroupNotificationFree_4
+* Sentinel element has @.change = 0
+*/
   buf->notification =
-  
static_cast(malloc(buf->numberOfItems * 
sizeof(SaAmfProtectionGroupNotificationT_4)));
+  
static_cast(malloc((buf->numberOfItems + 
1) * sizeof(SaAmfProtectionGroupNotificationT_4)));
   if (buf->notification != NULL) {
 ava_cpy_protection_group_ntf(buf->notification, 
rsp_buf->notification,
  buf->numberOfItems, 
SA_AMF_HARS_READY_FOR_ASSIGNMENT);
+buf->notification[buf->numberOfItems].change = 
static_cast(0);
   } else {
 rc = SA_AIS_ERR_NO_MEMORY;
 buf->numberOfItems = 0;
@@ -2555,8 +2562,12 @@ SaAisErrorT AmfAgent::ProtectionGroupNot
 
   /* free memory */
   if(notification) {
-// TODO (minhchau): memleak if notification is an array
-osaf_extended_name_free(>member.compName);
+// Free LongDn until reach sentinel element
+   int i = 0;
+   while (notification[i].change != 0) {
+   osaf_extended_name_free([i].member.compName);
+   i++;
+   }
 free(notification);
   }
   else
diff --git a/osaf/libs/agents/saf/amfa/ava_hdl.cc 
b/osaf/libs/agents/saf/amfa/ava_hdl.cc
--- a/osaf/libs/agents/saf/amfa/ava_hdl.cc
+++ b/osaf/libs/agents/saf/amfa/ava_hdl.cc
@@ -680,19 +680,17 @@ uint32_t ava_hdl_cbk_rec_prc(AVSV_AMF_CB
/* copy the contents into a malloced 
buffer.. appl frees it */
buf.numberOfItems = 
pg_track->buf.numberOfItems;
buf.notification =
-   
static_cast(malloc(buf.numberOfItems * 
sizeof(SaAmfProtectionGroupNotificationT_4)));
+   
static_cast(malloc((buf.numberOfItems+1) 
* sizeof(SaAmfProtectionGroupNotificationT_4)));
if (buf.notification) {

ava_cpy_protection_group_ntf(buf.notification, pg_track->buf.notification,

pg_track->buf.numberOfItems, SA_AMF_HARS_READY_FOR_ASSIGNMENT);
-
-   /* allocate LongDn strings for 
notification if any
-* then client needs to free 
these LongDn string as well
+   /*
+* NOTE: This buf->notification 
is allocated by Agent, it's
+* added sentinel element at 
the end so that it helps
+* to free LongDn in 
saAmfProtectionGroupNotificationFree_4
+* Sentinel element has 
@.change = 0
 */
-   for (i=0 ; i < 
buf.numberOfItems; i++) {
-   
osaf_extended_name_alloc(
-   
osaf_extended_name_borrow(_track->buf.notification[i].member.compName),
-   
[i].member.compName);
-   }
+   buf.notification[buf.numberOfItems].change 
= static_cast(0);
TRACE("Invoking PGTrack 
callback for CSIName = %s", osaf_extended_name_borrow(_track->csi_name));

((SaAmfCallbacksT_4*)reg_cbk)->saAmfProtectionGroupTrackCallback(_track->csi_name,

,


[devel] [PATCH 1 of 1] amf: README file for long DN support [#1642]

2016-08-23 Thread Long HB Nguyen
 osaf/services/saf/amf/README |  72 
 1 files changed, 72 insertions(+), 0 deletions(-)


diff --git a/osaf/services/saf/amf/README b/osaf/services/saf/amf/README
new file mode 100755
--- /dev/null
+++ b/osaf/services/saf/amf/README
@@ -0,0 +1,72 @@
+#
+#  -*- OpenSAF  -*-
+#
+# (C) Copyright 2016 The OpenSAF Foundation
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
+# under the GNU Lesser General Public License Version 2.1, February 1999.
+# The complete license can be accessed from the following location:
+# http://opensource.org/licenses/lgpl-license.php
+# See the Copying file included with the OpenSAF distribution for full
+# licensing terms.
+#
+# Author(s): Ericsson AB
+#
+
+GENERAL
+---
+
+This is a description of how the AMF service supports long DNs.
+Ticket: https://sourceforge.net/p/opensaf/tickets/1642
+This enhancement is part of the general enhancement for supporting long
+DNs in OpenSAF introduced by ticket: #191. Ticket #1642 adds support for
+long DNs to AMF.
+
+CONFIGURATION
+-
+
+To enable support for long DNs/RDNs in IMM, the longDnsAllowed
+attribute must be enabled using the following command:
+
+immcfg -a longDnsAllowed=1 opensafImm=opensafImm,safApp=safImmService
+
+The IMM service will reject attempts to set the longDnsAllowed attribute
+back to 0 if the IMM database contains objects with DNs longer than 255 bytes
+or RDNs longer than 64 bytes.
+
+To enable long DN support, an application must follow these things:
+- Compile the application with the SA_EXTENDED_NAME_SOURCE preprocessor 
+macro defined.
+- Set the environment variable SA_ENABLE_EXTENDED_NAMES to 1 before 
+the first call to any SAF API.
+- Treat the SaNameT type as opaque and use the SaNameT tunnelling primitives
+saAisNameLend(), saAisNameBorrow() to manipulate SaNameT variables.
+
+IMPLEMENTATION DETAILS
+--
+
+The implementation has been adapted to the "tunnelling" solution provided
+by the OpenSAF generic patch (#191).
+Please see the document below on how to use the SaNameT tunnelling primitives:
+OpenSAF_Extensions_PR.odt
+
+This implementation also includes following enhancements:
+1) Replace internal SaNameT variables with std::string variables in amfd, 
amfnd.
+2) Replace patricia trees with std::map in amfnd.
+
+saAmfDispatch() may return SA_AIS_ERR_NAME_TOO_LONG if an application which
+does not support long DN, receives an AMF callback containing a long DN entity.
+An application should not be configured with long DN entities until long DN
+support has been added.
+
+In AMF B.01.01 spec, the application can free extended SaNameT variables in
+SaAmfProtectionGroupNotificationBufferT using the example below:
+SaAmfProtectionGroupNotificationBufferT buff;
+...
+for ( i=0; i 
+SA_MAX_UNEXTENDED_NAME_LENGTH)
+free(saAisNameBorrow(buff.notification[i].member.comp_name));
+}

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for amf: README file for long DN support [#1642]

2016-08-23 Thread Long HB Nguyen
Summary: amf: README file for long DN support [#1642]
Review request for Trac Ticket(s): #1642
Peer Reviewer(s): AMF devs
Pull request to: AMF maintainers
Affected branch(es): default
Development branch: default


Impacted area   Impact y/n

 Docsy
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 <>

changeset 4aa0bb1d8315598514beda43e00898ddf4d02467
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 23 Aug 2016 14:06:48 +0700

amf: README file for long DN support [#1642]


Added Files:

 osaf/services/saf/amf/README


Complete diffstat:
--
 osaf/services/saf/amf/README |  72 

 1 files changed, 72 insertions(+), 0 deletions(-)


Testing Commands:
-
 <>


Testing, Expected Results:
--
 <>


Conditions of Submission:
-
 Ack from reviewers


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for amfnd: remove used code in util.cc [#1642]

2016-08-19 Thread Long HB Nguyen
Summary: amfnd: remove used code in util.cc [#1642]
Review request for Trac Ticket(s): 1642
Peer Reviewer(s): AMF devs
Pull request to: AMF maintainers
Affected branch(es): default
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesy
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 <>

changeset d214fafbc0401e97dfae9ca9a7cea7311c53696a
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Fri, 19 Aug 2016 11:35:54 +0700

amfnd: remove used code in util.cc [#1642]


Complete diffstat:
--
 osaf/services/saf/amf/amfnd/util.cc |  546 

 1 files changed, 0 insertions(+), 546 deletions(-)


Testing Commands:
-
 <>


Testing, Expected Results:
--
 <>


Conditions of Submission:
-
 <>


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] amfnd: remove used code in util.cc [#1642]

2016-08-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/util.cc |  546 
 1 files changed, 0 insertions(+), 546 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/util.cc 
b/osaf/services/saf/amf/amfnd/util.cc
--- a/osaf/services/saf/amf/amfnd/util.cc
+++ b/osaf/services/saf/amf/amfnd/util.cc
@@ -249,552 +249,6 @@ const char *avnd_failed_state_file_locat
return failed_state_file_name;
 }
 
-/*
- * Function: free_d2n_su_msg_info
- *
- * Purpose:  This function frees the d2n SU message contents.
- *
- * Input: su_msg - Pointer to the SU message contents to be freed.
- *
- * Returns: None
- *
- * NOTES: none.
- *
- * 
- **/
-
-static void free_d2n_su_msg_info(AVSV_DND_MSG *su_msg)
-{
-   AVSV_SU_INFO_MSG *su_info;
-
-   while (su_msg->msg_info.d2n_reg_su.su_list != nullptr) {
-   su_info = su_msg->msg_info.d2n_reg_su.su_list;
-   su_msg->msg_info.d2n_reg_su.su_list = su_info->next;
-   delete su_info;
-   }
-}
-
-
-/*
- * Function: free_d2n_susi_msg_info
- *
- * Purpose:  This function frees the d2n SU SI message contents.
- *
- * Input: susi_msg - Pointer to the SUSI message contents to be freed.
- *
- * Returns: none
- *
- * NOTES: It also frees the array of attributes, which are sperately
- * allocated and pointed to by AVSV_SUSI_ASGN structure.
- *
- * 
- **/
-
-static void free_d2n_susi_msg_info(AVSV_DND_MSG *susi_msg)
-{
-   AVSV_SUSI_ASGN *compcsi_info;
-
-   while (susi_msg->msg_info.d2n_su_si_assign.list != nullptr) {
-   compcsi_info = susi_msg->msg_info.d2n_su_si_assign.list;
-   susi_msg->msg_info.d2n_su_si_assign.list = compcsi_info->next;
-   if (compcsi_info->attrs.list != nullptr) {
-   // AVSV_ATTR_NAME_VAL variables
-   // are malloc'ed, use free()
-   free(compcsi_info->attrs.list);
-   compcsi_info->attrs.list = nullptr;
-   }
-   delete compcsi_info;
-   }
-}
-
-/*
- * Function: free_d2n_pg_msg_info
- *
- * Purpose:  This function frees the d2n PG track response message contents.
- *
- * Input: pg_msg - Pointer to the PG message contents to be freed.
- *
- * Returns: None
- *
- * NOTES: None
- *
- * 
- **/
-
-static void free_d2n_pg_msg_info(AVSV_DND_MSG *pg_msg)
-{
-   AVSV_D2N_PG_TRACK_ACT_RSP_MSG_INFO *info = 
_msg->msg_info.d2n_pg_track_act_rsp;
-
-   if (info->mem_list.numberOfItems > 0)
-   delete [] info->mem_list.notification;
-
-   info->mem_list.notification = 0;
-   info->mem_list.numberOfItems = 0;
-}
-
-/
-  Name  : dnd_msg_free
- 
-  Description   : This routine frees the Message structures used for
-  communication between AvD and AvND. 
- 
-  Arguments : msg - ptr to the DND message that needs to be freed.
- 
-  Return Values : None
- 
-  Notes : For : AVSV_D2N_REG_SU_MSG, AVSV_D2N_INFO_SU_SI_ASSIGN_MSG
-  and AVSV_D2N_PG_TRACK_ACT_RSP_MSG, this procedure calls the
-  corresponding information free function to free the
-  list information in them before freeing the message.
-**/
-void dnd_msg_free(AVSV_DND_MSG *msg)
-{
-   if (msg == nullptr)
-   return;
-
-   /* these messages have information list in them free them
-* first by calling the corresponding free routine.
-*/
-   switch (msg->msg_type) {
-   case AVSV_D2N_REG_SU_MSG:
-   free_d2n_su_msg_info(msg);
-   break;
-   case AVSV_D2N_INFO_SU_SI_ASSIGN_MSG:
-   free_d2n_susi_msg_info(msg);
-   break;
-   case AVSV_D2N_PG_TRACK_ACT_RSP_MSG:
-   free_d2n_pg_msg_info(msg);
-   break;
-   case AVSV_N2D_ND_SISU_STATE_INFO_MSG:
-   free_n2d_nd_sisu_state_info(msg);
-   break;
-   case AVSV_N2D_ND_CSICOMP_STATE_INFO_MSG:
-   free_n2d_nd_csicomp_state_info(msg);
-   break;
-   default:
-   break;
-   }
-
-   /* free the message */
-   delete msg;
-}
-
-/
-  Name  : nda_ava_msg_free
- 
-  Description   : This routine frees the AvA message.
- 
-  Arguments : msg - ptr to the AvA msg
- 
-  Return Values : None
- 
-  Notes   

[devel] [PATCH 0 of 1] Review Request for amfa: fixed freeing notification buff [#1642]

2016-08-19 Thread Long HB Nguyen
Summary: amfa: fixed freeing notification buff [#1642]
Review request for Trac Ticket(s): 1642
Peer Reviewer(s): AMF devs
Pull request to: Amf maintainers
Affected branch(es): default
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  y
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 This patch is to fix for Praveen's commnents
 on amf agent (for notification buffer).

changeset 41a247bdf14274810463c51b4ff58fe57b6001ec
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Fri, 19 Aug 2016 11:35:38 +0700

amfa: fixed freeing notification buff [#1642]


Complete diffstat:
--
 osaf/libs/agents/saf/amfa/amf_agent.cc |  1 +
 osaf/libs/agents/saf/amfa/ava_hdl.cc   |  2 --
 2 files changed, 1 insertions(+), 2 deletions(-)


Testing Commands:
-
 <>


Testing, Expected Results:
--
 <>


Conditions of Submission:
-
 <>


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] amfa: fixed freeing notification buff [#1642]

2016-08-19 Thread Long HB Nguyen
 osaf/libs/agents/saf/amfa/amf_agent.cc |  1 +
 osaf/libs/agents/saf/amfa/ava_hdl.cc   |  2 --
 2 files changed, 1 insertions(+), 2 deletions(-)


diff --git a/osaf/libs/agents/saf/amfa/amf_agent.cc 
b/osaf/libs/agents/saf/amfa/amf_agent.cc
--- a/osaf/libs/agents/saf/amfa/amf_agent.cc
+++ b/osaf/libs/agents/saf/amfa/amf_agent.cc
@@ -2450,6 +2450,7 @@ SaAisErrorT AmfAgent::ProtectionGroupTra
   ava_cpy_protection_group_ntf(buf->notification, 
rsp_buf->notification,
buf->numberOfItems, 
SA_AMF_HARS_READY_FOR_ASSIGNMENT);
   rc = SA_AIS_ERR_NO_SPACE;
+ buf->numberOfItems = rsp_buf->numberOfItems;
 }
   } else { /* if(create_memory == false) */
 
diff --git a/osaf/libs/agents/saf/amfa/ava_hdl.cc 
b/osaf/libs/agents/saf/amfa/ava_hdl.cc
--- a/osaf/libs/agents/saf/amfa/ava_hdl.cc
+++ b/osaf/libs/agents/saf/amfa/ava_hdl.cc
@@ -697,7 +697,6 @@ uint32_t ava_hdl_cbk_rec_prc(AVSV_AMF_CB

((SaAmfCallbacksT_4*)reg_cbk)->saAmfProtectionGroupTrackCallback(_track->csi_name,

,

  pg_track->mem_num, pg_track->err);
-   free(buf.notification);
} else {
pg_track->err = 
SA_AIS_ERR_NO_MEMORY;
LOG_CR("Notification is NULL: 
Invoking PGTrack Callback with error SA_AIS_ERR_NO_MEMORY");
@@ -740,7 +739,6 @@ uint32_t ava_hdl_cbk_rec_prc(AVSV_AMF_CB
((SaAmfCallbacksT 
*)reg_cbk)->saAmfProtectionGroupTrackCallback(_track->csi_name,

   ,

   pg_track->mem_num, pg_track->err);
-   free(buf.notification);
} else {
pg_track->err = 
SA_AIS_ERR_NO_MEMORY;
LOG_CR("Notification is NULL: 
Invoking PGTrack Callback with error SA_AIS_ERR_NO_MEMORY");

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for amfnd: fix issue with environment variable [#1642]

2016-08-15 Thread Long HB Nguyen
Summary: amfnd: fix issue with environment variable [#1642]
Review request for Trac Ticket(s): 1642
Peer Reviewer(s): AMF devs
Pull request to: AMF maintainers
Affected branch(es): default
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 <>

changeset d92fc66e31fdb5a7152fd90831ab25fc772ada26
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Mon, 15 Aug 2016 14:28:54 +0700

amfnd: fix issue with environment variable [#1642]

The amf agent inherits the env for amfnd via 
clc-cli script. Since the SA_ENABLE_EXTENDED_NAMES
variable is only used to set flags for 
osaf_extended_name_init(), we can unset it after it
is used.


Complete diffstat:
--
 osaf/services/saf/amf/amfnd/main.cc |  10 +++---
 1 files changed, 7 insertions(+), 3 deletions(-)


Testing Commands:
-
 <>


Testing, Expected Results:
--
 <>


Conditions of Submission:
-
 <>


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. http://sdm.link/zohodev2dev
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for amfnd: enable long DN support [#1642]

2016-07-11 Thread Long HB Nguyen
Summary: amfnd: enable long DN support [#1642]
Review request for Trac Ticket(s): 1642
Peer Reviewer(s): AMF devs
Pull request to: AMF maintainers
Affected branch(es): default
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 This patch is to add long DN support to amfnd.
 Besides that, it also refactors patricia trees to
 std::map [Minh did that] and most of SaNameT to
 std::string.

changeset 86a7cc021c8a3cc8a328ce6e9a25c05a71d3ca76
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Mon, 11 Jul 2016 16:07:16 +0700

amfnd: enable long DN support [#1642]

This patch refactors the patricia tree to std::map [Minh], replaces 
most of
SaNameT to std::string and supports for long DN.


Complete diffstat:
--
 osaf/services/saf/amf/amfnd/Makefile.am  |2 +-
 osaf/services/saf/amf/amfnd/amfnd.cc |   55 +++--
 osaf/services/saf/amf/amfnd/cbq.cc   |   58 +++---
 osaf/services/saf/amf/amfnd/chc.cc   |   68 +++--
 osaf/services/saf/amf/amfnd/clc.cc   |  197 
+--
 osaf/services/saf/amf/amfnd/clm.cc   |   44 ++-
 osaf/services/saf/amf/amfnd/comp.cc  |  438 
+++---
 osaf/services/saf/amf/amfnd/compdb.cc|  579 
++
 osaf/services/saf/amf/amfnd/cpm.cc   |   18 ++--
 osaf/services/saf/amf/amfnd/di.cc|  163 
+
 osaf/services/saf/amf/amfnd/err.cc   |  106 
+--
 osaf/services/saf/amf/amfnd/evt.cc   |   10 ++-
 osaf/services/saf/amf/amfnd/hcdb.cc  |  271 
+
 osaf/services/saf/amf/amfnd/imm.cc   |9 +-
 osaf/services/saf/amf/amfnd/include/avnd.h   |3 +-
 osaf/services/saf/amf/amfnd/include/avnd_cb.h|   17 ++--
 osaf/services/saf/amf/amfnd/include/avnd_comp.h  |   79 ++-
 osaf/services/saf/amf/amfnd/include/avnd_di.h|6 +-
 osaf/services/saf/amf/amfnd/include/avnd_hc.h|   11 +-
 osaf/services/saf/amf/amfnd/include/avnd_mds.h   |   28 ---
 osaf/services/saf/amf/amfnd/include/avnd_pg.h|   19 +---
 osaf/services/saf/amf/amfnd/include/avnd_proxy.h |   14 +--
 osaf/services/saf/amf/amfnd/include/avnd_su.h|   26 ++
 osaf/services/saf/amf/amfnd/include/avnd_util.h  |1 +
 osaf/services/saf/amf/amfnd/main.cc  |   43 +++---
 osaf/services/saf/amf/amfnd/mds.cc   |  247 
---
 osaf/services/saf/amf/amfnd/mon.cc   |6 +-
 osaf/services/saf/amf/amfnd/pg.cc|   72 ++
 osaf/services/saf/amf/amfnd/pgdb.cc  |   82 +++-
 osaf/services/saf/amf/amfnd/proxy.cc |  108 
+++-
 osaf/services/saf/amf/amfnd/proxydb.cc   |  113 
+---
 osaf/services/saf/amf/amfnd/sidb.cc  |  151 
++-
 osaf/services/saf/amf/amfnd/su.cc|  119 
++
 osaf/services/saf/amf/amfnd/sudb.cc  |  105 
++
 osaf/services/saf/amf/amfnd/susm.cc  |  269 
++---
 osaf/services/saf/amf/amfnd/term.cc  |   24 -
 osaf/services/saf/amf/amfnd/tmr.cc   |8 +-
 osaf/services/saf/amf/amfnd/util.cc  |   58 --
 38 files changed, 1692 insertions(+), 1935 deletions(-)


Testing Commands:
-
 Running amf_demo with long DNs.


Testing, Expected Results:
--
 Working properly as with normal DNs.


Conditions of Submission:
-
 Ack from devs or 2 weeks from now.


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: mak

[devel] [PATCH 0 of 1] Review Request for libs/common/amf: enable long DN support [#1642]

2016-07-11 Thread Long HB Nguyen
Summary: libs/common/amf: enable long DN support [#1642]
Review request for Trac Ticket(s): 1642
Peer Reviewer(s): AMF devs
Pull request to: AMF maintainers
Affected branch(es): default
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  y
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 This patch is to add the long DN support in 
 libs/common/amf

changeset 135c1fd75d1258e0e62ff0427f457c121a70aecd
Author: Hans Nordeback 
Date:   Mon, 11 Jul 2016 15:49:48 +0700

libs/common/amf: enable long DN support [#1642]


Added Files:

 osaf/libs/common/amf/include/amf_db_template.h


Complete diffstat:
--
 osaf/libs/common/amf/Makefile.am   |1 +
 osaf/libs/common/amf/d2nmsg.c  |  301 
--
 osaf/libs/common/amf/include/Makefile.am   |1 +
 osaf/libs/common/amf/include/amf.h |2 +-
 osaf/libs/common/amf/include/amf_db_template.h |  146 
+++
 osaf/libs/common/amf/include/amf_n2avamsg.h|2 +
 osaf/libs/common/amf/include/amf_util.h|8 +--
 osaf/libs/common/amf/n2avaedu.c|1 +
 osaf/libs/common/amf/n2avamsg.c|  332 

 osaf/libs/common/amf/util.c|  246 
+++--
 10 files changed, 832 insertions(+), 208 deletions(-)


Testing Commands:
-
 Running amf_demo with long DNs.


Testing, Expected Results:
--
 Working properly as with normal DNs.


Conditions of Submission:
-
 Ack from devs or 2 weeks from now.


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
 

[devel] [PATCH 1 of 1] libs/common/amf: enable long DN support [#1642]

2016-07-11 Thread Long HB Nguyen
 osaf/libs/common/amf/Makefile.am   |1 +
 osaf/libs/common/amf/d2nmsg.c  |  301 +-
 osaf/libs/common/amf/include/Makefile.am   |1 +
 osaf/libs/common/amf/include/amf.h |2 +-
 osaf/libs/common/amf/include/amf_db_template.h |  146 ++
 osaf/libs/common/amf/include/amf_n2avamsg.h|2 +
 osaf/libs/common/amf/include/amf_util.h|8 +-
 osaf/libs/common/amf/n2avaedu.c|1 +
 osaf/libs/common/amf/n2avamsg.c|  332 -
 osaf/libs/common/amf/util.c|  246 +
 10 files changed, 832 insertions(+), 208 deletions(-)


diff --git a/osaf/libs/common/amf/Makefile.am b/osaf/libs/common/amf/Makefile.am
--- a/osaf/libs/common/amf/Makefile.am
+++ b/osaf/libs/common/amf/Makefile.am
@@ -23,6 +23,7 @@ SUBDIRS = include
 noinst_LTLIBRARIES = libamf_common.la
 
 libamf_common_la_CPPFLAGS = \
+   -DSA_EXTENDED_NAME_SOURCE \
$(AM_CPPFLAGS) \
-I$(top_srcdir)/osaf/libs/common/amf/include
 
diff --git a/osaf/libs/common/amf/d2nmsg.c b/osaf/libs/common/amf/d2nmsg.c
--- a/osaf/libs/common/amf/d2nmsg.c
+++ b/osaf/libs/common/amf/d2nmsg.c
@@ -25,6 +25,7 @@
 
 #include "amf.h"
 #include "amf_d2nmsg.h"
+#include "osaf_extended_name.h"
 
 /*
  * Function: free_d2n_su_msg_info
@@ -47,6 +48,7 @@ static void free_d2n_su_msg_info(AVSV_DN
while (su_msg->msg_info.d2n_reg_su.su_list != NULL) {
su_info = su_msg->msg_info.d2n_reg_su.su_list;
su_msg->msg_info.d2n_reg_su.su_list = su_info->next;
+   osaf_extended_name_free(_info->name);
free(su_info);
}
 }
@@ -70,9 +72,6 @@ static uint32_t cpy_d2n_su_msg(AVSV_DND_
 {
AVSV_SU_INFO_MSG *s_su_info, *d_su_info;
 
-   memset(d_su_msg, '\0', sizeof(AVSV_DND_MSG));
-
-   memcpy(d_su_msg, s_su_msg, sizeof(AVSV_DND_MSG));
d_su_msg->msg_info.d2n_reg_su.su_list = NULL;
 
s_su_info = s_su_msg->msg_info.d2n_reg_su.su_list;
@@ -85,6 +84,7 @@ static uint32_t cpy_d2n_su_msg(AVSV_DND_
}
 
memcpy(d_su_info, s_su_info, sizeof(AVSV_SU_INFO_MSG));
+   
osaf_extended_name_alloc(osaf_extended_name_borrow(_su_info->name), 
_su_info->name);
d_su_info->next = d_su_msg->msg_info.d2n_reg_su.su_list;
d_su_msg->msg_info.d2n_reg_su.su_list = d_su_info;
 
@@ -114,14 +114,24 @@ static uint32_t cpy_d2n_su_msg(AVSV_DND_
 static void free_d2n_susi_msg_info(AVSV_DND_MSG *susi_msg)
 {
AVSV_SUSI_ASGN *compcsi_info;
+   uint16_t i;
 
while (susi_msg->msg_info.d2n_su_si_assign.list != NULL) {
compcsi_info = susi_msg->msg_info.d2n_su_si_assign.list;
susi_msg->msg_info.d2n_su_si_assign.list = compcsi_info->next;
if (compcsi_info->attrs.list != NULL) {
+   for (i = 0; i < compcsi_info->attrs.number; i++) {
+   
osaf_extended_name_free(_info->attrs.list[i].name);
+   
osaf_extended_name_free(_info->attrs.list[i].value);
+   free(compcsi_info->attrs.list[i].string_ptr);
+   compcsi_info->attrs.list[i].string_ptr = NULL;
+   }
free(compcsi_info->attrs.list);
compcsi_info->attrs.list = NULL;
}
+   osaf_extended_name_free(_info->active_comp_name);
+   osaf_extended_name_free(_info->comp_name);
+   osaf_extended_name_free(_info->csi_name);
free(compcsi_info);
}
 }
@@ -144,10 +154,13 @@ static void free_d2n_susi_msg_info(AVSV_
 static uint32_t cpy_d2n_susi_msg(AVSV_DND_MSG *d_susi_msg, AVSV_DND_MSG 
*s_susi_msg)
 {
AVSV_SUSI_ASGN *s_compcsi_info, *d_compcsi_info;
+   uint16_t i;
 
-   memset(d_susi_msg, '\0', sizeof(AVSV_DND_MSG));
+   
osaf_extended_name_alloc(osaf_extended_name_borrow(_susi_msg->msg_info.d2n_su_si_assign.si_name),
+   _susi_msg->msg_info.d2n_su_si_assign.si_name);
+   
osaf_extended_name_alloc(osaf_extended_name_borrow(_susi_msg->msg_info.d2n_su_si_assign.su_name),
+   _susi_msg->msg_info.d2n_su_si_assign.su_name);
 
-   memcpy(d_susi_msg, s_susi_msg, sizeof(AVSV_DND_MSG));
d_susi_msg->msg_info.d2n_su_si_assign.list = NULL;
 
s_compcsi_info = s_susi_msg->msg_info.d2n_su_si_assign.list;
@@ -160,6 +173,9 @@ static uint32_t cpy_d2n_susi_msg(AVSV_DN
}
 
memcpy(d_compcsi_info, s_compcsi_info, sizeof(AVSV_SUSI_ASGN));
+   
osaf_extended_name_alloc(osaf_extended_name_borrow(_compcsi_info->active_comp_name),
 _compcsi_info->active_comp_name);
+   
osaf_extended_name_alloc(osaf_extended_name_borrow(_compcsi_info->comp_name), 

[devel] [PATCH 1 of 1] amfa: enable long DN support [#1642]

2016-07-11 Thread Long HB Nguyen
 osaf/libs/agents/saf/amfa/Makefile.am   |1 +
 osaf/libs/agents/saf/amfa/amf_agent.cc  |  638 ++-
 osaf/libs/agents/saf/amfa/ava_hdl.cc|  246 +
 osaf/libs/agents/saf/amfa/ava_init.cc   |   21 +-
 osaf/libs/agents/saf/amfa/ava_mds.cc|  448 +++-
 osaf/libs/agents/saf/amfa/ava_op.cc |   23 +-
 osaf/libs/agents/saf/amfa/include/ava.h |1 +
 osaf/libs/agents/saf/amfa/include/ava_cb.h  |1 +
 osaf/libs/agents/saf/amfa/include/ava_mds.h |  267 +-
 9 files changed, 979 insertions(+), 667 deletions(-)


diff --git a/osaf/libs/agents/saf/amfa/Makefile.am 
b/osaf/libs/agents/saf/amfa/Makefile.am
--- a/osaf/libs/agents/saf/amfa/Makefile.am
+++ b/osaf/libs/agents/saf/amfa/Makefile.am
@@ -25,6 +25,7 @@ noinst_LTLIBRARIES = libava.la
 libava_la_CXXFLAGS = $(AM_CXXFLAGS)
 
 libava_la_CPPFLAGS = \
+   -DSA_EXTENDED_NAME_SOURCE \
$(AM_CPPFLAGS) \
-I$(top_srcdir)/osaf/libs/common/amf/include \
-I$(top_srcdir)/osaf/libs/agents/saf/amfa/include
diff --git a/osaf/libs/agents/saf/amfa/amf_agent.cc 
b/osaf/libs/agents/saf/amfa/amf_agent.cc
--- a/osaf/libs/agents/saf/amfa/amf_agent.cc
+++ b/osaf/libs/agents/saf/amfa/amf_agent.cc
@@ -366,7 +366,7 @@ SaAisErrorT AmfAgent::Finalize(SaAmfHand
   }
 
   /* populate & send the finalize message */
-  m_AVA_AMF_FINALIZE_MSG_FILL(msg, cb->ava_dest, hdl, cb->comp_name);
+  ava_fill_finalize_msg(, cb->ava_dest, hdl, cb->comp_name);
   rc = static_cast(ava_mds_send(cb, , 0));
   if (NCSCC_RC_SUCCESS == rc) {
 ncshm_give_hdl(hdl);
@@ -429,13 +429,12 @@ SaAisErrorT AmfAgent::ComponentRegister(
   AVA_HDL_REC *hdl_rec = 0;
   AVSV_NDA_AVA_MSG msg = {};
   AVSV_NDA_AVA_MSG *msg_rsp = 0;
-  SaNameT pcomp_name = {0};
+  SaNameT pcomp_name;
   SaAisErrorT rc = SA_AIS_OK;
   TRACE_ENTER2("SaAmfHandleT passed is %llx", hdl);
 
-  if (!comp_name || !(comp_name->length) ||
-  (comp_name->length > SA_MAX_NAME_LENGTH) ||
-  (proxy_comp_name && (!proxy_comp_name->length || proxy_comp_name->length 
> SA_MAX_NAME_LENGTH))) {
+  if (!comp_name || !ava_sanamet_is_valid(comp_name) ||
+(proxy_comp_name && !ava_sanamet_is_valid(proxy_comp_name))) {
 TRACE_LEAVE2("Incorrect arguments");
 return SA_AIS_ERR_INVALID_PARAM;
   }
@@ -461,15 +460,17 @@ SaAisErrorT AmfAgent::ComponentRegister(
   }
 
   if (!m_AVA_FLAG_IS_COMP_NAME(cb)) {
-if (getenv("SA_AMF_COMPONENT_NAME")) {
-  if (strlen(getenv("SA_AMF_COMPONENT_NAME")) < SA_MAX_NAME_LENGTH) {
-strcpy((char *)cb->comp_name.value, getenv("SA_AMF_COMPONENT_NAME"));
-cb->comp_name.length = (uint16_t)strlen((char *)cb->comp_name.value);
-m_AVA_FLAG_SET(cb, AVA_FLAG_COMP_NAME);
-  } else {
-TRACE_2("Length of SA_AMF_COMPONENT_NAME exceeds SA_MAX_NAME_LENGTH 
bytes");
+SaConstStringT env_comp_name = getenv("SA_AMF_COMPONENT_NAME");
+if (env_comp_name) {
+  if (strlen(env_comp_name) > kOsafMaxDnLength) {
+TRACE_2("Length of SA_AMF_COMPONENT_NAME exceeds "
+"kOsafMaxDnLength(%d) bytes", kOsafMaxDnLength);
 rc = SA_AIS_ERR_INVALID_PARAM;
 goto done;
+  } else {
+// @cb->comp_name could be longDN, need to be freed later
+osaf_extended_name_alloc(env_comp_name, >comp_name);
+m_AVA_FLAG_SET(cb, AVA_FLAG_COMP_NAME);
   }
 } else {
   TRACE_2("The SA_AMF_COMPONENT_NAME environment variable is NULL");
@@ -481,26 +482,31 @@ SaAisErrorT AmfAgent::ComponentRegister(
 ncshm_give_hdl(gl_ava_hdl);
 
   /* non-proxied, component Length part of component name should be OK */
-  if (!proxy_comp_name && (comp_name->length != cb->comp_name.length)) {
+  if (!proxy_comp_name && (osaf_extended_name_length(comp_name) !=
+osaf_extended_name_length(>comp_name))) {
 rc = SA_AIS_ERR_INVALID_PARAM;
 goto done;
   }
 
   /* proxy component, Length part of proxy component name should be Ok */
-  if (proxy_comp_name && (proxy_comp_name->length != cb->comp_name.length)) {
+  if (proxy_comp_name && (osaf_extended_name_length(proxy_comp_name) !=
+osaf_extended_name_length(>comp_name))) {
 rc = SA_AIS_ERR_INVALID_PARAM;
 goto done;
   }
 
   /* non-proxied component should not forge its name while registering */
-  if (!proxy_comp_name && strncmp((char *)comp_name->value, (char 
*)cb->comp_name.value, comp_name->length)) {
+  if (!proxy_comp_name && strncmp(osaf_extended_name_borrow(comp_name),
+  osaf_extended_name_borrow(>comp_name),
+  osaf_extended_name_length(comp_name))) {
 rc = SA_AIS_ERR_BAD_OPERATION;
 goto done;
   }
 
   /* proxy component should not forge its name while registering its proxied */
-  if (proxy_comp_name &&
-  strncmp((char *)proxy_comp_name->value, (char *)cb->comp_name.value, 
proxy_comp_name->length)) {
+  if (proxy_comp_name && strncmp(osaf_extended_name_borrow(proxy_comp_name),
+

[devel] [PATCH 0 of 1] Review Request for amfa: enable long DN support [#1642]

2016-07-11 Thread Long HB Nguyen
Summary: amfa: enable long DN support [#1642]
Review request for Trac Ticket(s): 1642
Peer Reviewer(s): AMF devs
Pull request to: AMF maintainers
Affected branch(es): default
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  y
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 This patch is to add long DN support for amfa.

changeset 881bd46ef7f46058f536aff67fece6912ae84761
Author: Minh Hon Chau 
Date:   Mon, 11 Jul 2016 15:45:35 +0700

amfa: enable long DN support [#1642]


Complete diffstat:
--
 osaf/libs/agents/saf/amfa/Makefile.am   |1 +
 osaf/libs/agents/saf/amfa/amf_agent.cc  |  638 
+++
 osaf/libs/agents/saf/amfa/ava_hdl.cc|  246 
---
 osaf/libs/agents/saf/amfa/ava_init.cc   |   21 ++--
 osaf/libs/agents/saf/amfa/ava_mds.cc|  448 
-
 osaf/libs/agents/saf/amfa/ava_op.cc |   23 -
 osaf/libs/agents/saf/amfa/include/ava.h |1 +
 osaf/libs/agents/saf/amfa/include/ava_cb.h  |1 +
 osaf/libs/agents/saf/amfa/include/ava_mds.h |  267 
+---
 9 files changed, 979 insertions(+), 667 deletions(-)


Testing Commands:
-
 Running amf_demo with long DNs.


Testing, Expected Results:
--
 Working properly as with normal DNs.


Conditions of Submission:
-
 Ack from devs or 2 weeks from now.


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech 

[devel] [PATCH 0 of 1] Review Request for samples/amf: enable long DN support [#1642]

2016-07-11 Thread Long HB Nguyen
Summary: samples/amf: enable long DN support [#1642]
Review request for Trac Ticket(s): 1642
Peer Reviewer(s): AMF devs
Pull request to: AMF maintainers
Affected branch(es): default
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  n
 Samples y
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 This patch is to add some xml files to 
 samples/amf and modify amf_demo to run with long DNs.

changeset 9e0c6adb3ba3acc06b956c11aafd6242db76ac1f
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Mon, 11 Jul 2016 14:42:41 +0700

samples/amf: enable long DN support [#1642]


Added Files:

 samples/amf/non_sa_aware/net-snmp-longDN.xml
 samples/amf/proxy/proxy-longDN.xml
 samples/amf/sa_aware/AppConfig-2N-longDN.xml
 samples/amf/sa_aware/AppConfig-nwayactive-longDN.xml
 samples/amf/wrapper/net-snmp-longDN.xml


Complete diffstat:
--
 samples/amf/non_sa_aware/net-snmp-longDN.xml |  339 
++
 samples/amf/proxy/Makefile.am|1 +
 samples/amf/proxy/proxy-longDN.xml   |  265 
+++
 samples/amf/proxy/proxy.c|   83 
-
 samples/amf/proxy/proxy_script   |3 +-
 samples/amf/sa_aware/AppConfig-2N-longDN.xml |  315 
+
 samples/amf/sa_aware/AppConfig-nwayactive-longDN.xml |  408 
+++
 samples/amf/sa_aware/Makefile.am |1 +
 samples/amf/sa_aware/amf_demo.c  |   53 --
 samples/amf/sa_aware/amf_demo_script |4 +-
 samples/amf/wrapper/Makefile.am  |1 +
 samples/amf/wrapper/net-snmp-longDN.xml  |  331 
+++
 samples/amf/wrapper/wrapper.c|7 ++-
 samples/amf/wrapper/wrapper.sh   |5 +-
 14 files changed, 1779 insertions(+), 37 deletions(-)


Testing Commands:
-
 Run AMF samples with new xml files.


Testing, Expected Results:
--
 Working properly as with normal DNs.


Conditions of Submission:
-
 Ack from devs or 2 weeks from now.


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to a

[devel] [PATCH 1 of 1] samples/amf: enable long DN support [#1642]

2016-07-11 Thread Long HB Nguyen
 samples/amf/non_sa_aware/net-snmp-longDN.xml |  339 +++
 samples/amf/proxy/Makefile.am|1 +
 samples/amf/proxy/proxy-longDN.xml   |  265 
 samples/amf/proxy/proxy.c|   83 ++-
 samples/amf/proxy/proxy_script   |3 +-
 samples/amf/sa_aware/AppConfig-2N-longDN.xml |  315 ++
 samples/amf/sa_aware/AppConfig-nwayactive-longDN.xml |  408 +++
 samples/amf/sa_aware/Makefile.am |1 +
 samples/amf/sa_aware/amf_demo.c  |   53 ++-
 samples/amf/sa_aware/amf_demo_script |4 +-
 samples/amf/wrapper/Makefile.am  |1 +
 samples/amf/wrapper/net-snmp-longDN.xml  |  331 +++
 samples/amf/wrapper/wrapper.c|7 +-
 samples/amf/wrapper/wrapper.sh   |5 +-
 14 files changed, 1779 insertions(+), 37 deletions(-)


diff --git a/samples/amf/non_sa_aware/net-snmp-longDN.xml 
b/samples/amf/non_sa_aware/net-snmp-longDN.xml
new file mode 100755
--- /dev/null
+++ b/samples/amf/non_sa_aware/net-snmp-longDN.xml
@@ -0,0 +1,339 @@
+
+
+
+http://www.saforum.org/IMMSchema; 
xsi:noNamespaceSchemaLocation="SAI-AIS-IMM-XSD-A.01.01.xsd" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;>
+
+
+
+   
+   
safAppType=net-snmp-LongDNTesting
+   
+   
+   
safSgType=2N-net-snmp-LongDNTesting
+   
+   
+   safSuType=snmpd
+   
+   
+   safCompType=snmpd
+   
+   
+   safSvcType=snmpd
+   
+   
+   safCSType=snmpd
+   
+   
+   safVersion=1,safSvcType=snmpd
+   
+
+
+
+   
+   
safVersion=1,safAppType=net-snmp-LongDNTesting
+   
+   saAmfApptSGTypes
+   
safVersion=1,safSgType=2N-net-snmp-LongDNTesting
+   
+   
+   
+   
safVersion=1,safSgType=2N-net-snmp-LongDNTesting
+   
+   saAmfSgtRedundancyModel
+   1
+   
+   
+   saAmfSgtValidSuTypes
+   safVersion=1,safSuType=snmpd
+   
+   
+   saAmfSgtDefAutoAdjustProb
+   100
+   
+   
+   saAmfSgtDefCompRestartProb
+   40
+   
+   
+   saAmfSgtDefCompRestartMax
+   10
+   
+   
+   saAmfSgtDefSuRestartProb
+   40
+   
+   
+   saAmfSgtDefSuRestartMax
+   10
+   
+   
+   
+   safVersion=1,safSuType=snmpd
+   
+   saAmfSutIsExternal
+   0
+   
+   
+   saAmfSutDefSUFailover
+   1
+   
+   
+   saAmfSutProvidesSvcTypes
+   safVersion=1,safSvcType=snmpd
+   
+   
+   
+   safVersion=5.6.1-4.5.1,safCompType=snmpd
+   
+   saAmfCtCompCategory
+   8
+   
+   
+   saAmfCtSwBundle
+   safSmfBundle=net-snmp-5.6.1-4.5.1.x86_64
+   
+   
+   saAmfCtDefClcCliTimeout
+   100
+   
+   
+

[devel] [PATCH 1 of 1] amfpm: enable long DN support [#1642]

2016-07-11 Thread Long HB Nguyen
 osaf/tools/safamf/amfpm/Makefile.am |   1 +
 osaf/tools/safamf/amfpm/amf_pm.c|  31 ---
 2 files changed, 21 insertions(+), 11 deletions(-)


diff --git a/osaf/tools/safamf/amfpm/Makefile.am 
b/osaf/tools/safamf/amfpm/Makefile.am
--- a/osaf/tools/safamf/amfpm/Makefile.am
+++ b/osaf/tools/safamf/amfpm/Makefile.am
@@ -21,6 +21,7 @@ MAINTAINERCLEANFILES = Makefile.in
 sbin_PROGRAMS = amfpm
 
 amfpm_CPPFLAGS = \
+   -DSA_EXTENDED_NAME_SOURCE \
$(AM_CPPFLAGS)
 
 amfpm_SOURCES = \
diff --git a/osaf/tools/safamf/amfpm/amf_pm.c b/osaf/tools/safamf/amfpm/amf_pm.c
--- a/osaf/tools/safamf/amfpm/amf_pm.c
+++ b/osaf/tools/safamf/amfpm/amf_pm.c
@@ -137,7 +137,7 @@ int main(int argc, char **argv)
SaVersionT ver = {.releaseCode = 'B', ver.majorVersion = 0x04, 
ver.minorVersion = 0x01};
SaAisErrorT rc;
SaAmfHandleT amf_hdl;
-   SaNameT compName = {0};
+   SaNameT compName;
char *prog = basename(argv[0]);
SaUint64T processId = 0;
bool start = false;
@@ -157,6 +157,8 @@ int main(int argc, char **argv)
char *pidfile = NULL;
char *dn;
SaAmfRecommendedRecoveryT recrec = SA_AMF_NO_RECOMMENDATION;
+   char name[2048];
+   int length;
 
while (1) {
c = getopt_long(argc, argv, "af:p:hor:", long_options, NULL);
@@ -193,14 +195,13 @@ int main(int argc, char **argv)
 
/* DN specified as argument has precendence of env var */
if ((argc - optind) == 1) {
-   compName.length = snprintf((char*) compName.value, 
sizeof(compName.value), "%s", argv[optind]);
-   if (compName.length >=  sizeof(compName.value)) {
+   length = snprintf((char*)name, sizeof(name), "%s", 
argv[optind]);
+   if (length >=  sizeof(name)) {
logerr("too long DN\n");
exit(EXIT_FAILURE);
}
} else if ((dn = getenv("SA_AMF_COMPONENT_NAME")) != NULL) {
-   compName.length = snprintf((char*) compName.value,
-  
sizeof(compName.value), "%s", dn);
+   length = snprintf((char*) name, sizeof(name), "%s", dn);
 
/* If AMF component use syslog for errors. */
usesyslog = true;
@@ -228,17 +229,18 @@ int main(int argc, char **argv)
** by LSB start_daemon (and friends) using basename from DN
*/
if ((processId == 0) && (pidfile == NULL)) {
-   char basename[64];
+   char basename[2048];
char *start, *stop, *p;
int i;
+   int pidfilelen;

-   start = strchr((char*)compName.value, '=');
+   start = strchr((char*)name, '=');
if (start == NULL) {
logerr("invalid component DN\n");
exit(EXIT_FAILURE);
}
 
-   stop = strchr((char*)compName.value, ',');
+   stop = strchr((char*)name, ',');
if (stop == NULL) {
logerr("invalid component DN\n");
exit(EXIT_FAILURE);
@@ -248,9 +250,10 @@ int main(int argc, char **argv)
basename[i] = *p;
 
basename[i] = '\0';
+   pidfilelen = strlen(basename) + 15;
 
-   pidfile = malloc(64);
-   snprintf(pidfile, 64, "/var/run/%s.pid", basename);
+   pidfile = malloc(pidfilelen);
+   snprintf(pidfile, pidfilelen, "/var/run/%s.pid", basename);
}
 
if (processId == 0) {
@@ -262,7 +265,9 @@ int main(int argc, char **argv)
logerr("saAmfInitialize FAILED %u\n", rc);
exit(EXIT_FAILURE);
}
-
+   
+   // Assign the component name
+   saAisNameLend((char *)name, );
if (start) {
rc = saAmfPmStart_3(amf_hdl, , processId, 
descendentsTreeDepth,
pmErr, recrec);
@@ -278,6 +283,10 @@ int main(int argc, char **argv)
}
}
 
+   if (pidfile != NULL) {
+   free(pidfile);
+   }
+
(void) saAmfFinalize(amf_hdl);
 
return 0;

--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for amfpm: enable long DN support [#1642]

2016-07-11 Thread Long HB Nguyen
Summary: amfpm: enable long DN support [#1642]
Review request for Trac Ticket(s): 1642
Peer Reviewer(s): AMF devs
Pull request to: AMF maintainer
Affected branch(es): default
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 This patch is to add long DN support for amfpm.

changeset 445409e6f4df000e158f2ed763fcae1f35ee5981
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Mon, 11 Jul 2016 14:41:38 +0700

amfpm: enable long DN support [#1642]


Complete diffstat:
--
 osaf/tools/safamf/amfpm/Makefile.am |   1 +
 osaf/tools/safamf/amfpm/amf_pm.c|  31 ---
 2 files changed, 21 insertions(+), 11 deletions(-)


Testing Commands:
-
 Running the non_sa_ware sample with long DNs.


Testing, Expected Results:
--
 Working properly as with normal DNs.


Conditions of Submission:
-
 Ack from devs or 2 weeks from now.


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for amfwdog: enable long DN support [#1642]

2016-07-11 Thread Long HB Nguyen
Summary: amfwdog: enable long DN support [#1642]
Review request for Trac Ticket(s): 1642
Peer Reviewer(s): AMF devs
Pull request to: AMF maintainer
Affected branch(es): default
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 This patch is to support long DN in amfwdog.

changeset a57092dc84dcc63533f629934bc9fb11984bbda3
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Mon, 11 Jul 2016 14:40:04 +0700

amfwdog: enable long DN support [#1642]


Complete diffstat:
--
 osaf/services/saf/amf/amfwdog/Makefile.am |  1 +
 osaf/services/saf/amf/amfwdog/amf_wdog.c  |  2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)


Testing Commands:
-
 Running amf_demo with long DNs.


Testing, Expected Results:
--
 Working properly as with normal DNs.


Conditions of Submission:
-
 Ack from devs or 2 weeks from now.


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 21 of 30] amfnd: convert NULL to nullptr for pg.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/pg.cc |  12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/pg.cc 
b/osaf/services/saf/amf/amfnd/pg.cc
--- a/osaf/services/saf/amf/amfnd/pg.cc
+++ b/osaf/services/saf/amf/amfnd/pg.cc
@@ -106,7 +106,7 @@ static uint32_t avnd_pg_start_rsp_prc(AV
for (curr = (AVND_PG_TRK 
*)m_NCS_DBLIST_FIND_FIRST(>trk_list);
 curr; curr = (AVND_PG_TRK 
*)m_NCS_DBLIST_FIND_NEXT(>pg_dll_node)) {
rc = avnd_amf_resp_send(cb, AVSV_AMF_PG_START, 
SA_AIS_ERR_NOT_EXIST,
-   0, >info.key.mds_dest, 
>info.mds_ctxt, NULL, false);
+   0, >info.key.mds_dest, 
>info.mds_ctxt, nullptr, false);
if (NCSCC_RC_SUCCESS != rc)
return rc;
}   /* while */
@@ -247,7 +247,7 @@ uint32_t avnd_evt_ava_pg_stop_evh(AVND_C
/* respond bk to the application */
if (!pg || !pg_trk)
amf_rc = SA_AIS_ERR_NOT_EXIST;
-   rc = avnd_amf_resp_send(cb, AVSV_AMF_PG_STOP, amf_rc, 0, 
_info->dest, >mds_ctxt, NULL, false);
+   rc = avnd_amf_resp_send(cb, AVSV_AMF_PG_STOP, amf_rc, 0, 
_info->dest, >mds_ctxt, nullptr, false);
 
/* proceed with rest of the processing */
if ((SA_AIS_OK == amf_rc) && (NCSCC_RC_SUCCESS == rc)) {
@@ -292,7 +292,7 @@ static uint32_t avnd_process_pg_track_st
/* get the mem rec */
pg_mem = m_AVND_PGDB_MEM_REC_GET(*pg, 
mem_info->member.compName);
 
-   if (NULL == pg_mem) {
+   if (nullptr == pg_mem) {
pg_mem = avnd_pgdb_mem_rec_add(cb, pg, 
mem_info);
} else {
pg_mem->mem_exist = true;
@@ -398,7 +398,7 @@ uint32_t avnd_evt_avd_pg_track_act_rsp_e
pg = m_AVND_PGDB_REC_GET(cb->pgdb, info->csi_name);
TRACE("pg '%p', msg_on_fover '%u'", pg, 
info->msg_on_fover);
if (true == info->msg_on_fover) {
-   if (NULL != pg) {
+   if (nullptr != pg) {
if (false == pg->is_exist)
return 
avnd_pg_start_rsp_prc(cb, pg, info);
else
@@ -502,7 +502,7 @@ uint32_t avnd_evt_avd_pg_upd_evh(AVND_CB
osafassert(0);
}   /* switch */
 
-   if (NULL == chg_mem)
+   if (nullptr == chg_mem)
return NCSCC_RC_FAILURE;
 
/* inform all the appl */
@@ -643,7 +643,7 @@ uint32_t avnd_pg_track_start(AVND_CB *cb
/* send the response to the application */
if (false == pg_trk->info.is_syn) {
rc = avnd_amf_resp_send(cb, AVSV_AMF_PG_START, SA_AIS_OK,
-   0, _trk->info.key.mds_dest, 
_trk->info.mds_ctxt, NULL, false);
+   0, _trk->info.key.mds_dest, 
_trk->info.mds_ctxt, nullptr, false);
if (NCSCC_RC_SUCCESS != rc)
return rc;
}

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 12 of 30] amfnd: convert NULL to nullptr for cpm.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/cpm.cc |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/cpm.cc 
b/osaf/services/saf/amf/amfnd/cpm.cc
--- a/osaf/services/saf/amf/amfnd/cpm.cc
+++ b/osaf/services/saf/amf/amfnd/cpm.cc
@@ -112,7 +112,7 @@ uint32_t avnd_comp_pm_rec_add(AVND_CB *c
return rc;
 
/* add the record to the mon req list */
-   if(avnd_mon_req_add(cb, rec) == NULL) {
+   if(avnd_mon_req_add(cb, rec) == nullptr) {
ncs_db_link_list_remove(>pm_list, rec->comp_dll_node.key);
return NCSCC_RC_FAILURE;
}
@@ -146,7 +146,7 @@ void avnd_comp_pm_rec_del(AVND_CB *cb, A
if (NCSCC_RC_SUCCESS != rc) {
LOG_NO("PM Rec doesn't exist in Comp '%s' of pid %llu", 
comp->name.value, pid);
}
-   rec = NULL; /* rec is no more, dont use it */
+   rec = nullptr;  /* rec is no more, dont use it */
 
/* remove the corresponding element from mon_req list */
rc = avnd_mon_req_del(cb, pid);

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 15 of 30] amfnd: convert NULL to nullptr for evt.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/evt.cc |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/evt.cc 
b/osaf/services/saf/amf/amfnd/evt.cc
--- a/osaf/services/saf/amf/amfnd/evt.cc
+++ b/osaf/services/saf/amf/amfnd/evt.cc
@@ -176,7 +176,7 @@ AVND_EVT *avnd_evt_create(AVND_CB *cb,
 
default:
delete evt;
-   evt = NULL;
+   evt = nullptr;
break;
}
 

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 29 of 30] amfnd: convert NULL to nullptr for verify.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/verify.cc |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/verify.cc 
b/osaf/services/saf/amf/amfnd/verify.cc
--- a/osaf/services/saf/amf/amfnd/verify.cc
+++ b/osaf/services/saf/amf/amfnd/verify.cc
@@ -57,7 +57,7 @@ static uint32_t avnd_send_pg_start_on_fo
 
memset(_name, '\0', sizeof(SaNameT));
 
-   while (NULL != (pg = m_AVND_PGDB_REC_GET_NEXT(cb->pgdb, csi_name))) {
+   while (nullptr != (pg = m_AVND_PGDB_REC_GET_NEXT(cb->pgdb, csi_name))) {
rc = avnd_di_pg_act_send(cb, >csi_name, 
AVSV_PG_TRACK_ACT_START, true);
 
if (NCSCC_RC_SUCCESS != rc)
@@ -137,7 +137,7 @@ uint32_t avnd_evt_avd_verify_evh(AVND_CB
 * Otherwise this exercise also helps us in cleaning all the messages 
 * currently pending in the Queue and are not acked.
 */
-   for (rec = list->head; NULL != rec;) {
+   for (rec = list->head; nullptr != rec;) {
t_rec = *rec;
 
/* 

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 26 of 30] amfnd: convert NULL to nullptr for susm.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/susm.cc |  106 ++--
 1 files changed, 53 insertions(+), 53 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/susm.cc 
b/osaf/services/saf/amf/amfnd/susm.cc
--- a/osaf/services/saf/amf/amfnd/susm.cc
+++ b/osaf/services/saf/amf/amfnd/susm.cc
@@ -309,7 +309,7 @@ uint32_t avnd_su_si_msg_prc(AVND_CB *cb,
 {
AVND_SU_SI_REC *si = 0;
uint32_t rc = NCSCC_RC_SUCCESS;
-   AVND_COMP_CSI_REC *csi = NULL;
+   AVND_COMP_CSI_REC *csi = nullptr;
 
TRACE_ENTER2("'%s', act=%u, ha_state=%u, single_csi=%u",
 su->name.value, info->msg_act, info->ha_state, 
info->single_csi);
@@ -328,7 +328,7 @@ uint32_t avnd_su_si_msg_prc(AVND_CB *cb,
if (false == info->single_csi) {
/* add to the database */
si = avnd_su_si_rec_add(cb, su, info, );
-   if (NULL != si) {
+   if (nullptr != si) {
/* Send the ASYNC updates for this SI 
and its CSI. First of all 
   send SU_SI record and then all the 
CSIs. */
m_AVND_SEND_CKPT_UPDT_ASYNC_ADD(cb, si, 
AVND_CKPT_SU_SI_REC);
@@ -383,7 +383,7 @@ uint32_t avnd_su_si_msg_prc(AVND_CB *cb,
csi_param = info->list;
osafassert(csi_param);
osafassert(!(csi_param->next));
-   if (NULL ==  (csi_rec = 
avnd_compdb_csi_rec_get(cb, _param->comp_name, _param->csi_name))) {
+   if (nullptr ==  (csi_rec = 
avnd_compdb_csi_rec_get(cb, _param->comp_name, _param->csi_name))) {
LOG_ER("No CSI Rec exists for 
comp='%s'and csi=%s",csi_param->comp_name.value, 

csi_param->csi_name.value); 
goto done;
@@ -479,21 +479,21 @@ static uint32_t assign_si_to_su(AVND_SU_
if (single_csi) {
for (curr_csi = (AVND_COMP_CSI_REC 
*)m_NCS_DBLIST_FIND_FIRST(>csi_list),
rank = curr_csi->rank;
-   (curr_csi != NULL) && ((curr_csi->rank 
== rank) || (curr_csi->si->single_csi_add_rem_in_si == AVSV_SUSI_ACT_ASGN));
+   (curr_csi != nullptr) && 
((curr_csi->rank == rank) || (curr_csi->si->single_csi_add_rem_in_si == 
AVSV_SUSI_ACT_ASGN));
curr_csi = (AVND_COMP_CSI_REC 
*)m_NCS_DBLIST_FIND_NEXT(_csi->si_dll_node)) {
curr_csi->comp->assigned_flag = false;
}
}
for (curr_csi = (AVND_COMP_CSI_REC 
*)m_NCS_DBLIST_FIND_FIRST(>csi_list),
 rank = curr_csi->rank;
- (curr_csi != NULL) && ((curr_csi->rank == 
rank) || (curr_csi->si->single_csi_add_rem_in_si == AVSV_SUSI_ACT_ASGN));
+ (curr_csi != nullptr) && ((curr_csi->rank == 
rank) || (curr_csi->si->single_csi_add_rem_in_si == AVSV_SUSI_ACT_ASGN));
  curr_csi = (AVND_COMP_CSI_REC 
*)m_NCS_DBLIST_FIND_NEXT(_csi->si_dll_node)) {
 
if (AVND_COMP_CSI_ASSIGN_STATE_ASSIGNED != 
curr_csi->curr_assign_state) {
if (false == 
curr_csi->comp->assigned_flag) {
/* Dont assign, if already 
assignd */
if 
(AVND_SU_SI_ASSIGN_STATE_ASSIGNED != curr_csi->si->curr_assign_state) {
-   rc = 
avnd_comp_csi_assign(avnd_cb, curr_csi->comp, (single_csi) ? curr_csi : NULL);
+   rc = 
avnd_comp_csi_assign(avnd_cb, curr_csi->comp, (single_csi) ? curr_csi : 
nullptr);
if (NCSCC_RC_SUCCESS != 
rc)
goto done;
}
@@ -511,14 +511,14 @@ static uint32_t assign_si_to_su(AVND_SU_
if (single_csi) {
for (curr_csi = (AVND_COMP_CSI_REC 
*)m_NCS_DBLIST_FIND_LAST(>csi_list),
rank = curr_csi->rank;
-   (curr_csi != NULL) && ((curr_csi->rank 
== rank) || (curr_csi->si->single_csi_add_rem_in_si == AVSV_SUSI_ACT_ASGN));
+   (curr_csi != nullptr) && 
((curr_csi->rank == rank) || (curr_csi->si->single_csi_add_rem_in_si == 

[devel] [PATCH 17 of 30] amfnd: convert NULL to nullptr for main.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/main.cc |  8 
 1 files changed, 4 insertions(+), 4 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/main.cc 
b/osaf/services/saf/amf/amfnd/main.cc
--- a/osaf/services/saf/amf/amfnd/main.cc
+++ b/osaf/services/saf/amf/amfnd/main.cc
@@ -315,8 +315,8 @@ AVND_CB *avnd_cb_create()
cb->hb_duration_tmr.type = AVND_TMR_HB_DURATION;
cb->hb_duration = AVSV_DEF_HB_DURATION;
 
-   if ((val = getenv("AVSV_HB_DURATION")) != NULL) {
-   cb->hb_duration = strtoll(val, NULL, 0);
+   if ((val = getenv("AVSV_HB_DURATION")) != nullptr) {
+   cb->hb_duration = strtoll(val, nullptr, 0);
if (cb->hb_duration == 0) {
/* no value or non convertable value, revert to default 
*/
cb->hb_duration = AVSV_DEF_HB_DURATION;
@@ -500,7 +500,7 @@ void avnd_sigterm_handler(void)
uint32_t rc = NCSCC_RC_SUCCESS;
 
/* create the evt with evt type indicating last step of termination */
-   evt = avnd_evt_create(avnd_cb, AVND_EVT_LAST_STEP_TERM, NULL, NULL, 
NULL, 0, 0);
+   evt = avnd_evt_create(avnd_cb, AVND_EVT_LAST_STEP_TERM, nullptr, 
nullptr, nullptr, 0, 0);
if (!evt) {
LOG_ER("SIG term event create failed");
rc = NCSCC_RC_FAILURE;
@@ -600,7 +600,7 @@ void avnd_main_process(void)
}
 
if (fds[FD_MBX].revents & POLLIN) {
-   while (NULL != (evt = (AVND_EVT 
*)ncs_ipc_non_blk_recv(_cb->mbx)))
+   while (nullptr != (evt = (AVND_EVT 
*)ncs_ipc_non_blk_recv(_cb->mbx)))
avnd_evt_process(evt);
}
 

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 25 of 30] amfnd: convert NULL to nullptr for su.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/su.cc |  28 ++--
 1 files changed, 14 insertions(+), 14 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/su.cc 
b/osaf/services/saf/amf/amfnd/su.cc
--- a/osaf/services/saf/amf/amfnd/su.cc
+++ b/osaf/services/saf/amf/amfnd/su.cc
@@ -54,7 +54,7 @@ static bool get_su_failover(const SaName
SaImmAttrNameT attributeNames[] = {
const_cast("saAmfSUFailover"),
const_cast("saAmfSUType"),
-   NULL
+   nullptr
};
 
TRACE_ENTER2("'%s'", name->value);
@@ -62,7 +62,7 @@ static bool get_su_failover(const SaName
// TODO remove, just for test
LOG_NO("get_su_failover '%s'", name->value);
 
-   immutil_saImmOmInitialize(, NULL, );
+   immutil_saImmOmInitialize(, nullptr, );
immutil_saImmOmAccessorInitialize(immOmHandle, );
 
/* Use an attribute name list to avoid reading runtime attributes which
@@ -80,8 +80,8 @@ static bool get_su_failover(const SaName
attributes, 0, ) == SA_AIS_OK) {
 
attributeNames[0] = 
const_cast("saAmfSutDefSUFailover");
-   attributeNames[1] = NULL;
-   if (immutil_saImmOmAccessorGet_2(accessorHandle, 
, NULL,
+   attributeNames[1] = nullptr;
+   if (immutil_saImmOmAccessorGet_2(accessorHandle, 
, nullptr,
(SaImmAttrValuesT_2 ***)) == 
SA_AIS_OK) {

immutil_getAttr(const_cast("saAmfSutDefSUFailover"),
attributes, 0, );
@@ -144,7 +144,7 @@ uint32_t avnd_evt_avd_reg_su_evh(AVND_CB
   1. for adding new SU in the data base
   2. for adding a new component in the existing su.
   So, check whether the SU exists or not. */
-   if (su == NULL)
+   if (su == nullptr)
su = avnd_sudb_rec_add(cb, su_info, );
 
m_AVND_SEND_CKPT_UPDT_ASYNC_ADD(cb, su, AVND_CKPT_SU_CONFIG);
@@ -212,7 +212,7 @@ static uint32_t avnd_avd_su_update_on_fo
 
/* scan the su list & add each su to su-db */
for (su_info = info->su_list; su_info; su = 0, su_info = su_info->next) 
{
-   if (NULL == (su = m_AVND_SUDB_REC_GET(cb->sudb, 
su_info->name))) {
+   if (nullptr == (su = m_AVND_SUDB_REC_GET(cb->sudb, 
su_info->name))) {
/* SU is not present so add it */
su = avnd_sudb_rec_add(cb, su_info, );
if (!su) {
@@ -243,7 +243,7 @@ static uint32_t avnd_avd_su_update_on_fo
 * updates are not received in the message.
 */
memset(_name, 0, sizeof(SaNameT));
-   while (NULL != (su = (AVND_SU *)ncs_patricia_tree_getnext(>sudb, 
(uint8_t *)_name))) {
+   while (nullptr != (su = (AVND_SU *)ncs_patricia_tree_getnext(>sudb, 
(uint8_t *)_name))) {
su_name = su->name;
 
if (false == su->avd_updt_flag) {
@@ -319,7 +319,7 @@ static uint32_t get_sirank(const SaNameT
SaAisErrorT error;
SaImmAccessorHandleT accessorHandle;
const SaImmAttrValuesT_2 **attributes;
-   SaImmAttrNameT attributeNames[2] = 
{const_cast("saAmfSIRank"), NULL};
+   SaImmAttrNameT attributeNames[2] = 
{const_cast("saAmfSIRank"), nullptr};
SaImmHandleT immOmHandle;
SaVersionT immVersion = {'A', 2, 1};
uint32_t rank = -1; // lowest possible rank if uninitialized
@@ -327,7 +327,7 @@ static uint32_t get_sirank(const SaNameT
// TODO remove, just for test
LOG_NO("get_sirank %s", dn->value);
 
-   immutil_saImmOmInitialize(, NULL, );
+   immutil_saImmOmInitialize(, nullptr, );
immutil_saImmOmAccessorInitialize(immOmHandle, );
 
osafassert((error = immutil_saImmOmAccessorGet_2(accessorHandle, dn,
@@ -403,7 +403,7 @@ uint32_t avnd_evt_avd_info_su_si_assign_
 
/* indicate that capability is invalid for later use 
when
 * creating CSI_REC */
-   for (csi = info->list; csi != NULL; csi = csi->next) {
+   for (csi = info->list; csi != nullptr; csi = csi->next) 
{
csi->capability = (SaAmfCompCapabilityModelT) 
~0;
}
 
@@ -412,11 +412,11 @@ uint32_t avnd_evt_avd_info_su_si_assign_
}
} else {
if (info->si_name.length > 0) {
-   if (avnd_su_si_rec_get(cb, >su_name, 
>si_name) == NULL)
+   if (avnd_su_si_rec_get(cb, >su_name, 
>si_name) == nullptr)
LOG_ER("susi_assign_evh: '%s' is not assigned 
to '%s'",
info->si_name.value, 
su->name.value);
} else {
-   if 

[devel] [PATCH 04 of 30] amfnd: convert NULL to nullptr for ckpt_dec.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/ckpt_dec.cc |  396 
 1 files changed, 198 insertions(+), 198 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/ckpt_dec.cc 
b/osaf/services/saf/amf/amfnd/ckpt_dec.cc
--- a/osaf/services/saf/amf/amfnd/ckpt_dec.cc
+++ b/osaf/services/saf/amf/amfnd/ckpt_dec.cc
@@ -334,7 +334,7 @@ static uint32_t avnd_decode_cold_sync_rs
uint32_t status = NCSCC_RC_SUCCESS;
uint32_t count = 0;
EDU_ERR ederror = static_cast(0);
-   AVND_SU *su_ptr = NULL;
+   AVND_SU *su_ptr = nullptr;
AVND_SU dec_su;
 
 
@@ -427,7 +427,7 @@ static uint32_t avnd_decode_cold_sync_rs
EDU_ERR ederror = static_cast(0);
AVND_SU_SIQ_REC *su_siq_ckpt;
AVND_SU_SIQ_REC dec_su_siq_ckpt;
-   AVND_SU_SI_PARAM *su_si_param_ptr = NULL;
+   AVND_SU_SI_PARAM *su_si_param_ptr = nullptr;
 
su_si_param_ptr = &(dec_su_siq_ckpt.info);
su_siq_ckpt = _su_siq_ckpt;
@@ -1098,7 +1098,7 @@ static uint32_t avnd_decode_ckpt_siq_rec
uint32_t status = NCSCC_RC_SUCCESS;
AVND_SU_SIQ_REC *siq_ptr;
AVND_SU_SIQ_REC dec_siq;
-   AVND_SU_SI_PARAM *su_si_param_ptr = NULL;
+   AVND_SU_SI_PARAM *su_si_param_ptr = nullptr;
EDU_ERR ederror = static_cast(0);
 
 
@@ -1358,9 +1358,9 @@ static uint32_t avnd_decode_ckpt_hc_peri
 {
uint32_t status = NCSCC_RC_SUCCESS;
EDU_ERR ederror = static_cast(0);
-   AVND_HC *hc_ptr = NULL;
+   AVND_HC *hc_ptr = nullptr;
AVND_HC dec_hc;
-   AVND_HC *hc_rec = NULL;
+   AVND_HC *hc_rec = nullptr;
 
 
hc_ptr = _hc;
@@ -1378,7 +1378,7 @@ static uint32_t avnd_decode_ckpt_hc_peri
}
 
hc_rec = avnd_hcdb_rec_get(cb, _ptr->key);
-   if (NULL == hc_rec) {
+   if (nullptr == hc_rec) {
return NCSCC_RC_FAILURE;
}
 
@@ -1408,9 +1408,9 @@ static uint32_t avnd_decode_ckpt_hc_max_
 {
uint32_t status = NCSCC_RC_SUCCESS;
EDU_ERR ederror = static_cast(0);
-   AVND_HC *hc_ptr = NULL;
+   AVND_HC *hc_ptr = nullptr;
AVND_HC dec_hc;
-   AVND_HC *hc_rec = NULL;
+   AVND_HC *hc_rec = nullptr;
 
 
hc_ptr = _hc;
@@ -1428,7 +1428,7 @@ static uint32_t avnd_decode_ckpt_hc_max_
}
 
hc_rec = avnd_hcdb_rec_get(cb, _ptr->key);
-   if (NULL == hc_rec) {
+   if (nullptr == hc_rec) {
return NCSCC_RC_FAILURE;
}
 
@@ -1458,9 +1458,9 @@ static uint32_t avnd_decode_ckpt_su_flag
 {
uint32_t status = NCSCC_RC_SUCCESS;
EDU_ERR ederror = static_cast(0);
-   AVND_SU *su_dec_ptr = NULL;
+   AVND_SU *su_dec_ptr = nullptr;
AVND_SU dec_su;
-   AVND_SU *su_rec = NULL;
+   AVND_SU *su_rec = nullptr;
 
 
su_dec_ptr = _su;
@@ -1478,7 +1478,7 @@ static uint32_t avnd_decode_ckpt_su_flag
}
 
su_rec = m_AVND_SUDB_REC_GET(cb->sudb, su_dec_ptr->name);
-   if (NULL == su_rec) {
+   if (nullptr == su_rec) {
return NCSCC_RC_FAILURE;
}
 
@@ -1508,9 +1508,9 @@ static uint32_t avnd_decode_ckpt_su_err_
 {
uint32_t status = NCSCC_RC_SUCCESS;
EDU_ERR ederror = static_cast(0);
-   AVND_SU *su_dec_ptr = NULL;
+   AVND_SU *su_dec_ptr = nullptr;
AVND_SU dec_su;
-   AVND_SU *su_rec = NULL;
+   AVND_SU *su_rec = nullptr;
 
 
su_dec_ptr = _su;
@@ -1528,7 +1528,7 @@ static uint32_t avnd_decode_ckpt_su_err_
}
 
su_rec = m_AVND_SUDB_REC_GET(cb->sudb, su_dec_ptr->name);
-   if (NULL == su_rec) {
+   if (nullptr == su_rec) {
return NCSCC_RC_FAILURE;
}
 
@@ -1558,9 +1558,9 @@ static uint32_t avnd_decode_ckpt_su_comp
 {
uint32_t status = NCSCC_RC_SUCCESS;
EDU_ERR ederror = static_cast(0);
-   AVND_SU *su_dec_ptr = NULL;
+   AVND_SU *su_dec_ptr = nullptr;
AVND_SU dec_su;
-   AVND_SU *su_rec = NULL;
+   AVND_SU *su_rec = nullptr;
 
 
su_dec_ptr = _su;
@@ -1578,7 +1578,7 @@ static uint32_t avnd_decode_ckpt_su_comp
}
 
su_rec = m_AVND_SUDB_REC_GET(cb->sudb, su_dec_ptr->name);
-   if (NULL == su_rec) {
+   if (nullptr == su_rec) {
return NCSCC_RC_FAILURE;
}
 
@@ -1608,9 +1608,9 @@ static uint32_t avnd_decode_ckpt_su_comp
 {
uint32_t status = NCSCC_RC_SUCCESS;
EDU_ERR ederror = static_cast(0);
-   AVND_SU *su_dec_ptr = NULL;
+   AVND_SU *su_dec_ptr = nullptr;
AVND_SU dec_su;
-   AVND_SU *su_rec = NULL;
+   AVND_SU *su_rec = nullptr;
 
 
su_dec_ptr = _su;
@@ -1628,7 +1628,7 @@ static uint32_t avnd_decode_ckpt_su_comp
}
 
su_rec = m_AVND_SUDB_REC_GET(cb->sudb, su_dec_ptr->name);
-   if (NULL == su_rec) {
+   if (nullptr == su_rec) {
return NCSCC_RC_FAILURE;
}
 
@@ -1658,9 +1658,9 @@ static uint32_t avnd_decode_ckpt_su_rest
 {
uint32_t status = NCSCC_RC_SUCCESS;
EDU_ERR 

[devel] [PATCH 10 of 30] amfnd: convert NULL to nullptr for comp.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/comp.cc |  60 ++--
 1 files changed, 30 insertions(+), 30 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/comp.cc 
b/osaf/services/saf/amf/amfnd/comp.cc
--- a/osaf/services/saf/amf/amfnd/comp.cc
+++ b/osaf/services/saf/amf/amfnd/comp.cc
@@ -133,7 +133,7 @@ uint32_t avnd_evt_ava_finalize_evh(AVND_
if (m_AVND_COMP_TYPE_IS_PROXIED(comp))
rc = avnd_comp_unreg_prc(cb, comp, comp->pxy_comp);
else
-   rc = avnd_comp_unreg_prc(cb, comp, NULL);
+   rc = avnd_comp_unreg_prc(cb, comp, nullptr);
}
/* Now do the same for the normal component */
avnd_comp_hdl_finalize(cb, comp, fin, api_info);
@@ -198,7 +198,7 @@ uint32_t avnd_evt_ava_comp_reg_evh(AVND_
pxy_comp = 
avnd_internode_comp_add(&(cb->internode_avail_comp_db),
   &(reg->proxy_comp_name), 
node_id, ,
   comp->su->su_is_external, 
true);
-   if (NULL != pxy_comp) {
+   if (nullptr != pxy_comp) {
if (SA_AIS_ERR_EXIST == rc) {
/* This means that the proxy component is 
already serving to at 
   least one proxied component, so no need to 
send Ckpt Update 
@@ -208,7 +208,7 @@ uint32_t avnd_evt_ava_comp_reg_evh(AVND_
}
}
 
-   if (NULL == pxy_comp)
+   if (nullptr == pxy_comp)
amf_rc = static_cast(rc);
else {
/* We need to set amf_rc to OK as this has been changed 
to INVLD. See 
@@ -511,7 +511,7 @@ proceed:
 
 proceed_next:
 
-   if (NULL == (*o_comp)) {
+   if (nullptr == (*o_comp)) {
*o_amf_rc = SA_AIS_ERR_INVALID_PARAM;
return;
}
@@ -834,7 +834,7 @@ uint32_t avnd_comp_unreg_prc(AVND_CB *cb
}
 
m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, comp, 
AVND_CKPT_COMP_PROXY_PROXIED_DEL);
-   rc = avnd_comp_proxied_del(cb, comp, comp->pxy_comp, false, 
NULL);
+   rc = avnd_comp_proxied_del(cb, comp, comp->pxy_comp, false, 
nullptr);
 
if (NCSCC_RC_SUCCESS != rc) {
LOG_ER("avnd_comp_proxied_del fail:'%s' Type=%u 
Hdl='%llx' Dest=%" PRId64,
@@ -877,7 +877,7 @@ uint32_t avnd_comp_unreg_prc(AVND_CB *cb
 
/*remove the component from the list of proxied of its proxy */
m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, comp, 
AVND_CKPT_COMP_PROXY_PROXIED_DEL);
-   rc = avnd_comp_proxied_del(cb, comp, pxy_comp, true, NULL);
+   rc = avnd_comp_proxied_del(cb, comp, pxy_comp, true, nullptr);
 
/* process proxied comp unregistration */
if (m_AVND_COMP_PRES_STATE_IS_INSTANTIATED(comp))
@@ -1473,7 +1473,7 @@ static bool all_csis_at_rank_assigned(st
TRACE_ENTER2("'%s'rank=%u", si->name.value, rank);
 
for (csi = (AVND_COMP_CSI_REC*)m_NCS_DBLIST_FIND_FIRST(>csi_list);
-   csi != NULL;
+   csi != nullptr;
csi = 
(AVND_COMP_CSI_REC*)m_NCS_DBLIST_FIND_NEXT(>si_dll_node)) {
 
if ((csi->rank == rank) && (csi->curr_assign_state != 
AVND_COMP_CSI_ASSIGN_STATE_ASSIGNED)) {
@@ -1520,13 +1520,13 @@ static int assign_all_csis_at_rank(struc
TRACE_ENTER2("'%s' rank=%u", si->name.value, rank);
 
for (csi = (AVND_COMP_CSI_REC*)m_NCS_DBLIST_FIND_FIRST(>csi_list);
- csi != NULL;
+ csi != nullptr;
  csi = (AVND_COMP_CSI_REC 
*)m_NCS_DBLIST_FIND_NEXT(>si_dll_node)) {
 
if (csi->rank == rank &&
(csi->si->curr_assign_state != 
AVND_SU_SI_ASSIGN_STATE_ASSIGNED)
&& (csi->si->curr_assign_state != 
AVND_SU_SI_ASSIGN_STATE_REMOVED)) {
-   rc = avnd_comp_csi_assign(avnd_cb, csi->comp, 
(single_csi) ? csi : NULL);
+   rc = avnd_comp_csi_assign(avnd_cb, csi->comp, 
(single_csi) ? csi : nullptr);
if (NCSCC_RC_SUCCESS != rc)
break;
}
@@ -1545,10 +1545,10 @@ static int assign_all_csis_at_rank(struc
  */
 static AVND_COMP_CSI_REC *find_unassigned_csi_at_rank(struct avnd_su_si_rec 
*si, uint32_t rank)
 {
-   AVND_COMP_CSI_REC *csi = NULL;
+   AVND_COMP_CSI_REC *csi = nullptr;
 
for (csi = (AVND_COMP_CSI_REC*)m_NCS_DBLIST_FIND_FIRST(>csi_list);
- csi != NULL;
+ csi != nullptr;
  csi = (AVND_COMP_CSI_REC 
*)m_NCS_DBLIST_FIND_NEXT(>si_dll_node)) {
 
if ((csi->rank == rank) &&  (csi->curr_assign_state == 
AVND_COMP_CSI_ASSIGN_STATE_UNASSIGNED))
@@ -1585,7 

[devel] [PATCH 07 of 30] amfnd: convert NULL to nullptr for ckpt_updt.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/ckpt_updt.cc |  134 +++---
 1 files changed, 67 insertions(+), 67 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/ckpt_updt.cc 
b/osaf/services/saf/amf/amfnd/ckpt_updt.cc
--- a/osaf/services/saf/amf/amfnd/ckpt_updt.cc
+++ b/osaf/services/saf/amf/amfnd/ckpt_updt.cc
@@ -58,7 +58,7 @@ extern AVND_COMP_HC_REC *avnd_comp_hc_re
 uint32_t avnd_ckpt_add_rmv_updt_su_data(AVND_CB *cb, AVND_SU *su, 
NCS_MBCSV_ACT_TYPE action)
 {
uint32_t status = NCSCC_RC_SUCCESS;
-   AVND_SU *su_ptr = NULL;
+   AVND_SU *su_ptr = nullptr;
AVSV_SU_INFO_MSG su_info;
uint32_t rc = NCSCC_RC_SUCCESS;
 
@@ -68,17 +68,17 @@ uint32_t avnd_ckpt_add_rmv_updt_su_data(
switch (action) {
case NCS_MBCSV_ACT_ADD:
{
-   if ((NULL == su_ptr) && (true == su->su_is_external)) {
+   if ((nullptr == su_ptr) && (true == 
su->su_is_external)) {
su_info.name = su->name;
su_info.comp_restart_prob = 
su->comp_restart_prob;
su_info.comp_restart_max = su->comp_restart_max;
su_info.su_restart_prob = su->su_restart_prob;
su_info.su_restart_max = su->su_restart_max;
su_info.su_is_external = su->su_is_external;
-   su_info.next = NULL;
+   su_info.next = nullptr;
su_info.is_ncs = false; /*External component is 
not part of NCS */
su_ptr = avnd_sudb_rec_add(cb, _info, );
-   if (NULL == su_ptr) {
+   if (nullptr == su_ptr) {
return NCSCC_RC_FAILURE;
}
} else {
@@ -88,7 +88,7 @@ uint32_t avnd_ckpt_add_rmv_updt_su_data(
}
case NCS_MBCSV_ACT_UPDATE:
{
-   if ((NULL != su_ptr) && (true == su->su_is_external)) {
+   if ((nullptr != su_ptr) && (true == 
su->su_is_external)) {
/*
 * Update all the data. Except SU name which 
would have got
 * updated with ADD.
@@ -115,7 +115,7 @@ uint32_t avnd_ckpt_add_rmv_updt_su_data(
 
case NCS_MBCSV_ACT_RMV:
{
-   if (NULL != su_ptr) {
+   if (nullptr != su_ptr) {
status = avnd_sudb_rec_del(cb, _ptr->name);
if (NCSCC_RC_SUCCESS != status) {
return NCSCC_RC_FAILURE;
@@ -154,27 +154,27 @@ uint32_t avnd_ckpt_add_rmv_updt_su_data(
 uint32_t avnd_ckpt_add_rmv_updt_su_si_rec(AVND_CB *cb, AVND_SU_SI_REC 
*su_si_ckpt, NCS_MBCSV_ACT_TYPE action)
 {
uint32_t status = NCSCC_RC_SUCCESS;
-   AVND_SU_SI_REC *su_si_rec_ptr = NULL;
+   AVND_SU_SI_REC *su_si_rec_ptr = nullptr;
AVND_SU_SI_PARAM info;
-   AVND_SU *su_ptr = NULL;
+   AVND_SU *su_ptr = nullptr;
uint32_t rc = NCSCC_RC_SUCCESS;
-   AVND_COMP_CSI_REC *csi_rec = NULL;
+   AVND_COMP_CSI_REC *csi_rec = nullptr;
 
su_si_rec_ptr = avnd_su_si_rec_get(cb, _si_ckpt->su_name, 
_si_ckpt->name);
 
switch (action) {
case NCS_MBCSV_ACT_ADD:
{
-   if (NULL == su_si_rec_ptr) {
+   if (nullptr == su_si_rec_ptr) {
memset(, 0, sizeof(AVND_SU_SI_PARAM));
info.su_name = su_si_ckpt->su_name;
info.si_name = su_si_ckpt->name;
su_ptr = m_AVND_SUDB_REC_GET(cb->sudb, 
su_si_ckpt->su_name);
-   if (NULL == su_ptr) {
+   if (nullptr == su_ptr) {
return NCSCC_RC_FAILURE;
}
su_si_rec_ptr = avnd_su_si_rec_add(cb, su_ptr, 
, );
-   if (NULL == su_si_rec_ptr) {
+   if (nullptr == su_si_rec_ptr) {
return NCSCC_RC_FAILURE;
}
} else {
@@ -188,7 +188,7 @@ uint32_t avnd_ckpt_add_rmv_updt_su_si_re
 
case NCS_MBCSV_ACT_UPDATE:
{
-   if (NULL != su_si_rec_ptr) {
+   if (nullptr != su_si_rec_ptr) {
su_si_rec_ptr->curr_state = 
su_si_ckpt->curr_state;
su_si_rec_ptr->prv_state = 
su_si_ckpt->prv_state;
su_si_rec_ptr->curr_assign_state = 

[devel] [PATCH 23 of 30] amfnd: convert NULL to nullptr for proxydb.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/proxydb.cc |  20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/proxydb.cc 
b/osaf/services/saf/amf/amfnd/proxydb.cc
--- a/osaf/services/saf/amf/amfnd/proxydb.cc
+++ b/osaf/services/saf/amf/amfnd/proxydb.cc
@@ -40,14 +40,14 @@
 **/
 uint32_t avnd_nodeid_mdsdest_rec_add(AVND_CB *cb, MDS_DEST mds_dest)
 {
-   AVND_NODEID_TO_MDSDEST_MAP *rec = NULL;
+   AVND_NODEID_TO_MDSDEST_MAP *rec = nullptr;
NODE_ID node_id = 0;
uint32_t res = NCSCC_RC_SUCCESS;
 
node_id = m_NCS_NODE_ID_FROM_MDS_DEST(mds_dest);
 
rec = (AVND_NODEID_TO_MDSDEST_MAP 
*)ncs_patricia_tree_get(>nodeid_mdsdest_db, (uint8_t *)&(node_id));
-   if (rec != NULL) {
+   if (rec != nullptr) {
LOG_ER("nodeid_mdsdest rec already exists, Rec Add Failed: 
MdsDest:%" PRId64 ", NodeId:%u",
mds_dest, node_id);
return NCSCC_RC_FAILURE;
@@ -68,7 +68,7 @@ uint32_t avnd_nodeid_mdsdest_rec_add(AVN
return res;
}
 
-   }   /* Else of if(rec != NULL)  */
+   }   /* Else of if(rec != nullptr)  */
 
return res;
 
@@ -89,14 +89,14 @@ uint32_t avnd_nodeid_mdsdest_rec_add(AVN
 **/
 uint32_t avnd_nodeid_mdsdest_rec_del(AVND_CB *cb, MDS_DEST mds_dest)
 {
-   AVND_NODEID_TO_MDSDEST_MAP *rec = NULL;
+   AVND_NODEID_TO_MDSDEST_MAP *rec = nullptr;
NODE_ID node_id = 0;
uint32_t res = NCSCC_RC_SUCCESS;
 
node_id = m_NCS_NODE_ID_FROM_MDS_DEST(mds_dest);
 
rec = (AVND_NODEID_TO_MDSDEST_MAP 
*)ncs_patricia_tree_get(>nodeid_mdsdest_db, (uint8_t *)&(node_id));
-   if (rec == NULL) {
+   if (rec == nullptr) {
LOG_ER("nodeid_mdsdest rec doesn't exist, Rec del failed: 
MdsDest:%" PRId64 " NodeId:%u",
mds_dest, node_id);
return NCSCC_RC_FAILURE;
@@ -109,7 +109,7 @@ uint32_t avnd_nodeid_mdsdest_rec_del(AVN
return res;
}
 
-   }   /* Else of if(rec == NULL) */
+   }   /* Else of if(rec == nullptr) */
 
delete rec;
 
@@ -130,10 +130,10 @@ uint32_t avnd_nodeid_mdsdest_rec_del(AVN
 **/
 MDS_DEST avnd_get_mds_dest_from_nodeid(AVND_CB *cb, NODE_ID node_id)
 {
-   AVND_NODEID_TO_MDSDEST_MAP *rec = NULL;
+   AVND_NODEID_TO_MDSDEST_MAP *rec = nullptr;
 
rec = (AVND_NODEID_TO_MDSDEST_MAP 
*)ncs_patricia_tree_get(>nodeid_mdsdest_db, (uint8_t *)&(node_id));
-   if (rec == NULL) {
+   if (rec == nullptr) {
LOG_ER("nodeid_mdsdest rec doesn't exist, Rec get failed: 
NodeId:%u",node_id);
return 0;
}
@@ -224,7 +224,7 @@ AVND_COMP *avnd_internode_comp_add(NCS_P
*rc = SA_AIS_OK;
 
/* verify if this component is already present in the db */
-   if (NULL != (comp = m_AVND_COMPDB_REC_GET(*ptree, *name))) {
+   if (nullptr != (comp = m_AVND_COMPDB_REC_GET(*ptree, *name))) {
/* This is a proxy and already proxying at least one component. 
   So, no problem. */
*rc = SA_AIS_ERR_EXIST;
@@ -305,7 +305,7 @@ uint32_t avnd_internode_comp_del(AVND_CB
 {
AVND_COMP *comp = 0;
uint32_t rc = NCSCC_RC_SUCCESS;
-   AVND_COMP_CBK *cbk_rec = NULL, *temp_cbk_ptr = NULL;
+   AVND_COMP_CBK *cbk_rec = nullptr, *temp_cbk_ptr = nullptr;
 
/* get the comp */
comp = m_AVND_COMPDB_REC_GET(*ptree, *name);

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 24 of 30] amfnd: convert NULL to nullptr for sidb.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/sidb.cc |  32 
 1 files changed, 16 insertions(+), 16 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/sidb.cc 
b/osaf/services/saf/amf/amfnd/sidb.cc
--- a/osaf/services/saf/amf/amfnd/sidb.cc
+++ b/osaf/services/saf/amf/amfnd/sidb.cc
@@ -81,15 +81,15 @@ AVND_SU_SI_REC *avnd_silist_getfirst(voi
 {
NCS_DB_LINK_LIST_NODE *p = m_NCS_DBLIST_FIND_FIRST(_cb->si_list);
 
-   if (p != NULL)
-   return (AVND_SU_SI_REC *) ((char*)p - ((char*) 
&((AVND_SU_SI_REC *)NULL)->cb_dll_node));
+   if (p != nullptr)
+   return (AVND_SU_SI_REC *) ((char*)p - ((char*) 
&((AVND_SU_SI_REC *)nullptr)->cb_dll_node));
else
-   return NULL;
+   return nullptr;
 }
 
 /**
  * Get next SI from SI list
- * @param si if NULL first SI is returned
+ * @param si if nullptr first SI is returned
  * 
  * @return AVND_SU_SI_REC*
  */
@@ -98,10 +98,10 @@ AVND_SU_SI_REC *avnd_silist_getnext(cons
if (si) {
NCS_DB_LINK_LIST_NODE *p = 
m_NCS_DBLIST_FIND_NEXT(>cb_dll_node);
 
-   if (p != NULL)
-   return (AVND_SU_SI_REC *) ((char*)p - ((char*) 
&((AVND_SU_SI_REC *)NULL)->cb_dll_node));
+   if (p != nullptr)
+   return (AVND_SU_SI_REC *) ((char*)p - ((char*) 
&((AVND_SU_SI_REC *)nullptr)->cb_dll_node));
else
-   return NULL;
+   return nullptr;
}
else
return avnd_silist_getfirst();
@@ -117,10 +117,10 @@ AVND_SU_SI_REC *avnd_silist_getprev(cons
 {
NCS_DB_LINK_LIST_NODE *p = m_NCS_DBLIST_FIND_PREV(>cb_dll_node);
 
-   if (p != NULL)
-   return (AVND_SU_SI_REC *) ((char*)p - ((char*) 
&((AVND_SU_SI_REC *)NULL)->cb_dll_node));
+   if (p != nullptr)
+   return (AVND_SU_SI_REC *) ((char*)p - ((char*) 
&((AVND_SU_SI_REC *)nullptr)->cb_dll_node));
else
-   return NULL;
+   return nullptr;
 }
 
 /**
@@ -133,10 +133,10 @@ AVND_SU_SI_REC *avnd_silist_getlast(void
 {
NCS_DB_LINK_LIST_NODE *p = m_NCS_DBLIST_FIND_LAST(_cb->si_list);
 
-   if (p != NULL)
-   return (AVND_SU_SI_REC *) ((char*)p - ((char*) 
&((AVND_SU_SI_REC *)NULL)->cb_dll_node));
+   if (p != nullptr)
+   return (AVND_SU_SI_REC *) ((char*)p - ((char*) 
&((AVND_SU_SI_REC *)nullptr)->cb_dll_node));
else
-   return NULL;
+   return nullptr;
 }
 
 /
@@ -249,7 +249,7 @@ static void get_cstype(SaImmHandleT immO
SaAisErrorT error;
const SaImmAttrValuesT_2 **attributes;
SaImmAttrNameT attributeNames[2] =
-   {const_cast("saAmfCSType"), NULL};
+   {const_cast("saAmfCSType"), nullptr};
 
// TODO remove, just for test
LOG_NO("get_cstype: csi = '%s'", csi_name->value);
@@ -274,7 +274,7 @@ static SaAmfCompCapabilityModelT get_com
const SaImmAttrValuesT_2 **attributes;
SaAmfCompCapabilityModelT comp_cap;
SaImmAttrNameT attributeNames[2] =
-   {const_cast("saAmfCtCompCapability"), NULL};
+   {const_cast("saAmfCtCompCapability"), nullptr};
SaImmHandleT immOmHandle = 0;
SaVersionT immVersion = { 'A', 2, 1 };
SaNameT cs_type;
@@ -284,7 +284,7 @@ static SaAmfCompCapabilityModelT get_com
 
TRACE_ENTER2("comptype = '%s' : csi = '%s'", comp_type->value, 
csi_name->value);
 
-   immutil_saImmOmInitialize(, NULL, );
+   immutil_saImmOmInitialize(, nullptr, );
immutil_saImmOmAccessorInitialize(immOmHandle, );
 
get_cstype(immOmHandle, accessorHandle, csi_name, _type);

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 16 of 30] amfnd: convert NULL to nullptr for hcdb.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/hcdb.cc |  28 ++--
 1 files changed, 14 insertions(+), 14 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/hcdb.cc 
b/osaf/services/saf/amf/amfnd/hcdb.cc
--- a/osaf/services/saf/amf/amfnd/hcdb.cc
+++ b/osaf/services/saf/amf/amfnd/hcdb.cc
@@ -191,7 +191,7 @@ uint32_t avnd_hcdb_rec_del(AVND_CB *cb, 
 static AVND_HC *hc_create(AVND_CB *cb, SaNameT *dn, const SaImmAttrValuesT_2 
**attributes)
 {
int rc = -1;
-   AVND_HC *hc = NULL;
+   AVND_HC *hc = nullptr;
   
hc = new AVND_HC();
 
@@ -214,7 +214,7 @@ static AVND_HC *hc_create(AVND_CB *cb, S
  done:
if (rc != NCSCC_RC_SUCCESS) {
delete hc;
-   hc = NULL;
+   hc = nullptr;
}
 
return hc;
@@ -233,7 +233,7 @@ SaAisErrorT avnd_hc_config_get(AVND_COMP
SaImmHandleT immOmHandle;
SaVersionT immVersion = { 'A', 2, 1 };
 
-   immutil_saImmOmInitialize(, NULL, );
+   immutil_saImmOmInitialize(, nullptr, );
 
avnd_hctype_config_get(immOmHandle, >saAmfCompType);
 
@@ -243,7 +243,7 @@ SaAisErrorT avnd_hc_config_get(AVND_COMP
 
error = immutil_saImmOmSearchInitialize_2(immOmHandle, _dn,
SA_IMM_SUBTREE, SA_IMM_SEARCH_ONE_ATTR | 
SA_IMM_SEARCH_GET_ALL_ATTR,
-   , NULL, );
+   , nullptr, );
 
if (SA_AIS_OK != error) {
LOG_ER("saImmOmSearchInitialize_2 failed: %u", error);
@@ -254,7 +254,7 @@ SaAisErrorT avnd_hc_config_get(AVND_COMP
 
TRACE_1("'%s'", hc_name.value);
 
-   if (hc_create(avnd_cb, _name, attributes) == NULL)
+   if (hc_create(avnd_cb, _name, attributes) == nullptr)
goto done2;
}
 
@@ -293,7 +293,7 @@ static AVND_HCTYPE *hctype_create(AVND_C
  done:
if (rc != NCSCC_RC_SUCCESS) {
delete hc;
-   hc = NULL;
+   hc = nullptr;
}
 
return hc;
@@ -316,7 +316,7 @@ SaAisErrorT avnd_hctype_config_get(SaImm
 
error = immutil_saImmOmSearchInitialize_2(immOmHandle, comptype_dn,
SA_IMM_SUBTREE, SA_IMM_SEARCH_ONE_ATTR | 
SA_IMM_SEARCH_GET_ALL_ATTR,
-   , NULL, );
+   , nullptr, );
 
if (SA_AIS_OK != error) {
LOG_ER("saImmOmSearchInitialize_2 failed: %u", error);
@@ -327,10 +327,10 @@ SaAisErrorT avnd_hctype_config_get(SaImm
 
TRACE_1("'%s'", hc_name.value);
//A record may get created in the context of some other 
component of same comptype.
-   AVND_HCTYPE *hctype = NULL;
+   AVND_HCTYPE *hctype = nullptr;
if ((hctype = (AVND_HCTYPE *)ncs_patricia_tree_get(,
-   (uint8_t *)_name)) == NULL) {
-   if (hctype_create(avnd_cb, _name, attributes) == 
NULL)
+   (uint8_t *)_name)) == 
nullptr) {
+   if (hctype_create(avnd_cb, _name, attributes) == 
nullptr)
goto done2;
}
else 
@@ -403,14 +403,14 @@ static void comp_hctype_update_compdb(AV
memcpy(hlt_chk.name.key, hlt_chk_key.c_str(), 
hlt_chk_key.size());
hlt_chk.name.keyLen = hlt_chk.key_len;
TRACE("comp_name %s key %s keyLen %u", 
hlt_chk.comp_name.value, hlt_chk.name.key, hlt_chk.name.keyLen);
-   if (avnd_hcdb_rec_get(cb, _chk) == NULL) {
+   if (avnd_hcdb_rec_get(cb, _chk) == nullptr) {
TRACE("comp uses healthcheckType rec");
// 4. found a component that uses the 
healthcheckType record, update the comp_hc_rec
memset(_hc_rec, '\0', 
sizeof(AVND_COMP_HC_REC));
tmp_hc_rec.key = hlt_chk.name;
tmp_hc_rec.req_hdl = comp->reg_hdl;
TRACE("tmp_hc_rec: key %s req_hdl %llu", 
tmp_hc_rec.key.key, tmp_hc_rec.req_hdl);
-   if ((comp_hc_rec = 
m_AVND_COMPDB_REC_HC_GET(*comp, tmp_hc_rec)) != NULL) {
+   if ((comp_hc_rec = 
m_AVND_COMPDB_REC_HC_GET(*comp, tmp_hc_rec)) != nullptr) {
TRACE("comp_hc_rec: period %llu max_dur 
%llu", comp_hc_rec->period, comp_hc_rec->max_dur);
switch (param->attr_id) {
case saAmfHctDefPeriod_ID:
@@ -466,7 +466,7 @@ uint32_t avnd_hc_oper_req(AVND_CB *cb, A
}
 
case AVSV_OBJ_OPR_DEL: {
-   if (hc != NULL) {
+   if (hc != nullptr) {
rc = ncs_patricia_tree_del(>hcdb, >tree_node);
osafassert(rc == NCSCC_RC_SUCCESS);
LOG_IN("Deleted 

[devel] [PATCH 28 of 30] amfnd: convert NULL to nullptr for util.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/util.cc |  24 
 1 files changed, 12 insertions(+), 12 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/util.cc 
b/osaf/services/saf/amf/amfnd/util.cc
--- a/osaf/services/saf/amf/amfnd/util.cc
+++ b/osaf/services/saf/amf/amfnd/util.cc
@@ -175,7 +175,7 @@ void avnd_msgid_assert(uint32_t rcv_msg_
char reason[128];
snprintf(reason, sizeof(reason), "Message ID mismatch, rec %u, 
expected %u",
 rcv_msg_id, expected_msg_id);
-   opensaf_reboot(0, NULL, reason);
+   opensaf_reboot(0, nullptr, reason);
abort();
}
 }
@@ -267,7 +267,7 @@ static void free_d2n_su_msg_info(AVSV_DN
 {
AVSV_SU_INFO_MSG *su_info;
 
-   while (su_msg->msg_info.d2n_reg_su.su_list != NULL) {
+   while (su_msg->msg_info.d2n_reg_su.su_list != nullptr) {
su_info = su_msg->msg_info.d2n_reg_su.su_list;
su_msg->msg_info.d2n_reg_su.su_list = su_info->next;
delete su_info;
@@ -294,14 +294,14 @@ static void free_d2n_susi_msg_info(AVSV_
 {
AVSV_SUSI_ASGN *compcsi_info;
 
-   while (susi_msg->msg_info.d2n_su_si_assign.list != NULL) {
+   while (susi_msg->msg_info.d2n_su_si_assign.list != nullptr) {
compcsi_info = susi_msg->msg_info.d2n_su_si_assign.list;
susi_msg->msg_info.d2n_su_si_assign.list = compcsi_info->next;
-   if (compcsi_info->attrs.list != NULL) {
+   if (compcsi_info->attrs.list != nullptr) {
// AVSV_ATTR_NAME_VAL variables
// are malloc'ed, use free()
free(compcsi_info->attrs.list);
-   compcsi_info->attrs.list = NULL;
+   compcsi_info->attrs.list = nullptr;
}
delete compcsi_info;
}
@@ -349,7 +349,7 @@ static void free_d2n_pg_msg_info(AVSV_DN
 **/
 void dnd_msg_free(AVSV_DND_MSG *msg)
 {
-   if (msg == NULL)
+   if (msg == nullptr)
return;
 
/* these messages have information list in them free them
@@ -451,7 +451,7 @@ void amf_csi_attr_list_copy(SaAmfCSIAttr
 {
uint32_t cnt;
 
-   if (dattr == NULL || sattr == NULL)
+   if (dattr == nullptr || sattr == nullptr)
goto done;
 
dattr->attr = new SaAmfCSIAttributeT[sattr->number];
@@ -493,7 +493,7 @@ void amf_csi_attr_list_free(SaAmfCSIAttr
 {
uint32_t cnt;
 
-   if (attrs == NULL)
+   if (attrs == nullptr)
return;
 
/* free the attr name-val pair */
@@ -524,7 +524,7 @@ uint32_t amf_cbk_copy(AVSV_AMF_CBK_INFO 
 {
uint32_t rc = NCSCC_RC_SUCCESS;
 
-   if (o_dcbk == NULL || scbk == NULL)
+   if (o_dcbk == nullptr || scbk == nullptr)
return NCSCC_RC_FAILURE;
 
/* allocate the dest cbk-info */
@@ -567,7 +567,7 @@ uint32_t amf_cbk_copy(AVSV_AMF_CBK_INFO 
if (scbk->param.csi_set.attrs.number > 0) {
(*o_dcbk)->param.csi_set.attrs.list = 
static_cast
(calloc(scbk->param.csi_set.attrs.number, 
sizeof(AVSV_ATTR_NAME_VAL)));
-   osafassert((*o_dcbk)->param.csi_set.attrs.list != NULL);
+   osafassert((*o_dcbk)->param.csi_set.attrs.list != 
nullptr);
 
for (uint32_t i = 0; i < 
scbk->param.csi_set.attrs.number; ++i) {
(*o_dcbk)->param.csi_set.attrs.list[i] =
@@ -603,7 +603,7 @@ uint32_t amf_cbk_copy(AVSV_AMF_CBK_INFO 
 **/
 void amf_cbk_free(AVSV_AMF_CBK_INFO *cbk_info)
 {
-   if (cbk_info == NULL)
+   if (cbk_info == nullptr)
return;
 
switch (cbk_info->type) {
@@ -666,4 +666,4 @@ void nd2nd_avnd_msg_free(AVSV_ND2ND_AVND
delete msg;
 
return;
-}
\ No newline at end of file
+}

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 18 of 30] amfnd: convert NULL to nullptr for mbcsv.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/mbcsv.cc |  28 ++--
 1 files changed, 14 insertions(+), 14 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/mbcsv.cc 
b/osaf/services/saf/amf/amfnd/mbcsv.cc
--- a/osaf/services/saf/amf/amfnd/mbcsv.cc
+++ b/osaf/services/saf/amf/amfnd/mbcsv.cc
@@ -166,7 +166,7 @@ static uint32_t avnd_mbcsv_cb(NCS_MBCSV_
 
TRACE_ENTER();
 
-   if (NULL == arg) {
+   if (nullptr == arg) {
LOG_ER("avnd_mbcsv_cb: arg is NULL");
return NCSCC_RC_FAILURE;
}
@@ -1054,7 +1054,7 @@ uint32_t avnd_dequeue_async_update_msgs(
 * This is a FIFO queue. Remove first message first entered in the 
 * queue and then process it.
 */
-   while (NULL != (updt_msg = cb->async_updt_msgs.async_updt_queue)) {
+   while (nullptr != (updt_msg = cb->async_updt_msgs.async_updt_queue)) {
cb->async_updt_msgs.async_updt_queue = updt_msg->next;
 
/*
@@ -1066,8 +1066,8 @@ uint32_t avnd_dequeue_async_update_msgs(
delete updt_msg;
}
 
-   /* All messages are dequeued. Set tail to NULL */
-   cb->async_updt_msgs.tail = NULL;
+   /* All messages are dequeued. Set tail to nullptr */
+   cb->async_updt_msgs.tail = nullptr;
 
TRACE_LEAVE();
return status;
@@ -1089,7 +1089,7 @@ uint32_t avnd_dequeue_async_update_msgs(
 uint32_t avnd_send_data_req(AVND_CB *cb)
 {
NCS_MBCSV_ARG mbcsv_arg;
-   NCS_UBAID *uba = NULL;
+   NCS_UBAID *uba = nullptr;
 
TRACE_ENTER();
 
@@ -1259,7 +1259,7 @@ static uint32_t avnd_validate_reo_type_i
 uint32_t avnd_evt_avd_role_change_evh(AVND_CB *cb, AVND_EVT *evt)
 {
uint32_t rc = NCSCC_RC_SUCCESS;
-   AVSV_D2N_ROLE_CHANGE_INFO *info = NULL;
+   AVSV_D2N_ROLE_CHANGE_INFO *info = nullptr;
V_DEST_RL mds_role;
SaAmfHAStateT prev_ha_state;
 
@@ -1350,12 +1350,12 @@ uint32_t avnd_evt_avd_role_change_evh(AV
 \**/
 uint32_t avnd_ckpt_for_ext(AVND_CB *cb, MBCSV_REO_HDL reo_hdl, uint32_t 
reo_type)
 {
-   uint8_t *reo_hdl_ptr = NULL;
+   uint8_t *reo_hdl_ptr = nullptr;
uint32_t rc = NCSCC_RC_FAILURE;
 
reo_hdl_ptr = static_cast(NCS_INT64_TO_PTR_CAST(reo_hdl));
 
-   if (NULL == reo_hdl_ptr)
+   if (nullptr == reo_hdl_ptr)
return rc;
 
switch (reo_type) {
@@ -1520,14 +1520,14 @@ uint32_t avnd_ckpt_for_ext(AVND_CB *cb, 
 \**/
 uint32_t avnd_evt_ha_state_change_evh(AVND_CB *cb, AVND_EVT *evt)
 {
-   AVND_HA_STATE_CHANGE_EVT *ha_state_event = NULL;
+   AVND_HA_STATE_CHANGE_EVT *ha_state_event = nullptr;
uint32_t rc = NCSCC_RC_FAILURE;
 
TRACE_ENTER();
 
ha_state_event = >info.ha_state_change;
 
-   if (NULL == ha_state_event)
+   if (nullptr == ha_state_event)
return rc;
 
if (AVND_EVT_HA_STATE_CHANGE != evt->type)
@@ -1569,10 +1569,10 @@ error:
 uint32_t avnd_ha_state_act_hdlr(AVND_CB *cb)
 {
uint32_t rc = NCSCC_RC_SUCCESS;
-   AVND_SU *su = NULL;
-   AVND_COMP *comp = NULL;
-   AVND_COMP_HC_REC *comp_hc = NULL;
-   AVND_COMP_CBK *comp_cbk = NULL;
+   AVND_SU *su = nullptr;
+   AVND_COMP *comp = nullptr;
+   AVND_COMP_HC_REC *comp_hc = nullptr;
+   AVND_COMP_CBK *comp_cbk = nullptr;
TRACE_ENTER();
 
 /**  Starting SU Timers  ***/

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 20 of 30] amfnd: convert NULL to nullptr for mon.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/mon.cc |  8 
 1 files changed, 4 insertions(+), 4 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/mon.cc 
b/osaf/services/saf/amf/amfnd/mon.cc
--- a/osaf/services/saf/amf/amfnd/mon.cc
+++ b/osaf/services/saf/amf/amfnd/mon.cc
@@ -221,7 +221,7 @@ uint32_t avnd_mon_task_create(void)
int policy = SCHED_OTHER; /*root defaults */
int prio_val = sched_get_priority_min(policy);

-   rc = m_NCS_TASK_CREATE((NCS_OS_CB)avnd_mon_process, NULL,
+   rc = m_NCS_TASK_CREATE((NCS_OS_CB)avnd_mon_process, nullptr,
   (char *)"OSAF_AVND_MON", prio_val, policy, 
m_AVND_STACKSIZE, _avnd_mon_task_hdl);
if (NCSCC_RC_SUCCESS != rc) {
LOG_CR("Passive Monitoring thread CREATE failed");
@@ -310,7 +310,7 @@ void avnd_mon_pids(AVND_CB *cb)
for (mon_rec = (AVND_MON_REQ *) m_NCS_DBLIST_FIND_FIRST(pid_mon_list);
 mon_rec; mon_rec = (AVND_MON_REQ *) 
m_NCS_DBLIST_FIND_NEXT(_rec->mon_dll_node)) {
 
-   if (mon_rec->pm_rec == NULL) {
+   if (mon_rec->pm_rec == nullptr) {
/* Should not happen, LOG the err message */
LOG_ER("Weird issue, PID (%lld) monitor rec doesn't 
have context of PM record", mon_rec->pid);
continue;
@@ -384,13 +384,13 @@ uint32_t avnd_evt_pid_exit_evh(AVND_CB *
 
TRACE_ENTER();
comp = m_AVND_COMPDB_REC_GET(cb->compdb, evt->info.pm_evt.comp_name);
-   if (NULL == comp) {
+   if (nullptr == comp) {
LOG_NO("Comp '%s' not found ", 
evt->info.pm_evt.comp_name.value);
goto done;
}
pm_rec = (AVND_COMP_PM_REC *)ncs_db_link_list_find(>pm_list, 
(uint8_t *)>info.pm_evt.pid);  
-   if (NULL == pm_rec) {
+   if (nullptr == pm_rec) {
LOG_NO("PID '%llu' not found for Comp '%s'", 
evt->info.pm_evt.pid, evt->info.pm_evt.comp_name.value);
goto done;
}

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 08 of 30] amfnd: convert NULL to nullptr for clc.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/clc.cc |  28 ++--
 1 files changed, 14 insertions(+), 14 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/clc.cc 
b/osaf/services/saf/amf/amfnd/clc.cc
--- a/osaf/services/saf/amf/amfnd/clc.cc
+++ b/osaf/services/saf/amf/amfnd/clc.cc
@@ -317,7 +317,7 @@ uint32_t avnd_evt_clc_resp_evh(AVND_CB *
comp = m_AVND_COMPDB_REC_GET(cb->compdb, clc_evt->comp_name);
 
/* the comp has been deleted? */
-   if (comp == NULL) {
+   if (comp == nullptr) {
 LOG_WA("%s: could not find comp '%s'", __FUNCTION__,
 clc_evt->comp_name.value);
 goto done;
@@ -614,12 +614,12 @@ done:
 **/
 static uint32_t comp_clc_resp_callback(NCS_OS_PROC_EXECUTE_TIMED_CB_INFO *info)
 {
-   AVND_CLC_EVT *clc_evt = NULL;
+   AVND_CLC_EVT *clc_evt = nullptr;
AVND_EVT *evt = 0;
uint32_t rc = NCSCC_RC_SUCCESS;
TRACE_ENTER();  
 
-   assert(info != NULL);
+   assert(info != nullptr);
clc_evt = (AVND_CLC_EVT *)info->i_usr_hdl;
 
/* fill the clc-evt param */
@@ -786,7 +786,7 @@ uint32_t avnd_comp_clc_fsm_run(AVND_CB *
osafassert(NCSCC_RC_SUCCESS == rc);
/* delete all SUSI record in amfnd database */
tmp_su = (AVND_SU 
*)ncs_patricia_tree_getnext(>sudb, (uint8_t *)0);
-   while (tmp_su != NULL) {
+   while (tmp_su != nullptr) {
if (tmp_su->is_ncs || 
tmp_su->su_is_external) {
/* Don't delete middleware 
SUSI. We are only performing appl
   failover in case of node 
failover recovery. This will help
@@ -1417,7 +1417,7 @@ uint32_t avnd_comp_clc_uninst_inst_hdler
   instantiating by calling the proxied callback. else start timer and 
   wait for inst timeout duration */
if (m_AVND_COMP_TYPE_IS_PROXIED(comp)) {
-   if (comp->pxy_comp != NULL) {
+   if (comp->pxy_comp != nullptr) {
if (m_AVND_COMP_TYPE_IS_PREINSTANTIABLE(comp))
/* call the proxied instantiate callback   */
rc = avnd_comp_cbk_send(cb, comp, 
AVSV_AMF_PXIED_COMP_INST, 0, 0);
@@ -1724,7 +1724,7 @@ uint32_t avnd_comp_clc_xxxing_cleansucc_
/* => keep retrying */
/* instantiate the comp */
if (m_AVND_COMP_TYPE_IS_PROXIED(comp)) {
-   if (comp->pxy_comp != NULL) {
+   if (comp->pxy_comp != nullptr) {
if (m_AVND_COMP_TYPE_IS_PREINSTANTIABLE(comp))
/* call the proxied instantiate 
callback   */
rc = avnd_comp_cbk_send(cb, comp, 
AVSV_AMF_PXIED_COMP_INST, 0, 0);
@@ -2178,7 +2178,7 @@ uint32_t avnd_comp_clc_terming_cleansucc
AVND_COMP_CSI_REC *csi;
 
for (csi = 
m_AVND_CSI_REC_FROM_COMP_DLL_NODE_GET(m_NCS_DBLIST_FIND_FIRST(>csi_list));
-   csi != NULL;
+   csi != nullptr;
csi = 
m_AVND_CSI_REC_FROM_COMP_DLL_NODE_GET(m_NCS_DBLIST_FIND_NEXT(>comp_dll_node)))
 {
/* In shutdown phase SIs are removed honoring 
saAmfSIRank in reverse
   order. A component which is having a CSI 
from a higher rank assigned 
@@ -2291,7 +2291,7 @@ uint32_t avnd_comp_clc_restart_inst_hdle
   instantiating by calling the proxied callback. else start timer and 
   wait for inst timeout duration */
if (m_AVND_COMP_TYPE_IS_PROXIED(comp)) {
-   if (comp->pxy_comp != NULL) {
+   if (comp->pxy_comp != nullptr) {
if (m_AVND_COMP_TYPE_IS_PREINSTANTIABLE(comp))
/* call the proxied instantiate callback   */
rc = avnd_comp_cbk_send(cb, comp, 
AVSV_AMF_PXIED_COMP_INST, 0, 0);
@@ -2809,10 +2809,10 @@ uint32_t avnd_comp_clc_cmd_execute(AVND_
/*** populate the env variable set ***/
env_counter = 0;
 
-   if (comp->saAmfCompCmdEnv != NULL) {
-   while ((env = comp->saAmfCompCmdEnv[env_counter]) != NULL) {
+   if (comp->saAmfCompCmdEnv != nullptr) {
+   while ((env = comp->saAmfCompCmdEnv[env_counter]) != nullptr) {
char* equalPos = strchr(env, '=');
-   if (equalPos == NULL) {
+   if (equalPos == nullptr) {
LOG_ER("Unknown enviroment variable format 
'%s'. Should be 'var=value'", env);
 

[devel] [PATCH 13 of 30] amfnd: convert NULL to nullptr for di.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/di.cc |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/di.cc 
b/osaf/services/saf/amf/amfnd/di.cc
--- a/osaf/services/saf/amf/amfnd/di.cc
+++ b/osaf/services/saf/amf/amfnd/di.cc
@@ -625,7 +625,7 @@ uint32_t avnd_di_susi_resp_send(AVND_CB 
   msg.info.avd->msg_info.n2d_su_si_assign.si_name.value, 
msg.info.avd->msg_info.n2d_su_si_assign.ha_state,
   msg.info.avd->msg_info.n2d_su_si_assign.error,  
msg.info.avd->msg_info.n2d_su_si_assign.single_csi);
 
-if ((su->si_list.n_nodes > 1) && (si == NULL)) {
+if ((su->si_list.n_nodes > 1) && (si == nullptr)) {
 if (msg.info.avd->msg_info.n2d_su_si_assign.msg_act == 
AVSV_SUSI_ACT_DEL)
 LOG_NO("Removed 'all SIs' from '%s'", su->name.value);
 

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 14 of 30] amfnd: convert NULL to nullptr for err.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/err.cc |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/err.cc 
b/osaf/services/saf/amf/amfnd/err.cc
--- a/osaf/services/saf/amf/amfnd/err.cc
+++ b/osaf/services/saf/amf/amfnd/err.cc
@@ -991,8 +991,8 @@ uint32_t avnd_err_rcvr_node_failover(AVN
m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, failed_su, 
AVND_CKPT_SU_FLAG_CHANGE);
}
/* Unordered cleanup of all local application components */
-   for (comp = (AVND_COMP *)ncs_patricia_tree_getnext(>compdb, 
(uint8_t *)NULL);
- comp != NULL;
+   for (comp = (AVND_COMP *)ncs_patricia_tree_getnext(>compdb, 
(uint8_t *)nullptr);
+ comp != nullptr;
  comp = (AVND_COMP *) ncs_patricia_tree_getnext(>compdb, 
(uint8_t *)>name)) {
 
if (comp->su->is_ncs || comp->su->su_is_external)

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 01 of 30] amfnd: convert NULL to nullptr for amfnd.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/amfnd.cc |  36 ++--
 1 files changed, 18 insertions(+), 18 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/amfnd.cc 
b/osaf/services/saf/amf/amfnd/amfnd.cc
--- a/osaf/services/saf/amf/amfnd/amfnd.cc
+++ b/osaf/services/saf/amf/amfnd/amfnd.cc
@@ -45,19 +45,19 @@ uint32_t avnd_evt_avnd_avnd_evh(AVND_CB 
 {
uint32_t res = NCSCC_RC_SUCCESS;
AVSV_ND2ND_AVND_MSG *avnd_avnd_msg = evt->info.avnd;
-   AVSV_ND2ND_AVA_MSG *msg = NULL;
+   AVSV_ND2ND_AVA_MSG *msg = nullptr;
 
TRACE_ENTER2("%u", avnd_avnd_msg->type);
 
if (AVND_AVND_CBK_DEL == avnd_avnd_msg->type) {
/* This is a Callback Del message */
-   AVSV_ND2ND_CBK_DEL *del_cbk = NULL;
-   AVND_COMP *o_comp = NULL;
-   AVND_COMP_CBK *cbk_rec = NULL;
+   AVSV_ND2ND_CBK_DEL *del_cbk = nullptr;
+   AVND_COMP *o_comp = nullptr;
+   AVND_COMP_CBK *cbk_rec = nullptr;
 
del_cbk = _avnd_msg->info.cbk_del;
o_comp = 
m_AVND_INT_EXT_COMPDB_REC_GET(cb->internode_avail_comp_db, del_cbk->comp_name);
-   if (NULL == o_comp) {
+   if (nullptr == o_comp) {
LOG_ER("Comp not in Inter/Ext Comp DB: %s : opq_hdl= 
%u",del_cbk->comp_name.value,del_cbk->opq_hdl);
return NCSCC_RC_FAILURE;
}
@@ -121,7 +121,7 @@ uint32_t avnd_evt_avnd_avnd_api_msg_hdl(
   is needed only in case of SYNC call from AvA ->proxy AvND. 
   Presently only two calls from AvA are ASYNC and 
   those are quiescing_compl and ava_resp, these wouln't require
-  mds context information and it will be NULL for these two calls */
+  mds context information and it will be nullptr for these two calls */
 
memcpy(&(evt->mds_ctxt), &(evt->info.avnd->mds_ctxt), 
sizeof(MDS_SYNC_SND_CTXT));
 
@@ -140,7 +140,7 @@ uint32_t avnd_evt_avnd_avnd_api_msg_hdl(
bool msg_from_avnd = true;
 
comp = m_AVND_COMPDB_REC_GET(cb->compdb, 
reg->comp_name);
-   if (NULL == comp)
+   if (nullptr == comp)
return NCSCC_RC_FAILURE;
 
/* send the response back to AvA */
@@ -181,15 +181,15 @@ uint32_t avnd_evt_avnd_avnd_api_resp_msg
 {
uint32_t res = NCSCC_RC_SUCCESS;
AVSV_ND2ND_AVND_MSG *avnd_msg = evt->info.avnd;
-   AVND_COMP *o_comp = NULL;
+   AVND_COMP *o_comp = nullptr;
AVSV_AMF_API_RESP_INFO *resp_info = 
_msg->info.msg->info.api_resp_info;
-   SaAmfHAStateT *ha_state = NULL;
+   SaAmfHAStateT *ha_state = nullptr;
MDS_DEST reg_dest = 0;
 
TRACE_ENTER2("%s: Type =%u and rc = %u",avnd_msg->comp_name.value, 
resp_info->type, resp_info->rc);
 
o_comp = m_AVND_INT_EXT_COMPDB_REC_GET(cb->internode_avail_comp_db, 
avnd_msg->comp_name);
-   if (NULL == o_comp) {
+   if (nullptr == o_comp) {
LOG_ER("Couldn't find comp in Inter/Ext Comp DB");
res = NCSCC_RC_FAILURE;
goto done;
@@ -203,7 +203,7 @@ uint32_t avnd_evt_avnd_avnd_api_resp_msg
if (SA_AIS_OK != resp_info->rc) {
/* We got comp reg failure. We need to delete the 
component.  */
o_comp = 
m_AVND_INT_EXT_COMPDB_REC_GET(cb->internode_avail_comp_db, avnd_msg->comp_name);
-   if (NULL == o_comp) {
+   if (nullptr == o_comp) {
LOG_ER("Couldn't find comp in Inter/Ext Comp 
DB");
res = NCSCC_RC_FAILURE;
goto done;
@@ -213,7 +213,7 @@ uint32_t avnd_evt_avnd_avnd_api_resp_msg
res = avnd_internode_comp_del(cb, 
&(cb->internode_avail_comp_db), &(avnd_msg->comp_name));
} else {
o_comp = 
m_AVND_INT_EXT_COMPDB_REC_GET(cb->internode_avail_comp_db, avnd_msg->comp_name);
-   if (NULL == o_comp) {
+   if (nullptr == o_comp) {
LOG_ER("Couldn't find comp in Inter/Ext Comp 
DB");
res = NCSCC_RC_FAILURE;
goto done;
@@ -234,14 +234,14 @@ uint32_t avnd_evt_avnd_avnd_api_resp_msg
/* Unreg SUCCESS. We need to delete the component as 
well as proxy-proxied 
   relation */
o_comp = 
m_AVND_INT_EXT_COMPDB_REC_GET(cb->internode_avail_comp_db, avnd_msg->comp_name);
-   if (NULL == o_comp) {
+   if (nullptr == o_comp) {
LOG_ER("Couldn't find comp in Inter/Ext Comp 
DB");
res = NCSCC_RC_FAILURE;
goto done;
  

[devel] [PATCH 19 of 30] amfnd: convert NULL to nullptr for mds.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/mds.cc |  30 +++---
 1 files changed, 15 insertions(+), 15 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/mds.cc 
b/osaf/services/saf/amf/amfnd/mds.cc
--- a/osaf/services/saf/amf/amfnd/mds.cc
+++ b/osaf/services/saf/amf/amfnd/mds.cc
@@ -844,7 +844,7 @@ uint32_t avnd_mds_flat_ava_enc(AVND_CB *
 {
AVSV_NDA_AVA_MSG *ava;
uint32_t rc = NCSCC_RC_SUCCESS, i;
-   SaStringT value = NULL;
+   SaStringT value = nullptr;
 
ava = ((AVND_MSG *)enc_info->i_msg)->info.ava;
osafassert(ava);
@@ -965,9 +965,9 @@ uint32_t avnd_mds_dec(AVND_CB *cb, MDS_C
EDP_OP_TYPE_DEC, (AVSV_DND_MSG 
**)_info->o_msg, ,
dec_info->i_msg_fmt_ver);
if (rc != NCSCC_RC_SUCCESS) {
-   if (dec_info->o_msg != NULL) {
+   if (dec_info->o_msg != nullptr) {

avsv_dnd_msg_free(static_cast(dec_info->o_msg));
-   dec_info->o_msg = NULL;
+   dec_info->o_msg = nullptr;
}
return rc;
}
@@ -984,9 +984,9 @@ uint32_t avnd_mds_dec(AVND_CB *cb, MDS_C
EDP_OP_TYPE_DEC, (AVSV_ND2ND_AVND_MSG 
**)_info->o_msg,
, dec_info->i_msg_fmt_ver);
if (rc != NCSCC_RC_SUCCESS) {
-   if (dec_info->o_msg != NULL) {
+   if (dec_info->o_msg != nullptr) {

avsv_nd2nd_avnd_msg_free(static_cast(dec_info->o_msg));
-   dec_info->o_msg = NULL;
+   dec_info->o_msg = nullptr;
}
return rc;
}
@@ -1003,9 +1003,9 @@ uint32_t avnd_mds_dec(AVND_CB *cb, MDS_C
EDP_OP_TYPE_DEC, (AVSV_NDA_AVA_MSG 
**)_info->o_msg, ,
dec_info->i_msg_fmt_ver);
if (rc != NCSCC_RC_SUCCESS) {
-   if (dec_info->o_msg != NULL) {
+   if (dec_info->o_msg != nullptr) {

avsv_nda_ava_msg_free(static_cast(dec_info->o_msg));
-   dec_info->o_msg = NULL;
+   dec_info->o_msg = nullptr;
}
return rc;
}
@@ -1061,9 +1061,9 @@ uint32_t avnd_mds_flat_dec(AVND_CB *cb, 
EDP_OP_TYPE_DEC, (AVSV_DND_MSG 
**)_info->o_msg, ,
dec_info->i_msg_fmt_ver);
if (rc != NCSCC_RC_SUCCESS) {
-   if (dec_info->o_msg != NULL) {
+   if (dec_info->o_msg != nullptr) {

avsv_dnd_msg_free(static_cast(dec_info->o_msg));
-   dec_info->o_msg = NULL;
+   dec_info->o_msg = nullptr;
}
return rc;
}
@@ -1080,9 +1080,9 @@ uint32_t avnd_mds_flat_dec(AVND_CB *cb, 
EDP_OP_TYPE_DEC, (AVSV_ND2ND_AVND_MSG 
**)_info->o_msg,
, dec_info->i_msg_fmt_ver);
if (rc != NCSCC_RC_SUCCESS) {
-   if (dec_info->o_msg != NULL) {
+   if (dec_info->o_msg != nullptr) {

avsv_nd2nd_avnd_msg_free(static_cast(dec_info->o_msg));
-   dec_info->o_msg = NULL;
+   dec_info->o_msg = nullptr;
}
return rc;
}
@@ -1347,8 +1347,8 @@ uint32_t avnd_avnd_mds_send(AVND_CB *cb,
 {
NCSMDS_INFO mds_info;
uint32_t rc = NCSCC_RC_SUCCESS;
-   MDS_SEND_INFO *send_info = NULL;
-   MDS_SENDTYPE_SNDRSP_INFO *send = NULL;
+   MDS_SEND_INFO *send_info = nullptr;
+   MDS_SENDTYPE_SNDRSP_INFO *send = nullptr;
 
TRACE_ENTER();
memset(_info, 0, sizeof(NCSMDS_INFO));
@@ -1428,8 +1428,8 @@ uint32_t avnd_mds_quiesced_process(AVND_
AVND_EVT *evt = 0;
uint32_t rc = NCSCC_RC_FAILURE;
 
-   evt = avnd_evt_create(cb, AVND_EVT_HA_STATE_CHANGE, 0, NULL, 0, 0, 0);
-   if (NULL == evt) {
+   evt = avnd_evt_create(cb, AVND_EVT_HA_STATE_CHANGE, 0, nullptr, 0, 0, 
0);
+   if (nullptr == evt) {
LOG_ER("%s, Event is NULL",__FUNCTION__);
} else {
/* Don't use avail_state_avnd as this is not yet updated. It 
will be 

--

[devel] [PATCH 06 of 30] amfnd: convert NULL to nullptr for ckpt_enc.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/ckpt_enc.cc |  22 +++---
 1 files changed, 11 insertions(+), 11 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/ckpt_enc.cc 
b/osaf/services/saf/amf/amfnd/ckpt_enc.cc
--- a/osaf/services/saf/amf/amfnd/ckpt_enc.cc
+++ b/osaf/services/saf/amf/amfnd/ckpt_enc.cc
@@ -289,7 +289,7 @@ static uint32_t avnd_entire_data_update(
ncs_enc_claim_space(>io_uba, sizeof(uint32_t));
 
/* 
-* If reo_handle and reo_type is NULL then this the first time mbcsv is 
calling
+* If reo_handle and reo_type is nullptr then this the first time mbcsv 
is calling
 * the cold sync response for the standby. So start from first data 
structure 
 * which is CB. Next time onwards depending on the value of reo_type 
and reo_handle
 * send the next data structures.
@@ -298,7 +298,7 @@ static uint32_t avnd_entire_data_update(
 
/* Now encode the number of objects actually in the UBA. */
 
-   if (encoded_cnt_loc != NULL) {
+   if (encoded_cnt_loc != nullptr) {
ncs_encode_32bit(_cnt_loc, num_of_obj);
}
 
@@ -390,9 +390,9 @@ static uint32_t avnd_encode_cold_sync_rs
   We need to send internode component(proxy) first and after that 
external
   component (proxied), bz while decoding, first we will add all proxy 
   components in DB and then one by one proxied component. After 
decoding
-  proxied component, we can check comp->proxy_comp_name, if it NULL,
+  proxied component, we can check comp->proxy_comp_name, if it nullptr,
   then comp will be in ORPH state and no proxy is attached to it. If 
-  comp->proxy_comp_name is not NULL, then it is name of proxy for the
+  comp->proxy_comp_name is not nullptr, then it is name of proxy for 
the
   proxied component and use avnd_comp_proxied_add to add it in proxy
   component pxied_list. For adding proxied component to the pxied_list
   of proxy component, we should have proxy component already in DB,
@@ -503,7 +503,7 @@ static uint32_t avnd_encode_cold_sync_rs
 static uint32_t avnd_encode_cold_sync_rsp_siq_rec(AVND_CB *cb, 
NCS_MBCSV_CB_ENC *enc, uint32_t *num_of_obj)
 {
uint32_t status = NCSCC_RC_SUCCESS;
-   AVND_SU *su = NULL;
+   AVND_SU *su = nullptr;
AVND_SU_SIQ_REC *siq;
EDU_ERR ederror = static_cast(0);
 
@@ -549,8 +549,8 @@ static uint32_t avnd_encode_cold_sync_rs
 {
uint32_t status = NCSCC_RC_SUCCESS;
AVND_SU *su;
-   AVND_SU_SI_REC *curr_su_si = NULL;
-   AVND_COMP_CSI_REC *csi = NULL;
+   AVND_SU_SI_REC *curr_su_si = nullptr;
+   AVND_COMP_CSI_REC *csi = nullptr;
EDU_ERR ederror = static_cast(0);
 
 
@@ -604,8 +604,8 @@ static uint32_t avnd_encode_cold_sync_rs
 static uint32_t avnd_encode_cold_sync_rsp_comp_hlt_rec(AVND_CB *cb, 
NCS_MBCSV_CB_ENC *enc, uint32_t *num_of_obj)
 {
uint32_t status = NCSCC_RC_SUCCESS;
-   AVND_COMP *comp = NULL;
-   AVND_COMP_HC_REC *comp_hc = NULL;
+   AVND_COMP *comp = nullptr;
+   AVND_COMP_HC_REC *comp_hc = nullptr;
EDU_ERR ederror = static_cast(0);
 
 
@@ -656,8 +656,8 @@ static uint32_t avnd_encode_cold_sync_rs
 static uint32_t avnd_encode_cold_sync_rsp_comp_cbk_rec(AVND_CB *cb, 
NCS_MBCSV_CB_ENC *enc, uint32_t *num_of_obj)
 {
uint32_t status = NCSCC_RC_SUCCESS;
-   AVND_COMP *comp = NULL;
-   AVND_COMP_CBK *comp_cbk = NULL;
+   AVND_COMP *comp = nullptr;
+   AVND_COMP_CBK *comp_cbk = nullptr;
EDU_ERR ederror = static_cast(0);
 
 

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 05 of 30] amfnd: convert NULL to nullptr for ckpt_edu.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/ckpt_edu.cc |  296 
 1 files changed, 148 insertions(+), 148 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/ckpt_edu.cc 
b/osaf/services/saf/amf/amfnd/ckpt_edu.cc
--- a/osaf/services/saf/amf/amfnd/ckpt_edu.cc
+++ b/osaf/services/saf/amf/amfnd/ckpt_edu.cc
@@ -55,34 +55,34 @@ uint32_t avnd_edp_ckpt_msg_hlt_config(ED
   EDU_BUF_ENV *buf_env, EDP_OP_TYPE op, 
EDU_ERR *o_err)
 {
uint32_t rc = NCSCC_RC_SUCCESS;
-   AVND_HC *struct_ptr = NULL, **d_ptr = NULL;
+   AVND_HC *struct_ptr = nullptr, **d_ptr = nullptr;
 
EDU_INST_SET avnd_ckpt_msg_hlt_rules[] = {
{EDU_START, avnd_edp_ckpt_msg_hlt_config, 0, 0, 0,
-sizeof(AVND_HC), 0, NULL},
+sizeof(AVND_HC), 0, nullptr},
 
/* Fill here AVD HLT data structure encoding rules */
{EDU_EXEC, ncs_edp_sanamet, 0, 0, 0,
-(long)&((AVND_HC *)0)->key.comp_name, 0, NULL},
+(long)&((AVND_HC *)0)->key.comp_name, 0, nullptr},
{EDU_EXEC, ncs_edp_uns8, EDQ_ARRAY, 0, 0,
-(long)&((AVND_HC *)0)->key.key_len, 4, NULL},
+(long)&((AVND_HC *)0)->key.key_len, 4, nullptr},
{EDU_EXEC, ncs_edp_saamfhealthcheckkeyt, 0, 0, 0,
-(long)&((AVND_HC *)0)->key.name, 0, NULL},
+(long)&((AVND_HC *)0)->key.name, 0, nullptr},
{EDU_EXEC, m_NCS_EDP_SATIMET, 0, 0, 0,
-(long)&((AVND_HC *)0)->period, 0, NULL},
+(long)&((AVND_HC *)0)->period, 0, nullptr},
{EDU_EXEC, m_NCS_EDP_SATIMET, 0, 0, 0,
-(long)&((AVND_HC *)0)->max_dur, 0, NULL},
+(long)&((AVND_HC *)0)->max_dur, 0, nullptr},
{EDU_EXEC, ncs_edp_ncs_bool, 0, 0, 0,
-(long)&((AVND_HC *)0)->is_ext, 0, NULL},
+(long)&((AVND_HC *)0)->is_ext, 0, nullptr},
 
-   {EDU_END, 0, 0, 0, 0, 0, 0, NULL},
+   {EDU_END, 0, 0, 0, 0, 0, 0, nullptr},
};
 
if (op == EDP_OP_TYPE_ENC) {
struct_ptr = (AVND_HC *)ptr;
} else if (op == EDP_OP_TYPE_DEC) {
d_ptr = (AVND_HC **)ptr;
-   if (*d_ptr == NULL) {
+   if (*d_ptr == nullptr) {
*o_err = EDU_ERR_MEM_FAIL;
return NCSCC_RC_FAILURE;
}
@@ -112,55 +112,55 @@ uint32_t avnd_edp_ckpt_msg_su(EDU_HDL *h
   NCSCONTEXT ptr, uint32_t *ptr_data_len, EDU_BUF_ENV 
*buf_env, EDP_OP_TYPE op, EDU_ERR *o_err)
 {
uint32_t rc = NCSCC_RC_SUCCESS;
-   AVND_SU *struct_ptr = NULL, **d_ptr = NULL;
+   AVND_SU *struct_ptr = nullptr, **d_ptr = nullptr;
 
EDU_INST_SET avnd_ckpt_msg_su_rules[] = {
{EDU_START, avnd_edp_ckpt_msg_su, 0, 0, 0,
-sizeof(AVND_SU), 0, NULL},
+sizeof(AVND_SU), 0, nullptr},
{EDU_EXEC, ncs_edp_sanamet, 0, 0, 0,
-(long)&((AVND_SU *)0)->name, 0, NULL},
+(long)&((AVND_SU *)0)->name, 0, nullptr},
{EDU_EXEC, ncs_edp_uns32, 0, 0, 0,
-(long)&((AVND_SU *)0)->flag, 0, NULL},
+(long)&((AVND_SU *)0)->flag, 0, nullptr},
{EDU_EXEC, ncs_edp_uns32, 0, 0, 0,
-(long)&((AVND_SU *)0)->su_err_esc_level, 0, NULL},
+(long)&((AVND_SU *)0)->su_err_esc_level, 0, nullptr},
{EDU_EXEC, m_NCS_EDP_SATIMET, 0, 0, 0,
-(long)&((AVND_SU *)0)->comp_restart_prob, 0, NULL},
+(long)&((AVND_SU *)0)->comp_restart_prob, 0, nullptr},
{EDU_EXEC, ncs_edp_uns32, 0, 0, 0,
-(long)&((AVND_SU *)0)->comp_restart_max, 0, NULL},
+(long)&((AVND_SU *)0)->comp_restart_max, 0, nullptr},
{EDU_EXEC, m_NCS_EDP_SATIMET, 0, 0, 0,
-(long)&((AVND_SU *)0)->su_restart_prob, 0, NULL},
+(long)&((AVND_SU *)0)->su_restart_prob, 0, nullptr},
{EDU_EXEC, ncs_edp_uns32, 0, 0, 0,
-(long)&((AVND_SU *)0)->su_restart_max, 0, NULL},
+(long)&((AVND_SU *)0)->su_restart_max, 0, nullptr},
{EDU_EXEC, ncs_edp_uns32, 0, 0, 0,
-(long)&((AVND_SU *)0)->comp_restart_cnt, 0, NULL},
+(long)&((AVND_SU *)0)->comp_restart_cnt, 0, nullptr},
{EDU_EXEC, ncs_edp_uns32, 0, 0, 0,
-(long)&((AVND_SU *)0)->su_restart_cnt, 0, NULL},
+(long)&((AVND_SU *)0)->su_restart_cnt, 0, nullptr},
 
{EDU_EXEC, ncs_edp_ncs_bool, 0, 0, 0,
-(long)&((AVND_SU *)0)->su_err_esc_tmr.is_active, 0, NULL},
+(long)&((AVND_SU *)0)->su_err_esc_tmr.is_active, 0, nullptr},
 
{EDU_EXEC, ncs_edp_uns32, 0, 0, 0,
-(long)&((AVND_SU *)0)->oper, 0, 

[devel] [PATCH 09 of 30] amfnd: convert NULL to nullptr for clm.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/clm.cc |  14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/clm.cc 
b/osaf/services/saf/amf/amfnd/clm.cc
--- a/osaf/services/saf/amf/amfnd/clm.cc
+++ b/osaf/services/saf/amf/amfnd/clm.cc
@@ -40,7 +40,7 @@
 
 static void clm_node_left(SaClmNodeIdT node_id)
 {
-   AVND_COMP *comp = NULL;
+   AVND_COMP *comp = nullptr;
uint32_t rc;
SaNameT name;
AVND_COMP_PXIED_REC *pxd_rec = 0, *curr_rec = 0;
@@ -55,7 +55,7 @@ static void clm_node_left(SaClmNodeIdT n
LOG_NO("This node has exited the cluster");
avnd_cb->node_info.member = SA_FALSE;
comp = (AVND_COMP *)ncs_patricia_tree_getnext(_cb->compdb, 
(uint8_t *)0);
-   while( comp != NULL ) {
+   while( comp != nullptr ) {
if(comp->su->is_ncs != true ) {
avnd_comp_clc_fsm_run(avnd_cb, comp, 
AVND_COMP_CLC_PRES_FSM_EV_TERM);
}
@@ -77,7 +77,7 @@ static void clm_node_left(SaClmNodeIdT n
/* Remove the proxied component from pxied_list 
 */
m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(avnd_cb, comp,
 
AVND_CKPT_COMP_PROXY_PROXIED_DEL);
-   avnd_comp_proxied_del(avnd_cb, comp, 
comp->pxy_comp, false, NULL);
+   avnd_comp_proxied_del(avnd_cb, comp, 
comp->pxy_comp, false, nullptr);
/* Delete the proxied component */
m_AVND_SEND_CKPT_UPDT_ASYNC_RMV(avnd_cb, comp, 
AVND_CKPT_COMP_CONFIG);
avnd_internode_comp_del(avnd_cb, 
&(avnd_cb->internode_avail_comp_db),
@@ -121,11 +121,11 @@ static void clm_to_amf_node(void)
searchParam.searchOneAttr.attrValueType = SA_IMM_ATTR_SASTRINGT;
searchParam.searchOneAttr.attrValue = 
 
-   immutil_saImmOmInitialize(, NULL, );
+   immutil_saImmOmInitialize(, nullptr, );
 
-   error = immutil_saImmOmSearchInitialize_2(immOmHandle, NULL, 
SA_IMM_SUBTREE,
+   error = immutil_saImmOmSearchInitialize_2(immOmHandle, nullptr, 
SA_IMM_SUBTREE,
SA_IMM_SEARCH_ONE_ATTR | 
SA_IMM_SEARCH_GET_ALL_ATTR,
-   ,NULL, );
+   ,nullptr, );
 
if (SA_AIS_OK != error) {
LOG_ER("No objects found");
@@ -276,7 +276,7 @@ SaAisErrorT avnd_clm_init(void)
 LOG_ER("Failed to get CLM selectionObject: %u", error);
 goto done;
 }
-   error = saClmClusterTrack_4(avnd_cb->clmHandle, trackFlags, NULL);
+   error = saClmClusterTrack_4(avnd_cb->clmHandle, trackFlags, nullptr);
 if (SA_AIS_OK != error) {
 LOG_ER("Failed to start cluster tracking: %u", error);
 goto done;

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 00 of 30] Review Request for amfnd: convert NULL to nullptr [#1551]

2015-10-20 Thread Long HB Nguyen
Summary: amfnd: convert NULL to nullptr [#1551]
Review request for Trac Ticket(s): [#1551]
Peer Reviewer(s): Hans, Gary, Praveen, Nagu
Pull request to: Hans
Affected branch(es): default
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-

changeset d9e5204b9cd64449385835be326c4635993233ca
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 20 Oct 2015 14:08:29 +0700

amfnd: convert NULL to nullptr for amfnd.cc [#1551]

changeset 4aa0c0e69ea683b655e5ce95a48bd46668bb1947
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 20 Oct 2015 14:13:52 +0700

amfnd: convert NULL to nullptr for cbq.cc [#1551]

changeset 8565a4b0f13090e2a248d4dc030107fe872c46e3
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 20 Oct 2015 14:16:24 +0700

amfnd: convert NULL to nullptr for chc.cc [#1551]

changeset 61e799adaa100457d5da11741daab89abb312342
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 20 Oct 2015 14:20:01 +0700

amfnd: convert NULL to nullptr for ckpt_dec.cc [#1551]

changeset 6146e7b22e233213be199892f03f8f2b87e7733a
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 20 Oct 2015 14:22:03 +0700

amfnd: convert NULL to nullptr for ckpt_edu.cc [#1551]

changeset 3010ccff64a8b80f0b0ba2abeee3c3f569c06a36
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 20 Oct 2015 14:23:20 +0700

amfnd: convert NULL to nullptr for ckpt_enc.cc [#1551]

changeset 19fff7f26c302b0a252c537979c5be117a96b8ab
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 20 Oct 2015 14:24:52 +0700

amfnd: convert NULL to nullptr for ckpt_updt.cc [#1551]

changeset 58263076e522c0494bd91480001a68369818b0c9
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 20 Oct 2015 14:26:02 +0700

amfnd: convert NULL to nullptr for clc.cc [#1551]

changeset ec0d86a8fcac950de12157c90406e1c60a688cc0
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 20 Oct 2015 14:27:11 +0700

amfnd: convert NULL to nullptr for clm.cc [#1551]

changeset 6f24ab6b30da4a901bff37e3c65f628e478505d9
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 20 Oct 2015 14:28:06 +0700

amfnd: convert NULL to nullptr for comp.cc [#1551]

changeset 114de32db084f1987a80fa450509619455702054
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 20 Oct 2015 14:29:43 +0700

amfnd: convert NULL to nullptr for compdb.cc [#1551]

changeset 1351acca1f39d71e0d084a7bdb156d8168b73b16
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 20 Oct 2015 14:42:44 +0700

amfnd: convert NULL to nullptr for cpm.cc [#1551]

changeset e850274601d9d382839c2538381c98b8151f08a2
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 20 Oct 2015 14:43:26 +0700

amfnd: convert NULL to nullptr for di.cc [#1551]

changeset 6f75b3025f9d26fee62aa3e1e92750e86a9e596c
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 20 Oct 2015 14:45:17 +0700

amfnd: convert NULL to nullptr for err.cc [#1551]

changeset 92a13233ca950df369ca41ab9d5241c815fe3bc3
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 20 Oct 2015 14:46:49 +0700

amfnd: convert NULL to nullptr for evt.cc [#1551]

changeset 913ca62cb17743d241dda8672bcfc22773c3aae3
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 20 Oct 2015 14:47:43 +0700

amfnd: convert NULL to nullptr for hcdb.cc [#1551]

changeset d18406ea8012bd153f83550b3a1c893996fe2d54
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 20 Oct 2015 14:48:39 +0700

    amfnd: convert NULL to nullptr for main.cc [#1551]

changeset 228c017ee533cc9a3d8aae0badc7a748b7f42584
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 20 Oct 2015 14:50:13 +0700

    amfnd: convert NULL to nullptr for mbcsv.cc [#1551]

changeset d6d3d5b4aa2a9c4ac41d9cfb6953ac2c6428200e
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 20 Oct 2015 14:51:32 +0700

    amfnd: convert NULL to nullptr for mds.cc [#1551]

changeset d1bf0e5468fd8908aa50273cb0b468d27f756ee7
Author: Long HB Nguyen<long.hb.ngu...@dektech.com.au>
Date:   Tue, 20 Oct 2015 14:52:13 +0700

    amfnd: convert NULL to nullptr for mon.cc [#1551]

changeset c1dd617127604017f92

[devel] [PATCH 02 of 30] amfnd: convert NULL to nullptr for cbq.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/cbq.cc |  16 
 1 files changed, 8 insertions(+), 8 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/cbq.cc 
b/osaf/services/saf/amf/amfnd/cbq.cc
--- a/osaf/services/saf/amf/amfnd/cbq.cc
+++ b/osaf/services/saf/amf/amfnd/cbq.cc
@@ -395,7 +395,7 @@ uint32_t avnd_evt_ava_resp_evh(AVND_CB *
 
// if all OK send a response to the client
if ((rc == NCSCC_RC_SUCCESS) && (resp->err == SA_AIS_OK)) {
-   rc = avnd_amf_resp_send(cb, AVSV_AMF_COMP_TERM_RSP, 
SA_AIS_OK, NULL,
+   rc = avnd_amf_resp_send(cb, AVSV_AMF_COMP_TERM_RSP, 
SA_AIS_OK, nullptr,
_info->dest, >mds_ctxt, comp, 
false);
}
break;
@@ -423,7 +423,7 @@ uint32_t avnd_evt_ava_resp_evh(AVND_CB *
 
/* check, if the older assignment was overriden by new one, if 
so trash this resp */
if (!csi) {
-   AVND_COMP_CSI_REC *temp_csi = NULL;
+   AVND_COMP_CSI_REC *temp_csi = nullptr;
temp_csi = m_AVND_COMPDB_REC_CSI_GET_FIRST(*comp);
 
if (cbk_rec->cbk_info->param.csi_set.ha != 
temp_csi->si->curr_state) {
@@ -721,8 +721,8 @@ uint32_t avnd_comp_cbq_rec_send(AVND_CB 
 {
AVND_MSG msg;
uint32_t rc = NCSCC_RC_SUCCESS;
-   AVSV_ND2ND_AVND_MSG *avnd_msg = NULL;
-   AVSV_NDA_AVA_MSG *temp_ptr = NULL;
+   AVSV_ND2ND_AVND_MSG *avnd_msg = nullptr;
+   AVSV_NDA_AVA_MSG *temp_ptr = nullptr;
 
TRACE_ENTER();
memset(, 0, sizeof(AVND_MSG));
@@ -1030,7 +1030,7 @@ void avnd_comp_cbq_csi_rec_del(AVND_CB *
AVSV_AMF_CBK_INFO *info = 0;
bool to_del = false;
 
-   TRACE_ENTER2("'%s', '%s'", comp->name.value, csi_name ? csi_name->value 
: NULL);
+   TRACE_ENTER2("'%s', '%s'", comp->name.value, csi_name ? csi_name->value 
: nullptr);
 
/* scan the entire comp-cbk list & delete the matching records */
while (curr) {
@@ -1082,7 +1082,7 @@ void avnd_comp_unreg_cbk_process(AVND_CB
AVND_COMP_CBK *cbk = 0, *temp_cbk_list = 0, *head = 0;
AVND_COMP_CSI_REC *csi = 0;
 
-   while ((comp->cbk_list != NULL) && (comp->cbk_list != cbk)) {
+   while ((comp->cbk_list != nullptr) && (comp->cbk_list != cbk)) {
cbk = comp->cbk_list;
 
switch (cbk->cbk_info->type) {
@@ -1097,7 +1097,7 @@ void avnd_comp_unreg_cbk_process(AVND_CB
LOG_NO("%s - '%s' type:%u", 
__FUNCTION__, comp->name.value,
   cbk->cbk_info->type);
 
-   cbk->next = NULL;
+   cbk->next = nullptr;
 
/*  add this rec on to temp_cbk_list */
{
@@ -1119,7 +1119,7 @@ void avnd_comp_unreg_cbk_process(AVND_CB
 
/* check, if the older assignment was overriden 
by new one, if so trash this resp */
if (!csi) {
-   AVND_COMP_CSI_REC *temp_csi = NULL;
+   AVND_COMP_CSI_REC *temp_csi = nullptr;
temp_csi = 
m_AVND_COMPDB_REC_CSI_GET_FIRST(*comp);
 
if (cbk->cbk_info->param.csi_set.ha != 
temp_csi->si->curr_state) {

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 03 of 30] amfnd: convert NULL to nullptr for chc.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/chc.cc |  14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/chc.cc 
b/osaf/services/saf/amf/amfnd/chc.cc
--- a/osaf/services/saf/amf/amfnd/chc.cc
+++ b/osaf/services/saf/amf/amfnd/chc.cc
@@ -352,7 +352,7 @@ void avnd_comp_hc_param_val(AVND_CB *cb,
/* get the record from healthcheck database */
if (0 == avnd_hcdb_rec_get(cb, _chk)) {
/* HC instance did not exist, look for HC type 
*/
-   if (NULL == 
avnd_hctypedb_rec_get(&(*o_comp)->saAmfCompType, _start->hc_key)) {
+   if (nullptr == 
avnd_hctypedb_rec_get(&(*o_comp)->saAmfCompType, _start->hc_key)) {
*o_amf_rc = SA_AIS_ERR_NOT_EXIST;
return;
}
@@ -509,13 +509,13 @@ AVND_COMP_HC_REC *avnd_comp_hc_rec_add(A
hlt_chk.name.keyLen = hc_start->hc_key.keyLen;
 
/* get the record from hc db */
-   if ((hc = avnd_hcdb_rec_get(cb, _chk)) != NULL) {
+   if ((hc = avnd_hcdb_rec_get(cb, _chk)) != nullptr) {
rec->period = hc->period;
rec->max_dur = hc->max_dur;
} else {
/* HC instance did not exist, look for HC type */
AVND_HCTYPE *hctype = 
avnd_hctypedb_rec_get(>saAmfCompType, _start->hc_key);
-   if (hctype != NULL) {
+   if (hctype != nullptr) {
rec->period = hctype->saAmfHctDefPeriod;
rec->max_dur = hctype->saAmfHctDefMaxDuration;
} else
@@ -762,12 +762,12 @@ uint32_t avnd_comp_hc_cmd_start(AVND_CB 
  */
 static AVND_COMP_HC_REC *find_hc_rec(const AVND_COMP *comp)
 {
-   AVND_COMP_HC_REC *rec = NULL;
+   AVND_COMP_HC_REC *rec = nullptr;
 
TRACE_ENTER2("'%s'", comp->name.value);
 
for (rec = (AVND_COMP_HC_REC *)m_NCS_DBLIST_FIND_FIRST(>hc_list);
- rec != NULL;
+ rec != nullptr;
  rec = (AVND_COMP_HC_REC 
*)m_NCS_DBLIST_FIND_NEXT(>comp_dll_node)) {
 
if (strncmp((char*)rec->key.key, hc_cmd_name, 
sizeof(rec->key.key)) == 0)
@@ -791,7 +791,7 @@ void avnd_comp_hc_cmd_restart(AVND_COMP 
 {
AVND_COMP_HC_REC *rec = find_hc_rec(comp);
/* This may come because of script responding after component was 
terminated by lock-in. */
-   if(rec == NULL)
+   if(rec == nullptr)
return;
 
if (rec->status == AVND_COMP_HC_STATUS_SND_TMR_EXPD) {
@@ -817,7 +817,7 @@ void avnd_comp_hc_cmd_stop(AVND_CB *cb, 
 {
AVND_COMP_HC_REC *rec = find_hc_rec(comp);
 
-   if (rec != NULL)
+   if (rec != nullptr)
avnd_stop_tmr(cb, >tmr);
 }
 

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 22 of 30] amfnd: convert NULL to nullptr for proxy.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/proxy.cc |  16 
 1 files changed, 8 insertions(+), 8 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/proxy.cc 
b/osaf/services/saf/amf/amfnd/proxy.cc
--- a/osaf/services/saf/amf/amfnd/proxy.cc
+++ b/osaf/services/saf/amf/amfnd/proxy.cc
@@ -169,9 +169,9 @@ uint32_t avnd_evt_avd_comp_validation_re
 {
uint32_t rc = NCSCC_RC_SUCCESS;
AVND_DND_MSG_LIST *rec = 0;
-   AVSV_D2N_COMP_VALIDATION_RESP_INFO *info = NULL;
+   AVSV_D2N_COMP_VALIDATION_RESP_INFO *info = nullptr;
SaAisErrorT amf_rc = SA_AIS_OK;
-   AVND_COMP *comp = NULL, *pxy_comp = NULL;
+   AVND_COMP *comp = nullptr, *pxy_comp = nullptr;
AVSV_N2D_COMP_VALIDATION_INFO comp_valid_info;
AVSV_AMF_API_INFO api_info;
 
@@ -188,7 +188,7 @@ uint32_t avnd_evt_avd_comp_validation_re
 
m_AVND_DIQ_REC_FIND(cb, info->msg_id, rec);
 
-   if ((NULL == rec) || (memcmp(>comp_name,
+   if ((nullptr == rec) || (memcmp(>comp_name,
 
>msg.info.avd->msg_info.n2d_comp_valid_info.comp_name,
 sizeof(SaNameT)) != 0)) {
/* Seems the rec was deleted, some problem. */
@@ -227,7 +227,7 @@ uint32_t avnd_evt_avd_comp_validation_re
goto send_resp;
}
 
-   if ((NULL != pxy_comp) && 
(!m_AVND_COMP_IS_REG(pxy_comp))) {
+   if ((nullptr != pxy_comp) && 
(!m_AVND_COMP_IS_REG(pxy_comp))) {
avnd_internode_comp_del(cb, 
&(cb->internode_avail_comp_db), &(info->comp_name));
rc = NCSCC_RC_FAILURE;
amf_rc = SA_AIS_ERR_NOT_EXIST;
@@ -286,7 +286,7 @@ uint32_t avnd_evt_avd_comp_validation_re
 
/* send the response back to AvA */
rc = avnd_amf_resp_send(cb, AVSV_AMF_COMP_REG, amf_rc, 0,
-   _valid_info.mds_dest, 
_valid_info.mds_ctxt, NULL, false);
+   _valid_info.mds_dest, 
_valid_info.mds_ctxt, nullptr, false);
 
  done:
if (rec) {
@@ -322,7 +322,7 @@ uint32_t avnd_avnd_msg_send(AVND_CB *cb,
 {
uint32_t rc = NCSCC_RC_SUCCESS;
AVND_MSG msg;
-   AVSV_ND2ND_AVA_MSG *nd_nd_ava_msg = NULL;
+   AVSV_ND2ND_AVA_MSG *nd_nd_ava_msg = nullptr;
MDS_DEST i_to_dest = 0;
AVSV_AMF_API_INFO *info = (AVSV_AMF_API_INFO *)msg_info;
 
@@ -413,7 +413,7 @@ uint32_t avnd_int_ext_comp_hdlr(AVND_CB 
 MDS_SYNC_SND_CTXT *ctxt, SaAisErrorT *o_amf_rc, 
bool *int_ext_comp)
 {
uint32_t rc = NCSCC_RC_SUCCESS;
-   AVND_COMP *o_comp = NULL;
+   AVND_COMP *o_comp = nullptr;
SaNameT comp_name;
bool send_resp = true;
AVND_COMP_CBK *cbk_rec = 0;
@@ -572,7 +572,7 @@ resp to originator AvND.
  resp_send:
 
if (true == send_resp) {
-   rc = avnd_amf_resp_send(cb, api_info->type, *o_amf_rc, 0, 
_info->dest, ctxt, NULL, false);
+   rc = avnd_amf_resp_send(cb, api_info->type, *o_amf_rc, 0, 
_info->dest, ctxt, nullptr, false);
}
 
  done:

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 30 of 30] amfnd: convert NULL to nullptr for avnd_comp.h [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/include/avnd_comp.h |  14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/include/avnd_comp.h 
b/osaf/services/saf/amf/amfnd/include/avnd_comp.h
--- a/osaf/services/saf/amf/amfnd/include/avnd_comp.h
+++ b/osaf/services/saf/amf/amfnd/include/avnd_comp.h
@@ -660,28 +660,28 @@ typedef struct avnd_comp_tag {
 /* macro to parse the clc cmd string */
 #define m_AVND_COMP_CLC_STR_PARSE(st, sc, ac, av, tav) \
 { \
-   char str[SAAMF_CLC_LEN], *tok = NULL; \
+   char str[SAAMF_CLC_LEN], *tok = nullptr; \
/* copy the str as strtok modifies the original str */ \
strcpy(str, st); \
ac = 0; \
-   if ( NULL != (tok = strtok(str, " ")) ) { \
+   if ( nullptr != (tok = strtok(str, " ")) ) { \
   strncpy(sc, tok, SAAMF_CLC_LEN-1); \
   av[ac] = sc; \
} \
ac++; \
-   while ( (NULL != (tok = strtok(NULL, " "))) && \
+   while ( (nullptr != (tok = strtok(nullptr, " "))) && \
(ac < (AVND_COMP_CLC_PARAM_MAX+1)) ) { \
   if ( strlen(tok) > AVND_COMP_CLC_PARAM_SIZE_MAX ) break; \
   strcpy(tav[ac], tok); \
   av[ac] = tav[ac]; \
   ac++;\
} \
-   if ( NULL != tok ) { \
-  sc[0] = (char)(long)NULL; \
-  av[0] = NULL; \
+   if ( nullptr != tok ) { \
+  sc[0] = (char)(long)nullptr; \
+  av[0] = nullptr; \
   ac = 0; \
} else \
-  av[ac] = NULL; \
+  av[ac] = nullptr; \
 }
 
 /* macros for comp proxy status */

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 27 of 30] amfnd: convert NULL to nullptr for term.cc [#1551]

2015-10-20 Thread Long HB Nguyen
 osaf/services/saf/amf/amfnd/term.cc |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/term.cc 
b/osaf/services/saf/amf/amfnd/term.cc
--- a/osaf/services/saf/amf/amfnd/term.cc
+++ b/osaf/services/saf/amf/amfnd/term.cc
@@ -65,7 +65,7 @@ void avnd_last_step_clean(AVND_CB *cb)
LOG_NO("Terminating all AMF components");
 
comp = (AVND_COMP *)ncs_patricia_tree_getnext(>compdb, (uint8_t 
*)0);
-   while (comp != NULL) {
+   while (comp != nullptr) {
if (false == comp->su->su_is_external) {
/* Don't call cleanup script for PI/NPI components in 
UNINSTANTIATED state.*/
if ((comp->pres != SA_AMF_PRESENCE_UNINSTANTIATED) &&
@@ -157,7 +157,7 @@ uint32_t avnd_evt_last_step_term_evh(AVN
sirank = si->rank;
 
/* Remove all assignments of equal rank */
-   for (; (si != NULL) && (si->rank == sirank); ) {
+   for (; (si != nullptr) && (si->rank == sirank); ) {
AVND_SU_SI_REC *currsi = si;
si = avnd_silist_getprev(currsi);
 
@@ -212,7 +212,7 @@ uint32_t avnd_evt_avd_set_leds_evh(AVND_
cb->led_state = AVND_LED_STATE_GREEN;
 
/* Notify the NIS script/deamon that we have fully come up */
-   nid_notify(const_cast("AMFND"), NCSCC_RC_SUCCESS, NULL);
+   nid_notify(const_cast("AMFND"), NCSCC_RC_SUCCESS, nullptr);
 
 done:
TRACE_LEAVE();

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 29 of 48] amfd: convert NULL to nullptr for pg.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/pg.cc |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/pg.cc b/osaf/services/saf/amf/amfd/pg.cc
--- a/osaf/services/saf/amf/amfd/pg.cc
+++ b/osaf/services/saf/amf/amfd/pg.cc
@@ -70,7 +70,7 @@ void avd_pg_trk_act_evh(AVD_CL_CB *cb, A
 
/* run sanity check on the msg */
if ((node = avd_msg_sanity_chk(evt, info->node_id, 
AVSV_N2D_PG_TRACK_ACT_MSG,
-   info->msg_id)) == NULL)
+   info->msg_id)) == nullptr)
goto done;
 
/* Update the receive id for the node */
@@ -85,7 +85,7 @@ void avd_pg_trk_act_evh(AVD_CL_CB *cb, A
csi = csi_db->find(Amf::to_string(>csi_name));
 
/* update the pg lists maintained on csi & node */
-   if (csi != NULL) {
+   if (csi != nullptr) {
switch (info->actn) {
case AVSV_PG_TRACK_ACT_START:
/* add the relvant recs to the lists */
@@ -108,7 +108,7 @@ void avd_pg_trk_act_evh(AVD_CL_CB *cb, A
 
 done:
avsv_dnd_msg_free(evt->info.avnd_msg);
-   evt->info.avnd_msg = NULL;
+   evt->info.avnd_msg = nullptr;
TRACE_LEAVE();
 }
 

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 11 of 48] amfd: convert NULL to nullptr for compcstype.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/compcstype.cc |  44 
 1 files changed, 22 insertions(+), 22 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/compcstype.cc 
b/osaf/services/saf/amf/amfd/compcstype.cc
--- a/osaf/services/saf/amf/amfd/compcstype.cc
+++ b/osaf/services/saf/amf/amfd/compcstype.cc
@@ -29,7 +29,7 @@
 #include 
 #include 
 
-AmfDb *compcstype_db = NULL;;
+AmfDb *compcstype_db = nullptr;;
 
 //
 // TODO(HANO) Temporary use this function instead of strdup which uses malloc.
@@ -56,7 +56,7 @@ void avd_compcstype_db_add(AVD_COMPCS_TY
 {
unsigned int rc;
 
-   if (compcstype_db->find(Amf::to_string(>name)) == NULL) {
+   if (compcstype_db->find(Amf::to_string(>name)) == nullptr) {
rc = compcstype_db->insert(Amf::to_string(>name),cst); 
osafassert(rc == NCSCC_RC_SUCCESS);
}
@@ -74,7 +74,7 @@ AVD_COMPCS_TYPE *avd_compcstype_new(cons
 static void compcstype_add_to_model(AVD_COMPCS_TYPE *cst)
 {
/* Check comp link to see if it has been added already */
-   if (cst->comp == NULL) {
+   if (cst->comp == nullptr) {
SaNameT dn;
avd_compcstype_db_add(cst);
avsv_sanamet_init(>name, , "safComp=");
@@ -100,7 +100,7 @@ static void compcstype_add_to_model(AVD_
 
 AVD_COMPCS_TYPE * avd_compcstype_find_match(const SaNameT *cstype_name, const 
AVD_COMP *comp)
 {
-   AVD_COMPCS_TYPE *cst = NULL;
+   AVD_COMPCS_TYPE *cst = nullptr;
SaNameT dn;
 
TRACE_ENTER();
@@ -128,7 +128,7 @@ static int is_config_valid(const SaNameT
char *p;
 
/* This is an association class, the parent (SaAmfComp) should come 
after the second comma */
-   if ((parent = strchr((char*)dn->value, ',')) == NULL) {
+   if ((parent = strchr((char*)dn->value, ',')) == nullptr) {
report_ccb_validation_error(opdata, "No parent to '%s' ", 
dn->value);
goto free_cstype_name;
}
@@ -136,7 +136,7 @@ static int is_config_valid(const SaNameT
parent++;
 
/* Second comma should be the parent */
-   if ((parent = strchr(parent, ',')) == NULL) {
+   if ((parent = strchr(parent, ',')) == nullptr) {
report_ccb_validation_error(opdata, "No parent to '%s' ", 
dn->value);
goto free_cstype_name;
}
@@ -157,17 +157,17 @@ static int is_config_valid(const SaNameT
avsv_sanamet_init(dn, _name, "safComp=");
comp = comp_db->find(Amf::to_string(_name));
 
-   if (comp != NULL)
+   if (comp != nullptr)
comptype_name = >saAmfCompType;
else {
CcbUtilOperationData_t *tmp;
 
-   if (opdata == NULL) {
+   if (opdata == nullptr) {
report_ccb_validation_error(opdata, "'%s' does not 
exist in model", comp_name.value);
goto free_cstype_name;
}
 
-   if ((tmp = ccbutil_getCcbOpDataByDN(opdata->ccbId, _name)) 
== NULL) {
+   if ((tmp = ccbutil_getCcbOpDataByDN(opdata->ccbId, _name)) 
== nullptr) {
LOG_ER("'%s'does not exist in existing model or in 
CCB", comp_name.value);
osafassert(0);
goto free_cstype_name;
@@ -183,13 +183,13 @@ static int is_config_valid(const SaNameT
 
ctcstype_name.length = sprintf((char*)ctcstype_name.value, "%s,%s", 
cstype_name, comptype_name->value);
 
-   if (ctcstype_db->find(Amf::to_string(_name)) == NULL) {
-   if (opdata == NULL) {
+   if (ctcstype_db->find(Amf::to_string(_name)) == nullptr) {
+   if (opdata == nullptr) {
report_ccb_validation_error(opdata, "'%s' does not 
exist in model", ctcstype_name.value);
goto free_cstype_name;
}
 
-   if (ccbutil_getCcbOpDataByDN(opdata->ccbId, _name) == 
NULL) {
+   if (ccbutil_getCcbOpDataByDN(opdata->ccbId, _name) == 
nullptr) {
report_ccb_validation_error(opdata, "'%s' does not 
exist in existing model or in CCB",
ctcstype_name.value);
goto free_cstype_name;
@@ -222,8 +222,8 @@ static AVD_COMPCS_TYPE *compcstype_creat
** If called at new active at failover, the object is found in the DB
** but needs to get configuration attributes initialized.
*/
-   if ((NULL == (compcstype = compcstype_db->find(Amf::to_string(dn &&
-   ((compcstype = avd_compcstype_new(dn)) == NULL))
+   if ((nullptr == (compcstype = compcstype_db->find(Amf::to_string(dn 
&&
+   ((compcstype = avd_compcstype_new(dn)) == nullptr))
goto done;
 
avsv_sanamet_init(dn, _name, "safComp=");
@@ -287,7 +287,7 @@ SaAisErrorT avd_compcstype_config_get(Sa
const 

[devel] [PATCH 13 of 48] amfd: convert NULL to nullptr for csi.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/csi.cc |  180 +++---
 1 files changed, 90 insertions(+), 90 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/csi.cc 
b/osaf/services/saf/amf/amfd/csi.cc
--- a/osaf/services/saf/amf/amfd/csi.cc
+++ b/osaf/services/saf/amf/amfd/csi.cc
@@ -24,7 +24,7 @@
 #include 
 #include 
 
-AmfDb *csi_db = NULL;
+AmfDb *csi_db = nullptr;
 
 //
 AVD_COMP* AVD_CSI::find_assigned_comp(const SaNameT *cstype,
@@ -35,7 +35,7 @@ AVD_COMP* AVD_CSI::find_assigned_comp(co
   for (; iter != list_of_comp.end(); ++iter) {
 comp = *iter;
 AVD_COMPCS_TYPE *cst;
-if (NULL != (cst = avd_compcstype_find_match(cstype, comp))) {
+if (nullptr != (cst = avd_compcstype_find_match(cstype, comp))) {
   if (SA_AMF_HA_ACTIVE == sisu->state) {
 if (cst->saAmfCompNumCurrActiveCSIs < cst->saAmfCompNumMaxActiveCSIs) {
   break;
@@ -65,7 +65,7 @@ void avd_csi_delete(AVD_CSI *csi)
 
/* Delete CSI attributes */
temp = csi->list_attributes;
-   while (temp != NULL) {
+   while (temp != nullptr) {
avd_csi_remove_csiattr(csi, temp);
temp = csi->list_attributes;
}
@@ -75,12 +75,12 @@ void avd_csi_delete(AVD_CSI *csi)
 
csi_db->erase(Amf::to_string(>name));

-   if (csi->saAmfCSIDependencies != NULL) {
+   if (csi->saAmfCSIDependencies != nullptr) {
AVD_CSI_DEPS *csi_dep;
AVD_CSI_DEPS *next_csi_dep;

csi_dep = csi->saAmfCSIDependencies;
-   while (csi_dep != NULL) {
+   while (csi_dep != nullptr) {
next_csi_dep = csi_dep->csi_dep_next;
delete csi_dep;
csi_dep = next_csi_dep;
@@ -98,7 +98,7 @@ void csi_cmplt_delete(AVD_CSI *csi, bool
if (!ckpt) {
/* inform the avnds that track this csi */
for (curr = (AVD_PG_CSI_NODE 
*)m_NCS_DBLIST_FIND_FIRST(>pg_node_list);
-   curr != NULL; curr = (AVD_PG_CSI_NODE 
*)m_NCS_DBLIST_FIND_NEXT(>csi_dll_node)) {
+   curr != nullptr; curr = (AVD_PG_CSI_NODE 
*)m_NCS_DBLIST_FIND_NEXT(>csi_dll_node)) {
   avd_snd_pg_upd_msg(avd_cb, curr->node, 0, 
static_cast(0), >name);
}
}
@@ -124,7 +124,7 @@ static int is_config_valid(const SaNameT
const char *parent;
unsigned int values_number;
 
-   if ((parent = avd_getparent((const char*)dn->value)) == NULL) {
+   if ((parent = avd_getparent((const char*)dn->value)) == nullptr) {
report_ccb_validation_error(opdata, "No parent to '%s' ", 
dn->value);
return 0;
}
@@ -137,14 +137,14 @@ static int is_config_valid(const SaNameT
rc = immutil_getAttr(const_cast("saAmfCSType"), 
attributes, 0, );
osafassert(rc == SA_AIS_OK);
 
-   if (cstype_db->find(Amf::to_string()) == NULL) {
+   if (cstype_db->find(Amf::to_string()) == nullptr) {
/* CS type does not exist in current model, check CCB if passed 
as param */
-   if (opdata == NULL) {
+   if (opdata == nullptr) {
report_ccb_validation_error(opdata, "'%s' does not 
exist in model", aname.value);
return 0;
}
 
-   if (ccbutil_getCcbOpDataByDN(opdata->ccbId, ) == NULL) {
+   if (ccbutil_getCcbOpDataByDN(opdata->ccbId, ) == nullptr) 
{
report_ccb_validation_error(opdata, "'%s' does not 
exist in existing model or in CCB", aname.value);
return 0;
}
@@ -168,9 +168,9 @@ static int is_config_valid(const SaNameT
return 0;
}
 
-   if (csi_db->find(Amf::to_string()) 
== NULL) {
+   if (csi_db->find(Amf::to_string()) 
== nullptr) {
/* CSI does not exist in current model, check 
CCB if passed as param */
-   if (opdata == NULL) {
+   if (opdata == nullptr) {
/* initial loading, check IMM */
if 
(!object_exist_in_imm()) {

report_ccb_validation_error(opdata, "'%s' validation failed - '%s' does not"
@@ -178,7 +178,7 @@ static int is_config_valid(const SaNameT
dn->value, 
saAmfCSIDependency.value);
return 0;
}
-   } else if 
(ccbutil_getCcbOpDataByDN(opdata->ccbId, ) == NULL) {
+   } else if 
(ccbutil_getCcbOpDataByDN(opdata->ccbId, ) == nullptr) {
 

[devel] [PATCH 38 of 48] amfd: convert NULL to nullptr for sgtype.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/sgtype.cc |  42 ++--
 1 files changed, 21 insertions(+), 21 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/sgtype.cc 
b/osaf/services/saf/amf/amfd/sgtype.cc
--- a/osaf/services/saf/amf/amfd/sgtype.cc
+++ b/osaf/services/saf/amf/amfd/sgtype.cc
@@ -28,7 +28,7 @@
 #include 
 #include 
 
-AmfDb *sgtype_db = NULL;
+AmfDb *sgtype_db = nullptr;
 
 void avd_sgtype_add_sg(AVD_SG *sg)
 {
@@ -87,7 +87,7 @@ static int is_config_valid(const SaNameT
AVD_SUTYPE *sut;
const SaImmAttrValuesT_2 *attr;
 
-   if ((parent = strchr((char*)dn->value, ',')) == NULL) {
+   if ((parent = strchr((char*)dn->value, ',')) == nullptr) {
report_ccb_validation_error(opdata, "No parent to '%s' ", 
dn->value);
return 0;
}
@@ -107,7 +107,7 @@ static int is_config_valid(const SaNameT
return 0;
}
 
-   while ((attr = attributes[i++]) != NULL)
+   while ((attr = attributes[i++]) != nullptr)
if (!strcmp(attr->attrName, "saAmfSgtValidSuTypes"))
break;
 
@@ -117,14 +117,14 @@ static int is_config_valid(const SaNameT
for (j = 0; j < attr->attrValuesNumber; j++) {
SaNameT *name = (SaNameT *)attr->attrValues[j];
sut = sutype_db->find(Amf::to_string(name));
-   if (sut == NULL) {
-   if (opdata == NULL) {
+   if (sut == nullptr) {
+   if (opdata == nullptr) {
report_ccb_validation_error(opdata, "'%s' does 
not exist in model", name->value);
return 0;
}

/* SG type does not exist in current model, check CCB */
-   if (ccbutil_getCcbOpDataByDN(opdata->ccbId, name) == 
NULL) {
+   if (ccbutil_getCcbOpDataByDN(opdata->ccbId, name) == 
nullptr) {
report_ccb_validation_error(opdata, "'%s' does 
not exist either in model or CCB",
name->value);
return 0;
@@ -180,7 +180,7 @@ static AVD_AMF_SG_TYPE *sgtype_create(Sa
error = 
immutil_getAttr(const_cast("saAmfSgtRedundancyModel"), 
attributes, 0, >saAmfSgtRedundancyModel);
osafassert(error == SA_AIS_OK);
 
-   while ((attr = attributes[i++]) != NULL)
+   while ((attr = attributes[i++]) != nullptr)
if (!strcmp(attr->attrName, "saAmfSgtValidSuTypes"))
break;
 
@@ -234,7 +234,7 @@ static AVD_AMF_SG_TYPE *sgtype_create(Sa
if (rc != 0) {
delete [] sgt->saAmfSGtValidSuTypes;
delete sgt;
-   sgt = NULL;
+   sgt = nullptr;
}
 
TRACE_LEAVE();
@@ -263,9 +263,9 @@ SaAisErrorT avd_sgtype_config_get(void)
searchParam.searchOneAttr.attrValueType = SA_IMM_ATTR_SASTRINGT;
searchParam.searchOneAttr.attrValue = 
 
-   error = immutil_saImmOmSearchInitialize_2(avd_cb->immOmHandle, NULL, 
SA_IMM_SUBTREE,
+   error = immutil_saImmOmSearchInitialize_2(avd_cb->immOmHandle, nullptr, 
SA_IMM_SUBTREE,
  SA_IMM_SEARCH_ONE_ATTR | 
SA_IMM_SEARCH_GET_ALL_ATTR, ,
- NULL, );
+ nullptr, );
 
if (SA_AIS_OK != error) {
LOG_ER("saImmOmSearchInitialize_2 failed: %u", error);
@@ -273,10 +273,10 @@ SaAisErrorT avd_sgtype_config_get(void)
}
 
while (immutil_saImmOmSearchNext_2(searchHandle, , 
(SaImmAttrValuesT_2 ***)) == SA_AIS_OK) {
-   if (!is_config_valid(, attributes, NULL))
+   if (!is_config_valid(, attributes, nullptr))
goto done2;
-   if (( sgt = sgtype_db->find(Amf::to_string())) == NULL) {
-   if ((sgt = sgtype_create(, attributes)) == NULL)
+   if (( sgt = sgtype_db->find(Amf::to_string())) == nullptr) {
+   if ((sgt = sgtype_create(, attributes)) == nullptr)
goto done2;
 
sgtype_add_to_model(sgt);
@@ -307,9 +307,9 @@ static SaAisErrorT sgtype_ccb_completed_
AVD_AMF_SG_TYPE *sgt = 
sgtype_db->find(Amf::to_string(>objectName));
 
TRACE_ENTER2("CCB ID %llu, '%s'", opdata->ccbId, 
opdata->objectName.value);
-   while ((attr_mod = opdata->param.modify.attrMods[i++]) != NULL) {
+   while ((attr_mod = opdata->param.modify.attrMods[i++]) != nullptr) {

-   if ((attr_mod->modType == SA_IMM_ATTR_VALUES_DELETE) || 
(attr_mod->modAttr.attrValues == NULL))
+   if ((attr_mod->modType == SA_IMM_ATTR_VALUES_DELETE) || 

[devel] [PATCH 35 of 48] amfd: convert NULL to nullptr for sg_nway_fsm.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/sg_nway_fsm.cc |  188 +++---
 1 files changed, 94 insertions(+), 94 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/sg_nway_fsm.cc 
b/osaf/services/saf/amf/amfd/sg_nway_fsm.cc
--- a/osaf/services/saf/amf/amfd/sg_nway_fsm.cc
+++ b/osaf/services/saf/amf/amfd/sg_nway_fsm.cc
@@ -347,7 +347,7 @@ uint32_t SG_NWAY::susi_failed(AVD_CL_CB 
}
}
else if ((susi->state == SA_AMF_HA_ACTIVE) && (susi->su 
== sg->min_assigned_su)) {
-   AVD_SU_SI_REL *t_susi = NULL;
+   AVD_SU_SI_REL *t_susi = nullptr;
/* if the si is assigned active on min su in SI 
transfer */
/* delete the quiesced assignment on the max su 
 and let su failure
 * handling take care of assigning the standby 
to active */
@@ -362,9 +362,9 @@ uint32_t SG_NWAY::susi_failed(AVD_CL_CB 
}
}
/* reset all the pointers marked for si transfer */
-   sg->si_tobe_redistributed = NULL;
-   sg->max_assigned_su = NULL;
-   sg->min_assigned_su = NULL;
+   sg->si_tobe_redistributed = nullptr;
+   sg->max_assigned_su = nullptr;
+   sg->min_assigned_su = nullptr;
m_AVSV_SEND_CKPT_UPDT_ASYNC_RMV(avd_cb, sg, 
AVSV_CKPT_AVD_SI_TRANS);
TRACE ("SI transfer FAILED '%s'", susi->si->name.value);
}
@@ -788,11 +788,11 @@ done:
  */
 static void avd_sg_nway_swap_si_redistr(AVD_SG *sg)
 {
-   AVD_SU_SI_REL *susi = NULL;
-
-   osafassert(sg->si_tobe_redistributed != NULL);
-   osafassert(sg->max_assigned_su != NULL);
-   osafassert(sg->min_assigned_su != NULL);
+   AVD_SU_SI_REL *susi = nullptr;
+
+   osafassert(sg->si_tobe_redistributed != nullptr);
+   osafassert(sg->max_assigned_su != nullptr);
+   osafassert(sg->min_assigned_su != nullptr);
 
TRACE_ENTER2("'%s' from '%s' to '%s'", 
sg->si_tobe_redistributed->name.value,
 sg->max_assigned_su->name.value, 
sg->min_assigned_su->name.value);
@@ -801,7 +801,7 @@ static void avd_sg_nway_swap_si_redistr(
 
/* get the susi that is to be transferred */
susi = avd_su_susi_find(avd_cb, sg->max_assigned_su, 
>si_tobe_redistributed->name); 
-   osafassert(susi != NULL);
+   osafassert(susi != nullptr);
 
 
if (susi->state == SA_AMF_HA_ACTIVE) {
@@ -810,9 +810,9 @@ static void avd_sg_nway_swap_si_redistr(
 * once the susi response comes make the assignment on the min 
su
 */
if (avd_susi_mod_send(susi, SA_AMF_HA_QUIESCED) == 
NCSCC_RC_FAILURE) {
-   sg->max_assigned_su = NULL;
-   sg->min_assigned_su = NULL;
-   sg->si_tobe_redistributed = NULL;
+   sg->max_assigned_su = nullptr;
+   sg->min_assigned_su = nullptr;
+   sg->si_tobe_redistributed = nullptr;
m_AVSV_SEND_CKPT_UPDT_ASYNC_RMV(avd_cb, sg, 
AVSV_CKPT_AVD_SI_TRANS);
} else {
m_AVD_SET_SG_FSM(avd_cb, susi->su->sg_of_su, 
AVD_SG_FSM_SI_OPER);
@@ -833,9 +833,9 @@ static void avd_sg_nway_swap_si_redistr(
 * flow will take care of assigning the removed SI 
 * to the possible minimum assigned SU
 */
-   sg->max_assigned_su = NULL;
-   sg->min_assigned_su = NULL;
-   sg->si_tobe_redistributed = NULL;
+   sg->max_assigned_su = nullptr;
+   sg->min_assigned_su = nullptr;
+   sg->si_tobe_redistributed = nullptr;
m_AVSV_SEND_CKPT_UPDT_ASYNC_RMV(avd_cb, sg, 
AVSV_CKPT_AVD_SI_TRANS);
} else {
/* susi to be redistributed cannot be in any other HA state */
@@ -856,7 +856,7 @@ avd_sirankedsu_t *avd_si_find_sirankedsu
 {
 avd_sirankedsu_t *temp_su;
 
-for (temp_su = si->rankedsu_list_head; temp_su != NULL; temp_su = 
temp_su->next) {
+for (temp_su = si->rankedsu_list_head; temp_su != nullptr; temp_su = 
temp_su->next) {
 if (memcmp(_su->suname, >name, sizeof(SaNameT)) == 0)
 break;
 }
@@ -877,15 +877,15 @@ static uint32_t su_has_any_non_ranked_as
 
TRACE_ENTER2("'%s' for state '%u'",su->name.value,ha_state);
 
-   for (susi = su->list_of_susi;susi != NULL;susi = susi->su_next) {
+   for (susi = su->list_of_susi;susi != nullptr;susi = susi->su_next) {
if (susi->state == ha_state) {
-if (NULL == susi->si->rankedsu_list_head) {
+if (nullptr 

[devel] [PATCH 17 of 48] amfd: convert NULL to nullptr for dmsg.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/dmsg.cc |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/dmsg.cc 
b/osaf/services/saf/amf/amfd/dmsg.cc
--- a/osaf/services/saf/amf/amfd/dmsg.cc
+++ b/osaf/services/saf/amf/amfd/dmsg.cc
@@ -57,7 +57,7 @@
 
 void avd_mds_d_enc(MDS_CALLBACK_ENC_INFO *enc_info)
 {
-   NCS_UBAID *uba = NULL;
+   NCS_UBAID *uba = nullptr;
uint8_t *data;
AVD_D2D_MSG *msg = 0;
 
@@ -232,5 +232,5 @@ uint32_t avd_d2d_msg_rcv(AVD_D2D_MSG *rc
 void avsv_d2d_msg_free(AVD_D2D_MSG *d2d_msg)
 {
delete d2d_msg;
-   d2d_msg = NULL;
+   d2d_msg = nullptr;
 }

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 08 of 48] amfd: convert NULL to nullptr for clm.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/clm.cc |  20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/clm.cc 
b/osaf/services/saf/amf/amfd/clm.cc
--- a/osaf/services/saf/amf/amfd/clm.cc
+++ b/osaf/services/saf/amf/amfd/clm.cc
@@ -96,7 +96,7 @@ static void clm_node_exit_validate(AVD_A
for (const auto& su : node->list_of_su) {
susi = su->list_of_susi;
/* now evalutate each SI that is assigned to this SU */
-   while (susi != NULL) {
+   while (susi != nullptr) {
if ((susi->state == SA_AMF_HA_ACTIVE) &&
(susi->si->saAmfSINumCurrActiveAssignments == 1) &&
(susi->si->saAmfSINumCurrStandbyAssignments == 0) &&
@@ -162,7 +162,7 @@ static void clm_node_exit_start(AVD_AVND
}
 
if (change == SA_CLM_NODE_SHUTDOWN) {
-   /* call with NULL invocation to differentiate it with AMF node 
shutdown. */
+   /* call with nullptr invocation to differentiate it with AMF 
node shutdown. */
avd_node_admin_lock_unlock_shutdown(node, 0, 
SA_AMF_ADMIN_SHUTDOWN); 
}
else {/* SA_CLM_NODE_LEFT case */
@@ -183,7 +183,7 @@ static void clm_node_exit_complete(SaClm
 
TRACE_ENTER2("%x", nodeId);
 
-   if (node == NULL) {
+   if (node == nullptr) {
LOG_IN("Node %x left but is not an AMF cluster member", nodeId);
goto done;
}
@@ -230,7 +230,7 @@ static void clm_track_cb(const SaClmClus
case SA_CLM_CHANGE_VALIDATE:
if(notifItem->clusterChange == SA_CLM_NODE_LEFT) {
node = 
avd_node_find_nodeid(notifItem->clusterNode.nodeId);
-   if (node == NULL) {
+   if (node == nullptr) {
LOG_IN("%s: CLM node '%s' is not an AMF 
cluster member",
   __FUNCTION__, 
notifItem->clusterNode.nodeName.value);
goto done;
@@ -247,7 +247,7 @@ static void clm_track_cb(const SaClmClus
 
case SA_CLM_CHANGE_START:
node = 
avd_node_find_nodeid(notifItem->clusterNode.nodeId);
-   if (node == NULL) {
+   if (node == nullptr) {
LOG_IN("%s: CLM node '%s' is not an AMF cluster 
member",
   __FUNCTION__, 
notifItem->clusterNode.nodeName.value);
goto done;
@@ -270,7 +270,7 @@ static void clm_track_cb(const SaClmClus
if( (notifItem->clusterChange == SA_CLM_NODE_LEFT)||
(notifItem->clusterChange == SA_CLM_NODE_SHUTDOWN)) 
{
node = 
avd_node_find_nodeid(notifItem->clusterNode.nodeId);
-   if (node == NULL) {
+   if (node == nullptr) {
LOG_IN("%s: CLM node '%s' is not an AMF 
cluster member",
   __FUNCTION__, 
notifItem->clusterNode.nodeName.value);
goto done;
@@ -315,7 +315,7 @@ static void clm_track_cb(const SaClmClus
/* delete, reconfigure, re-add to the node-id db
   incase if the node id has changed */
node = 
avd_node_find_nodeid(notifItem->clusterNode.nodeId);
-   if (node == NULL) {
+   if (node == nullptr) {
LOG_NO("Node not a member");
goto done;
}
@@ -330,7 +330,7 @@ static void clm_track_cb(const SaClmClus
   SA_TRACK_CURRENT|CHANGES_ONLY and supply no 
buffer
   in saClmClusterTrack call so update the 
local database */
/* get the first node */
-   node = NULL;
+   node = nullptr;
for (std::map::const_iterator it = node_name_db->begin();
it != node_name_db->end(); 
it++) {
node = it->second;
@@ -339,7 +339,7 @@ static void clm_track_cb(const SaClmClus

notifItem->clusterNode.nodeName.length))
break;
}
-   if ( node != NULL ) {
+   if ( node != nullptr ) {

[devel] [PATCH 42 of 48] amfd: convert NULL to nullptr for sirankedsu.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/sirankedsu.cc |  68 
 1 files changed, 34 insertions(+), 34 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/sirankedsu.cc 
b/osaf/services/saf/amf/amfd/sirankedsu.cc
--- a/osaf/services/saf/amf/amfd/sirankedsu.cc
+++ b/osaf/services/saf/amf/amfd/sirankedsu.cc
@@ -35,12 +35,12 @@
 #include 
 #include 
 
-AmfDb, AVD_SUS_PER_SI_RANK> *sirankedsu_db= 
NULL;
+AmfDb, AVD_SUS_PER_SI_RANK> *sirankedsu_db= 
nullptr;
 static void avd_susi_namet_init(const SaNameT *object_name, SaNameT *su_name, 
SaNameT *si_name);
 
 static void avd_sirankedsu_db_add(AVD_SUS_PER_SI_RANK *sirankedsu)
 {
-AVD_SI *avd_si = NULL;
+AVD_SI *avd_si = nullptr;
unsigned int rc = 
sirankedsu_db->insert(make_pair(Amf::to_string(&(sirankedsu->indx.si_name)),
sirankedsu->indx.su_rank), sirankedsu);
 osafassert(rc == NCSCC_RC_SUCCESS);
@@ -105,7 +105,7 @@ static AVD_SUS_PER_SI_RANK *avd_siranked
 
 static AVD_SUS_PER_SI_RANK *avd_sirankedsu_find(AVD_CL_CB *cb, 
AVD_SUS_PER_SI_RANK_INDX indx)
 {
-   AVD_SUS_PER_SI_RANK *ranked_su_per_si = NULL;
+   AVD_SUS_PER_SI_RANK *ranked_su_per_si = nullptr;
AVD_SUS_PER_SI_RANK_INDX rank_indx;
 
memset(_indx, '\0', sizeof(AVD_SUS_PER_SI_RANK_INDX));
@@ -136,7 +136,7 @@ static AVD_SUS_PER_SI_RANK *avd_siranked
  **/
 static uint32_t avd_sirankedsu_delete(AVD_CL_CB *cb, AVD_SUS_PER_SI_RANK 
*ranked_su_per_si)
 {
-   if (ranked_su_per_si == NULL)
+   if (ranked_su_per_si == nullptr)
return NCSCC_RC_FAILURE;
 

sirankedsu_db->erase(make_pair(Amf::to_string(&(ranked_su_per_si->indx.si_name)),
@@ -163,7 +163,7 @@ static AVD_SUS_PER_SI_RANK * avd_siranke
const SaImmAttrValuesT_2 **attributes)
 {
 uint32_t rank = 0;
-   AVD_SUS_PER_SI_RANK *avd_sus_per_si_rank = NULL;
+   AVD_SUS_PER_SI_RANK *avd_sus_per_si_rank = nullptr;
SaNameT su_name;
SaNameT si_name;
AVD_SUS_PER_SI_RANK_INDX indx;
@@ -204,13 +204,13 @@ static AVD_SUS_PER_SI_RANK * avd_siranke
  **/
 static void avd_sirankedsu_del_si_list(AVD_CL_CB *cb, AVD_SUS_PER_SI_RANK 
*sus_per_si_rank)
 {
-   AVD_SUS_PER_SI_RANK *i_sus_per_si_rank = NULL;
-   AVD_SUS_PER_SI_RANK *prev_sus_per_si_rank = NULL;
+   AVD_SUS_PER_SI_RANK *i_sus_per_si_rank = nullptr;
+   AVD_SUS_PER_SI_RANK *prev_sus_per_si_rank = nullptr;
 
-   if (sus_per_si_rank->sus_per_si_rank_on_si != NULL) {
+   if (sus_per_si_rank->sus_per_si_rank_on_si != nullptr) {
i_sus_per_si_rank = 
sus_per_si_rank->sus_per_si_rank_on_si->list_of_sus_per_si_rank;
 
-   while ((i_sus_per_si_rank != NULL) && (i_sus_per_si_rank != 
sus_per_si_rank)) {
+   while ((i_sus_per_si_rank != nullptr) && (i_sus_per_si_rank != 
sus_per_si_rank)) {
prev_sus_per_si_rank = i_sus_per_si_rank;
i_sus_per_si_rank = 
i_sus_per_si_rank->sus_per_si_rank_list_si_next;
}
@@ -220,7 +220,7 @@ static void avd_sirankedsu_del_si_list(A
sus_per_si_rank->indx.si_name.value, 
sus_per_si_rank->su_name.value,
sus_per_si_rank->indx.su_rank);
} else {
-   if (prev_sus_per_si_rank == NULL) {
+   if (prev_sus_per_si_rank == nullptr) {

sus_per_si_rank->sus_per_si_rank_on_si->list_of_sus_per_si_rank =

sus_per_si_rank->sus_per_si_rank_list_si_next;
} else {
@@ -230,8 +230,8 @@ static void avd_sirankedsu_del_si_list(A
}

sus_per_si_rank->sus_per_si_rank_on_si->remove_rankedsu(_per_si_rank->su_name);
 
-   sus_per_si_rank->sus_per_si_rank_list_si_next = NULL;
-   sus_per_si_rank->sus_per_si_rank_on_si = NULL;
+   sus_per_si_rank->sus_per_si_rank_list_si_next = nullptr;
+   sus_per_si_rank->sus_per_si_rank_on_si = nullptr;
}
 
return;
@@ -239,12 +239,12 @@ static void avd_sirankedsu_del_si_list(A
 
 static int is_config_valid(const SaNameT *dn, const SaImmAttrValuesT_2 
**attributes, CcbUtilOperationData_t *opdata)
 {
-AVD_SI *avd_si = NULL;
+AVD_SI *avd_si = nullptr;
SaNameT su_name;
SaNameT si_name;
 uint32_t rank = 0;
AVD_SUS_PER_SI_RANK_INDX indx;
-   AVD_SU *avd_su = NULL;
+   AVD_SU *avd_su = nullptr;
 
 memset(_name, 0, sizeof(SaNameT));
 memset(_name, 0, sizeof(SaNameT));
@@ -253,14 +253,14 @@ static int is_config_valid(const SaNameT
 /* Find the si name. */
 avd_si = 

[devel] [PATCH 32 of 48] amfd: convert NULL to nullptr for sg_2n_fsm.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/sg_2n_fsm.cc |  248 
 1 files changed, 124 insertions(+), 124 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc 
b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
--- a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
+++ b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
@@ -45,12 +45,12 @@ static void complete_siswap(AVD_SU *su, 
TRACE_ENTER();
 
/* find the SI on which SWAP admin operation is pending */
-   for (l_susi = su->list_of_susi; l_susi != NULL; l_susi = 
l_susi->su_next) {
+   for (l_susi = su->list_of_susi; l_susi != nullptr; l_susi = 
l_susi->su_next) {
if (l_susi->si->invocation != 0)
break;
}
 
-   if (l_susi != NULL) {
+   if (l_susi != nullptr) {
avd_saImmOiAdminOperationResult(avd_cb->immOiHandle, 
l_susi->si->invocation, status);
l_susi->si->invocation = 0;
LOG_NO("%s Swap done", l_susi->si->name.value);
@@ -81,7 +81,7 @@ AVD_SU_SI_STATE avd_su_fsm_state_determi
 
temp_susi = su->list_of_susi;
osafassert(temp_susi);
-   while (NULL != temp_susi) {
+   while (nullptr != temp_susi) {
fsm_state = temp_susi->fsm;
if (AVD_SU_SI_STATE_ASGN == temp_susi->fsm) {
assigning_flag =  true;
@@ -176,7 +176,7 @@ bool all_assignments_done(const AVD_SU *
 {
AVD_SU_SI_REL *susi;
 
-   for (susi = su->list_of_susi;susi != NULL;susi = susi->su_next) {
+   for (susi = su->list_of_susi;susi != nullptr;susi = susi->su_next) {
if (AVD_SU_SI_STATE_ASGND != susi->fsm)
return false;
}
@@ -262,12 +262,12 @@ static AVD_SU_SI_REL *su_assigned_susi_f
 {
AVD_SU_SI_REL *susi, *another_su_susi;
bool act_found = false, quisced_found = false, std_found = false, 
any_susi_act_found = false;
-   AVD_SU_SI_REL *a_susi = NULL;
-   AVD_SU_SI_REL *s_susi = NULL;
+   AVD_SU_SI_REL *a_susi = nullptr;
+   AVD_SU_SI_REL *s_susi = nullptr;
 
TRACE_ENTER2("'%s'", su->name.value);
 
-   for (susi = su->list_of_susi;NULL != susi;susi = susi->su_next ) {
+   for (susi = su->list_of_susi;nullptr != susi;susi = susi->su_next ) {
if (SA_AMF_HA_ACTIVE == susi->state) {
act_found = true;
TRACE("Act su'%s', si'%s'", susi->su->name.value, 
susi->si->name.value);
@@ -290,11 +290,11 @@ static AVD_SU_SI_REL *su_assigned_susi_f
for (const auto& si_temp : su->sg_of_su->list_of_si) {
TRACE("si'%s'", si_temp->name.value);
/* check to see if this SI has both the assignments */
-   if (NULL == (susi = si_temp->list_of_sisu)) {
+   if (nullptr == (susi = si_temp->list_of_sisu)) {
continue;
}
TRACE("su'%s', si'%s'", susi->su->name.value, 
susi->si->name.value);
-   if (NULL != susi->si_next) {
+   if (nullptr != susi->si_next) {
if (su == susi->su) {
a_susi = susi;
s_susi = susi->si_next;
@@ -326,16 +326,16 @@ static AVD_SU_SI_REL *su_assigned_susi_f
for (const auto& si_temp : su->sg_of_su->list_of_si) {
TRACE("si'%s'", si_temp->name.value);
/* check to see if this SI has both the assignments */
-   if (NULL == (susi = si_temp->list_of_sisu)) {
+   if (nullptr == (susi = si_temp->list_of_sisu)) {
continue;
}
TRACE("su'%s', si'%s'", susi->su->name.value, 
susi->si->name.value);
-   if (NULL != susi->si_next) {
+   if (nullptr != susi->si_next) {
if (su == susi->su) {
/* If quisced_found is true, then we 
need to check wether any one SUSI is Act
   on another SU. If yes, then other SU 
will be considered as Act. */
another_su_susi = 
susi->si_next->su->list_of_susi;
-   while (NULL != another_su_susi) {
+   while (nullptr != another_su_susi) {
if (SA_AMF_HA_ACTIVE == 
another_su_susi->state) {
any_susi_act_found = 
true;
break;
@@ -361,7 +361,7 @@ static AVD_SU_SI_REL *su_assigned_susi_f
/* We need to check wether any one SUSI 
is Act on another SU. 

[devel] [PATCH 33 of 48] amfd: convert NULL to nullptr for sg_nored_fsm.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/sg_nored_fsm.cc |  46 +++---
 1 files changed, 23 insertions(+), 23 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/sg_nored_fsm.cc 
b/osaf/services/saf/amf/amfd/sg_nored_fsm.cc
--- a/osaf/services/saf/amf/amfd/sg_nored_fsm.cc
+++ b/osaf/services/saf/amf/amfd/sg_nored_fsm.cc
@@ -49,8 +49,8 @@ AVD_SU *SG_NORED::assign_sis_to_sus() {
(i_si->si_dep_state == AVD_SI_SPONSOR_UNASSIGNED) ||
(i_si->si_dep_state == AVD_SI_READY_TO_UNASSIGN) ||
(i_si->si_dep_state == AVD_SI_UNASSIGNING_DUE_TO_DEP) ||
-   (i_si->list_of_csi == NULL) ||
-   (i_si->list_of_sisu != NULL)) {
+   (i_si->list_of_csi == nullptr) ||
+   (i_si->list_of_sisu != nullptr)) {
continue;
}
 
@@ -60,7 +60,7 @@ AVD_SU *SG_NORED::assign_sis_to_sus() {
for (; iter != list_of_su.end(); ++iter) {
const auto& su = *iter;
if ((su->saAmfSuReadinessState == 
SA_AMF_READINESS_IN_SERVICE) &&
-   (su->list_of_susi == NULL)) {
+   (su->list_of_susi == nullptr)) {
/* if the SU is not null assign active to that 
SU for the SI. */
if (avd_new_assgn_susi(avd_cb, su, i_si, 
SA_AMF_HA_ACTIVE, false, ) == NCSCC_RC_SUCCESS) {
su_oper_list_add(su);
@@ -81,7 +81,7 @@ AVD_SU *SG_NORED::assign_sis_to_sus() {
if (su_oper_list.empty() == false)
return su_oper_list.front();
else
-   return NULL;
+   return nullptr;
 }
 
 uint32_t SG_NORED::si_assign(AVD_CL_CB *cb, AVD_SI *si) {
@@ -97,7 +97,7 @@ uint32_t SG_NORED::si_assign(AVD_CL_CB *
return NCSCC_RC_SUCCESS;
}
 
-   if (assign_sis_to_sus() == NULL) {
+   if (assign_sis_to_sus() == nullptr) {
/* all the assignments have already been done in the SG. */
return NCSCC_RC_SUCCESS;
}
@@ -109,7 +109,7 @@ uint32_t SG_NORED::si_assign(AVD_CL_CB *
 
 uint32_t SG_NORED::su_fault(AVD_CL_CB *cb, AVD_SU *su) {
bool flag;
-   AVD_AVND *su_node_ptr = NULL;
+   AVD_AVND *su_node_ptr = nullptr;
 
TRACE_ENTER2("%u", su->sg_of_su->sg_fsm_state);
 
@@ -306,7 +306,7 @@ uint32_t SG_NORED::su_insvc(AVD_CL_CB *c
return NCSCC_RC_SUCCESS;
}
 
-   if (assign_sis_to_sus() == NULL) {
+   if (assign_sis_to_sus() == nullptr) {
avd_sg_app_su_inst_func(cb, su->sg_of_su);
 
/* all the assignments have already been done in the SG. */
@@ -320,7 +320,7 @@ uint32_t SG_NORED::su_insvc(AVD_CL_CB *c
 uint32_t SG_NORED::susi_success(AVD_CL_CB *cb, AVD_SU *su, AVD_SU_SI_REL *susi,
   AVSV_SUSI_ACT act, SaAmfHAStateT state) {
AVD_SI *l_si;
-   AVD_AVND *su_node_ptr = NULL;
+   AVD_AVND *su_node_ptr = nullptr;
 
TRACE_ENTER2("%u", su->sg_of_su->sg_fsm_state);
osafassert(su->sg_of_su == this);   
@@ -362,7 +362,7 @@ uint32_t SG_NORED::susi_success(AVD_CL_C
}
 
if ((admin_si == AVD_SI_NULL) && (su_oper_list.empty() 
== true)) {
-   if (assign_sis_to_sus() == NULL) {
+   if (assign_sis_to_sus() == nullptr) {
/* No New assignments are been done in 
the SG */
set_fsm_state(AVD_SG_FSM_STABLE);
avd_sidep_sg_take_action(this); 
@@ -406,7 +406,7 @@ uint32_t SG_NORED::susi_success(AVD_CL_C
su_oper_list_del(su);
 
if (su_oper_list.empty() == true) {
-   if (assign_sis_to_sus() == NULL) {
+   if (assign_sis_to_sus() == nullptr) {
/* No New assignments are been done in 
the SG */
set_fsm_state(AVD_SG_FSM_STABLE);
avd_sidep_sg_take_action(this); 
@@ -436,7 +436,7 @@ uint32_t SG_NORED::susi_success(AVD_CL_C
su_oper_list_del(su);
 
if (su->sg_of_su->su_oper_list.empty() == true) {
-   if (assign_sis_to_sus() != NULL) {
+   if (assign_sis_to_sus() != nullptr) {
/* New assignments are been done in the 
SG. */
set_fsm_state(AVD_SG_FSM_SG_REALIGN);
return NCSCC_RC_SUCCESS;
@@ -506,7 +506,7 @@ uint32_t SG_NORED::susi_success(AVD_CL_C
}
 
if (su->sg_of_su->admin_si == 

[devel] [PATCH 28 of 48] amfd: convert NULL to nullptr for ntf.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/ntf.cc |  18 +-
 1 files changed, 9 insertions(+), 9 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/ntf.cc 
b/osaf/services/saf/amf/amfd/ntf.cc
--- a/osaf/services/saf/amf/amfd/ntf.cc
+++ b/osaf/services/saf/amf/amfd/ntf.cc
@@ -120,7 +120,7 @@ void avd_send_cluster_reset_alarm(const 
 SA_AMF_NTFID_CLUSTER_RESET,
 SA_NTF_SOFTWARE_ERROR,
 SA_NTF_SEVERITY_MAJOR,
-NULL,
+nullptr,
 false /* No add_info */);
 
 }
@@ -151,7 +151,7 @@ void avd_send_si_unassigned_alarm(const 
 SA_AMF_NTFID_SI_UNASSIGNED,
 SA_NTF_SOFTWARE_ERROR,
 SA_NTF_SEVERITY_MAJOR,
-NULL,
+nullptr,
 false /* No add_info */);
 
 }
@@ -183,7 +183,7 @@ void avd_send_comp_proxy_status_unproxie
 SA_AMF_NTFID_COMP_UNPROXIED,
 SA_NTF_SOFTWARE_ERROR,
 SA_NTF_SEVERITY_MAJOR,
-NULL,
+nullptr,
 false /* No add_info */);
 
 }
@@ -219,7 +219,7 @@ void avd_send_admin_state_chg_ntf(const 
SA_AMF_ADMIN_STATE,
old_state,
new_state,
-   NULL,
+   nullptr,
false);
 
TRACE_LEAVE();
@@ -256,7 +256,7 @@ void avd_send_oper_chg_ntf(const SaNameT
SA_AMF_OP_STATE,
old_state,
new_state,
-   NULL,
+   nullptr,
false);
TRACE_LEAVE();
 }
@@ -292,7 +292,7 @@ void avd_send_su_pres_state_chg_ntf(cons
SA_AMF_PRESENCE_STATE,
old_state,
new_state,
-   NULL,
+   nullptr,
false);
 
TRACE_LEAVE();
@@ -406,7 +406,7 @@ void avd_send_si_assigned_ntf(const SaNa
SA_AMF_ASSIGNMENT_STATE,
old_state,
new_state,
-   NULL,
+   nullptr,
false);
 
TRACE_LEAVE();
@@ -444,7 +444,7 @@ void avd_send_comp_proxy_status_proxied_
SA_AMF_PROXY_STATUS,
old_status,
new_status,
-   NULL,
+   nullptr,
false);
 
 }
@@ -477,7 +477,7 @@ void avd_alarm_clear(const SaNameT *name
   minorId,
   probableCause,
   SA_NTF_SEVERITY_CLEARED,
-  NULL,
+  nullptr,
   false);
 }
 

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 20 of 48] amfd: convert NULL to nullptr for imm.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/imm.cc |  110 +++---
 1 files changed, 55 insertions(+), 55 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/imm.cc 
b/osaf/services/saf/amf/amfd/imm.cc
--- a/osaf/services/saf/amf/amfd/imm.cc
+++ b/osaf/services/saf/amf/amfd/imm.cc
@@ -120,7 +120,7 @@ ImmObjCreate::~ImmObjCreate()
 {
unsigned int i, j;
 
-   for (i = 0; attrValues_[i] != NULL; i++) {
+   for (i = 0; attrValues_[i] != nullptr; i++) {
SaImmAttrValuesT_2 *attrValue =
(SaImmAttrValuesT_2 *)attrValues_[i];

@@ -147,7 +147,7 @@ AvdJobDequeueResultT ImmObjUpdate::exec(
AvdJobDequeueResultT res;

SaImmAttrModificationT_2 attrMod;
-   const SaImmAttrModificationT_2 *attrMods[] = {, NULL};
+   const SaImmAttrModificationT_2 *attrMods[] = {, nullptr};
SaImmAttrValueT attrValues[] = {value_};
 
TRACE_ENTER2("Update '%s' %s", dn_.value, attributeName_);
@@ -324,7 +324,7 @@ AvdJobDequeueResultT Fifo::execute(SaImm
return JOB_EINVH;
}
 
-   if ((ajob = peek()) == NULL)
+   if ((ajob = peek()) == nullptr)
return JOB_ENOTEXIST;
 
TRACE_ENTER();
@@ -343,7 +343,7 @@ void Fifo::empty()
 
TRACE_ENTER();
 
-   while ((ajob = dequeue()) != NULL) {
+   while ((ajob = dequeue()) != nullptr) {
delete ajob;
}
 
@@ -521,10 +521,10 @@ static const SaImmAttrValuesT_2 **dupSaI
const SaImmAttrValuesT_2 **copy;
unsigned int i, alen = 0;
 
-   if (original == NULL)
-   return NULL;
+   if (original == nullptr)
+   return nullptr;
 
-   while (original[alen] != NULL)
+   while (original[alen] != nullptr)
alen++;
 
copy = new const SaImmAttrValuesT_2*[alen + 1]();
@@ -692,8 +692,8 @@ static void admin_operation_cb(SaImmOiHa
(strncmp((char*)object_name->value, applierNamePrefix, 
strlen(applierNamePrefix)) == 0)) {
// admin op targeted at the AMF implementer itself
if (op_id == 99) {
-   char *filename = NULL;
-   if (params[0] != NULL) {
+   char *filename = nullptr;
+   if (params[0] != nullptr) {
const SaImmAdminOperationParamsT_2 *param = 
params[0];
if (param->paramType == SA_IMM_ATTR_SASTRINGT &&
strcmp(param->paramName, 
"filename") == 0)
@@ -704,16 +704,16 @@ static void admin_operation_cb(SaImmOiHa
(void) 
saImmOiAdminOperationResult(immoi_handle, invocation, SA_AIS_OK);
else
report_admin_op_error(immoi_handle, invocation,
-   SA_AIS_ERR_INVALID_PARAM, NULL, "%s", 
strerror(rc));
+   SA_AIS_ERR_INVALID_PARAM, nullptr,  
"%s", strerror(rc));
} else
-   report_admin_op_error(immoi_handle, invocation, 
SA_AIS_ERR_INVALID_PARAM, NULL,
+   report_admin_op_error(immoi_handle, invocation, 
SA_AIS_ERR_INVALID_PARAM, nullptr,
"Admin operation not supported for %s (%u)", 
object_name->value, type);
goto done;
}
 
/* ignore admin ops if we are in the middle of a role switch */
if (avd_cb->swap_switch == SA_TRUE) {
-   report_admin_op_error(immoi_handle, invocation, 
SA_AIS_ERR_TRY_AGAIN, NULL,
+   report_admin_op_error(immoi_handle, invocation, 
SA_AIS_ERR_TRY_AGAIN, nullptr,
"Admin op received during a role switch");
goto done;
}
@@ -721,9 +721,9 @@ static void admin_operation_cb(SaImmOiHa
saflog(LOG_NOTICE, amfSvcUsrName, "Admin op \"%s\" initiated for '%s', 
invocation: %llu",
   admin_op_name(static_cast(op_id)), 
object_name->value, invocation);
 
-   if (admin_op_callback[type] != NULL) {
+   if (admin_op_callback[type] != nullptr) {
if (admin_op_is_valid(op_id, type) == false) {
-   report_admin_op_error(immoi_handle, invocation, 
SA_AIS_ERR_TRY_AGAIN, NULL,
+   report_admin_op_error(immoi_handle, invocation, 
SA_AIS_ERR_TRY_AGAIN, nullptr,
"AMF (state %u) is not available for 
admin op'%llu' on '%s'",
avd_cb->init_state, op_id, 
object_name->value);
goto done;
@@ -732,7 +732,7 @@ static void admin_operation_cb(SaImmOiHa
}
} else {
LOG_ER("Admin operation not supported for %s (%u)", 
object_name->value, type);
-   report_admin_op_error(immoi_handle, invocation, 

[devel] [PATCH 05 of 48] amfd: convert NULL to nullptr for ckpt_edu.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/ckpt_edu.cc |  182 
 1 files changed, 91 insertions(+), 91 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/ckpt_edu.cc 
b/osaf/services/saf/amf/amfd/ckpt_edu.cc
--- a/osaf/services/saf/amf/amfd/ckpt_edu.cc
+++ b/osaf/services/saf/amf/amfd/ckpt_edu.cc
@@ -109,27 +109,27 @@ uint32_t avsv_edp_ckpt_msg_cb(EDU_HDL *h
   NCSCONTEXT ptr, uint32_t *ptr_data_len, EDU_BUF_ENV 
*buf_env, EDP_OP_TYPE op, EDU_ERR *o_err)
 {
uint32_t rc = NCSCC_RC_SUCCESS;
-   AVD_CL_CB *struct_ptr = NULL, **d_ptr = NULL;
+   AVD_CL_CB *struct_ptr = nullptr, **d_ptr = nullptr;
 
EDU_INST_SET avsv_ckpt_msg_cb_rules[] = {
-   {EDU_START, avsv_edp_ckpt_msg_cb, 0, 0, 0, sizeof(AVD_CL_CB), 
0, NULL},
+   {EDU_START, avsv_edp_ckpt_msg_cb, 0, 0, 0, sizeof(AVD_CL_CB), 
0, nullptr},
 
/* AVD Control block information */
{EDU_EXEC, ncs_edp_int, 0, 0, 0,
-(long)&((AVD_CL_CB *)0)->init_state, 0, NULL},
+(long)&((AVD_CL_CB *)0)->init_state, 0, nullptr},
{EDU_EXEC, m_NCS_EDP_SATIMET, 0, 0, 0,
-(long)&((AVD_CL_CB *)0)->cluster_init_time, 0, NULL},
+(long)&((AVD_CL_CB *)0)->cluster_init_time, 0, nullptr},
{EDU_EXEC, ncs_edp_uns32, 0, 0, 0,
-(long)&((AVD_CL_CB *)0)->nodes_exit_cnt, 0, NULL},
+(long)&((AVD_CL_CB *)0)->nodes_exit_cnt, 0, nullptr},
 
-   {EDU_END, 0, 0, 0, 0, 0, 0, NULL},
+   {EDU_END, 0, 0, 0, 0, 0, 0, nullptr},
};
 
if (op == EDP_OP_TYPE_ENC) {
struct_ptr = (AVD_CL_CB *)ptr;
} else if (op == EDP_OP_TYPE_DEC) {
d_ptr = (AVD_CL_CB **)ptr;
-   if (*d_ptr == NULL) {
+   if (*d_ptr == nullptr) {
*o_err = EDU_ERR_MEM_FAIL;
return NCSCC_RC_FAILURE;
}
@@ -160,19 +160,19 @@ uint32_t avsv_edp_ckpt_msg_cluster(EDU_H
EDU_BUF_ENV *buf_env, EDP_OP_TYPE op, EDU_ERR *o_err)
 {
uint32_t rc = NCSCC_RC_SUCCESS;
-   AVD_CLUSTER *struct_ptr = NULL, **d_ptr = NULL;
+   AVD_CLUSTER *struct_ptr = nullptr, **d_ptr = nullptr;
 
EDU_INST_SET avsv_ckpt_msg_cluster_rules[] = {
-   {EDU_START, avsv_edp_ckpt_msg_cluster, 0, 0, 0, 
sizeof(AVD_CLUSTER), 0, NULL},
-   {EDU_EXEC, ncs_edp_uns32, 0, 0, 0, (long)&((AVD_CLUSTER 
*)0)->saAmfClusterAdminState, 0, NULL},
-   {EDU_END, 0, 0, 0, 0, 0, 0, NULL},
+   {EDU_START, avsv_edp_ckpt_msg_cluster, 0, 0, 0, 
sizeof(AVD_CLUSTER), 0, nullptr},
+   {EDU_EXEC, ncs_edp_uns32, 0, 0, 0, (long)&((AVD_CLUSTER 
*)0)->saAmfClusterAdminState, 0, nullptr},
+   {EDU_END, 0, 0, 0, 0, 0, 0, nullptr},
};
 
if (op == EDP_OP_TYPE_ENC) {
struct_ptr = (AVD_CLUSTER *)ptr;
} else if (op == EDP_OP_TYPE_DEC) {
d_ptr = (AVD_CLUSTER **)ptr;
-   if (*d_ptr == NULL) {
+   if (*d_ptr == nullptr) {
*o_err = EDU_ERR_MEM_FAIL;
return NCSCC_RC_FAILURE;
}
@@ -204,33 +204,33 @@ uint32_t avsv_edp_ckpt_msg_node(EDU_HDL 
EDU_BUF_ENV *buf_env, EDP_OP_TYPE op, EDU_ERR *o_err)
 {
uint32_t rc = NCSCC_RC_SUCCESS;
-   AVD_AVND *struct_ptr = NULL, **d_ptr = NULL;
+   AVD_AVND *struct_ptr = nullptr, **d_ptr = nullptr;
 
EDU_INST_SET avsv_ckpt_msg_node_rules[] = {
-   {EDU_START, avsv_edp_ckpt_msg_node, 0, 0, 0, sizeof(AVD_AVND), 
0, NULL},
+   {EDU_START, avsv_edp_ckpt_msg_node, 0, 0, 0, sizeof(AVD_AVND), 
0, nullptr},
 
/* Fill here AVD AVND config data structure encoding rules */
-   {EDU_EXEC, m_NCS_EDP_SACLMNODEIDT, 0, 0, 0, (long)&((AVD_AVND 
*)0)->node_info.nodeId, 0, NULL},
-   {EDU_EXEC, ncs_edp_saclmnodeaddresst, 0, 0, 0, 
(long)&((AVD_AVND *)0)->node_info.nodeAddress, 0, NULL},
-   {EDU_EXEC, ncs_edp_sanamet, 0, 0, 0, (long)&((AVD_AVND 
*)0)->name, 0, NULL},
-   {EDU_EXEC, ncs_edp_int, 0, 0, 0, (long)&((AVD_AVND 
*)0)->node_info.member, 0, NULL},
-   {EDU_EXEC, m_NCS_EDP_SATIMET, 0, 0, 0, (long)&((AVD_AVND 
*)0)->node_info.bootTimestamp, 0, NULL},
-   {EDU_EXEC, m_NCS_EDP_SAUINT64T, 0, 0, 0, (long)&((AVD_AVND 
*)0)->node_info.initialViewNumber, 0, NULL},
-   {EDU_EXEC, ncs_edp_mds_dest, 0, 0, 0, (long)&((AVD_AVND 
*)0)->adest, 0, NULL},
-   {EDU_EXEC, ncs_edp_uns32, 0, 0, 0, (long)&((AVD_AVND 
*)0)->saAmfNodeAdminState, 0, NULL},
-   {EDU_EXEC, ncs_edp_uns32, 0, 0, 0, (long)&((AVD_AVND 
*)0)->saAmfNodeOperState, 0, NULL},
-   {EDU_EXEC, ncs_edp_uns32, 0, 0, 0, (long)&((AVD_AVND 
*)0)->node_state, 0, NULL},
-   {EDU_EXEC, ncs_edp_uns32, 0, 0, 0, 

[devel] [PATCH 10 of 48] amfd: convert NULL to nullptr for comp.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/comp.cc |  118 ++--
 1 files changed, 59 insertions(+), 59 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/comp.cc 
b/osaf/services/saf/amf/amfd/comp.cc
--- a/osaf/services/saf/amf/amfd/comp.cc
+++ b/osaf/services/saf/amf/amfd/comp.cc
@@ -40,13 +40,13 @@
 #include 
 #include 
 
-AmfDb *comp_db = NULL;
+AmfDb *comp_db = nullptr;
 
 void avd_comp_db_add(AVD_COMP *comp)
 {
unsigned int rc;
 
-   if (comp_db->find(Amf::to_string(>comp_info.name)) == NULL) {
+   if (comp_db->find(Amf::to_string(>comp_info.name)) == nullptr) {
rc = comp_db->insert(Amf::to_string(>comp_info.name), 
comp);
osafassert(rc == NCSCC_RC_SUCCESS);
}
@@ -234,7 +234,7 @@ static void comp_add_to_model(AVD_COMP *
TRACE_ENTER2("%s", comp->comp_info.name.value);
 
/* Check parent link to see if it has been added already */
-   if (su != NULL) {
+   if (su != nullptr) {
TRACE("already added");
goto done;
}
@@ -329,7 +329,7 @@ static int is_config_valid(const SaNameT
char *parent;
SaUint32T value;
 
-   if ((parent = strchr((char*)dn->value, ',')) == NULL) {
+   if ((parent = strchr((char*)dn->value, ',')) == nullptr) {
report_ccb_validation_error(opdata, "No parent to '%s' ", 
dn->value);
return 0;
}
@@ -342,14 +342,14 @@ static int is_config_valid(const SaNameT
rc = immutil_getAttr(const_cast("saAmfCompType"), 
attributes, 0, );
osafassert(rc == SA_AIS_OK);
 
-   if (comptype_db->find(Amf::to_string()) == NULL) {
+   if (comptype_db->find(Amf::to_string()) == nullptr) {
/* Comp type does not exist in current model, check CCB */
-   if (opdata == NULL) {
+   if (opdata == nullptr) {
report_ccb_validation_error(opdata, "'%s' does not 
exist in model", aname.value);
return 0;
}
 
-   if (ccbutil_getCcbOpDataByDN(opdata->ccbId, ) == NULL) {
+   if (ccbutil_getCcbOpDataByDN(opdata->ccbId, ) == nullptr) 
{
report_ccb_validation_error(opdata, "'%s' does not 
exist in existing model or in CCB", aname.value);
return 0;
}
@@ -454,7 +454,7 @@ static int is_config_valid(const SaNameT
avd_create_association_class_dn(>saAmfCompType, 
>saAmfSUType,
"safMemberCompType", _name);
sutcomptype = avd_sutcomptype_get(_name);
-   if (sutcomptype == NULL) {
+   if (sutcomptype == nullptr) {
LOG_ER("Not found '%s'", sutcomptype_name.value);
return -1;
}
@@ -500,8 +500,8 @@ static AVD_COMP *comp_create(const SaNam
** If called at new active at failover, the object is found in the DB
** but needs to get configuration attributes initialized.
*/
-   if (NULL == (comp = comp_db->find(Amf::to_string(dn {
-   if ((comp = avd_comp_new(dn)) == NULL)
+   if (nullptr == (comp = comp_db->find(Amf::to_string(dn {
+   if ((comp = avd_comp_new(dn)) == nullptr)
goto done;
}
else
@@ -510,7 +510,7 @@ static AVD_COMP *comp_create(const SaNam
error = immutil_getAttr(const_cast("saAmfCompType"), 
attributes, 0, >saAmfCompType);
osafassert(error == SA_AIS_OK);
 
-   if ((comptype = 
comptype_db->find(Amf::to_string(>saAmfCompType))) == NULL) {
+   if ((comptype = 
comptype_db->find(Amf::to_string(>saAmfCompType))) == nullptr) {
LOG_ER("saAmfCompType '%s' does not exist", 
comp->saAmfCompType.value);
goto done;
}
@@ -527,10 +527,10 @@ static AVD_COMP *comp_create(const SaNam
cmd_argv = comp->comp_info.init_info + 
strlen(comp->comp_info.init_info);
*cmd_argv++ = 0x20; /* Insert SPACE between cmd and args */
 
-   if ((str = immutil_getStringAttr(attributes, 
"saAmfCompInstantiateCmdArgv", 0)) == NULL)
+   if ((str = immutil_getStringAttr(attributes, 
"saAmfCompInstantiateCmdArgv", 0)) == nullptr)
str = comptype->saAmfCtDefInstantiateCmdArgv;
 
-   if (str != NULL)
+   if (str != nullptr)
strcpy(cmd_argv, str);
 
comp->comp_info.init_len = strlen(comp->comp_info.init_info);
@@ -563,10 +563,10 @@ static AVD_COMP *comp_create(const SaNam
cmd_argv = comp->comp_info.term_info + 
strlen(comp->comp_info.term_info);
*cmd_argv++ = 0x20; /* Insert SPACE between cmd and args */
 
-   if ((str = immutil_getStringAttr(attributes, 
"saAmfCompTerminateCmdArgv", 0)) == NULL)
+   if ((str = 

[devel] [PATCH 40 of 48] amfd: convert NULL to nullptr for si_dep.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/si_dep.cc |  224 +-
 1 files changed, 112 insertions(+), 112 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/si_dep.cc 
b/osaf/services/saf/amf/amfd/si_dep.cc
--- a/osaf/services/saf/amf/amfd/si_dep.cc
+++ b/osaf/services/saf/amf/amfd/si_dep.cc
@@ -44,14 +44,14 @@
   
   1)A SI which is not participating in SI dependency can take 
 AVD_SI_NO_DEPENDENCY for si_dep_state.
-Such a SI will have si->spons_list as NULL and si->num_dependents 
+Such a SI will have si->spons_list as nullptr and si->num_dependents 
 as zero.
   2)A SI with only dependents and no sponsors can take following values 
 for si_dep_state:
 
 AVD_SI_NO_DEPENDENCY,
 AVD_SI_ASSIGNED.
-Such a SI will have si->spons_list as NULL.
+Such a SI will have si->spons_list as nullptr.
 
   3)A SI having sponsors as well as dependents can take all values for 
 si_dep_states except AVD_SI_NO_DEPENDENCY.
@@ -157,7 +157,7 @@
 #include 
 #include 
 
-AmfDb, AVD_SI_DEP> *sidep_db = NULL;
+AmfDb, AVD_SI_DEP> *sidep_db = nullptr;
 extern void avd_sg_npm_stdbysu_role_change(AVD_SU *su);
 extern uint32_t avd_sg_get_curr_act_cnt(AVD_SG *sg);
 
@@ -263,7 +263,7 @@ void avd_sidep_si_dep_state_set(AVD_SI *
  **/
 bool sidep_is_si_active(AVD_SI *si)
 {
-   AVD_SU_SI_REL *susi = NULL;
+   AVD_SU_SI_REL *susi = nullptr;
bool si_active = false;
 
TRACE_ENTER2("'%s'", si->name.value);
@@ -297,18 +297,18 @@ bool sidep_is_si_active(AVD_SI *si)
  **/
 void sidep_spons_list_del(AVD_SI_DEP *si_dep_rec)
 {
-   AVD_SI *dep_si = NULL;
-   AVD_SPONS_SI_NODE *spons_si_node = NULL;
-   AVD_SPONS_SI_NODE *del_spons_si_node = NULL;
+   AVD_SI *dep_si = nullptr;
+   AVD_SPONS_SI_NODE *spons_si_node = nullptr;
+   AVD_SPONS_SI_NODE *del_spons_si_node = nullptr;
 
TRACE_ENTER();
 
/* Dependent SI should be active, if not return error */
dep_si = avd_si_get(_dep_rec->dep_name);
-   osafassert(dep_si != NULL); 
+   osafassert(dep_si != nullptr); 
 
/* SI doesn't depend on any other SIs */
-   osafassert (dep_si->spons_si_list != NULL);
+   osafassert (dep_si->spons_si_list != nullptr);
 
spons_si_node = dep_si->spons_si_list;
 
@@ -319,7 +319,7 @@ void sidep_spons_list_del(AVD_SI_DEP *si
spons_si_node->si->num_dependents --;
delete spons_si_node;
} else {
-   while (spons_si_node->next != NULL) {
+   while (spons_si_node->next != nullptr) {
if (m_CMP_HORDER_SANAMET(spons_si_node->next->si->name,
 si_dep_rec->spons_si->name) != 
0) {
spons_si_node = spons_si_node->next;
@@ -406,7 +406,7 @@ void sidep_stop_tol_timer(AVD_CL_CB *cb,
AVD_SPONS_SI_NODE *spons_si_node = dep_si->spons_si_list;
 
while (spons_si_node) {
-   if ((rec = sidep_db_find(_si_node->si->name, 
_si->name)) != NULL) {
+   if ((rec = sidep_db_find(_si_node->si->name, 
_si->name)) != nullptr) {
if (rec->si_dep_timer.is_active == true) {
avd_stop_tmr(cb, >si_dep_timer);
TRACE("Tolerance timer stopped for '%s'", 
dep_si->name.value);
@@ -439,7 +439,7 @@ void sidep_stop_tol_timer(AVD_CL_CB *cb,
  **/
 uint32_t sidep_unassign_dependent(AVD_CL_CB *cb, AVD_SI *si)
 {
-   AVD_SU_SI_REL *susi = NULL;
+   AVD_SU_SI_REL *susi = nullptr;
uint32_t rc = NCSCC_RC_FAILURE;
 
TRACE_ENTER2("'%s'", si->name.value);
@@ -454,7 +454,7 @@ uint32_t sidep_unassign_dependent(AVD_CL
 
susi = susi->si_next;
}
-   if(si->spons_si_list == NULL)
+   if(si->spons_si_list == nullptr)
avd_sidep_si_dep_state_set(si, AVD_SI_NO_DEPENDENCY);
else
avd_sidep_si_dep_state_set(si, AVD_SI_SPONSOR_UNASSIGNED);
@@ -529,7 +529,7 @@ done:
  
*/
 uint32_t sidep_si_dep_state_evt_send(AVD_CL_CB *cb, AVD_SI *si, AVD_EVT_TYPE 
evt_type)
 {
-   AVD_EVT *evt = NULL;
+   AVD_EVT *evt = nullptr;
uint32_t rc = NCSCC_RC_FAILURE;
 
TRACE_ENTER2("si:'%s' evt_type:%u", si->name.value, evt_type);
@@ -595,8 +595,8 @@ void avd_sidep_stdby_amfd_tol_timer_expi
 */
 void avd_sidep_tol_tmr_evh(AVD_CL_CB *cb, AVD_EVT *evt)
 {
-   AVD_SI *si = NULL;
-   AVD_SI *spons_si = NULL;
+   AVD_SI *si = nullptr;
+   AVD_SI *spons_si = nullptr;
 
TRACE_ENTER();
 
@@ -605,7 +605,7 @@ void 

[devel] [PATCH 37 of 48] amfd: convert NULL to nullptr for sgproc.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/sgproc.cc |  104 +-
 1 files changed, 52 insertions(+), 52 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/sgproc.cc 
b/osaf/services/saf/amf/amfd/sgproc.cc
--- a/osaf/services/saf/amf/amfd/sgproc.cc
+++ b/osaf/services/saf/amf/amfd/sgproc.cc
@@ -109,9 +109,9 @@ uint32_t avd_new_assgn_susi(AVD_CL_CB *c
/* on Active AMFD empty SI should never be tried for 
assignments.
 * on Standby AMFD this may be still possible as CSI are not
 * checkpointed dynamically */
-   osafassert (si->list_of_csi != NULL);
+   osafassert (si->list_of_csi != nullptr);
 
-   if ((susi = avd_susi_create(cb, si, su, ha_state, ckpt)) == NULL) {
+   if ((susi = avd_susi_create(cb, si, su, ha_state, ckpt)) == nullptr) {
LOG_ER("%s: Could not create SUSI '%s' '%s'", __FUNCTION__,
su->name.value, si->name.value);
goto done;
@@ -122,7 +122,7 @@ uint32_t avd_new_assgn_susi(AVD_CL_CB *c
 
/* Mark csi to be unassigned to detect duplicate assignment.*/
l_csi = si->list_of_csi;
-   while (l_csi != NULL) {
+   while (l_csi != nullptr) {
l_csi->assign_flag = false;
l_csi = l_csi->si_list_of_csi_next;
}
@@ -130,7 +130,7 @@ uint32_t avd_new_assgn_susi(AVD_CL_CB *c
su->reset_all_comps_assign_flag();
 
l_csi = si->list_of_csi;
-   while (l_csi != NULL) {
+   while (l_csi != nullptr) {
/* find a component that can be assigned this CSI */
l_comp = 
su->find_unassigned_comp_that_provides_cstype(_csi->saAmfCSType);
 
@@ -141,7 +141,7 @@ uint32_t avd_new_assgn_susi(AVD_CL_CB *c
continue;
}
 
-   if ((compcsi = avd_compcsi_create(susi, l_csi, l_comp, true)) 
== NULL) {
+   if ((compcsi = avd_compcsi_create(susi, l_csi, l_comp, true)) 
== nullptr) {
/* free all the CSI assignments and end this loop */
avd_compcsi_delete(cb, susi, true);
l_csi = l_csi->si_list_of_csi_next;
@@ -157,7 +157,7 @@ uint32_t avd_new_assgn_susi(AVD_CL_CB *c
if (su->saAmfSUPreInstantiable == false)
goto npisu_done;
 
-   /* After previous while loop(while (l_csi != NULL)) all the deserving 
components got assigned at least one. Some
+   /* After previous while loop(while (l_csi != nullptr)) all the 
deserving components got assigned at least one. Some
   components and csis may be left out. We need to ignore now all 
unassigned comps as they cann't be assigned 
   any csi. Unassigned csis may include those csi, which cann't be 
assigned to any comp and those csi, which 
   can be assigned to comp, which are already assigned(more than 1 csi 
to be assigned). 
@@ -167,7 +167,7 @@ uint32_t avd_new_assgn_susi(AVD_CL_CB *c
   assigiment.*/
TRACE("Now assigning more than one csi per comp");
l_csi = si->list_of_csi;
-   while (NULL !=  l_csi) {
+   while (nullptr !=  l_csi) {
if (false == l_csi->assign_flag) {
/* Assign to only those comps, which have assignment. 
Those comps, which could not have assignment 
   before, cann't find compcsi here also.*/
@@ -175,7 +175,7 @@ uint32_t avd_new_assgn_susi(AVD_CL_CB *c
AVD_COMP_TYPE *comptype = 
comptype_db->find(Amf::to_string(_->saAmfCompType));
osafassert(comptype);
if ((true == comp_->assigned()) && 
(comptype->saAmfCtCompCategory != SA_AMF_COMP_LOCAL)) {
-   if (NULL != (cst = 
avd_compcstype_find_match(_csi->saAmfCSType, comp_))) {
+   if (nullptr != (cst = 
avd_compcstype_find_match(_csi->saAmfCSType, comp_))) {
if (SA_AMF_HA_ACTIVE == 
ha_state) {
if 
(cst->saAmfCompNumCurrActiveCSIs < cst->saAmfCompNumMaxActiveCSIs) {
} else { /* We cann't 
assign this csi to this comp, so check for another comp */
@@ -187,7 +187,7 @@ uint32_t avd_new_assgn_susi(AVD_CL_CB *c
continue ;
}
}
-   if ((compcsi = 
avd_compcsi_create(susi, l_csi, comp_, true)) == NULL) {
+   if ((compcsi = 
avd_compcsi_create(susi, l_csi, comp_, true)) == nullptr) {
/* free all the CSI 
assignments and end this loop */

[devel] [PATCH 41 of 48] amfd: convert NULL to nullptr for siass.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/siass.cc |  72 ++--
 1 files changed, 36 insertions(+), 36 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/siass.cc 
b/osaf/services/saf/amf/amfd/siass.cc
--- a/osaf/services/saf/amf/amfd/siass.cc
+++ b/osaf/services/saf/amf/amfd/siass.cc
@@ -70,10 +70,10 @@ static void avd_create_susi_in_imm(SaAmf
_safSISU,
_saAmfSISUHAState,
_saAmfSISUHAReadinessState,
-   NULL
+   nullptr
};
 
-   avsv_create_association_class_dn(su_dn, NULL, "safSISU", );
+   avsv_create_association_class_dn(su_dn, nullptr, "safSISU", );
avd_saImmOiRtObjectCreate("SaAmfSIAssignment", si_dn, attrValues);
 }
 
@@ -112,7 +112,7 @@ void avd_susi_update(AVD_SU_SI_REL *susi
   SA_IMM_ATTR_SAUINT32T, _state);
 
/* Update all CSI assignments */
-   for (compcsi = susi->list_of_csicomp; compcsi != NULL; compcsi = 
compcsi->susi_csicomp_next) {
+   for (compcsi = susi->list_of_csicomp; compcsi != nullptr; compcsi = 
compcsi->susi_csicomp_next) {
   avsv_create_association_class_dn(>comp->comp_info.name,
   >csi->name, "safCSIComp", );
 
@@ -153,7 +153,7 @@ AVD_SU_SI_REL *avd_susi_create(AVD_CL_CB
 
su_si->state = state;
su_si->fsm = AVD_SU_SI_STATE_ABSENT;
-   su_si->list_of_csicomp = NULL;
+   su_si->list_of_csicomp = nullptr;
su_si->si = si;
su_si->su = su;
 
@@ -176,7 +176,7 @@ AVD_SU_SI_REL *avd_susi_create(AVD_CL_CB
su_si->is_per_si = (curr_su == su) ? true : false;
 
/* determine the insert position */
-   for (p_su_si = NULL, i_su_si = si->list_of_sisu;
+   for (p_su_si = nullptr, i_su_si = si->list_of_sisu;
 i_su_si; p_su_si = i_su_si, i_su_si = i_su_si->si_next) {
if (i_su_si->is_per_si == true) {
if (false == su_si->is_per_si)
@@ -218,21 +218,21 @@ AVD_SU_SI_REL *avd_susi_create(AVD_CL_CB
}
 
/* keep the list in su inascending order */
-   if (su->list_of_susi == NULL) {
+   if (su->list_of_susi == nullptr) {
su->list_of_susi = su_si;
-   su_si->su_next = NULL;
+   su_si->su_next = nullptr;
goto done;
}
 
-   p_su_si = NULL;
+   p_su_si = nullptr;
i_su_si = su->list_of_susi;
-   while ((i_su_si != NULL) &&
+   while ((i_su_si != nullptr) &&
   (m_CMP_HORDER_SANAMET(i_su_si->si->name, su_si->si->name) < 0)) {
p_su_si = i_su_si;
i_su_si = i_su_si->su_next;
}
 
-   if (p_su_si == NULL) {
+   if (p_su_si == nullptr) {
su_si->su_next = su->list_of_susi;
su->list_of_susi = su_si;
} else {
@@ -241,7 +241,7 @@ AVD_SU_SI_REL *avd_susi_create(AVD_CL_CB
}
 
 done:
-   if ((ckpt == false) && (su_si != NULL)) {
+   if ((ckpt == false) && (su_si != nullptr)) {
avd_create_susi_in_imm(state, >name, >name);
avd_susi_update_assignment_counters(su_si, AVSV_SUSI_ACT_ASGN, 
state, state);
avd_gen_su_ha_state_changed_ntf(cb, su_si);
@@ -279,15 +279,15 @@ AVD_SU_SI_REL *avd_su_susi_find(AVD_CL_C
memcpy(lsi_name.value, si_name->value, si_name->length);
lsi_name.length = si_name->length;
 
-   while ((su_si != NULL) && (m_CMP_HORDER_SANAMET(su_si->si->name, 
lsi_name) < 0)) {
+   while ((su_si != nullptr) && (m_CMP_HORDER_SANAMET(su_si->si->name, 
lsi_name) < 0)) {
su_si = su_si->su_next;
}
 
-   if ((su_si != NULL) && (m_CMP_HORDER_SANAMET(su_si->si->name, lsi_name) 
== 0)) {
+   if ((su_si != nullptr) && (m_CMP_HORDER_SANAMET(su_si->si->name, 
lsi_name) == 0)) {
return su_si;
}
 
-   return NULL;
+   return nullptr;
 }
 
 /*
@@ -311,8 +311,8 @@ AVD_SU_SI_REL *avd_susi_find(AVD_CL_CB *
 {
AVD_SU *su;
 
-   if ((su = su_db->find(Amf::to_string(su_name))) == NULL)
-   return NULL;
+   if ((su = su_db->find(Amf::to_string(su_name))) == nullptr)
+   return nullptr;
 
return avd_su_susi_find(cb, su, si_name);
 }
@@ -343,13 +343,13 @@ uint32_t avd_susi_delete(AVD_CL_CB *cb, 
 
/* check the SU list to get the prev pointer */
i_su_si = susi->su->list_of_susi;
-   p_su_si = NULL;
-   while ((i_su_si != NULL) && (i_su_si != susi)) {
+   p_su_si = nullptr;
+   while ((i_su_si != nullptr) && (i_su_si != susi)) {
p_su_si = i_su_si;
i_su_si = i_su_si->su_next;
}
 
-   if (i_su_si == NULL) {
+   if (i_su_si == nullptr) {
/* problem it is mssing to delete */
/* log error */
return 

[devel] [PATCH 09 of 48] amfd: convert NULL to nullptr for cluster.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/cluster.cc |  14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/cluster.cc 
b/osaf/services/saf/amf/amfd/cluster.cc
--- a/osaf/services/saf/amf/amfd/cluster.cc
+++ b/osaf/services/saf/amf/amfd/cluster.cc
@@ -92,7 +92,7 @@ static void ccb_apply_modify_hdlr(struct
const SaImmAttrModificationT_2 *attr_mod;
int i = 0;
 
-   while ((attr_mod = opdata->param.modify.attrMods[i++]) != NULL) {
+   while ((attr_mod = opdata->param.modify.attrMods[i++]) != nullptr) {
if (!strcmp(attr_mod->modAttr.attrName, 
"saAmfClusterStartupTimeout")) {
SaTimeT cluster_startup_timeout = *((SaTimeT 
*)attr_mod->modAttr.attrValues[0]);
TRACE("saAmfClusterStartupTimeout modified from '%llu' 
to '%llu'", 
@@ -108,7 +108,7 @@ static SaAisErrorT ccb_completed_modify_
const SaImmAttrModificationT_2 *attr_mod;
int i = 0;
 
-   while ((attr_mod = opdata->param.modify.attrMods[i++]) != NULL) {
+   while ((attr_mod = opdata->param.modify.attrMods[i++]) != nullptr) {
if (!strcmp(attr_mod->modAttr.attrName, 
"saAmfClusterStartupTimeout")) {
SaTimeT cluster_startup_timeout = *((SaTimeT 
*)attr_mod->modAttr.attrValues[0]);
if (0 == cluster_startup_timeout) {
@@ -180,7 +180,7 @@ static void cluster_admin_op_cb(SaImmOiH
case SA_AMF_ADMIN_UNLOCK_INSTANTIATION:
case SA_AMF_ADMIN_RESTART:
default:
-   report_admin_op_error(immOiHandle, invocation, 
SA_AIS_ERR_NOT_SUPPORTED, NULL, "Not supported"); 
+   report_admin_op_error(immOiHandle, invocation, 
SA_AIS_ERR_NOT_SUPPORTED, nullptr, "Not supported"); 
break;
}
 }
@@ -206,9 +206,9 @@ SaAisErrorT avd_cluster_config_get(void)
searchParam.searchOneAttr.attrValueType = SA_IMM_ATTR_SASTRINGT;
searchParam.searchOneAttr.attrValue = 
 
-   if ((error = immutil_saImmOmSearchInitialize_2(avd_cb->immOmHandle, 
NULL, SA_IMM_SUBTREE,
+   if ((error = immutil_saImmOmSearchInitialize_2(avd_cb->immOmHandle, 
nullptr, SA_IMM_SUBTREE,
   SA_IMM_SEARCH_ONE_ATTR | 
SA_IMM_SEARCH_GET_ALL_ATTR,
-  , NULL, 
)) != SA_AIS_OK) {
+  , nullptr, 
)) != SA_AIS_OK) {
LOG_ER("saImmOmSearchInitialize failed: %u", error);
goto done;
}
@@ -221,7 +221,7 @@ SaAisErrorT avd_cluster_config_get(void)
avd_cluster->saAmfCluster = dn;
 
/* Cluster should be root object */
-   if (strchr((char *)dn.value, ',') != NULL) {
+   if (strchr((char *)dn.value, ',') != nullptr) {
LOG_ER("Parent to '%s' is not root", dn.value);
return static_cast(-1);
}
@@ -258,7 +258,7 @@ SaAisErrorT avd_cluster_config_get(void)
 
 void avd_cluster_constructor(void)
 {
-   avd_class_impl_set("SaAmfCluster", NULL, cluster_admin_op_cb,
+   avd_class_impl_set("SaAmfCluster", nullptr, cluster_admin_op_cb,
cluster_ccb_completed_cb, cluster_ccb_apply_cb);
 }
 

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 36 of 48] amfd: convert NULL to nullptr for sg_nwayact_fsm.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc |  176 +-
 1 files changed, 88 insertions(+), 88 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc 
b/osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc
--- a/osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc
+++ b/osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc
@@ -40,7 +40,7 @@ static AVD_SU *avd_get_qualified_su(AVD_
  * search for in-service SUs that can take assignment for this SI and assign 
  * this unassigned SIs to them by Sending D2N-INFO_SU_SI_ASSIGN message for 
the 
  * SUs with role active for the SIs. It then adds the Assigning SUs to 
- * the SU operation list. If no assignments happen, it returns NULL.
+ * the SU operation list. If no assignments happen, it returns nullptr.
  *
  * Input: cb - the AVD control block
  *sg - The pointer to the service group.
@@ -73,7 +73,7 @@ AVD_SU *avd_sg_nacvred_su_chose_asgn(AVD
 
/* verify that the SI is ready and needs come more assignments. 
*/
if ((i_si->saAmfSIAdminState != SA_AMF_ADMIN_UNLOCKED) ||
-   (i_si->list_of_csi == NULL) ||
+   (i_si->list_of_csi == nullptr) ||
(i_si->pref_active_assignments() <= 
i_si->curr_active_assignments() )) {
continue;
}
@@ -100,7 +100,7 @@ AVD_SU *avd_sg_nacvred_su_chose_asgn(AVD
AVD_SI *si = 
avd_si_get(_rank_rec->indx.si_name);
 
/* validate this entry */
-   if ((si == NULL) || (i_su == NULL) || 
(si->sg_of_si != i_su->sg_of_su))
+   if ((si == nullptr) || (i_su == nullptr) || 
(si->sg_of_si != i_su->sg_of_su))
continue;
}
 
@@ -115,7 +115,7 @@ AVD_SU *avd_sg_nacvred_su_chose_asgn(AVD
if (iter != 
i_su->sg_of_su->list_of_su.end()) {
i_su = *iter;
} else {
-   i_su = NULL;
+   i_su = nullptr;
}
}
continue;
@@ -167,7 +167,7 @@ AVD_SU *avd_sg_nacvred_su_chose_asgn(AVD
if (i_si->pref_active_assignments() <= 
i_si->curr_active_assignments() ) {
/* The preferred number of active assignments 
for SI has reached, so continue
   to next SI */
-   i_su = NULL;
+   i_su = nullptr;
continue;
}
 
@@ -187,7 +187,7 @@ AVD_SU *avd_sg_nacvred_su_chose_asgn(AVD
/* Check if the SI can take more assignments. 
If not exit the SU loop.
 */
if (i_si->pref_active_assignments() <= 
i_si->curr_active_assignments() ) {
-   i_su = NULL;
+   i_su = nullptr;
continue;
}
} else {
@@ -202,15 +202,15 @@ AVD_SU *avd_sg_nacvred_su_chose_asgn(AVD
l_flag = false;
while (true) {
qualified_su = avd_get_qualified_su(sg, i_si, 
_si_tobe_assigned);
-   if ((NULL == qualified_su) && (false == 
next_si_tobe_assigned)) {
+   if ((nullptr == qualified_su) && (false == 
next_si_tobe_assigned)) {
l_flag = false; /* All SU are 
unqualified, no need to next si*/
break;
}
-   if ((NULL == qualified_su) && (true == 
next_si_tobe_assigned)) {
+   if ((nullptr == qualified_su) && (true == 
next_si_tobe_assigned)) {
l_flag = true; /* Go for next 
assignment */
break;
}
-   if ((NULL != qualified_su) && (true == 
next_si_tobe_assigned)){
+   if ((nullptr != qualified_su) && (true == 
next_si_tobe_assigned)){
l_flag = true; 
/* found the SU assign the SI to the SU 
as active */
if (avd_new_assgn_susi(cb, 
qualified_su, i_si, SA_AMF_HA_ACTIVE, false, _rel) 
@@ -235,7 +235,7 @@ AVD_SU *avd_sg_nacvred_su_chose_asgn(AVD
TRACE_LEAVE();
 
if (sg->su_oper_list.empty() == true) {
-   return NULL;
+ 

[devel] [PATCH 39 of 48] amfd: convert NULL to nullptr for si.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/si.cc |  182 +++---
 1 files changed, 91 insertions(+), 91 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/si.cc b/osaf/services/saf/amf/amfd/si.cc
--- a/osaf/services/saf/amf/amfd/si.cc
+++ b/osaf/services/saf/amf/amfd/si.cc
@@ -27,7 +27,7 @@
 #include 
 #include 
 
-AmfDb *si_db = NULL;
+AmfDb *si_db = nullptr;
 
 /**
  * @brief Checks if the dependencies configured leads to loop
@@ -38,7 +38,7 @@ AmfDb *si_db = NULL
  */
 static void osafassert_if_loops_in_csideps(SaNameT *csi_name, AVD_CSI* csi)
 { 
-   AVD_CSI *temp_csi = NULL;
+   AVD_CSI *temp_csi = nullptr;
AVD_CSI_DEPS *csi_dep_ptr;
  
TRACE_ENTER2("%s", csi->name.value);
@@ -70,7 +70,7 @@ static void osafassert_if_loops_in_cside
 
 void AVD_SI::arrange_dep_csi(AVD_CSI* csi)
 {
-   AVD_CSI *temp_csi = NULL;
+   AVD_CSI *temp_csi = nullptr;
 
TRACE_ENTER2("%s", csi->name.value);

@@ -112,7 +112,7 @@ void AVD_SI::arrange_dep_csi(AVD_CSI* cs
 
 void AVD_SI::add_csi(AVD_CSI* avd_csi)
 {
-   AVD_CSI *temp_csi = NULL;
+   AVD_CSI *temp_csi = nullptr;
 bool found = false;
 
TRACE_ENTER2("%s", avd_csi->name.value);
@@ -162,16 +162,16 @@ void AVD_SI::add_csi_db(AVD_CSI* csi)
 {
TRACE_ENTER2("%s", csi->name.value);
 
-   AVD_CSI *i_csi = NULL;
-   AVD_CSI *prev_csi = NULL;
+   AVD_CSI *i_csi = nullptr;
+   AVD_CSI *prev_csi = nullptr;
bool found_pos =  false;
 
-   osafassert((csi != NULL) && (csi->si != NULL));
+   osafassert((csi != nullptr) && (csi->si != nullptr));
osafassert(csi->si == this);
 
i_csi = list_of_csi;
-   while ((i_csi != NULL) && (csi->rank <= i_csi->rank)) {
-   while ((i_csi != NULL) && (csi->rank == i_csi->rank)) {
+   while ((i_csi != nullptr) && (csi->rank <= i_csi->rank)) {
+   while ((i_csi != nullptr) && (csi->rank == i_csi->rank)) {
 
if (m_CMP_HORDER_SANAMET(csi->name, i_csi->name) < 0){
found_pos = true;
@@ -180,19 +180,19 @@ void AVD_SI::add_csi_db(AVD_CSI* csi)
prev_csi = i_csi;
i_csi = i_csi->si_list_of_csi_next;
 
-   if ((i_csi != NULL) && (i_csi->rank < csi->rank)) {
+   if ((i_csi != nullptr) && (i_csi->rank < csi->rank)) {
found_pos = true;
break;
}
}
 
-   if (found_pos || i_csi == NULL)
+   if (found_pos || i_csi == nullptr)
break;
prev_csi = i_csi;
i_csi = i_csi->si_list_of_csi_next;
}
 
-   if (prev_csi == NULL) {
+   if (prev_csi == nullptr) {
csi->si_list_of_csi_next = list_of_csi;
list_of_csi = csi;
} else {
@@ -213,7 +213,7 @@ void AVD_SI::add_csi_db(AVD_CSI* csi)
 void AVD_SI::add_rankedsu(const SaNameT *suname, uint32_t saAmfRank)
 {
avd_sirankedsu_t *tmp;
-   avd_sirankedsu_t *prev = NULL;
+   avd_sirankedsu_t *prev = nullptr;
avd_sirankedsu_t *ranked_su;
TRACE_ENTER();
 
@@ -221,14 +221,14 @@ void AVD_SI::add_rankedsu(const SaNameT 
ranked_su->suname = *suname;
ranked_su->saAmfRank = saAmfRank;
 
-   for (tmp = rankedsu_list_head; tmp != NULL; tmp = tmp->next) {
+   for (tmp = rankedsu_list_head; tmp != nullptr; tmp = tmp->next) {
if (tmp->saAmfRank >= saAmfRank)
break;
else
prev = tmp;
}
 
-   if (prev == NULL) {
+   if (prev == nullptr) {
ranked_su->next = rankedsu_list_head;
rankedsu_list_head = ranked_su;
} else {
@@ -246,17 +246,17 @@ void AVD_SI::add_rankedsu(const SaNameT 
 void AVD_SI::remove_rankedsu(const SaNameT *suname)
 {
avd_sirankedsu_t *tmp;
-   avd_sirankedsu_t *prev = NULL;
+   avd_sirankedsu_t *prev = nullptr;
TRACE_ENTER();
 
-   for (tmp = rankedsu_list_head; tmp != NULL; tmp = tmp->next) {
+   for (tmp = rankedsu_list_head; tmp != nullptr; tmp = tmp->next) {
if (memcmp(>suname, suname, sizeof(*suname)) == 0)
break;
prev = tmp;
}
 
-   if (prev == NULL)
-   rankedsu_list_head = NULL;
+   if (prev == nullptr)
+   rankedsu_list_head = nullptr;
else
prev->next = tmp->next;
 
@@ -266,17 +266,17 @@ void AVD_SI::remove_rankedsu(const SaNam
 
 void AVD_SI::remove_csi(AVD_CSI* csi)
 {
-   AVD_CSI *i_csi = NULL;
-   AVD_CSI *prev_csi = NULL;
+   AVD_CSI *i_csi = nullptr;
+   AVD_CSI *prev_csi = nullptr;

osafassert(csi->si == this);
 
/* 

[devel] [PATCH 48 of 48] amfd: convert NULL to nullptr for util.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/util.cc |  64 +++---
 1 files changed, 32 insertions(+), 32 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/util.cc 
b/osaf/services/saf/amf/amfd/util.cc
--- a/osaf/services/saf/amf/amfd/util.cc
+++ b/osaf/services/saf/amf/amfd/util.cc
@@ -188,7 +188,7 @@ uint32_t avd_snd_node_data_verify_msg(AV
TRACE_ENTER();
 
/* Verify if the AvND structure pointer is valid. */
-   if (avnd == NULL) {
+   if (avnd == nullptr) {
/* This is a invalid situation as the node record
 * needs to be mentioned.
 */
@@ -247,7 +247,7 @@ uint32_t avd_snd_node_up_msg(AVD_CL_CB *
TRACE_ENTER();
 
/* Verify if the AvND structure pointer is valid. */
-   if (avnd == NULL) {
+   if (avnd == nullptr) {
/* This is a invalid situation as the node record
 * needs to be mentioned.
 */
@@ -306,7 +306,7 @@ uint32_t avd_snd_oper_state_msg(AVD_CL_C
TRACE_ENTER();
 
/* Verify if the node structure pointer is valid. */
-   if (avnd == NULL) {
+   if (avnd == nullptr) {
/* This is a invalid situation as the avnd record
 * needs to be mentioned.
 */
@@ -399,7 +399,7 @@ done:
  *
  * Input: cb - Pointer to the AVD control block
  *avnd - Pointer to the AVND info for the node that needs to be sent
- *   the message. Non NULL if message need to be sent to a
+ *   the message. Non nullptr if message need to be sent to a
  *   particular node.
  *  param_info - Pointer to the information and operation that need to be done.
  * 
@@ -425,7 +425,7 @@ uint32_t avd_snd_op_req_msg(AVD_CL_CB *c
op_req_msg->msg_type = AVSV_D2N_OPERATION_REQUEST_MSG;
memcpy(_req_msg->msg_info.d2n_op_req.param_info, param_info, 
sizeof(AVSV_PARAM_INFO));
 
-   if (avnd == NULL) {
+   if (avnd == nullptr) {
/* This means the message needs to be broadcasted to
 * all the nodes.
 */
@@ -505,7 +505,7 @@ static void reg_su_msg_init_su_info(AVD_
 
 uint32_t avd_snd_su_reg_msg(AVD_CL_CB *cb, AVD_AVND *avnd, bool fail_over)
 {
-   AVD_SU *su = NULL;
+   AVD_SU *su = nullptr;
uint32_t rc = NCSCC_RC_SUCCESS;
 
TRACE_ENTER2("%s", avnd->node_name);
@@ -545,7 +545,7 @@ uint32_t avd_snd_su_reg_msg(AVD_CL_CB *c
/* check if atleast one SU data is being sent. If not 
 * dont send the messages.
 */
-   if (su_msg->msg_info.d2n_reg_su.su_list == NULL) {
+   if (su_msg->msg_info.d2n_reg_su.su_list == nullptr) {
/* Free all the messages and return success */
d2n_msg_free(su_msg);
goto done;
@@ -658,7 +658,7 @@ static uint32_t avd_prep_csi_attr_info(A
compcsi_info->attrs.number = 0;
 
/* Scan the list of attributes for the CSI and add it to the message */
-   while ((attr_ptr != NULL) && (compcsi_info->attrs.number < 
compcsi->csi->num_attributes)) {
+   while ((attr_ptr != nullptr) && (compcsi_info->attrs.number < 
compcsi->csi->num_attributes)) {
memcpy(i_ptr, _ptr->name_value, 
sizeof(AVSV_ATTR_NAME_VAL));
compcsi_info->attrs.number++;
i_ptr = i_ptr + 1;
@@ -694,12 +694,12 @@ static SaAmfCompCapabilityModelT get_com
  *
  * Input: cb - Pointer to the AVD control block *
  *su - Pointer to the SU related to which the messages need to be sent.
- *  susi - SU SI relationship struct pointer. Is NULL when all the 
+ *  susi - SU SI relationship struct pointer. Is nullptr when all the 
  * SI assignments need to be deleted
  * or when all the SIs of the SU need to change role.
  *  actn - The action value that needs to be sent in the message.
  *  single_csi - If a single component is to be assigned as csi.
- *  compcsi - Comp CSI assignment(signle comp and associated csi) if 
single_csi is true else NULL.
+ *  compcsi - Comp CSI assignment(signle comp and associated csi) if 
single_csi is true else nullptr.
  *
  * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
  *
@@ -898,7 +898,7 @@ uint32_t avd_snd_susi_msg(AVD_CL_CB *cb,
} else
l_compcsi = l_susi->list_of_csicomp;
 
-   while (l_compcsi != NULL) {
+   while (l_compcsi != nullptr) {
compcsi_info = new AVSV_SUSI_ASGN();
 
compcsi_info->comp_name = 
l_compcsi->comp->comp_info.name;
@@ -922,8 +922,8 @@ uint32_t avd_snd_susi_msg(AVD_CL_CB *cb,
/* fill the quiesced and active component name info */
if (!((actn == AVSV_SUSI_ACT_ASGN) &&
  (susi_msg->msg_info.d2n_su_si_assign.ha_state == 
SA_AMF_HA_ACTIVE))) {
-

[devel] [PATCH 46 of 48] amfd: convert NULL to nullptr for svctype.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/svctype.cc |  38 +-
 1 files changed, 19 insertions(+), 19 deletions(-)


long_description

diff --git a/osaf/services/saf/amf/amfd/svctype.cc 
b/osaf/services/saf/amf/amfd/svctype.cc
--- a/osaf/services/saf/amf/amfd/svctype.cc
+++ b/osaf/services/saf/amf/amfd/svctype.cc
@@ -29,7 +29,7 @@
 #include 
 #include 
 
-AmfDb *svctype_db = NULL;
+AmfDb *svctype_db = nullptr;
 
 //
 // TODO(HANO) Temporary use this function instead of strdup which uses malloc.
@@ -53,18 +53,18 @@ static void svctype_delete(AVD_SVC_TYPE 
 {
svctype_db->erase(Amf::to_string(_type->name));
 
-   if (svc_type->saAmfSvcDefActiveWeight != NULL) {
+   if (svc_type->saAmfSvcDefActiveWeight != nullptr) {
unsigned int i = 0;
-   while (svc_type->saAmfSvcDefActiveWeight[i] != NULL) {
+   while (svc_type->saAmfSvcDefActiveWeight[i] != nullptr) {
delete [] svc_type->saAmfSvcDefActiveWeight[i];
++i;
}
delete [] svc_type->saAmfSvcDefActiveWeight;
}
 
-   if (svc_type->saAmfSvcDefStandbyWeight != NULL) {
+   if (svc_type->saAmfSvcDefStandbyWeight != nullptr) {
unsigned int i = 0;
-   while (svc_type->saAmfSvcDefStandbyWeight[i] != NULL) {
+   while (svc_type->saAmfSvcDefStandbyWeight[i] != nullptr) {
delete [] svc_type->saAmfSvcDefStandbyWeight[i];
++i;
}
@@ -89,8 +89,8 @@ static AVD_SVC_TYPE *svctype_create(cons
 
svct = new AVD_SVC_TYPE(dn);
 
-   svct->saAmfSvcDefActiveWeight = NULL;
-   svct->saAmfSvcDefStandbyWeight = NULL;
+   svct->saAmfSvcDefActiveWeight = nullptr;
+   svct->saAmfSvcDefStandbyWeight = nullptr;
 
/* Optional, [0..*] */
if 
(immutil_getAttrValuesNumber(const_cast("saAmfSvcDefActiveWeight"),
 attributes, ) == SA_AIS_OK) {
@@ -99,7 +99,7 @@ static AVD_SVC_TYPE *svctype_create(cons
svct->saAmfSvcDefActiveWeight[i] =
StrDup(immutil_getStringAttr(attributes, 
"saAmfSvcDefActiveWeight", i));
}
-   svct->saAmfSvcDefActiveWeight[i] = NULL;
+   svct->saAmfSvcDefActiveWeight[i] = nullptr;
}
 
/* Optional, [0..*] */
@@ -109,7 +109,7 @@ static AVD_SVC_TYPE *svctype_create(cons
svct->saAmfSvcDefStandbyWeight[i] =
StrDup(immutil_getStringAttr(attributes, 
"saAmfSvcDefStandbyWeight", i));
}
-   svct->saAmfSvcDefStandbyWeight[i] = NULL;
+   svct->saAmfSvcDefStandbyWeight[i] = nullptr;
}
 
TRACE_LEAVE();
@@ -120,7 +120,7 @@ static int is_config_valid(const SaNameT
 {
char *parent;
 
-   if ((parent = strchr((char*)dn->value, ',')) == NULL) {
+   if ((parent = strchr((char*)dn->value, ',')) == nullptr) {
report_ccb_validation_error(opdata, "No parent to '%s' ", 
dn->value);
return 0;
}
@@ -160,7 +160,7 @@ static SaAisErrorT svctype_ccb_completed
 */
for (const auto& si : svc_type->list_of_si) {
t_opData = ccbutil_getCcbOpDataByDN(opdata->ccbId, 
>name);
-   if ((t_opData == NULL) || (t_opData->operationType != 
CCBUTIL_DELETE)) {
+   if ((t_opData == nullptr) || (t_opData->operationType 
!= CCBUTIL_DELETE)) {
si_exist = true;
break;
}
@@ -230,20 +230,20 @@ SaAisErrorT avd_svctype_config_get(void)
searchParam.searchOneAttr.attrValueType = SA_IMM_ATTR_SASTRINGT;
searchParam.searchOneAttr.attrValue = 
 
-   if (immutil_saImmOmSearchInitialize_2(avd_cb->immOmHandle, NULL, 
SA_IMM_SUBTREE,
+   if (immutil_saImmOmSearchInitialize_2(avd_cb->immOmHandle, nullptr, 
SA_IMM_SUBTREE,
SA_IMM_SEARCH_ONE_ATTR | SA_IMM_SEARCH_GET_ALL_ATTR, 
,
-   NULL, ) != SA_AIS_OK) {
+   nullptr, ) != SA_AIS_OK) {
 
LOG_ER("No objects found (1)");
goto done1;
}
 
while (immutil_saImmOmSearchNext_2(searchHandle, , 
(SaImmAttrValuesT_2 ***)) == SA_AIS_OK) {
-   if (!is_config_valid(, attributes, NULL))
+   if (!is_config_valid(, attributes, nullptr))
goto done2;
 
-   if ((svc_type = svctype_db->find(Amf::to_string())) == NULL) 
{
-   if ((svc_type = svctype_create(, attributes)) == 
NULL)
+   if ((svc_type = svctype_db->find(Amf::to_string())) == 
nullptr) {
+   if ((svc_type = svctype_create(, attributes)) == 
nullptr)
goto done2;
 

[devel] [PATCH 44 of 48] amfd: convert NULL to nullptr for sutcomptype.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/sutcomptype.cc |  16 
 1 files changed, 8 insertions(+), 8 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/sutcomptype.cc 
b/osaf/services/saf/amf/amfd/sutcomptype.cc
--- a/osaf/services/saf/amf/amfd/sutcomptype.cc
+++ b/osaf/services/saf/amf/amfd/sutcomptype.cc
@@ -24,7 +24,7 @@
 #include 
 #include 
 
-AmfDb *sutcomptype_db = NULL;
+AmfDb *sutcomptype_db = nullptr;
 
 static void sutcomptype_db_add(AVD_SUTCOMP_TYPE *sutcomptype)
 {
@@ -83,7 +83,7 @@ SaAisErrorT avd_sutcomptype_config_get(S
 
error = immutil_saImmOmSearchInitialize_2(avd_cb->immOmHandle, 
sutype_name, SA_IMM_SUBTREE,
SA_IMM_SEARCH_ONE_ATTR | SA_IMM_SEARCH_GET_ALL_ATTR, 
,
-   NULL, );
+   nullptr, );

if (SA_AIS_OK != error) {
LOG_ER("saImmOmSearchInitialize_2 failed: %u", error);
@@ -91,10 +91,10 @@ SaAisErrorT avd_sutcomptype_config_get(S
}
 
while (immutil_saImmOmSearchNext_2(searchHandle, , 
(SaImmAttrValuesT_2 ***)) == SA_AIS_OK) {
-   if (!is_config_valid(, attributes, NULL))
+   if (!is_config_valid(, attributes, nullptr))
goto done2;
-   if ((sutcomptype = sutcomptype_db->find(Amf::to_string())) 
== NULL) {
-   if ((sutcomptype = sutcomptype_create(, attributes)) 
== NULL) {
+   if ((sutcomptype = sutcomptype_db->find(Amf::to_string())) 
== nullptr) {
+   if ((sutcomptype = sutcomptype_create(, attributes)) 
== nullptr) {
error = SA_AIS_ERR_FAILED_OPERATION;
goto done2;
}
@@ -115,7 +115,7 @@ SaAisErrorT avd_sutcomptype_config_get(S
 static SaAisErrorT sutcomptype_ccb_completed_cb(CcbUtilOperationData_t *opdata)
 {
SaAisErrorT rc = SA_AIS_ERR_BAD_OPERATION;
-   AVD_SUTCOMP_TYPE *sutcomptype = NULL;
+   AVD_SUTCOMP_TYPE *sutcomptype = nullptr;
 
TRACE_ENTER2("CCB ID %llu, '%s'", opdata->ccbId, 
opdata->objectName.value);
 
@@ -144,7 +144,7 @@ static SaAisErrorT sutcomptype_ccb_compl
 
 static void sutcomptype_ccb_apply_cb(CcbUtilOperationData_t *opdata)
 {
-   AVD_SUTCOMP_TYPE *sutcomptype = NULL;
+   AVD_SUTCOMP_TYPE *sutcomptype = nullptr;
 
TRACE_ENTER2("CCB ID %llu, '%s'", opdata->ccbId, 
opdata->objectName.value);
 
@@ -167,7 +167,7 @@ void avd_sutcomptype_constructor(void)
 {
 
sutcomptype_db = new AmfDb;
-   avd_class_impl_set("SaAmfSutCompType", NULL, NULL,
+   avd_class_impl_set("SaAmfSutCompType", nullptr, nullptr,
sutcomptype_ccb_completed_cb, sutcomptype_ccb_apply_cb);
 }
 

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 47 of 48] amfd: convert NULL to nullptr for svctypecstypes.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/svctypecstypes.cc |  20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/svctypecstypes.cc 
b/osaf/services/saf/amf/amfd/svctypecstypes.cc
--- a/osaf/services/saf/amf/amfd/svctypecstypes.cc
+++ b/osaf/services/saf/amf/amfd/svctypecstypes.cc
@@ -23,7 +23,7 @@
 #include 
 
 
-AmfDb *svctypecstypes_db = NULL;
+AmfDb *svctypecstypes_db = nullptr;
 static void svctypecstype_db_add(AVD_SVC_TYPE_CS_TYPE *svctypecstype)
 {
uint32_t rc = 
svctypecstypes_db->insert(Amf::to_string(>name),svctypecstype);
@@ -76,7 +76,7 @@ SaAisErrorT avd_svctypecstypes_config_ge
 
error = immutil_saImmOmSearchInitialize_2(avd_cb->immOmHandle, 
svctype_name, SA_IMM_SUBTREE,
SA_IMM_SEARCH_ONE_ATTR | SA_IMM_SEARCH_GET_ALL_ATTR, 
,
-   NULL, );
+   nullptr, );

if (SA_AIS_OK != error) {
LOG_ER("saImmOmSearchInitialize_2 failed: %u", error);
@@ -85,8 +85,8 @@ SaAisErrorT avd_svctypecstypes_config_ge
 
while (immutil_saImmOmSearchNext_2(searchHandle, , 
(SaImmAttrValuesT_2 ***)) == SA_AIS_OK) {
 
-   if ((svctypecstype = 
svctypecstypes_db->find(Amf::to_string()))== NULL) {
-   if ((svctypecstype = svctypecstypes_create(, 
attributes)) == NULL) {
+   if ((svctypecstype = 
svctypecstypes_db->find(Amf::to_string()))== nullptr) {
+   if ((svctypecstype = svctypecstypes_create(, 
attributes)) == nullptr) {
error = SA_AIS_ERR_FAILED_OPERATION;
goto done2;
}
@@ -125,15 +125,15 @@ static SaAisErrorT svctypecstypes_ccb_co
goto done;
}
 
-   if (cstype_db->find(Amf::to_string(_dn)) == NULL) {
-   if (cstype_db->find(Amf::to_string(_dn)) == 
NULL) {
-   if (opdata == NULL) {
+   if (cstype_db->find(Amf::to_string(_dn)) == nullptr) {
+   if (cstype_db->find(Amf::to_string(_dn)) == 
nullptr) {
+   if (opdata == nullptr) {
report_ccb_validation_error(opdata,
"SaAmfCSType object '%s' does 
not exist", cstype_dn.value);
goto done;
}
 
-   if (ccbutil_getCcbOpDataByDN(opdata->ccbId, 
_dn) == NULL) {
+   if (ccbutil_getCcbOpDataByDN(opdata->ccbId, 
_dn) == nullptr) {
report_ccb_validation_error(opdata,
"SaAmfCSType object '%s' does 
not exist in model or in CCB",
cstype_dn.value);
@@ -182,7 +182,7 @@ static void svctypecstypes_ccb_apply_cb(
break;
case CCBUTIL_DELETE:
svctypecstype = 
svctypecstypes_db->find(Amf::to_string(>objectName));
-   if (svctypecstype != NULL) {
+   if (svctypecstype != nullptr) {

svctypecstypes_db->erase(Amf::to_string(>objectName));
delete svctypecstype;
}
@@ -197,7 +197,7 @@ static void svctypecstypes_ccb_apply_cb(
 void avd_svctypecstypes_constructor(void)
 {
svctypecstypes_db = new AmfDb;
-   avd_class_impl_set("SaAmfSvcTypeCSTypes", NULL, NULL,
+   avd_class_impl_set("SaAmfSvcTypeCSTypes", nullptr, nullptr,
svctypecstypes_ccb_completed_cb, svctypecstypes_ccb_apply_cb);
 }
 

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 34 of 48] amfd: convert NULL to nullptr for sg_npm_fsm.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/sg_npm_fsm.cc |  272 +++---
 1 files changed, 136 insertions(+), 136 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/sg_npm_fsm.cc 
b/osaf/services/saf/amf/amfd/sg_npm_fsm.cc
--- a/osaf/services/saf/amf/amfd/sg_npm_fsm.cc
+++ b/osaf/services/saf/amf/amfd/sg_npm_fsm.cc
@@ -58,11 +58,11 @@ static void avd_sg_npm_si_transfer_for_r
 static AVD_SU *avd_sg_npm_su_next_asgn(AVD_CL_CB *cb, AVD_SG *sg, AVD_SU *su, 
SaAmfHAStateT state)
 {
std::vector::iterator iter;
-   AVD_SU* next_su = NULL;
+   AVD_SU* next_su = nullptr;

TRACE_ENTER();
 
-   if (su == NULL) {
+   if (su == nullptr) {
if (sg->list_of_su.empty() == false) {
iter = sg->list_of_su.begin();
} else {
@@ -189,7 +189,7 @@ static uint32_t avd_sg_npm_su_chk_snd(AV
|| (q_su->su_on_node->saAmfNodeOperState == 
SA_AMF_OPERATIONAL_DISABLED)
|| (q_su->su_on_node->saAmfNodeAdminState == 
SA_AMF_ADMIN_LOCKED)) {
/* Update the dependent SI's dep_state */
-   for (i_susi = s_su->list_of_susi;i_susi != NULL;i_susi 
= i_susi->su_next) {
+   for (i_susi = s_su->list_of_susi;i_susi != 
nullptr;i_susi = i_susi->su_next) {
if (i_susi->si->num_dependents > 0) {
/* This is a Sponsor SI update its 
dependent states */

avd_sidep_update_depstate_si_failover(i_susi->si, q_su);
@@ -216,12 +216,12 @@ done:
  * ha_state - the SU required for this HA state assignment 
  *
  * Return value: A pointer to SU which has least SI assignments or 
- *  NULL if not found any SU
+ *  nullptr if not found any SU
  *  
  */
 static AVD_SU* avd_sg_npm_get_least_su(AVD_SG *sg, SaAmfHAStateT ha_state)
 {
-   AVD_SU *pref_su = NULL;
+   AVD_SU *pref_su = nullptr;
uint32_t curr_act_sus = 0;
uint32_t curr_std_sus = 0;
 
@@ -333,12 +333,12 @@ done:
  *
  * Input:  sg - sg in which equal distribution of SIs is to be done
  *
- * Return value: NULL
+ * Return value: nullptr
  *  
  */
 static void avd_sg_npm_distribute_si_equal(AVD_SG *sg)
 {
-   AVD_SU *curr_su = NULL;
+   AVD_SU *curr_su = nullptr;
AVD_SU_SI_REL *susi;
 
TRACE_ENTER();
@@ -355,7 +355,7 @@ static void avd_sg_npm_distribute_si_equ
(curr_si->saAmfSIAssignmentState == 
SA_AMF_ASSIGNMENT_FULLY_ASSIGNED) ||
(curr_si->si_dep_state == 
AVD_SI_SPONSOR_UNASSIGNED) ||
(curr_si->si_dep_state == 
AVD_SI_UNASSIGNING_DUE_TO_DEP) ||
-   (curr_si->list_of_csi == NULL)) {
+   (curr_si->list_of_csi == nullptr)) {
continue;
}
 
@@ -366,7 +366,7 @@ static void avd_sg_npm_distribute_si_equ
 */
curr_su = avd_sg_npm_get_least_su(sg, SA_AMF_HA_ACTIVE);
 
-   if (curr_su == NULL) {
+   if (curr_su == nullptr) {
/* there are no more SUs that can take an 
active assignment
 * so break from the loop as no more SIs can be 
assigned active
 */
@@ -410,7 +410,7 @@ static void avd_sg_npm_distribute_si_equ
/* now get an SU for the standby HA assignment for this 
SI */
curr_su = avd_sg_npm_get_least_su(sg, 
SA_AMF_HA_STANDBY);
 
-   if (curr_su == NULL) {
+   if (curr_su == nullptr) {
/* there are no more SUs that can take an 
standby assignment
 * so break from the loop as no more SIs can be 
assigned standby
 */
@@ -445,7 +445,7 @@ static void avd_sg_npm_distribute_si_equ
  * take active assignments. For each SI that has active assignment it verifies 
if
  * standby assignment exists, if no it identifies the standby SU corresponding 
to
  * this SU and assigns this SI to the SU in standby role. It then adds the 
Assigning SUs to 
- * the SU operation list. If no assignments happen, it returns NULL.
+ * the SU operation list. If no assignments happen, it returns nullptr.
  *
  * Input: cb - the AVD control block
  *sg - The pointer to the service group.
@@ -461,9 +461,9 @@ static void avd_sg_npm_distribute_si_equ
 
 static AVD_SU *avd_sg_npm_su_chose_asgn(AVD_CL_CB *cb, AVD_SG *sg)
 {
-   AVD_SU *i_su = NULL, *l_su = NULL, *n_su;
+   AVD_SU *i_su = 

[devel] [PATCH 43 of 48] amfd: convert NULL to nullptr for su.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/su.cc |  206 +++---
 1 files changed, 103 insertions(+), 103 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/su.cc b/osaf/services/saf/amf/amfd/su.cc
--- a/osaf/services/saf/amf/amfd/su.cc
+++ b/osaf/services/saf/amf/amfd/su.cc
@@ -31,7 +31,7 @@
 #include 
 #include 
 
-AmfDb *su_db = NULL;
+AmfDb *su_db = nullptr;
 
 void AVD_SU::initialize() {

@@ -51,12 +51,12 @@ void AVD_SU::initialize() {
su_switch = AVSV_SI_TOGGLE_STABLE;
su_is_external = false;
su_act_state = 0;
-   sg_of_su = NULL;
-   su_on_node = NULL;
-   list_of_susi = NULL;
+   sg_of_su = nullptr;
+   su_on_node = nullptr;
+   list_of_susi = nullptr;
list_of_comp = {};
-   su_type = NULL;
-   su_list_su_type_next = NULL; 
+   su_type = nullptr;
+   su_list_su_type_next = nullptr; 
name.length = 0;
saAmfSUType.length = 0;
saAmfSUMaintenanceCampaign.length = 0;
@@ -87,7 +87,7 @@ void AVD_SU::remove_from_model() {
 * by now, just do the sanity check to confirm it is done 
 */
osafassert(list_of_comp.empty() == true);
-   osafassert(list_of_susi == NULL);
+   osafassert(list_of_susi == nullptr);
 
m_AVSV_SEND_CKPT_UPDT_ASYNC_RMV(avd_cb, this, AVSV_CKPT_AVD_SU_CONFIG);
avd_node_remove_su(this);
@@ -109,7 +109,7 @@ int AVD_SU::hastate_assignments_count(Sa
const AVD_SU_SI_REL *susi;
int curr_assignment_cnt = 0;
 
-   for (susi = list_of_susi; susi != NULL; susi = susi->su_next) {
+   for (susi = list_of_susi; susi != nullptr; susi = susi->su_next) {
if (susi->state == ha_state)
curr_assignment_cnt++;
}
@@ -120,13 +120,13 @@ int AVD_SU::hastate_assignments_count(Sa
 void AVD_SU::remove_comp(AVD_COMP *comp) {
AVD_SU *su_ref = comp->su;
 
-   osafassert(su_ref != NULL);
+   osafassert(su_ref != nullptr);
 
if (comp->su != nullptr) {

su_ref->list_of_comp.erase(std::remove(su_ref->list_of_comp.begin(),
su_ref->list_of_comp.end(), comp), 
su_ref->list_of_comp.end());
 
-   /* Marking SU referance pointer to NULL, please dont use 
further in the routine */
+   /* Marking SU referance pointer to nullptr, please dont use 
further in the routine */
comp->su = nullptr;
}
 
@@ -189,11 +189,11 @@ static int is_config_valid(const SaNameT
SaAmfAdminStateT admstate;
char *parent;
SaUint32T saAmfSutIsExternal;
-   AVD_SUTYPE *sut = NULL;
+   AVD_SUTYPE *sut = nullptr;
CcbUtilOperationData_t *tmp;
AVD_SG *sg;
 
-   if ((parent = strchr((char*)dn->value, ',')) == NULL) {
+   if ((parent = strchr((char*)dn->value, ',')) == nullptr) {
report_ccb_validation_error(opdata, "No parent to '%s' ", 
dn->value);
return 0;
}
@@ -206,16 +206,16 @@ static int is_config_valid(const SaNameT
rc = immutil_getAttr(const_cast("saAmfSUType"), 
attributes, 0, );
osafassert(rc == SA_AIS_OK);
 
-   if ((sut = sutype_db->find(Amf::to_string())) != NULL) {
+   if ((sut = sutype_db->find(Amf::to_string())) != nullptr) {
saAmfSutIsExternal = sut->saAmfSutIsExternal;
} else {
/* SU type does not exist in current model, check CCB if passed 
as param */
-   if (opdata == NULL) {
+   if (opdata == nullptr) {
report_ccb_validation_error(opdata, "'%s' does not 
exist in model", saAmfSUType.value);
return 0;
}
 
-   if ((tmp = ccbutil_getCcbOpDataByDN(opdata->ccbId, 
)) == NULL) {
+   if ((tmp = ccbutil_getCcbOpDataByDN(opdata->ccbId, 
)) == nullptr) {
report_ccb_validation_error(opdata, "'%s' does not 
exist in existing model or in CCB",
saAmfSUType.value);
return 0;
@@ -229,14 +229,14 @@ static int is_config_valid(const SaNameT
if 
(immutil_getAttr(const_cast("saAmfSUHostNodeOrNodeGroup"), 
attributes, 0, 
) == SA_AIS_OK) {
if (strncmp((char*)saAmfSUHostNodeOrNodeGroup.value, 
"safAmfNode=", 11) == 0) {
-   if (avd_node_get() == NULL) {
-   if (opdata == NULL) {
+   if (avd_node_get() == 
nullptr) {
+   if (opdata == nullptr) {
report_ccb_validation_error(opdata, 
"'%s' does not exist in model", 

saAmfSUHostNodeOrNodeGroup.value);
return 0;
}
 
-   if 

[devel] [PATCH 21 of 48] amfd: convert NULL to nullptr for main.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/main.cc |  30 +++---
 1 files changed, 15 insertions(+), 15 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/main.cc 
b/osaf/services/saf/amf/amfd/main.cc
--- a/osaf/services/saf/amf/amfd/main.cc
+++ b/osaf/services/saf/amf/amfd/main.cc
@@ -239,14 +239,14 @@ static void standby_invalid_evh(AVD_CL_C
LOG_IN("avd_standby_invalid_evh: %u", evt->rcv_evt);
 
if ((evt->rcv_evt >= AVD_EVT_NODE_UP_MSG) && (evt->rcv_evt <= 
AVD_EVT_VERIFY_ACK_NACK_MSG)) {
-   if (evt->info.avnd_msg == NULL) {
+   if (evt->info.avnd_msg == nullptr) {
LOG_ER("avd_standby_invalid_evh: no msg");
return;
}
 
n2d_msg = evt->info.avnd_msg;
avsv_dnd_msg_free(n2d_msg);
-   evt->info.avnd_msg = NULL;
+   evt->info.avnd_msg = nullptr;
}
 }
 
@@ -275,14 +275,14 @@ static void qsd_invalid_evh(AVD_CL_CB *c
cb->sync_required = false;
 
if ((evt->rcv_evt >= AVD_EVT_NODE_UP_MSG) && (evt->rcv_evt <= 
AVD_EVT_VERIFY_ACK_NACK_MSG)) {
-   if (evt->info.avnd_msg == NULL) {
+   if (evt->info.avnd_msg == nullptr) {
LOG_ER("avd_qsd_invalid_evh: no msg");
return;
}
 
n2d_msg = evt->info.avnd_msg;
avsv_dnd_msg_free(n2d_msg);
-   evt->info.avnd_msg = NULL;
+   evt->info.avnd_msg = nullptr;
}
 }
 
@@ -308,14 +308,14 @@ static void qsd_ignore_evh(AVD_CL_CB *cb
cb->sync_required = false;
 
if ((evt->rcv_evt >= AVD_EVT_NODE_UP_MSG) && (evt->rcv_evt <= 
AVD_EVT_VERIFY_ACK_NACK_MSG)) {
-   if (evt->info.avnd_msg == NULL) {
+   if (evt->info.avnd_msg == nullptr) {
LOG_ER("avd_qsd_ignore_evh: no msg");
return;
}
 
n2d_msg = evt->info.avnd_msg;
avsv_dnd_msg_free(n2d_msg);
-   evt->info.avnd_msg = NULL;
+   evt->info.avnd_msg = nullptr;
}
 }
 
@@ -391,7 +391,7 @@ static void handle_event_in_failover_sta
   and process them now */
m_AVD_EVT_QUEUE_DEQUEUE(cb, queue_evt);
 
-   while (NULL != queue_evt) {
+   while (nullptr != queue_evt) {
process_event(cb, queue_evt->evt);
delete queue_evt;
m_AVD_EVT_QUEUE_DEQUEUE(cb, queue_evt);
@@ -411,7 +411,7 @@ static void handle_event_in_failover_sta
   performed or not. */
for (const auto& i_su : node->list_of_ncs_su) {
if 
((i_su->sg_of_su->sg_redundancy_model == SA_AMF_NO_REDUNDANCY_MODEL) &&
-   (i_su->list_of_susi == 
NULL)) {
+   (i_su->list_of_susi == 
nullptr)) {
fover_done = true;
break;
}
@@ -533,8 +533,8 @@ static uint32_t initialize(void)
cb->heartbeat_tmr.type = AVD_TMR_SND_HB;
cb->heartbeat_tmr_period = AVSV_DEF_HB_PERIOD;
 
-   if ((val = getenv("AVSV_HB_PERIOD")) != NULL) {
-   cb->heartbeat_tmr_period = strtoll(val, NULL, 0);
+   if ((val = getenv("AVSV_HB_PERIOD")) != nullptr) {
+   cb->heartbeat_tmr_period = strtoll(val, nullptr, 0);
if (cb->heartbeat_tmr_period == 0) {
/* no value or non convertable value, revert to default 
*/
cb->heartbeat_tmr_period = AVSV_DEF_HB_PERIOD;
@@ -564,7 +564,7 @@ static uint32_t initialize(void)
goto done;
}
 
-   if ((rc = saNtfInitialize(>ntfHandle, NULL, )) != 
SA_AIS_OK) {
+   if ((rc = saNtfInitialize(>ntfHandle, nullptr, )) != 
SA_AIS_OK) {
LOG_ER("saNtfInitialize Failed (%u)", rc);
rc = NCSCC_RC_FAILURE;
goto done;
@@ -687,8 +687,8 @@ static void main_loop(void)
if (fds[FD_MBX].revents & POLLIN) {
evt = (AVD_EVT *)ncs_ipc_non_blk_recv(>avd_mbx);
 
-   if (evt == NULL) {
-   LOG_ER("main: NULL evt");
+   if (evt == nullptr) {
+   LOG_ER("main: nullptr evt");
continue;
}
 
@@ -837,7 +837,7 @@ int main(int argc, char *argv[])
daemonize(argc, argv);
 
if (initialize() != NCSCC_RC_SUCCESS) {
-   (void) nid_notify(const_cast("AMFD"), NCSCC_RC_FAILURE, 
NULL);
+   (void) nid_notify(const_cast("AMFD"), NCSCC_RC_FAILURE, 
nullptr);
 

[devel] [PATCH 18 of 48] amfd: convert NULL to nullptr for hlt.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/hlt.cc |  8 
 1 files changed, 4 insertions(+), 4 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/hlt.cc 
b/osaf/services/saf/amf/amfd/hlt.cc
--- a/osaf/services/saf/amf/amfd/hlt.cc
+++ b/osaf/services/saf/amf/amfd/hlt.cc
@@ -32,7 +32,7 @@ static SaAisErrorT ccb_completed_modify_
const SaImmAttrModificationT_2 *attr_mod;
int i = 0;
 
-   while ((attr_mod = opdata->param.modify.attrMods[i++]) != NULL) {
+   while ((attr_mod = opdata->param.modify.attrMods[i++]) != nullptr) {
const SaImmAttrValuesT_2 *attribute = _mod->modAttr;
SaTimeT *value = (SaTimeT *)attribute->attrValues[0];
 
@@ -71,7 +71,7 @@ static SaAisErrorT ccb_completed_delete_
avsv_sanamet_init(>objectName, _name, "safComp=");
 
comp = comp_db->find(Amf::to_string(_name));
-   for (curr_susi = comp->su->list_of_susi; curr_susi != NULL; curr_susi = 
curr_susi->su_next)
+   for (curr_susi = comp->su->list_of_susi; curr_susi != nullptr; 
curr_susi = curr_susi->su_next)
for (compcsi = curr_susi->list_of_csicomp; compcsi; compcsi = 
compcsi->susi_csicomp_next) {
if (compcsi->comp == comp) {
report_ccb_validation_error(opdata, "Deletion 
of SaAmfHealthcheck requires"
@@ -128,7 +128,7 @@ static void ccb_apply_modify_hdlr(CcbUti
comp = comp_db->find(Amf::to_string(_dn));
osafassert(comp);
 
-   while ((attr_mod = opdata->param.modify.attrMods[i++]) != NULL) {
+   while ((attr_mod = opdata->param.modify.attrMods[i++]) != nullptr) {
AVSV_PARAM_INFO param;
const SaImmAttrValuesT_2 *attribute = _mod->modAttr;
SaTimeT *param_val = (SaTimeT *)attribute->attrValues[0];
@@ -189,7 +189,7 @@ static void hc_ccb_apply_cb(CcbUtilOpera
 
 void avd_hc_constructor(void)
 {
-   avd_class_impl_set("SaAmfHealthcheck", NULL, NULL, hc_ccb_completed_cb,
+   avd_class_impl_set("SaAmfHealthcheck", nullptr, nullptr, 
hc_ccb_completed_cb,
hc_ccb_apply_cb);
 }
 

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 12 of 48] amfd: convert NULL to nullptr for comptype.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/comptype.cc |  92 +-
 1 files changed, 46 insertions(+), 46 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/comptype.cc 
b/osaf/services/saf/amf/amfd/comptype.cc
--- a/osaf/services/saf/amf/amfd/comptype.cc
+++ b/osaf/services/saf/amf/amfd/comptype.cc
@@ -29,7 +29,7 @@
 /* Global variable for the singleton object used by comp class */
 AVD_COMP_GLOBALATTR avd_comp_global_attrs;
 
-AmfDb *comptype_db = NULL;
+AmfDb *comptype_db = nullptr;
 
 static void comptype_db_add(AVD_COMP_TYPE *compt)
 {
@@ -39,7 +39,7 @@ static void comptype_db_add(AVD_COMP_TYP
 
 static void comptype_delete(AVD_COMP_TYPE *avd_comp_type)
 {
-   osafassert(NULL == avd_comp_type->list_of_comp);
+   osafassert(nullptr == avd_comp_type->list_of_comp);
comptype_db->erase(Amf::to_string(_comp_type->name));
delete avd_comp_type;
 }
@@ -52,26 +52,26 @@ void avd_comptype_add_comp(AVD_COMP *com
 
 void avd_comptype_remove_comp(AVD_COMP *comp)
 {
-   AVD_COMP *i_comp = NULL;
-   AVD_COMP *prev_comp = NULL;
+   AVD_COMP *i_comp = nullptr;
+   AVD_COMP *prev_comp = nullptr;
 
-   if (comp->comp_type != NULL) {
+   if (comp->comp_type != nullptr) {
i_comp = comp->comp_type->list_of_comp;
 
-   while ((i_comp != NULL) && (i_comp != comp)) {
+   while ((i_comp != nullptr) && (i_comp != comp)) {
prev_comp = i_comp;
i_comp = i_comp->comp_type_list_comp_next;
}
 
if (i_comp == comp) {
-   if (prev_comp == NULL) {
+   if (prev_comp == nullptr) {
comp->comp_type->list_of_comp = 
comp->comp_type_list_comp_next;
} else {
prev_comp->comp_type_list_comp_next = 
comp->comp_type_list_comp_next;
}
 
-   comp->comp_type_list_comp_next = NULL;
-   comp->comp_type = NULL;
+   comp->comp_type_list_comp_next = nullptr;
+   comp->comp_type = nullptr;
}
}
 }
@@ -97,33 +97,33 @@ static AVD_COMP_TYPE *comptype_create(co
 
(void)immutil_getAttr(const_cast("saAmfCtSwBundle"), 
attributes, 0, >saAmfCtSwBundle);
 
-   if ((str = immutil_getStringAttr(attributes, "saAmfCtDefCmdEnv", 0)) != 
NULL)
+   if ((str = immutil_getStringAttr(attributes, "saAmfCtDefCmdEnv", 0)) != 
nullptr)
strcpy(compt->saAmfCtDefCmdEnv, str);

(void)immutil_getAttr(const_cast("saAmfCtDefClcCliTimeout"), 
attributes, 0, >saAmfCtDefClcCliTimeout);

(void)immutil_getAttr(const_cast("saAmfCtDefCallbackTimeout"), 
attributes, 0, >saAmfCtDefCallbackTimeout);
 
-   if ((str = immutil_getStringAttr(attributes, 
"saAmfCtRelPathInstantiateCmd", 0)) != NULL)
+   if ((str = immutil_getStringAttr(attributes, 
"saAmfCtRelPathInstantiateCmd", 0)) != nullptr)
strcpy(compt->saAmfCtRelPathInstantiateCmd, str);
-   if ((str = immutil_getStringAttr(attributes, 
"saAmfCtDefInstantiateCmdArgv", 0)) != NULL)
+   if ((str = immutil_getStringAttr(attributes, 
"saAmfCtDefInstantiateCmdArgv", 0)) != nullptr)
strcpy(compt->saAmfCtDefInstantiateCmdArgv, str);
 

(void)immutil_getAttr(const_cast("saAmfCtDefInstantiationLevel"),
 attributes, 0, >saAmfCtDefInstantiationLevel);
 
-   if ((str = immutil_getStringAttr(attributes, 
"saAmfCtRelPathTerminateCmd", 0)) != NULL)
+   if ((str = immutil_getStringAttr(attributes, 
"saAmfCtRelPathTerminateCmd", 0)) != nullptr)
strcpy(compt->saAmfCtRelPathTerminateCmd, str);
-   if ((str = immutil_getStringAttr(attributes, 
"saAmfCtDefTerminateCmdArgv", 0)) != NULL)
+   if ((str = immutil_getStringAttr(attributes, 
"saAmfCtDefTerminateCmdArgv", 0)) != nullptr)
strcpy(compt->saAmfCtDefTerminateCmdArgv, str);
-   if ((str = immutil_getStringAttr(attributes, 
"saAmfCtRelPathCleanupCmd", 0)) != NULL)
+   if ((str = immutil_getStringAttr(attributes, 
"saAmfCtRelPathCleanupCmd", 0)) != nullptr)
strcpy(compt->saAmfCtRelPathCleanupCmd, str);
-   if ((str = immutil_getStringAttr(attributes, 
"saAmfCtDefCleanupCmdArgv", 0)) != NULL)
+   if ((str = immutil_getStringAttr(attributes, 
"saAmfCtDefCleanupCmdArgv", 0)) != nullptr)
strcpy(compt->saAmfCtDefCleanupCmdArgv, str);
-   if ((str = immutil_getStringAttr(attributes, 
"saAmfCtRelPathAmStartCmd", 0)) != NULL)
+   if ((str = immutil_getStringAttr(attributes, 
"saAmfCtRelPathAmStartCmd", 0)) != nullptr)
strcpy(compt->saAmfCtRelPathAmStartCmd, str);
-   if ((str = immutil_getStringAttr(attributes, 
"saAmfCtDefAmStartCmdArgv", 0)) != NULL)
+   if ((str = immutil_getStringAttr(attributes, 

[devel] [PATCH 15 of 48] amfd: convert NULL to nullptr for cstype.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/cstype.cc |  42 ++--
 1 files changed, 21 insertions(+), 21 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/cstype.cc 
b/osaf/services/saf/amf/amfd/cstype.cc
--- a/osaf/services/saf/amf/amfd/cstype.cc
+++ b/osaf/services/saf/amf/amfd/cstype.cc
@@ -22,7 +22,7 @@
 #include 
 #include 
 
-AmfDb *cstype_db = NULL;
+AmfDb *cstype_db = nullptr;
 
 //
 // TODO(HANO) Temporary use this function instead of strdup which uses malloc.
@@ -80,8 +80,8 @@ static void cstype_delete(AVD_CS_TYPE *c
 
cstype_db->erase(Amf::to_string(>name));
 
-   if (cst->saAmfCSAttrName != NULL) {
-   while ((p = cst->saAmfCSAttrName[i++]) != NULL) {
+   if (cst->saAmfCSAttrName != nullptr) {
+   while ((p = cst->saAmfCSAttrName[i++]) != nullptr) {
delete [] p;
}
}
@@ -98,12 +98,12 @@ void avd_cstype_add_csi(AVD_CSI *csi)
 void avd_cstype_remove_csi(AVD_CSI *csi)
 {
AVD_CSI *i_csi;
-   AVD_CSI *prev_csi = NULL;
+   AVD_CSI *prev_csi = nullptr;
 
-   if (csi->cstype != NULL) {
+   if (csi->cstype != nullptr) {
i_csi = csi->cstype->list_of_csi;
 
-   while ((i_csi != NULL) && (i_csi != csi)) {
+   while ((i_csi != nullptr) && (i_csi != csi)) {
prev_csi = i_csi;
i_csi = i_csi->csi_list_cs_type_next;
}
@@ -112,15 +112,15 @@ void avd_cstype_remove_csi(AVD_CSI *csi)
/* Log a fatal error */
osafassert(0);
} else {
-   if (prev_csi == NULL) {
+   if (prev_csi == nullptr) {
csi->cstype->list_of_csi = 
csi->csi_list_cs_type_next;
} else {
prev_csi->csi_list_cs_type_next = 
csi->csi_list_cs_type_next;
}
}
 
-   csi->csi_list_cs_type_next = NULL;
-   csi->cstype = NULL;
+   csi->csi_list_cs_type_next = nullptr;
+   csi->cstype = nullptr;
}
 }
 
@@ -128,7 +128,7 @@ static int is_config_valid(const SaNameT
 {
char *parent;
 
-   if ((parent = strchr((char*)dn->value, ',')) == NULL) {
+   if ((parent = strchr((char*)dn->value, ',')) == nullptr) {
report_ccb_validation_error(opdata, "No parent to '%s' ", 
dn->value);
return 0;
}
@@ -164,18 +164,18 @@ SaAisErrorT avd_cstype_config_get(void)
searchParam.searchOneAttr.attrValueType = SA_IMM_ATTR_SASTRINGT;
searchParam.searchOneAttr.attrValue = 
 
-   if (immutil_saImmOmSearchInitialize_2(avd_cb->immOmHandle, NULL, 
SA_IMM_SUBTREE,
-   SA_IMM_SEARCH_ONE_ATTR | SA_IMM_SEARCH_GET_ALL_ATTR, 
, NULL, ) != SA_AIS_OK) {
+   if (immutil_saImmOmSearchInitialize_2(avd_cb->immOmHandle, nullptr, 
SA_IMM_SUBTREE,
+   SA_IMM_SEARCH_ONE_ATTR | SA_IMM_SEARCH_GET_ALL_ATTR, 
, nullptr, ) != SA_AIS_OK) {
LOG_ER("saImmOmSearchInitialize_2 failed: %u", error);
goto done1;
}
 
while (immutil_saImmOmSearchNext_2(searchHandle, , 
(SaImmAttrValuesT_2 ***)) == SA_AIS_OK) {
-   if (!is_config_valid(, NULL))
+   if (!is_config_valid(, nullptr))
goto done2;
 
-   if ((cst = cstype_db->find(Amf::to_string())) == NULL){
-   if ((cst = cstype_create(, attributes)) == NULL)
+   if ((cst = cstype_db->find(Amf::to_string())) == nullptr){
+   if ((cst = cstype_create(, attributes)) == nullptr)
goto done2;
 
cstype_add_to_model(cst);
@@ -217,14 +217,14 @@ static SaAisErrorT cstype_ccb_completed_
break;
case CCBUTIL_DELETE:
cst = cstype_db->find(Amf::to_string(>objectName));
-   if (cst->list_of_csi != NULL) {
+   if (cst->list_of_csi != nullptr) {
/* check whether there exists a delete operation for 
 * each of the CSI in the cs_type list in the current 
CCB 
 */  
csi = cst->list_of_csi;
-   while (csi != NULL) {  
+   while (csi != nullptr) {  
t_opData = 
ccbutil_getCcbOpDataByDN(opdata->ccbId, >name);
-   if ((t_opData == NULL) || 
(t_opData->operationType != CCBUTIL_DELETE)) {
+   if ((t_opData == nullptr) || 
(t_opData->operationType != CCBUTIL_DELETE)) {
csi_exist = true;   
break;  

[devel] [PATCH 04 of 48] amfd: convert NULL to nullptr for ckpt_dec.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/ckpt_dec.cc |  84 +-
 1 files changed, 42 insertions(+), 42 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/ckpt_dec.cc 
b/osaf/services/saf/amf/amfd/ckpt_dec.cc
--- a/osaf/services/saf/amf/amfd/ckpt_dec.cc
+++ b/osaf/services/saf/amf/amfd/ckpt_dec.cc
@@ -171,7 +171,7 @@ const AVSV_DECODE_CKPT_DATA_FUNC_PTR avd
dec_comp_readiness_state,
dec_comp_pres_state,
dec_comp_restart_count,
-   NULL,   /* AVSV_SYNC_COMMIT */
+   nullptr,/* AVSV_SYNC_COMMIT */
dec_su_restart_count,
dec_si_dep_state,
dec_ng_admin_state
@@ -809,7 +809,7 @@ static uint32_t dec_node_up_info(AVD_CL_
return status;
}
 
-   if (NULL == (avnd_struct = 
avd_node_find_nodeid(avnd_ptr->node_info.nodeId))) {
+   if (nullptr == (avnd_struct = 
avd_node_find_nodeid(avnd_ptr->node_info.nodeId))) {
LOG_ER("%s: node not found, nodeid=%x", __FUNCTION__, 
avnd_ptr->node_info.nodeId);
return NCSCC_RC_FAILURE;
}
@@ -860,7 +860,7 @@ static uint32_t dec_node_admin_state(AVD
 
osafassert(status == NCSCC_RC_SUCCESS);
 
-   if (NULL == (avnd_struct = avd_node_get(_ptr->name))) {
+   if (nullptr == (avnd_struct = avd_node_get(_ptr->name))) {
LOG_ER("%s: node not found, nodeid=%s", __FUNCTION__, 
avnd_ptr->name.value);
return NCSCC_RC_FAILURE;
}
@@ -908,7 +908,7 @@ static uint32_t dec_node_oper_state(AVD_
 
osafassert(status == NCSCC_RC_SUCCESS);
 
-   if (NULL == (avnd_struct = avd_node_get(_ptr->name))) {
+   if (nullptr == (avnd_struct = avd_node_get(_ptr->name))) {
LOG_ER("%s: node not found, nodeid=%s", __FUNCTION__, 
avnd_ptr->name.value);
return NCSCC_RC_FAILURE;
}
@@ -956,7 +956,7 @@ static uint32_t dec_node_state(AVD_CL_CB
 
osafassert(status == NCSCC_RC_SUCCESS);
 
-   if (NULL == (avnd_struct = avd_node_get(_ptr->name))) {
+   if (nullptr == (avnd_struct = avd_node_get(_ptr->name))) {
LOG_ER("%s: node not found, nodeid=%s", __FUNCTION__, 
avnd_ptr->name.value);
return NCSCC_RC_FAILURE;
}
@@ -1003,7 +1003,7 @@ static uint32_t dec_node_rcv_msg_id(AVD_
 
osafassert(status == NCSCC_RC_SUCCESS);
 
-   if (NULL == (avnd_struct = 
avd_node_find_nodeid(avnd_ptr->node_info.nodeId))) {
+   if (nullptr == (avnd_struct = 
avd_node_find_nodeid(avnd_ptr->node_info.nodeId))) {
LOG_ER("%s: node not found, nodeid=%x", __FUNCTION__, 
avnd_ptr->node_info.nodeId);
return NCSCC_RC_FAILURE;
}
@@ -1051,7 +1051,7 @@ static uint32_t dec_node_snd_msg_id(AVD_
 
osafassert(status == NCSCC_RC_SUCCESS);
 
-   if (NULL == (avnd_struct = 
avd_node_find_nodeid(avnd_ptr->node_info.nodeId))) {
+   if (nullptr == (avnd_struct = 
avd_node_find_nodeid(avnd_ptr->node_info.nodeId))) {
LOG_ER("%s: node not found, nodeid=%x", __FUNCTION__, 
avnd_ptr->node_info.nodeId);
return NCSCC_RC_FAILURE;
}
@@ -1086,7 +1086,7 @@ static uint32_t dec_sg_admin_state(AVD_C
 
osaf_decode_sanamet(>i_uba, );
AVD_SG *sg = sg_db->find(Amf::to_string());
-   osafassert(sg != NULL);
+   osafassert(sg != nullptr);
osaf_decode_uint32(>i_uba, (uint32_t*)>saAmfSGAdminState);
 
cb->async_updt_cnt.sg_updt++;
@@ -1139,7 +1139,7 @@ static uint32_t dec_sg_su_assigned_num(A
 
osaf_decode_sanamet(>i_uba, );
AVD_SG *sg = sg_db->find(Amf::to_string());
-   osafassert(sg != NULL);
+   osafassert(sg != nullptr);
osaf_decode_uint32(>i_uba, >saAmfSGNumCurrAssignedSUs);
 
cb->async_updt_cnt.sg_updt++;
@@ -1171,7 +1171,7 @@ static uint32_t dec_sg_su_spare_num(AVD_
 
osaf_decode_sanamet(>i_uba, );
AVD_SG *sg = sg_db->find(Amf::to_string());
-   osafassert(sg != NULL);
+   osafassert(sg != nullptr);
osaf_decode_uint32(>i_uba, 
>saAmfSGNumCurrInstantiatedSpareSUs);
 
cb->async_updt_cnt.sg_updt++;
@@ -1203,7 +1203,7 @@ static uint32_t dec_sg_su_uninst_num(AVD
 
osaf_decode_sanamet(>i_uba, );
AVD_SG *sg = sg_db->find(Amf::to_string());
-   osafassert(sg != NULL);
+   osafassert(sg != nullptr);
osaf_decode_uint32(>i_uba, 
>saAmfSGNumCurrNonInstantiatedSpareSUs);
 
cb->async_updt_cnt.sg_updt++;
@@ -1235,7 +1235,7 @@ static uint32_t dec_sg_adjust_state(AVD_
 
osaf_decode_sanamet(>i_uba, );
AVD_SG *sg = sg_db->find(Amf::to_string());
-   osafassert(sg != NULL);
+   osafassert(sg != nullptr);
osaf_decode_uint32(>i_uba, (uint32_t*)>adjust_state);
 
cb->async_updt_cnt.sg_updt++;
@@ -1266,7 +1266,7 @@ static uint32_t dec_sg_fsm_state(AVD_CL_
 
osaf_decode_sanamet(>i_uba, );
AVD_SG *sg = sg_db->find(Amf::to_string());
-   

[devel] [PATCH 26 of 48] amfd: convert NULL to nullptr for nodegroup.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/nodegroup.cc |  88 
 1 files changed, 44 insertions(+), 44 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/nodegroup.cc 
b/osaf/services/saf/amf/amfd/nodegroup.cc
--- a/osaf/services/saf/amf/amfd/nodegroup.cc
+++ b/osaf/services/saf/amf/amfd/nodegroup.cc
@@ -56,7 +56,7 @@ static int is_config_valid(const SaNameT
const SaImmAttrValuesT_2 *attr;
 
p = strchr((char *)dn->value, ',');
-   if (p == NULL) {
+   if (p == nullptr) {
report_ccb_validation_error(opdata, "No parent to '%s' ", 
dn->value);
return 0;
}
@@ -66,7 +66,7 @@ static int is_config_valid(const SaNameT
return 0;
}
 
-   while ((attr = attributes[i++]) != NULL)
+   while ((attr = attributes[i++]) != nullptr)
if (!strcmp(attr->attrName, "saAmfNGNodeList"))
break;
 
@@ -76,14 +76,14 @@ static int is_config_valid(const SaNameT
for (j = 0; j < attr->attrValuesNumber; j++) {
SaNameT *name = (SaNameT *)attr->attrValues[j];
AVD_AVND *node = avd_node_get(name);
-   if (node == NULL) {
-   if (opdata == NULL) {
+   if (node == nullptr) {
+   if (opdata == nullptr) {
report_ccb_validation_error(opdata, "'%s' does 
not exist in model", name->value);
return 0;
}
 
/* Node does not exist in current model, check CCB */
-   if (ccbutil_getCcbOpDataByDN(opdata->ccbId, name) == 
NULL) {
+   if (ccbutil_getCcbOpDataByDN(opdata->ccbId, name) == 
nullptr) {
report_ccb_validation_error(opdata, "'%s' does 
not exist either in model or CCB",
name->value);
return 0;
@@ -98,7 +98,7 @@ static int is_config_valid(const SaNameT
 */

AVD_AMF_NG *tmp_ng = ng_create((SaNameT *)dn, attributes);
-   if (tmp_ng == NULL)
+   if (tmp_ng == nullptr)
return 0;
if (attr->attrValuesNumber != tmp_ng->number_nodes()) {
LOG_ER("Duplicate nodes in saAmfNGNodeList of 
'%s'",tmp_ng->name.value);
@@ -147,7 +147,7 @@ static AVD_AMF_NG *ng_create(SaNameT *dn
_number) == SA_AIS_OK) && (values_number > 0)) {
 
for (i = 0; i < values_number; i++) {
-   if ((node_name = immutil_getNameAttr(attributes, 
"saAmfNGNodeList", i)) != NULL) {
+   if ((node_name = immutil_getNameAttr(attributes, 
"saAmfNGNodeList", i)) != nullptr) {

ng->saAmfNGNodeList.insert(Amf::to_string(node_name));
}
}
@@ -166,7 +166,7 @@ static AVD_AMF_NG *ng_create(SaNameT *dn
 done:
if (rc != 0) {
delete ng;
-   ng = NULL;
+   ng = nullptr;
}
 
TRACE_LEAVE();
@@ -215,9 +215,9 @@ SaAisErrorT avd_ng_config_get(void)
searchParam.searchOneAttr.attrValueType = SA_IMM_ATTR_SASTRINGT;
searchParam.searchOneAttr.attrValue = 
 
-   error = immutil_saImmOmSearchInitialize_2(avd_cb->immOmHandle, NULL, 
SA_IMM_SUBTREE,
+   error = immutil_saImmOmSearchInitialize_2(avd_cb->immOmHandle, nullptr, 
SA_IMM_SUBTREE,
SA_IMM_SEARCH_ONE_ATTR | SA_IMM_SEARCH_GET_ALL_ATTR, 
,
-   NULL, );
+   nullptr, );
 
if (SA_AIS_OK != error) {
LOG_ER("No objects found");
@@ -225,12 +225,12 @@ SaAisErrorT avd_ng_config_get(void)
}
 
while (immutil_saImmOmSearchNext_2(searchHandle, , 
(SaImmAttrValuesT_2 ***)) == SA_AIS_OK) {
-   if (!is_config_valid(, attributes, NULL)) {
+   if (!is_config_valid(, attributes, nullptr)) {
error = SA_AIS_ERR_FAILED_OPERATION;
goto done2;
}
 
-   if ((ng = ng_create(, (const SaImmAttrValuesT_2 
**)attributes)) == NULL)
+   if ((ng = ng_create(, (const SaImmAttrValuesT_2 
**)attributes)) == nullptr)
goto done2;
 
nodegroup_db->insert(Amf::to_string(>name), ng);
@@ -304,12 +304,12 @@ static SaAisErrorT ng_ccb_completed_modi
TRACE_ENTER();
 
ng = avd_ng_get(>objectName);
-   if (ng == NULL) {
+   if (ng == nullptr) {
report_ccb_validation_error(opdata, "ng modify: nodegroup 
cannot be found");
goto done;
}
 
-   while ((mod = opdata->param.modify.attrMods[i++]) != NULL) {
+   while ((mod = opdata->param.modify.attrMods[i++]) != nullptr) {
if (mod->modType == SA_IMM_ATTR_VALUES_REPLACE) {
TRACE("replace");
goto done;

[devel] [PATCH 31 of 48] amfd: convert NULL to nullptr for sg.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/sg.cc |  162 +++---
 1 files changed, 81 insertions(+), 81 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/sg.cc b/osaf/services/saf/amf/amfd/sg.cc
--- a/osaf/services/saf/amf/amfd/sg.cc
+++ b/osaf/services/saf/amf/amfd/sg.cc
@@ -31,7 +31,7 @@
 #include 
 #include 
 
-AmfDb *sg_db = NULL;
+AmfDb *sg_db = nullptr;
 
 static void avd_verify_equal_ranked_su(AVD_SG *avd_sg);
 
@@ -39,7 +39,7 @@ void avd_sg_db_add(AVD_SG *sg)
 {
unsigned int rc;
 
-   if (sg_db->find(Amf::to_string(>name)) == NULL) {
+   if (sg_db->find(Amf::to_string(>name)) == nullptr) {
rc = sg_db->insert(Amf::to_string(>name),sg);
osafassert(rc == NCSCC_RC_SUCCESS);
}
@@ -57,7 +57,7 @@ static void sg_add_to_model(AVD_SG *sg)
TRACE_ENTER2("%s", sg->name.value);
 
/* Check parent link to see if it has been added already */
-   if (sg->app != NULL) {
+   if (sg->app != nullptr) {
TRACE("already added");
goto done;
}
@@ -115,15 +115,15 @@ AVD_SG::AVD_SG():
adjust_state(AVSV_SG_STABLE),
sg_ncs_spec(false),
sg_fsm_state(AVD_SG_FSM_STABLE),
-   admin_si(NULL),
+   admin_si(nullptr),
sg_redundancy_model(SA_AMF_NO_REDUNDANCY_MODEL),
-   sg_type(NULL),
-   sg_list_app_next(NULL),
-   app(NULL),
+   sg_type(nullptr),
+   sg_list_app_next(nullptr),
+   app(nullptr),
equal_ranked_su(false),
-   max_assigned_su(NULL),
-   min_assigned_su(NULL),
-   si_tobe_redistributed(NULL),
+   max_assigned_su(nullptr),
+   min_assigned_su(nullptr),
+   si_tobe_redistributed(nullptr),
try_inst_counter(0)
 {
adminOp = static_cast(0);
@@ -184,7 +184,7 @@ void AVD_SG::remove_si(AVD_SI* si)
osafassert(false);
}
 
-   si->sg_of_si = NULL;
+   si->sg_of_si = nullptr;
 }
 
 /**
@@ -203,7 +203,7 @@ static int is_config_valid(const SaNameT
SaAmfAdminStateT admstate;
char *parent;
 
-   if ((parent = strchr((char*)dn->value, ',')) == NULL) {
+   if ((parent = strchr((char*)dn->value, ',')) == nullptr) {
report_ccb_validation_error(opdata, "No parent to '%s' ", 
dn->value);
return 0;
}
@@ -216,14 +216,14 @@ static int is_config_valid(const SaNameT
rc = immutil_getAttr(const_cast("saAmfSGType"), 
attributes, 0, );
osafassert(rc == SA_AIS_OK);
 
-   if (sgtype_db->find(Amf::to_string()) == NULL) {
-   if (opdata == NULL) {
+   if (sgtype_db->find(Amf::to_string()) == nullptr) {
+   if (opdata == nullptr) {
report_ccb_validation_error(opdata, "'%s' does not 
exist in model", aname.value);
return 0;
}
 
/* SG type does not exist in current model, check CCB */
-   if (ccbutil_getCcbOpDataByDN(opdata->ccbId, ) == NULL) {
+   if (ccbutil_getCcbOpDataByDN(opdata->ccbId, ) == nullptr) 
{
report_ccb_validation_error(opdata, "'%s' does not 
exist in existing model or in CCB", aname.value);
return 0;
}
@@ -248,7 +248,7 @@ static int is_config_valid(const SaNameT
}
 
if 
((immutil_getAttr(const_cast("saAmfSGSuHostNodeGroup"), 
attributes, 0, ) == SA_AIS_OK) &&
-   (avd_ng_get() == NULL)) {
+   (avd_ng_get() == nullptr)) {
report_ccb_validation_error(opdata, "Invalid 
saAmfSGSuHostNodeGroup '%s' for '%s'", aname.value, dn->value);
return 0;
}
@@ -379,7 +379,7 @@ static AVD_SG *sg_create(const SaNameT *
 
if (rc != 0) {
avd_sg_delete(sg);
-   sg = NULL;
+   sg = nullptr;
}
 
TRACE_LEAVE();
@@ -419,7 +419,7 @@ SaAisErrorT avd_sg_config_get(const SaNa
const_cast("saAmfSGSuRestartProb"),
const_cast("saAmfSGSuRestartMax"),
const_cast("saAmfSGAdminState"),
-   NULL
+   nullptr
};
 
TRACE_ENTER();
@@ -441,12 +441,12 @@ SaAisErrorT avd_sg_config_get(const SaNa
while ((rc = immutil_saImmOmSearchNext_2(searchHandle, ,
(SaImmAttrValuesT_2 ***))) == SA_AIS_OK) {
 
-   if (!is_config_valid(, attributes, NULL)) {
+   if (!is_config_valid(, attributes, nullptr)) {
error = SA_AIS_ERR_FAILED_OPERATION;
goto done2;
}
 
-   if ((sg = sg_create(, attributes)) == NULL) {
+   if ((sg = sg_create(, attributes)) == nullptr) {
error = 

[devel] [PATCH 27 of 48] amfd: convert NULL to nullptr for nodeswbundle.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/nodeswbundle.cc |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/nodeswbundle.cc 
b/osaf/services/saf/amf/amfd/nodeswbundle.cc
--- a/osaf/services/saf/amf/amfd/nodeswbundle.cc
+++ b/osaf/services/saf/amf/amfd/nodeswbundle.cc
@@ -38,7 +38,7 @@ static int is_config_valid(const SaNameT
const char *path_prefix;
 
parent = avd_getparent((char*)dn->value);
-   if (parent == NULL) {
+   if (parent == nullptr) {
report_ccb_validation_error(opdata, "No parent to '%s' ", 
dn->value);
return 0;
}
@@ -164,6 +164,6 @@ static void nodeswbdl_ccb_apply_cb(CcbUt
 
 void avd_nodeswbundle_constructor(void)
 {
-   avd_class_impl_set("SaAmfNodeSwBundle", NULL, NULL,
+   avd_class_impl_set("SaAmfNodeSwBundle", nullptr, nullptr,
nodeswbdl_ccb_completed_cb, nodeswbdl_ccb_apply_cb);
 }

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 01 of 48] amfd: convert NULL to nullptr for app.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/app.cc |  84 +++---
 1 files changed, 42 insertions(+), 42 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/app.cc 
b/osaf/services/saf/amf/amfd/app.cc
--- a/osaf/services/saf/amf/amfd/app.cc
+++ b/osaf/services/saf/amf/amfd/app.cc
@@ -28,10 +28,10 @@ AmfDb *app_db = 0;
 AVD_APP::AVD_APP() :
saAmfApplicationAdminState(SA_AMF_ADMIN_UNLOCKED),
saAmfApplicationCurrNumSGs(0),
-   list_of_sg(NULL),
-   list_of_si(NULL),
-   app_type_list_app_next(NULL),
-   app_type(NULL)
+   list_of_sg(nullptr),
+   list_of_si(nullptr),
+   app_type_list_app_next(nullptr),
+   app_type(nullptr)
 {
memset(, 0, sizeof(SaNameT));
memset(, 0, sizeof(SaNameT));
@@ -40,10 +40,10 @@ AVD_APP::AVD_APP() :
 AVD_APP::AVD_APP(const SaNameT* dn) :
saAmfApplicationAdminState(SA_AMF_ADMIN_UNLOCKED),
saAmfApplicationCurrNumSGs(0),
-   list_of_sg(NULL),
-   list_of_si(NULL),
-   app_type_list_app_next(NULL),
-   app_type(NULL)
+   list_of_sg(nullptr),
+   list_of_si(nullptr),
+   app_type_list_app_next(nullptr),
+   app_type(nullptr)
 {
memset(, 0, sizeof(SaNameT));
memcpy(name.value, dn->value, dn->length);
@@ -69,7 +69,7 @@ static void app_add_to_model(AVD_APP *ap
TRACE_ENTER2("%s", app->name.value);
 
/* Check type link to see if it has been added already */
-   if (app->app_type != NULL) {
+   if (app->app_type != nullptr) {
TRACE("already added");
goto done;
}
@@ -96,11 +96,11 @@ void AVD_APP::add_si(AVD_SI *si)
 void AVD_APP::remove_si(AVD_SI *si)
 {
AVD_SI *i_si;
-   AVD_SI *prev_si = NULL;
+   AVD_SI *prev_si = nullptr;
 
i_si = list_of_si;
 
-   while ((i_si != NULL) && (i_si != si)) {
+   while ((i_si != nullptr) && (i_si != si)) {
prev_si = i_si;
i_si = i_si->si_list_app_next;
}
@@ -109,15 +109,15 @@ void AVD_APP::remove_si(AVD_SI *si)
/* Log a fatal error */
osafassert(0);
} else {
-   if (prev_si == NULL) {
+   if (prev_si == nullptr) {
list_of_si = si->si_list_app_next;
} else {
prev_si->si_list_app_next = si->si_list_app_next;
}
}

-   si->si_list_app_next = NULL;
-   si->app = NULL;
+   si->si_list_app_next = nullptr;
+   si->app = nullptr;
 }
 
 void AVD_APP::add_sg(AVD_SG *sg)
@@ -132,11 +132,11 @@ void AVD_APP::add_sg(AVD_SG *sg)
 void AVD_APP::remove_sg(AVD_SG *sg)
 {
AVD_SG *i_sg;
-   AVD_SG *prev_sg = NULL;
+   AVD_SG *prev_sg = nullptr;
 
i_sg = list_of_sg;
 
-   while ((i_sg != NULL) && (i_sg != sg)) {
+   while ((i_sg != nullptr) && (i_sg != sg)) {
prev_sg = i_sg;
i_sg = i_sg->sg_list_app_next;
}
@@ -145,7 +145,7 @@ void AVD_APP::remove_sg(AVD_SG *sg)
/* Log a fatal error */
osafassert(0);
} else {
-   if (prev_sg == NULL) {
+   if (prev_sg == nullptr) {
list_of_sg = sg->sg_list_app_next;
} else {
prev_sg->sg_list_app_next = sg->sg_list_app_next;
@@ -156,8 +156,8 @@ void AVD_APP::remove_sg(AVD_SG *sg)
saAmfApplicationCurrNumSGs--;
if (avd_cb->avd_peer_ver < AVD_MBCSV_SUB_PART_VERSION_4)
m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, this, 
AVSV_CKPT_AVD_APP_CONFIG);
-   sg->sg_list_app_next = NULL;
-   sg->app = NULL;
+   sg->sg_list_app_next = nullptr;
+   sg->app = nullptr;
 }
 
 static int is_config_valid(const SaNameT *dn, const SaImmAttrValuesT_2 
**attributes,
@@ -168,7 +168,7 @@ static int is_config_valid(const SaNameT
SaAmfAdminStateT admstate;
 
/* Applications should be root objects */
-   if (strchr((char *)dn->value, ',') != NULL) {
+   if (strchr((char *)dn->value, ',') != nullptr) {
report_ccb_validation_error(opdata, "Parent to '%s' is not 
root", dn->value);
return 0;
}
@@ -176,14 +176,14 @@ static int is_config_valid(const SaNameT
rc = immutil_getAttr(const_cast("saAmfAppType"), 
attributes, 0, );
osafassert(rc == SA_AIS_OK);
 
-   if (avd_apptype_get() == NULL) {
+   if (avd_apptype_get() == nullptr) {
/* App type does not exist in current model, check CCB */
-   if (opdata == NULL) {
+   if (opdata == nullptr) {
report_ccb_validation_error(opdata, "'%s' does not 
exist in model", aname.value);
return 0;
}
 
-   if (ccbutil_getCcbOpDataByDN(opdata->ccbId, ) == NULL) {
+   if (ccbutil_getCcbOpDataByDN(opdata->ccbId, ) == nullptr) 
{
  

[devel] [PATCH 25 of 48] amfd: convert NULL to nullptr for node.cc [#1547]

2015-10-19 Thread Long HB Nguyen
 osaf/services/saf/amf/amfd/node.cc |  94 +++---
 1 files changed, 47 insertions(+), 47 deletions(-)


diff --git a/osaf/services/saf/amf/amfd/node.cc 
b/osaf/services/saf/amf/amfd/node.cc
--- a/osaf/services/saf/amf/amfd/node.cc
+++ b/osaf/services/saf/amf/amfd/node.cc
@@ -55,7 +55,7 @@ uint32_t avd_node_add_nodeid(AVD_AVND *n
 {
unsigned int rc;
 
-   if ((node_id_db->find(node->node_info.nodeId) == NULL) &&
+   if ((node_id_db->find(node->node_info.nodeId) == nullptr) &&
(node->node_info.nodeId != 0)) {
rc = node_id_db->insert(node->node_info.nodeId, node);
osafassert(rc == NCSCC_RC_SUCCESS);
@@ -73,7 +73,7 @@ void avd_node_db_add(AVD_AVND *node)
 {
unsigned int rc;
 
-   if (node_name_db->find(Amf::to_string(>name)) == NULL) {
+   if (node_name_db->find(Amf::to_string(>name)) == nullptr) {
rc = node_name_db->insert(Amf::to_string(>name), node);
osafassert(rc == NCSCC_RC_SUCCESS);
}
@@ -179,13 +179,13 @@ static void node_add_to_model(AVD_AVND *
TRACE_ENTER2("%s", node->node_info.nodeName.value);
 
/* Check parent link to see if it has been added already */
-   if (node->cluster != NULL) {
+   if (node->cluster != nullptr) {
TRACE("already added");
goto done;
}
 
node->cluster = avd_cluster;
-   node->admin_ng = NULL;
+   node->admin_ng = nullptr;
 
avd_node_db_add(node);
m_AVSV_SEND_CKPT_UPDT_ASYNC_ADD(avd_cb, node, 
AVSV_CKPT_AVD_NODE_CONFIG);
@@ -223,7 +223,7 @@ static int is_config_valid(const SaNameT
char *parent;
SaNameT saAmfNodeClmNode;
 
-   if ((parent = strchr((char *)dn->value, ',')) == NULL) {
+   if ((parent = strchr((char *)dn->value, ',')) == nullptr) {
report_ccb_validation_error(opdata, "No parent to '%s' ", 
dn->value);
return 0;
}
@@ -284,8 +284,8 @@ static AVD_AVND *node_create(SaNameT *dn
 ** If called at new active at failover, the object is found in the DB
 ** but needs to get configuration attributes initialized.
 */
-   if (NULL == (node = avd_node_get(dn))) {
-   if ((node = avd_node_new(dn)) == NULL)
+   if (nullptr == (node = avd_node_get(dn))) {
+   if ((node = avd_node_new(dn)) == nullptr)
goto done;
} else
TRACE("already created, refreshing config...");
@@ -330,7 +330,7 @@ static AVD_AVND *node_create(SaNameT *dn
 done:
if (rc != 0) {
avd_node_delete(node);
-   node = NULL;
+   node = nullptr;
}
 
TRACE_LEAVE();
@@ -359,9 +359,9 @@ SaAisErrorT avd_node_config_get(void)
searchParam.searchOneAttr.attrValueType = SA_IMM_ATTR_SASTRINGT;
searchParam.searchOneAttr.attrValue = 
 
-   error = immutil_saImmOmSearchInitialize_2(avd_cb->immOmHandle, NULL, 
SA_IMM_SUBTREE,
+   error = immutil_saImmOmSearchInitialize_2(avd_cb->immOmHandle, nullptr, 
SA_IMM_SUBTREE,
  SA_IMM_SEARCH_ONE_ATTR | 
SA_IMM_SEARCH_GET_ALL_ATTR, ,
- NULL, );
+ nullptr, );
 
if (SA_AIS_OK != error) {
LOG_ER("No objects found");
@@ -369,12 +369,12 @@ SaAisErrorT avd_node_config_get(void)
}
 
while (immutil_saImmOmSearchNext_2(searchHandle, , 
(SaImmAttrValuesT_2 ***)) == SA_AIS_OK) {
-   if (!is_config_valid(, attributes, NULL)) {
+   if (!is_config_valid(, attributes, nullptr)) {
error = SA_AIS_ERR_FAILED_OPERATION;
goto done2;
}
 
-   if ((node = node_create(, attributes)) == NULL) {
+   if ((node = node_create(, attributes)) == nullptr) {
error = SA_AIS_ERR_FAILED_OPERATION;
goto done2;
}
@@ -500,7 +500,7 @@ static SaAisErrorT node_ccb_completed_de
 */  
for (const auto& su : node->list_of_su) {
t_opData = ccbutil_getCcbOpDataByDN(opdata->ccbId, 
>name);
-   if ((t_opData == NULL) || (t_opData->operationType != 
CCBUTIL_DELETE)) {
+   if ((t_opData == nullptr) || (t_opData->operationType 
!= CCBUTIL_DELETE)) {
su_exist = true;   
break;  
}   
@@ -523,8 +523,8 @@ static SaAisErrorT node_ccb_completed_de
TRACE("check if node is being deleted from nodegroup 
'%s'", ng->name.value);
t_opData = ccbutil_getCcbOpDataByDN(opdata->ccbId, 
>name);

-

  1   2   >