> 
> It is possible to add (void) in front of strtok(), but it's not necessary in 
> order
> to get rid of the compiler warnings.
>
Yes, I meant to cast it to void to satisfy some code analysis tools.

> You can't remove the calls to strtok(), if that is what you mean.
> strtok() has side effects!
> 

No! I did not mean that! It would create problems in the flows touched by the 
patch!

Thanks,
Mathi.

> regards,
> Anders Widell
> 
> 2013-08-01 13:52, Mathivanan Naickan Palanivelu skrev:
> > Perhaps, its better to cast out the strotk() calls wherever the return 
> > values
> are ignored!
> > Thanks,
> > Mathi.
> >
> >> -----Original Message-----
> >> From: Mathivanan Naickan Palanivelu
> >> Sent: Thursday, August 01, 2013 5:15 PM
> >> To: anders.wid...@ericsson.com
> >> Cc: opensaf-devel@lists.sourceforge.net
> >> Subject: [devel] [PATCH 1 of 1] plm: fix build errors thrown by gcc >
> >> 4.6 [#527]
> >>
> >>   osaf/services/saf/plmsv/plms/hpi_intf/plms_epath_util.c |   3 ---
> >>   osaf/services/saf/plmsv/plms/hpi_intf/plms_hrb.c        |   7 -------
> >>   osaf/services/saf/plmsv/plms/plms_imm.c                 |  14 
> >> +++++++-------
> >>   osaf/services/saf/plmsv/plms/plms_utils.c               |   3 ---
> >>   4 files changed, 7 insertions(+), 20 deletions(-)
> >>
> >>
> >> diff --git a/osaf/services/saf/plmsv/plms/hpi_intf/plms_epath_util.c
> >> b/osaf/services/saf/plmsv/plms/hpi_intf/plms_epath_util.c
> >> --- a/osaf/services/saf/plmsv/plms/hpi_intf/plms_epath_util.c
> >> +++ b/osaf/services/saf/plmsv/plms/hpi_intf/plms_epath_util.c
> >> @@ -321,7 +321,6 @@ static SaUint32T convert_entity_types(Sa
> >>                            SaUint32T
> >> index_array[SAHPI_MAX_ENTITY_PATH])
> >>   {
> >>    SaUint32T i     = 0;
> >> -  SaUint32T index = 0;
> >>    SaUint32T count;
> >>    SaUint32T rc = NCSCC_RC_SUCCESS;
> >>
> >> @@ -332,8 +331,6 @@ static SaUint32T convert_entity_types(Sa
> >>
> >>           for(i = 0; i < SAHPI_MAX_ENTITY_PATH; i++)
> >>           {
> >> -          index = entity_path->Entry[i].EntityLocation;
> >> -
> >>
> >>    memcpy(ent_path_str,hpi_ent_type_list[index_array[i]].etype_str,
> >>                    strlen(hpi_ent_type_list[index_array[i]].etype_str));
> >>
> >> diff --git a/osaf/services/saf/plmsv/plms/hpi_intf/plms_hrb.c
> >> b/osaf/services/saf/plmsv/plms/hpi_intf/plms_hrb.c
> >> --- a/osaf/services/saf/plmsv/plms/hpi_intf/plms_hrb.c
> >> +++ b/osaf/services/saf/plmsv/plms/hpi_intf/plms_hrb.c
> >> @@ -276,7 +276,6 @@ static SaUint32T hrb_process_hpi_req( PL
> >>    PLMS_INV_DATA      inv_data;
> >>    SaHpiRptEntryT     rpt_entry;
> >>    SaUint32T          rc = NCSCC_RC_SUCCESS;
> >> -  SaHpiSessionIdT    session_id;
> >>
> >>    TRACE_ENTER();
> >>
> >> @@ -297,12 +296,6 @@ static SaUint32T hrb_process_hpi_req( PL
> >>                                            &rpt_entry,&resourceid))
> >>            return NCSCC_RC_FAILURE;
> >>
> >> -
> >> -  /* Get the session_id */
> >> -  pthread_mutex_lock(&cb->mutex);
> >> -  session_id = cb->session_id;
> >> -  pthread_mutex_unlock(&cb->mutex);
> >> -
> >>    response = (PLMS_HPI_RSP *)malloc(sizeof(PLMS_HPI_RSP));
> >>    if(NULL == response){
> >>            LOG_ER("HRB:PLMS_HPI_RSP memory alloc failed error
> val:%s", diff
> >> --git a/osaf/services/saf/plmsv/plms/plms_imm.c
> >> b/osaf/services/saf/plmsv/plms/plms_imm.c
> >> --- a/osaf/services/saf/plmsv/plms/plms_imm.c
> >> +++ b/osaf/services/saf/plmsv/plms/plms_imm.c
> >> @@ -1093,7 +1093,7 @@ static SaAisErrorT plms_imm_ccb_obj_modi
> >>    PLMS_ENTITY *plm_ent, *dep_node;
> >>    SaUint8T j, k;
> >>    SaUint32T parent_dn_len, *attr_value;
> >> -  SaStringT rdn_val, rdn, parent_dn;
> >> +  SaStringT rdn_val, parent_dn;
> >>    SaNameT key_dn, *dep_name;
> >>    SaAisErrorT rc;
> >>    SaUint8T dep_names_num=0, dep_min_num=0,
> cur_names_num=0; @@
> >> -1260,7 +1260,7 @@ static SaAisErrorT plms_imm_ccb_obj_modi
> >>            /* This object can be modified only if the associated HE/EE
> >>               is out-of-service. */
> >>            /* Get the parent DN and parent object in patricia tree */
> >> -          rdn = strtok(dn_name, ",");
> >> +          strtok(dn_name, ",");
> >>            parent_dn = strtok(NULL, "\0");
> >>            parent_dn_len = strlen(parent_dn);
> >>            memset(&key_dn, 0, sizeof(SaNameT)); @@ -1778,7 +1778,7
> @@ static
> >> SaAisErrorT validate_deletion_of_  {
> >>    CcbUtilOperationData_t *opdata = NULL;
> >>    PLMS_ENTITY *plm_ent;
> >> -  SaStringT parent_dn, tmp;
> >> +  SaStringT parent_dn;
> >>    SaUint8T j;
> >>    SaNameT *attr_val;
> >>    SaImmAttrValuesT_2 **attr;
> >> @@ -1794,7 +1794,7 @@ static SaAisErrorT validate_deletion_of_
> >>                    strncpy(ee_type, (SaInt8T *)plm_ent-
> >>> entity.ee_entity.
> >>                            saPlmEEType.value, plm_ent-
> >>> entity.ee_entity.
> >>                            saPlmEEType.length);
> >> -                  tmp = strtok(ee_type, ",");
> >> +                  strtok(ee_type, ",");
> >>                    parent_dn = strtok(NULL, "\0");
> >>                    if ((obj_name->length == strlen(parent_dn)) &&
> >>                            (memcmp(parent_dn, obj_name->value,
> obj_name-> @@ -1828,7
> >> +1828,7 @@ static SaAisErrorT validate_deletion_of_
> >>
> >>    memset(ee_type,0,SA_MAX_NAME_LENGTH+1);
> >>                                    strncpy(ee_type, (SaInt8T *)attr_val-
> >>                                            value, attr_val->length);
> >> -                                  tmp = strtok(ee_type, ",");
> >> +                                  strtok(ee_type, ",");
> >>                                    parent_dn = strtok(NULL, "\0");
> >>                                    if((obj_name->length == strlen(
> >>                                    parent_dn)) &&
> >> (memcmp(parent_dn, @@ -3904,14 +3904,14 @@ static void
> >> plms_free_ee_type_obj(PLMS_E  }  static void
> >> plms_delete_dep_obj(SaNameT *obj_name)  {
> >> -  SaStringT rdn, parent_dn;
> >> +  SaStringT parent_dn;
> >>    SaNameT key_dn;
> >>    PLMS_ENTITY *plm_ent;
> >>    SaInt8T tmp_dn[SA_MAX_NAME_LENGTH+1] = {0};
> >>    TRACE_ENTER();
> >>    /* Get the parent_dn and then plm_ent from the patricia tree */
> >>    strncpy(tmp_dn, (SaInt8T *)obj_name->value, obj_name->length);
> >> -  rdn = strtok(tmp_dn, ",");
> >> +  strtok(tmp_dn, ",");
> >>    parent_dn = strtok(NULL, "\0");
> >>    memset(&key_dn, 0, sizeof(SaNameT));
> >>    key_dn.length = strlen(parent_dn); diff --git
> >> a/osaf/services/saf/plmsv/plms/plms_utils.c
> >> b/osaf/services/saf/plmsv/plms/plms_utils.c
> >> --- a/osaf/services/saf/plmsv/plms/plms_utils.c
> >> +++ b/osaf/services/saf/plmsv/plms/plms_utils.c
> >> @@ -1783,7 +1783,6 @@ SaNtfIdentifierT plms_readiness_flag_cle  {
> >>    SaUint32T ntf = 0;
> >>    SaUint32T old_flag;
> >> -  SaUint32T ret_err = NCSCC_RC_FAILURE;
> >>    SaUint32T ret_val;
> >>    PLMS_CB *cb = plms_cb;
> >>    SaNtfIdentifierT ntf_id = SA_NTF_IDENTIFIER_UNUSED; @@ -1815,7
> >> +1814,6 @@ SaNtfIdentifierT plms_readiness_flag_cle
> >>                    }
> >>
> >>                    ntf = 1;
> >> -                  ret_err = NCSCC_RC_SUCCESS;
> >>
> >>            }
> >>    }else{
> >> @@ -1844,7 +1842,6 @@ SaNtfIdentifierT plms_readiness_flag_cle
> >>                    }
> >>
> >>                    ntf = 1;
> >> -                  ret_err = NCSCC_RC_SUCCESS;
> >>            }
> >>
> >>    }
> >>
> >> ---------------------------------------------------------------------
> >> --------- Get your SQL database under version control now!
> >> Version control is standard for application code, but databases
> >> havent caught up. So what steps can you take to put your SQL
> >> databases under version control? Why should you start doing it? Read
> more to find out.
> >>
> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.
> >> clk
> >> trk
> >> _______________________________________________
> >> Opensaf-devel mailing list
> >> Opensaf-devel@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/opensaf-devel
> 

------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to