[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; - SaHpiSessionIdTsession_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_
Re: [devel] [PATCH 1 of 1] plm: fix build errors thrown by gcc > 4.6 [#527]
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; > - SaHpiSessionIdTsession_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)) && > (me
Re: [devel] [PATCH 1 of 1] plm: fix build errors thrown by gcc > 4.6 [#527]
Ack. regards, Anders Widell 2013-08-01 13:45, mathi.naic...@oracle.com skrev: > 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; > - SaHpiSessionIdTsession_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_ty
Re: [devel] [PATCH 1 of 1] plm: fix build errors thrown by gcc > 4.6 [#527]
It is possible to add (void) in front of strtok(), but it's not necessary in order to get rid of the compiler warnings. You can't remove the calls to strtok(), if that is what you mean. strtok() has side effects! 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; >> -SaHpiSessionIdTsession_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; >> SaImmAttrV
Re: [devel] [PATCH 1 of 1] plm: fix build errors thrown by gcc > 4.6 [#527]
> > 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; > >> - SaHpiSessionIdTsession_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 */ >
Re: [devel] [PATCH 1 of 1] plm: fix build errors thrown by gcc > 4.6 [#527]
Ok, yes possibly some code analysis tool could be happier with (void) in front of them. I am happy either way! :-) regards, Anders Widell 2013-08-01 14:38, Mathivanan Naickan Palanivelu skrev: >> 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; >>>> - SaHpiSessionIdTsession_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; >>>&