ack, code review only/Thanks HansN

On 01/25/2016 05:35 AM, Gary Lee wrote:
>   osaf/services/saf/amf/amfd/hlt.cc     |  14 +++++++-------
>   osaf/services/saf/amf/amfd/hlttype.cc |  18 ++++++++----------
>   2 files changed, 15 insertions(+), 17 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
> @@ -16,7 +16,7 @@
>    */
>   
>   #include <stddef.h>
> -#include <string.h>
> +#include <util.h>
>   
>   #include <logtrace.h>
>   #include <immutil.h>
> @@ -63,15 +63,15 @@
>   static SaAisErrorT ccb_completed_delete_hdlr(CcbUtilOperationData_t *opdata)
>   {
>       AVD_COMP *comp;
> -     SaNameT comp_name;
> +     std::string comp_name;
>       AVD_SU_SI_REL *curr_susi;
>       AVD_COMP_CSI_REL *compcsi;
>       SaAisErrorT rc = SA_AIS_ERR_BAD_OPERATION;
>   
>       TRACE_ENTER();
> -     avsv_sanamet_init(&opdata->objectName, &comp_name, "safComp=");
> +     avsv_sanamet_init(Amf::to_string(&opdata->objectName), comp_name, 
> "safComp=");
>   
> -     comp = comp_db->find(Amf::to_string(&comp_name));
> +     comp = comp_db->find(comp_name);
>       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) {
> @@ -118,15 +118,15 @@
>       const SaImmAttrModificationT_2 *attr_mod;
>       int i = 0;
>       const AVD_COMP *comp;
> -     SaNameT comp_dn;
> +     std::string comp_dn;
>       char *comp_name;
>   
>       TRACE_ENTER2("CCB ID %llu, '%s'", opdata->ccbId, 
> opdata->objectName.value);
>   
>       comp_name = strstr((char *)opdata->objectName.value, "safComp");
>       osafassert(comp_name);
> -     comp_dn.length = sprintf((char *)comp_dn.value, "%s", comp_name);
> -     comp = comp_db->find(Amf::to_string(&comp_dn));
> +     comp_dn = comp_name;
> +     comp = comp_db->find(comp_dn);
>       osafassert(comp);
>   
>       while ((attr_mod = opdata->param.modify.attrMods[i++]) != nullptr) {
> diff --git a/osaf/services/saf/amf/amfd/hlttype.cc 
> b/osaf/services/saf/amf/amfd/hlttype.cc
> --- a/osaf/services/saf/amf/amfd/hlttype.cc
> +++ b/osaf/services/saf/amf/amfd/hlttype.cc
> @@ -15,10 +15,8 @@
>    *
>    */
>   
> -#include <string>
> +#include "util.h"
>   #include <set>
> -#include <string.h>
> -#include "util.h"
>   #include "node.h"
>   #include <logtrace.h>
>   #include <immutil.h>
> @@ -65,15 +63,15 @@
>       const SaImmAttrModificationT_2 *attr_mod;
>       int i;
>       const AVD_COMP_TYPE *comp_type;
> -     SaNameT comp_type_name;
> +     std::string comp_type_name;
>   
>       TRACE_ENTER2("CCB ID %llu, '%s'", opdata->ccbId, 
> opdata->objectName.value);
>   
>       // input example: opdata.objectName.value, 
> safHealthcheckKey=AmfDemo,safVersion=1,safCompType=AmfDemo1
> -     avsv_sanamet_init(&opdata->objectName, &comp_type_name, "safVersion=");
> +     avsv_sanamet_init(Amf::to_string(&opdata->objectName), comp_type_name, 
> "safVersion=");
>   
> -     if ((comp_type = comptype_db->find(Amf::to_string(&comp_type_name))) == 
> 0) {
> -             LOG_ER("Internal error: %s not found", comp_type_name.value);
> +     if ((comp_type = comptype_db->find(comp_type_name)) == 0) {
> +             LOG_ER("Internal error: %s not found", comp_type_name.c_str());
>               return;
>       }
>   
> @@ -85,7 +83,7 @@
>       AVD_COMP *comp = comp_type->list_of_comp;
>       while (comp != nullptr) {
>               node_set.insert(comp->su->su_on_node);
> -             TRACE("comp name %s on node %s", comp->comp_info.name.value,  
> comp->su->su_on_node->name.value);
> +             TRACE("comp name %s on node %s", comp->comp_info.name.value,  
> comp->su->su_on_node->name.c_str());
>               comp = comp->comp_type_list_comp_next;
>       }                       
>               
> @@ -106,11 +104,11 @@
>   
>                       if (!strcmp(attribute->attrName, "saAmfHctDefPeriod")) {
>                               TRACE("saAmfHctDefPeriod modified to '%llu' for 
> CompType '%s' on node '%s'", *param_val,
> -                                   opdata->objectName.value, 
> (*it)->name.value);
> +                                   opdata->objectName.value, 
> (*it)->name.c_str());
>                               param.attr_id = saAmfHctDefPeriod_ID;
>                       } else if (!strcmp(attribute->attrName, 
> "saAmfHctDefMaxDuration")) {
>                               TRACE("saAmfHctDefMaxDuration modified to 
> '%llu' for CompType '%s' on node '%s", *param_val,
> -                                   opdata->objectName.value, 
> (*it)->name.value);
> +                                   opdata->objectName.value, 
> (*it)->name.c_str());
>                               param.attr_id = saAmfHctDefMaxDuration_ID;
>                       } else
>                               LOG_WA("Unexpected attribute name: %s", 
> attribute->attrName);


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to