From f13e50920a7b994dbc91068fb3bffdab876e30eb Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Aguerre?= Date: Thu, 30 Jun 2016 17:29:37 +0200 Subject: [PATCH] [MEDCalc] fix missing return status --- src/MEDCalc/cmp/MED.cxx | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/MEDCalc/cmp/MED.cxx b/src/MEDCalc/cmp/MED.cxx index a69140721..a780f5ae1 100644 --- a/src/MEDCalc/cmp/MED.cxx +++ b/src/MEDCalc/cmp/MED.cxx @@ -67,9 +67,6 @@ MED::addDatasourceToStudy(SALOMEDS::Study_ptr study, // set exception handler to catch unexpected CORBA exceptions Unexpect aCatch(SALOME_SalomeException); - // set result status to error initially - MED_ORB::status result = MED_ORB::OP_ERROR; - // check if reference to study is valid if (!CORBA::is_nil(study)) { // get full object path @@ -155,8 +152,7 @@ MED::addDatasourceToStudy(SALOMEDS::Study_ptr study, } } - result = MED_ORB::OP_OK; - return result; + return MED_ORB::OP_OK; } MED_ORB::status @@ -169,9 +165,6 @@ MED::registerPresentation(SALOMEDS::Study_ptr study, // set exception handler to catch unexpected CORBA exceptions Unexpect aCatch(SALOME_SalomeException); - // set result status to error initially - MED_ORB::status result = MED_ORB::OP_ERROR; - if (_fieldSeriesEntries.find(fieldId) == _fieldSeriesEntries.end()) { std::cerr << "Field not found\n"; return MED_ORB::OP_ERROR ; @@ -182,7 +175,7 @@ MED::registerPresentation(SALOMEDS::Study_ptr study, if (soFieldseries->IsNull()) { std::cerr << "Entry not found\n"; - return MED_ORB::OP_ERROR; + return MED_ORB::OP_ERROR; } SALOMEDS::StudyBuilder_var studyBuilder = study->NewBuilder(); @@ -201,8 +194,7 @@ MED::registerPresentation(SALOMEDS::Study_ptr study, aParam->SetBool(IS_PRESENTATION, true); aParam->SetInt(PRESENTATION_ID, presentationId); - result = MED_ORB::OP_OK; - return result; + return MED_ORB::OP_OK; } MED_ORB::status @@ -212,9 +204,6 @@ MED::unregisterPresentation(SALOMEDS::Study_ptr study, // set exception handler to catch unexpected CORBA exceptions Unexpect aCatch(SALOME_SalomeException); - // set result status to error initially - MED_ORB::status result = MED_ORB::OP_ERROR; - SALOMEDS::StudyBuilder_var studyBuilder = study->NewBuilder(); SALOMEDS::UseCaseBuilder_var useCaseBuilder = study->GetUseCaseBuilder(); @@ -237,6 +226,8 @@ MED::unregisterPresentation(SALOMEDS::Study_ptr study, } } } + + return MED_ORB::OP_OK; } Engines::TMPFile* -- 2.39.2