diff --git a/Code/Mantid/Framework/Algorithms/src/CalculateTransmission.cpp b/Code/Mantid/Framework/Algorithms/src/CalculateTransmission.cpp index 47ac1f5fe8ecc381f2160627e027704a1de1f604..b51addbfd5555b0c9c7a04cdc3f79a4937069511 100644 --- a/Code/Mantid/Framework/Algorithms/src/CalculateTransmission.cpp +++ b/Code/Mantid/Framework/Algorithms/src/CalculateTransmission.cpp @@ -158,7 +158,8 @@ void CalculateTransmission::exec() if (normaliseToMonitor) M2_direct = this->extractSpectrum(directWS,indices[1]); MatrixWorkspace_sptr M3_direct = this->extractSpectrum(directWS,indices[0]); - Progress progress(this, m_done, m_done += 0.2, 2); + double start = m_done; + Progress progress(this, start, m_done += 0.2, 2); progress.report("CalculateTransmission: Dividing transmission by incident"); // The main calculation MatrixWorkspace_sptr transmission = M3_sample/M3_direct; @@ -202,7 +203,8 @@ void CalculateTransmission::exec() */ API::MatrixWorkspace_sptr CalculateTransmission::extractSpectrum(API::MatrixWorkspace_sptr WS, const int64_t index) { - IAlgorithm_sptr childAlg = createSubAlgorithm("ExtractSingleSpectrum", m_done, m_done += 0.1); + double start = m_done; + IAlgorithm_sptr childAlg = createSubAlgorithm("ExtractSingleSpectrum", start, m_done += 0.1); childAlg->setProperty<MatrixWorkspace_sptr>("InputWorkspace", WS); childAlg->setProperty<int>("WorkspaceIndex", static_cast<int>(index)); childAlg->executeAsSubAlg(); @@ -233,7 +235,8 @@ API::MatrixWorkspace_sptr CalculateTransmission::fit(API::MatrixWorkspace_sptr r MantidVec & Y = output->dataY(0); MantidVec & E = output->dataE(0); - Progress prog2(this, m_done, m_done+=0.1 ,Y.size()); + double start = m_done; + Progress prog2(this, start, m_done+=0.1 ,Y.size()); for (size_t i=0; i < Y.size(); ++i) { // Take the log of each datapoint for fitting. Recalculate errors remembering that d(log(a))/da = 1/a @@ -302,7 +305,8 @@ API::MatrixWorkspace_sptr CalculateTransmission::fit(API::MatrixWorkspace_sptr r API::MatrixWorkspace_sptr CalculateTransmission::fitData(API::MatrixWorkspace_sptr WS, double & grad, double & offset) { g_log.information("Fitting the experimental transmission curve"); - IAlgorithm_sptr childAlg = createSubAlgorithm("Linear", m_done, m_done=0.9); + double start = m_done; + IAlgorithm_sptr childAlg = createSubAlgorithm("Linear", start, m_done=0.9); childAlg->setProperty<MatrixWorkspace_sptr>("InputWorkspace", WS); childAlg->executeAsSubAlg(); @@ -327,7 +331,8 @@ API::MatrixWorkspace_sptr CalculateTransmission::fitData(API::MatrixWorkspace_sp */ API::MatrixWorkspace_sptr CalculateTransmission::rebin(std::vector<double> & binParams, API::MatrixWorkspace_sptr ws) { - IAlgorithm_sptr childAlg = createSubAlgorithm("Rebin", m_done, m_done += 0.05); + double start = m_done; + IAlgorithm_sptr childAlg = createSubAlgorithm("Rebin", start, m_done += 0.05); childAlg->setProperty<MatrixWorkspace_sptr>("InputWorkspace", ws); childAlg->setProperty< std::vector<double> >("Params", binParams); childAlg->executeAsSubAlg(); diff --git a/Code/Mantid/Framework/Algorithms/test/CorrectKiKfTest.h b/Code/Mantid/Framework/Algorithms/test/CorrectKiKfTest.h index 1293b5c1afc184f3be6a82167a5fd80f7aee0439..a51753d835a428026abe56bf047fb838d67c59a4 100644 --- a/Code/Mantid/Framework/Algorithms/test/CorrectKiKfTest.h +++ b/Code/Mantid/Framework/Algorithms/test/CorrectKiKfTest.h @@ -48,7 +48,6 @@ public: TS_ASSERT( alg.isExecuted() ); Workspace2D_sptr result = boost::dynamic_pointer_cast<Workspace2D>(AnalysisDataService::Instance().retrieve(outputWSname)); double ei,ef,factor,deltaE,stdval; - size_t numHists = result->getNumberHistograms(); for (size_t i = 0; i < result->blocksize(); ++i) { ei = 7.5; @@ -72,7 +71,6 @@ public: alg.execute(); TS_ASSERT( alg.isExecuted() ); result = boost::dynamic_pointer_cast<Workspace2D>(AnalysisDataService::Instance().retrieve(outputWSname)); - numHists = result->getNumberHistograms(); for (size_t i = 0; i < result->blocksize(); ++i) { ei = 7.5; @@ -96,7 +94,6 @@ public: alg.execute(); TS_ASSERT( alg.isExecuted() ); result = boost::dynamic_pointer_cast<Workspace2D>(AnalysisDataService::Instance().retrieve(outputWSname)); - numHists = result->getNumberHistograms(); for (size_t i = 0; i < result->blocksize(); ++i) { ef = 7.5; @@ -120,7 +117,6 @@ public: alg.execute(); TS_ASSERT( alg.isExecuted() ); result = boost::dynamic_pointer_cast<Workspace2D>(AnalysisDataService::Instance().retrieve(outputWSname)); - numHists = result->getNumberHistograms(); for (size_t i = 0; i < result->blocksize(); ++i) { ef = 7.5; diff --git a/Code/Mantid/Framework/Algorithms/test/GetDetectorOffsetsTest.h b/Code/Mantid/Framework/Algorithms/test/GetDetectorOffsetsTest.h index 8cca1ac78672cd13529098e668dc7284166e0ce3..32803141d2b68f11d9ae02c4032eec4bdf7a7a8c 100644 --- a/Code/Mantid/Framework/Algorithms/test/GetDetectorOffsetsTest.h +++ b/Code/Mantid/Framework/Algorithms/test/GetDetectorOffsetsTest.h @@ -18,6 +18,12 @@ using Mantid::DataObjects::OffsetsWorkspace_sptr; class GetDetectorOffsetsTest : public CxxTest::TestSuite { public: + + GetDetectorOffsetsTest() + { + Mantid::API::FrameworkManager::Instance(); + } + void testTheBasics() { TS_ASSERT_EQUALS( offsets.name(), "GetDetectorOffsets" ); diff --git a/Code/Mantid/Framework/Crystal/src/AnvredCorrection.cpp b/Code/Mantid/Framework/Crystal/src/AnvredCorrection.cpp index fa36fcbd32d2e37d4240a11a66e5d7bb1d13f8e1..d62f24be68cf92c28b74ebd784f4bb2350d73c82 100644 --- a/Code/Mantid/Framework/Crystal/src/AnvredCorrection.cpp +++ b/Code/Mantid/Framework/Crystal/src/AnvredCorrection.cpp @@ -492,14 +492,12 @@ double AnvredCorrection::absor_sphere(double& twoth, double& wl) // incident spectrum double lamda; - bool use_incident_spectrum = true; double power = power_th; //GetSpectrumWeights( spectrum_file_name, lamda_weight); if ( lamda_weight.size() == 0 ) // loading spectrum failed so use { // array of 1's - use_incident_spectrum = false; // power = power_ns; // This is commented out, so we // don't override user specified // value. diff --git a/Code/Mantid/Framework/Crystal/src/LoadIsawPeaks.cpp b/Code/Mantid/Framework/Crystal/src/LoadIsawPeaks.cpp index 45427cf62d3aa89f5eb41a5e895998cd81790922..249be53eac1ad09ccd2b5e9f39ec5e794f68694b 100644 --- a/Code/Mantid/Framework/Crystal/src/LoadIsawPeaks.cpp +++ b/Code/Mantid/Framework/Crystal/src/LoadIsawPeaks.cpp @@ -168,10 +168,9 @@ namespace Crystal Mantid::DataObjects::Peak readPeak( PeaksWorkspace_sptr outWS, std::string & lastStr, std::ifstream& in, int & seqNum, std::string bankName) { double h ; double k ; double l ; double col ; - double row ; double chan ; double L2 ; - double ScatAng ; double Az ; double wl ; - double D ; double IPK ; double Inti ; - double SigI ; int iReflag; + double row ; double wl ; + double IPK ; double Inti ; + double SigI ; seqNum = -1; @@ -209,18 +208,18 @@ namespace Crystal col = strtod( getWord( in , false ).c_str() , 0 ) ; row = strtod( getWord( in , false ).c_str() , 0 ) ; - chan = strtod( getWord( in , false ).c_str() , 0 ) ; - L2 = strtod( getWord( in , false ).c_str() , 0 )/100 ; - ScatAng = strtod( getWord( in , false ).c_str() , 0 ) ; + strtod( getWord( in , false ).c_str() , 0 ) ; //chan + strtod( getWord( in , false ).c_str() , 0 ) ; //L2 + strtod( getWord( in , false ).c_str() , 0 ) ; //ScatAng - Az = strtod( getWord( in , false ).c_str() , 0 ) ; + strtod( getWord( in , false ).c_str() , 0 ) ; //Az wl = strtod( getWord( in , false ).c_str() , 0 ) ; - D = strtod( getWord( in , false ).c_str() , 0 ) ; + strtod( getWord( in , false ).c_str() , 0 ) ; //D IPK = strtod( getWord( in , false ).c_str() , 0 ) ; Inti = strtod( getWord( in , false ).c_str() , 0 ) ; SigI = strtod( getWord( in , false ).c_str() , 0 ) ; - iReflag = atoi( getWord( in , false ).c_str() ) ; + atoi( getWord( in , false ).c_str() ) ; // iReflag // Finish the line and get the first word of next line readToEndOfLine( in , true ); diff --git a/Code/Mantid/Framework/Crystal/src/MaskPeaksWorkspace.cpp b/Code/Mantid/Framework/Crystal/src/MaskPeaksWorkspace.cpp index fec7411c81516ad57cc53c947300585617303538..8eee11e6da144b62c086525ff9c9aac338c936e8 100644 --- a/Code/Mantid/Framework/Crystal/src/MaskPeaksWorkspace.cpp +++ b/Code/Mantid/Framework/Crystal/src/MaskPeaksWorkspace.cpp @@ -73,13 +73,14 @@ namespace Mantid int i, XPeak, YPeak; - double col, row, l1, l2, wl; + double col, row; // Build a map to sort by the peak bin count std::vector <std::pair<double, int> > v1; for (i = 0; i<peaksW->getNumberPeaks(); i++) + { v1.push_back(std::pair<double, int>(peaksW->getPeaks()[i].getBinCount(), i)); - + } //To get the workspace index from the detector ID detid2index_map * pixel_to_wi = inputW->getDetectorIDToWorkspaceIndexMap(true); //Get some stuff from the input workspace @@ -95,12 +96,9 @@ namespace Mantid // Direct ref to that peak Peak & peak = peaksW->getPeaks()[i]; - l1 = peak.getL1(); col = peak.getCol(); row = peak.getRow(); Kernel::V3D pos = peak.getDetPos(); - l2 = pos.norm(); - wl = peak.getWavelength(); XPeak = int(col+0.5)-1; YPeak = int(row+0.5)-1; diff --git a/Code/Mantid/Framework/Crystal/test/IntegratePeakTimeSlicesTest.h b/Code/Mantid/Framework/Crystal/test/IntegratePeakTimeSlicesTest.h index 57800202ae8f9824ebbd38c3933847c0748b273e..828d8332db31b41690e7a3ed58666a3d7e26f4c3 100644 --- a/Code/Mantid/Framework/Crystal/test/IntegratePeakTimeSlicesTest.h +++ b/Code/Mantid/Framework/Crystal/test/IntegratePeakTimeSlicesTest.h @@ -48,6 +48,10 @@ using namespace std; class IntegratePeakTimeSlicesTest: public CxxTest::TestSuite { public: + IntegratePeakTimeSlicesTest() + { + Mantid::API::FrameworkManager::Instance(); + } void test_abc() { int NRC = 30; diff --git a/Code/Mantid/Framework/CurveFitting/src/BivariateNormal.cpp b/Code/Mantid/Framework/CurveFitting/src/BivariateNormal.cpp index af68e3b6b722fe7c959fb31c05d20ac5075ce4d1..3d7dda498ea196d9c74533d5be16cb2bfb76d9bb 100644 --- a/Code/Mantid/Framework/CurveFitting/src/BivariateNormal.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/BivariateNormal.cpp @@ -409,29 +409,10 @@ void BivariateNormal::initCommon( double* LastParams,double* expVals, { //std::cout<<"in INIt Common1"<< std::endl; isNaNs= false; - double mIx,mIy,mx,my,SIxx,SIyy,SIxy,Sxx,Syy,Sxy; - - { - Attrib[S_1] = Attrib[NRows] * Attrib[NCols]; - mIx = Attrib[S_xint] / Attrib[S_int]; - mIy = Attrib[S_yint] / Attrib[S_int]; - mx = Attrib[S_x] / Attrib[S_1]; - my = Attrib[S_y] / Attrib[S_1]; - SIxx = Attrib[S_x2int] - (Attrib[S_xint] * Attrib[S_xint]) / Attrib[S_int]; - - SIyy = Attrib[S_y2int] - (Attrib[S_yint]) * (Attrib[S_yint]) / Attrib[S_int]; - SIxy = Attrib[S_xyint] - (Attrib[S_xint]) * (Attrib[S_yint]) / Attrib[S_int]; - Sxx = Attrib[S_x2] - (Attrib[S_x]) * (Attrib[S_x]) / Attrib[S_1]; - - Syy = Attrib[S_y2] - (Attrib[S_y]) * (Attrib[S_y]) / Attrib[S_1]; - Sxy = Attrib[S_xy] - (Attrib[S_x]) * (Attrib[S_y]) / Attrib[S_1]; - - - - } - for (size_t i = 0; i < nParams(); i++) + { LastParams[i] = getParameter(i); + } uu = LastParams[IVXX] * LastParams[IVYY] - LastParams[IVXY] * LastParams[IVXY]; coefNorm = .5 / M_PI / sqrt(uu); diff --git a/Code/Mantid/Framework/CurveFitting/test/CompositeFunctionTest.h b/Code/Mantid/Framework/CurveFitting/test/CompositeFunctionTest.h index 0c894f34af741c96dcedf507fe3dac830f40c96f..1cf00a36504390a355f23c1a3a313b6dbee76b51 100644 --- a/Code/Mantid/Framework/CurveFitting/test/CompositeFunctionTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/CompositeFunctionTest.h @@ -326,12 +326,10 @@ private: Mantid::DataObjects::Workspace2D_sptr ws = boost::dynamic_pointer_cast<Mantid::DataObjects::Workspace2D> (WorkspaceFactory::Instance().create("Workspace2D",nSpec,nX,nY)); - double spec; double x; for(int iSpec=0;iSpec<nSpec;iSpec++) { - spec = iSpec; Mantid::MantidVec& X = ws->dataX(iSpec); Mantid::MantidVec& Y = ws->dataY(iSpec); Mantid::MantidVec& E = ws->dataE(iSpec); diff --git a/Code/Mantid/Framework/CurveFitting/test/ConvolutionTest.h b/Code/Mantid/Framework/CurveFitting/test/ConvolutionTest.h index c4c32e8ee832db32e80f746db2bed9c38fcfd6d6..60d68dfe5bbaf9beaac9e48cd53903c666636672 100644 --- a/Code/Mantid/Framework/CurveFitting/test/ConvolutionTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/ConvolutionTest.h @@ -304,12 +304,11 @@ public: conv.addFunction(res); const int N = 116; - double x[N],xr[N],out[N],x0 = 0, dx = 0.13; + double x[N],out[N],x0 = 0, dx = 0.13; double Dx = dx*N; for(int i=0;i<N;i++) { x[i] = x0 + i*dx; - xr[i] = x[i] - x0 - Dx/2; } double c2 = x0 + Dx/2; @@ -362,12 +361,10 @@ private: Mantid::DataObjects::Workspace2D_sptr ws = boost::dynamic_pointer_cast<Mantid::DataObjects::Workspace2D> (WorkspaceFactory::Instance().create("Workspace2D",nSpec,nX,nY)); - double spec; double x; for(int iSpec=0;iSpec<nSpec;iSpec++) { - spec = iSpec; Mantid::MantidVec& X = ws->dataX(iSpec); Mantid::MantidVec& Y = ws->dataY(iSpec); Mantid::MantidVec& E = ws->dataE(iSpec); diff --git a/Code/Mantid/Framework/CurveFitting/test/FitTest.h b/Code/Mantid/Framework/CurveFitting/test/FitTest.h index c6dae54596a66baa74070b26b1fc6f9891c5776a..6f660dd4423f5f8085cbbcec5230e2eaa47a1655 100644 --- a/Code/Mantid/Framework/CurveFitting/test/FitTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/FitTest.h @@ -807,12 +807,10 @@ private: Mantid::DataObjects::Workspace2D_sptr ws = boost::dynamic_pointer_cast<Mantid::DataObjects::Workspace2D> (WorkspaceFactory::Instance().create("Workspace2D",nSpec,nX,nY)); - double spec; double x; for(int iSpec=0;iSpec<nSpec;iSpec++) { - spec = iSpec; Mantid::MantidVec& X = ws->dataX(iSpec); Mantid::MantidVec& Y = ws->dataY(iSpec); Mantid::MantidVec& E = ws->dataE(iSpec); diff --git a/Code/Mantid/Framework/CurveFitting/test/FunctionTest.h b/Code/Mantid/Framework/CurveFitting/test/FunctionTest.h index 49b902440e00e7fddd467765aa948ede38ff0b82..0dcb033f0608274e6a5532b310b927cfd8700c73 100644 --- a/Code/Mantid/Framework/CurveFitting/test/FunctionTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/FunctionTest.h @@ -322,12 +322,10 @@ private: Mantid::DataObjects::Workspace2D_sptr ws = boost::dynamic_pointer_cast<Mantid::DataObjects::Workspace2D> (WorkspaceFactory::Instance().create("Workspace2D",nSpec,nX,nY)); - double spec; double x; for(int iSpec=0;iSpec<nSpec;iSpec++) { - spec = iSpec; Mantid::MantidVec& X = ws->dataX(iSpec); Mantid::MantidVec& Y = ws->dataY(iSpec); Mantid::MantidVec& E = ws->dataE(iSpec); diff --git a/Code/Mantid/Framework/CurveFitting/test/PlotPeakByLogValueTest.h b/Code/Mantid/Framework/CurveFitting/test/PlotPeakByLogValueTest.h index b0f60c21c317d7c80feb41e057d416909693a256..169cf28570a13a856ca0ac8e445e07cb1c90e1b7 100644 --- a/Code/Mantid/Framework/CurveFitting/test/PlotPeakByLogValueTest.h +++ b/Code/Mantid/Framework/CurveFitting/test/PlotPeakByLogValueTest.h @@ -294,12 +294,10 @@ private: ws->getAxis(1)->spectraNo(i) = 0; } - double spec; double x; for(int iSpec=0;iSpec<nSpec;iSpec++) { - spec = iSpec; Mantid::MantidVec& X = ws->dataX(iSpec); Mantid::MantidVec& Y = ws->dataY(iSpec); Mantid::MantidVec& E = ws->dataE(iSpec); diff --git a/Code/Mantid/Framework/DataHandling/src/LoadDAE.cpp b/Code/Mantid/Framework/DataHandling/src/LoadDAE.cpp index d767ecd5f4b83c821db79211bcc0e33b8f51a359..f11193e6070d7a7a383884267a6c78c10d56fa98 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadDAE.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadDAE.cpp @@ -487,7 +487,6 @@ namespace Mantid if (i != std::string::npos) instrumentID.erase(i); IAlgorithm_sptr loadInst = createSubAlgorithm("LoadInstrument"); - bool successfulExecution(true); // Now execute the sub-algorithm. Catch and log any error, but don't stop. try { @@ -498,12 +497,10 @@ namespace Mantid } catch(std::invalid_argument &) { - successfulExecution = false; g_log.information("Invalid argument to LoadInstrument sub-algorithm"); } catch (std::runtime_error&) { - successfulExecution = false; g_log.information("Unable to successfully run LoadInstrument sub-algorithm"); } diff --git a/Code/Mantid/Framework/DataHandling/src/LoadEventPreNexus.cpp b/Code/Mantid/Framework/DataHandling/src/LoadEventPreNexus.cpp index 36deec18c10a7d2cb012edd1ed175e36ed1e7445..9d8881064c8aa62791f3b65ca836779d2c5f4967 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadEventPreNexus.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadEventPreNexus.cpp @@ -725,8 +725,6 @@ void LoadEventPreNexus::procEventsLinear(DataObjects::EventWorkspace_sptr & /*wo std::vector<TofEvent> ** arrayOfVectors, DasEvent * event_buffer, size_t current_event_buffer_size, size_t fileOffset) { - uint32_t period=0; - //Starting pulse time DateAndTime pulsetime; int64_t pulse_i = 0; @@ -759,7 +757,6 @@ void LoadEventPreNexus::procEventsLinear(DataObjects::EventWorkspace_sptr & /*wo if (this->using_mapping_file) { PixelType unmapped_pid = pid % this->numpixel; - period = (pid - unmapped_pid) / this->numpixel; pid = this->pixelmap[unmapped_pid]; } diff --git a/Code/Mantid/Framework/DataHandling/src/LoadISISNexus.cpp b/Code/Mantid/Framework/DataHandling/src/LoadISISNexus.cpp index e75bfcd1504f0e537330fe5ff5f325499bd7e154..29b1d3015d097eb8e6f62d8f66605dd791c6422a 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadISISNexus.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadISISNexus.cpp @@ -479,7 +479,6 @@ namespace Mantid IAlgorithm_sptr loadInst = createSubAlgorithm("LoadInstrument"); // Now execute the sub-algorithm. Catch and log any error, but don't stop. - bool executionSuccessful(true); try { loadInst->setPropertyValue("InstrumentName", m_instrument_name); @@ -490,12 +489,10 @@ namespace Mantid catch( std::invalid_argument&) { g_log.information("Invalid argument to LoadInstrument sub-algorithm"); - executionSuccessful = false; } catch (std::runtime_error&) { g_log.information("Unable to successfully run LoadInstrument sub-algorithm"); - executionSuccessful = false; } // If loading instrument definition file fails, run LoadInstrumentFromNexus instead diff --git a/Code/Mantid/Framework/DataHandling/src/LoadISISNexus2.cpp b/Code/Mantid/Framework/DataHandling/src/LoadISISNexus2.cpp index 9d2f25cd135bb23a7ce509e317b694ba211cc799..fdeb0215b7006ce15675fdc816662b4833d96046 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadISISNexus2.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadISISNexus2.cpp @@ -449,7 +449,6 @@ namespace Mantid const int64_t blocksize = 8; const int64_t rangesize = (m_spec_max - m_spec_min + 1) - m_monitors.size(); const int64_t fullblocks = rangesize / blocksize; - int64_t read_stop = 0; int64_t spectra_no = m_spec_min; if (first_monitor_spectrum == 1) {// this if crudely checks whether the monitors are at the begining or end of the spectra @@ -459,8 +458,6 @@ namespace Mantid int64_t filestart = std::lower_bound(spec_begin,m_spec_end,spectra_no) - spec_begin; if( fullblocks > 0 ) { - read_stop = (fullblocks * blocksize);// + m_monitors.size(); //RNT: I think monitors are excluded from the data - //for( ; hist_index < read_stop; ) for(int64_t i = 0; i < fullblocks; ++i) { loadBlock(data, blocksize, period_index, filestart, hist_index, spectra_no, local_workspace); diff --git a/Code/Mantid/Framework/DataHandling/src/LoadLogsForSNSPulsedMagnet.cpp b/Code/Mantid/Framework/DataHandling/src/LoadLogsForSNSPulsedMagnet.cpp index c7b24ea2334f2d12b89ec91f6c320902df4e4223..050b2a9ccb9e1dfa0cd25a2a19d4c07f723b7f12 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadLogsForSNSPulsedMagnet.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadLogsForSNSPulsedMagnet.cpp @@ -153,7 +153,6 @@ namespace DataHandling // 4. Parse std::ifstream logFile(logfilename, std::ios::in|std::ios::binary); size_t index = 0; - unsigned int chopperindices[4]; unsigned int localdelaytimes[4]; for (size_t p = 0; p < numpulses; p ++){ for (size_t i = 0; i < m_numchoppers; i ++){ @@ -175,7 +174,6 @@ namespace DataHandling if (delaytime != 0){ g_log.debug() << "Pulse Index = " << index << " Chopper = " << chopperindex << " Delay Time = " << delaytime << std::endl; } - chopperindices[i] = chopperindex; localdelaytimes[i] = delaytime; } diff --git a/Code/Mantid/Framework/DataHandling/src/LoadMuonNexus.cpp b/Code/Mantid/Framework/DataHandling/src/LoadMuonNexus.cpp index a7be816eb31c494afd68e97b51db3e6514089a29..e5381e72cc540c94c99db82f376860ca1cce97b8 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadMuonNexus.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadMuonNexus.cpp @@ -539,7 +539,6 @@ namespace Mantid IAlgorithm_sptr loadInst = createSubAlgorithm("LoadInstrument"); // Now execute the sub-algorithm. Catch and log any error, but don't stop. - bool executionSuccessful(true); try { loadInst->setPropertyValue("InstrumentName", m_instrument_name); @@ -550,12 +549,10 @@ namespace Mantid catch( std::invalid_argument&) { g_log.information("Invalid argument to LoadInstrument sub-algorithm"); - executionSuccessful = false; } catch (std::runtime_error&) { g_log.information("Unable to successfully run LoadInstrument sub-algorithm"); - executionSuccessful = false; } // If loading instrument definition file fails, run LoadInstrumentFromNexus instead diff --git a/Code/Mantid/Framework/DataHandling/src/LoadPreNexusMonitors.cpp b/Code/Mantid/Framework/DataHandling/src/LoadPreNexusMonitors.cpp index 0d44e326db987ed8590d9a6dff0cc74f7db61286..39468b464f99460de4fd5892305491d379970946 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadPreNexusMonitors.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadPreNexusMonitors.cpp @@ -69,7 +69,6 @@ void LoadPreNexusMonitors::exec() { // time of flight channel parameters double tmin = 0.0; - double tmax = 0.0; double tstep = 0.0; int tchannels = 0; std::string instrumentName; @@ -123,12 +122,6 @@ void LoadPreNexusMonitors::exec() g_log.debug() << "\tname: " << pE->getAttribute("name") << std::endl; g_log.debug() << "\tdescription: " << pE->getAttribute("description") << std::endl; - // Now lets get the tof binning settings - Poco::XML::Element* pTimeChannels = pE->getChildElement("NumTimeChannels"); - tmin = boost::lexical_cast<double>(pTimeChannels->getAttribute("startbin")); - tmax = boost::lexical_cast<double>(pTimeChannels->getAttribute("endbin")); - tstep = boost::lexical_cast<double>(pTimeChannels->getAttribute("width")); - } // Look for the 'DataList' node to get the monitor dims. @@ -172,14 +165,10 @@ void LoadPreNexusMonitors::exec() } pNode = it.nextNode(); - // std::cout << pNode->nodeName() << ":" << pNode->getNodeValue() << std::endl; } g_log.information() << "Found " << nMonitors << " beam monitors." << std::endl; - //tchannels = static_cast<size_t> ((tmax - tmin) / tstep); - //std::cout << "tchannels = " << tchannels << std::endl; - g_log.information() << "Number of Time Channels = " << tchannels << std::endl; // Now lets create the time of flight array. diff --git a/Code/Mantid/Framework/DataHandling/src/LoadRaw/isisraw.cpp b/Code/Mantid/Framework/DataHandling/src/LoadRaw/isisraw.cpp index a47d2612d426d255530e292ed6339ae8fcd1bda2..47307967632b6dad3bbf3af5442b94331d31eb81 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadRaw/isisraw.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadRaw/isisraw.cpp @@ -746,18 +746,17 @@ int ISISRAW::ioRAW(FILE* file, bool from_file, bool read_data) /// stuff int ISISRAW::ioRAW(FILE* file, int* s, int len, bool from_file) { - size_t n; if ( (len <= 0) || (s == 0) ) { return 0; } if (from_file) { - n = fread(s, sizeof(int), len, file); + fread(s, sizeof(int), len, file); } else { - n = fwrite(s, sizeof(int), len, file); + fwrite(s, sizeof(int), len, file); } return 0; } @@ -765,18 +764,17 @@ int ISISRAW::ioRAW(FILE* file, bool from_file, bool read_data) /// stuff int ISISRAW::ioRAW(FILE* file, uint32_t* s, int len, bool from_file) { - size_t n; if ( (len <= 0) || (s == 0) ) { return 0; } if (from_file) { - n = fread(s, sizeof(uint32_t), len, file); + fread(s, sizeof(uint32_t), len, file); } else { - n = fwrite(s, sizeof(uint32_t), len, file); + fwrite(s, sizeof(uint32_t), len, file); } return 0; } @@ -784,7 +782,6 @@ int ISISRAW::ioRAW(FILE* file, bool from_file, bool read_data) /// stuff int ISISRAW::ioRAW(FILE* file, float* s, int len, bool from_file) { - size_t n; int errcode = 0; if ( (len <= 0) || (s == 0) ) { @@ -792,13 +789,13 @@ int ISISRAW::ioRAW(FILE* file, bool from_file, bool read_data) } if (from_file) { - n = fread(s, sizeof(float), len, file); + fread(s, sizeof(float), len, file); vaxf_to_local(s, &len, &errcode); } else { local_to_vaxf(s, &len, &errcode); - n = fwrite(s, sizeof(float), len, file); + fwrite(s, sizeof(float), len, file); vaxf_to_local(s, &len, &errcode); } return 0; @@ -1097,7 +1094,6 @@ int ISISRAW::writeToFile(const char* filename) int ISISRAW::printInfo(std::ostream& os) { int i; - long offset; os << "INST section at " << add.ad_inst << " 0x" << std::hex << 4*add.ad_inst << std::dec << std::endl; os << "SE section at " << add.ad_se << " 0x" << std::hex << 4*add.ad_se << std::dec << std::endl; os << "Dae section at " << add.ad_dae << " 0x" << std::hex << 4*add.ad_dae << std::dec << std::endl; @@ -1110,7 +1106,6 @@ int ISISRAW::printInfo(std::ostream& os) os << "Compression is " << (dhdr.d_comp == 0 ? "NONE" : "BYTE-RELATIVE") << std::endl; os << "Compression ratio of data = " << dhdr.d_crdata << std::endl; os << "Offsets of spectrum data" << std::endl; - offset = add.ad_data; for(i=0; i < ((t_nsp1+1) * t_nper); i++) { os << i << " " << ddes[i].nwords << " words at offset " << ddes[i].offset << std::endl; diff --git a/Code/Mantid/Framework/DataHandling/src/LoadSNSspec.cpp b/Code/Mantid/Framework/DataHandling/src/LoadSNSspec.cpp index 528c54776744396e4aca93861af3249821c30105..901edcb860c8e54960b0612a7be97341117df7c9 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadSNSspec.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadSNSspec.cpp @@ -125,7 +125,6 @@ namespace Mantid std::vector<DataObjects::Histogram1D> spectra; //size_t iLine=0; // line number - size_t ncols = 3; // number of columns int nSpectra = 0; int nBins = 0; //number of rows std::string first_character; @@ -161,7 +160,6 @@ namespace Mantid typedef boost::tokenizer<boost::char_separator<char> > tokenizer; boost::char_separator<char> sep(" "); tokenizer tok(str, sep); - ncols = 0; for (tokenizer::iterator beg=tok.begin(); beg!=tok.end(); ++beg) { std::stringstream ss; diff --git a/Code/Mantid/Framework/DataHandling/src/LoadSPE.cpp b/Code/Mantid/Framework/DataHandling/src/LoadSPE.cpp index 2bfe0bc98a3ee08f96d73006420d175ab96df2f8..701195ab79df7c80852d7acb1f4e6602a4ab80f4 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadSPE.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadSPE.cpp @@ -79,7 +79,7 @@ void LoadSPE::exec() // Next line should be comment line: "### Phi Grid" or "### Q Grid" char comment[100]; - char* _tmp = fgets(comment,100,speFile); + fgets(comment,100,speFile); if ( comment[0] != '#' ) reportFormatError(std::string(comment)); // Create the axis that will hold the phi values @@ -108,10 +108,10 @@ void LoadSPE::exec() phiAxis->setValue(i,phi); } // Read to EOL - _tmp = fgets(comment,100,speFile); + fgets(comment,100,speFile); // Next line should be comment line: "### Energy Grid" - _tmp = fgets(comment,100,speFile); + fgets(comment,100,speFile); if ( comment[0] != '#' ) reportFormatError(std::string(comment)); // Now the X bin boundaries @@ -130,7 +130,7 @@ void LoadSPE::exec() } } // Read to EOL - _tmp = fgets(comment,100,speFile); + fgets(comment,100,speFile); // Now create the output workspace MatrixWorkspace_sptr workspace = WorkspaceFactory::Instance().create("Workspace2D",nhist,nbins+1,nbins); @@ -168,7 +168,7 @@ void LoadSPE::readHistogram(FILE* speFile, API::MatrixWorkspace_sptr workspace, { // First, there should be a comment line char comment[100]; - char* _tmp = fgets(comment,100,speFile); + fgets(comment,100,speFile); if ( comment[0] != '#' ) reportFormatError(std::string(comment)); // Then it's the Y values @@ -193,10 +193,10 @@ void LoadSPE::readHistogram(FILE* speFile, API::MatrixWorkspace_sptr workspace, } // Read to EOL - _tmp = fgets(comment,100,speFile); + fgets(comment,100,speFile); // Another comment line - _tmp = fgets(comment,100,speFile); + fgets(comment,100,speFile); if ( comment[0] != '#' ) reportFormatError(std::string(comment)); // And then the error values @@ -212,7 +212,7 @@ void LoadSPE::readHistogram(FILE* speFile, API::MatrixWorkspace_sptr workspace, } } // Read to EOL - _tmp =fgets(comment,100,speFile); + fgets(comment,100,speFile); return; } diff --git a/Code/Mantid/Framework/DataHandling/src/LoadSpec.cpp b/Code/Mantid/Framework/DataHandling/src/LoadSpec.cpp index e389c091f9d0117ecc374a6dc8575d870f583a68..7c04f578c5819a3fcbcec803b70190a7a6647b92 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadSpec.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadSpec.cpp @@ -124,7 +124,6 @@ namespace Mantid std::vector<DataObjects::Histogram1D> spectra; //size_t iLine=0; // line number - size_t ncols = 3; // number of columns int nSpectra = 0; int nBins = 0; //number of rows std::string first_character; @@ -159,7 +158,6 @@ namespace Mantid typedef boost::tokenizer<boost::char_separator<char> > tokenizer; boost::char_separator<char> sep(" "); tokenizer tok(str, sep); - ncols = 0; for (tokenizer::iterator beg=tok.begin(); beg!=tok.end(); ++beg) { std::stringstream ss; diff --git a/Code/Mantid/Framework/DataHandling/src/MaskDetectors.cpp b/Code/Mantid/Framework/DataHandling/src/MaskDetectors.cpp index ce2da32c3dd3e693285525ac20471ab9f897f66f..49dbbd637b2182185653da972ac409657546ab13 100644 --- a/Code/Mantid/Framework/DataHandling/src/MaskDetectors.cpp +++ b/Code/Mantid/Framework/DataHandling/src/MaskDetectors.cpp @@ -128,7 +128,6 @@ void MaskDetectors::exec() // If explicitly given a list of detectors to mask, just mark those. // Otherwise, mask all detectors pointing to the requested spectra in indexlist loop below - bool detsMasked = false; std::vector<detid_t>::const_iterator it; Instrument_const_sptr instrument = WS->getInstrument(); if ( !detectorList.empty() ) @@ -140,7 +139,6 @@ void MaskDetectors::exec() if ( const Geometry::ComponentID det = instrument->getDetector(*it)->getComponentID() ) { pmap.addBool(det,"masked",true); - //std::cout << "Manually masking det " << det->getID() << std::endl; } } catch(Kernel::Exception::NotFoundError &e) @@ -148,7 +146,6 @@ void MaskDetectors::exec() g_log.warning() << e.what() << " Found while running MaskDetectors" << std::endl; } } - detsMasked = true; } if ( indexList.size() == 0 ) diff --git a/Code/Mantid/Framework/DataHandling/src/SaveCanSAS1D.cpp b/Code/Mantid/Framework/DataHandling/src/SaveCanSAS1D.cpp index 0a18d9c30f76ed697308e919fd433bdc46658fca..26b2bd8784518b10bb61ef87ca6cdb8c019566b6 100644 --- a/Code/Mantid/Framework/DataHandling/src/SaveCanSAS1D.cpp +++ b/Code/Mantid/Framework/DataHandling/src/SaveCanSAS1D.cpp @@ -599,12 +599,9 @@ void SaveCanSAS1D::createSASProcessElement(std::string& sasProcess) sasProcname+="Mantid generated CanSAS1D XML"; sasProcname+="</name>"; sasProcess+=sasProcname; - //outFile<<sasProcname; time_t date; - time(&date); - std::tm* t; - t=localtime(&date); + localtime(&date); char temp [25]; strftime (temp,25,"%d-%b-%Y %H:%M:%S",localtime(&date)); diff --git a/Code/Mantid/Framework/DataHandling/src/SaveISISNexus.cpp b/Code/Mantid/Framework/DataHandling/src/SaveISISNexus.cpp index 26aa10b5c3e8a91b3bbf2ff8adb4e71eec33c468..0427d9ef709dc847cfde45cb837830810e4ab84c 100644 --- a/Code/Mantid/Framework/DataHandling/src/SaveISISNexus.cpp +++ b/Code/Mantid/Framework/DataHandling/src/SaveISISNexus.cpp @@ -418,8 +418,8 @@ void SaveISISNexus::toISO8601(std::string& str) /// Write isis_vms_compat void SaveISISNexus::write_isis_vms_compat() { - NXstatus status = NXmakegroup(handle,"isis_vms_compat","IXvms"); - status = NXopengroup(handle,"isis_vms_compat","IXvms"); + NXmakegroup(handle,"isis_vms_compat","IXvms"); + NXopengroup(handle,"isis_vms_compat","IXvms"); int ndet = m_isisRaw->i_det; int nmon = m_isisRaw->i_mon; @@ -492,8 +492,8 @@ void SaveISISNexus::write_isis_vms_compat() void SaveISISNexus::instrument() { - NXstatus status = NXmakegroup(handle,"instrument","NXinstrument"); - status = NXopengroup(handle,"instrument","NXinstrument"); + NXmakegroup(handle,"instrument","NXinstrument"); + NXopengroup(handle,"instrument","NXinstrument"); saveCharOpen("name",&m_isisRaw->i_inst,8); putAttr("short_name",m_isisRaw->hdr.inst_abrv,3); close(); @@ -506,8 +506,8 @@ void SaveISISNexus::instrument() void SaveISISNexus::detector_1() { - NXstatus status = NXmakegroup(handle,"detector_1","NXdata"); - status = NXopengroup(handle,"detector_1","NXdata"); + NXmakegroup(handle,"detector_1","NXdata"); + NXopengroup(handle,"detector_1","NXdata"); for(int i = 0; i < nmon; ++i) { @@ -520,7 +520,7 @@ void SaveISISNexus::detector_1() dim[0] = nper; dim[1] = nsp - nmon; dim[2] = ntc; - status = NXmakedata(handle,"counts",NX_INT32,3,dim); + NXmakedata(handle,"counts",NX_INT32,3,dim); NXopendata(handle,"counts"); putAttr("units","counts"); putAttr("signal",1); @@ -589,8 +589,8 @@ void SaveISISNexus::detector_1() */ void SaveISISNexus::moderator() { - NXstatus status = NXmakegroup(handle,"moderator","NXmoderator"); - status = NXopengroup(handle,"moderator","NXmoderator"); + NXmakegroup(handle,"moderator","NXmoderator"); + NXopengroup(handle,"moderator","NXmoderator"); float l1 = - m_isisRaw->ivpb.i_l1; saveFloatOpen("distance",&l1,1); @@ -604,8 +604,8 @@ void SaveISISNexus::moderator() */ void SaveISISNexus::source() { - NXstatus status = NXmakegroup(handle,"source","NXsource"); - status = NXopengroup(handle,"source","NXsource"); + NXmakegroup(handle,"source","NXsource"); + NXopengroup(handle,"source","NXsource"); saveString("name","ISIS"); saveString("probe","neutrons"); @@ -619,8 +619,8 @@ void SaveISISNexus::source() */ void SaveISISNexus::make_detector_1_link() { - NXstatus status = NXmakegroup(handle,"detector_1","NXdata"); - status = NXopengroup(handle,"detector_1","NXdata"); + NXmakegroup(handle,"detector_1","NXdata"); + NXopengroup(handle,"detector_1","NXdata"); NXmakelink(handle,&counts_link); NXmakelink(handle,&period_index_link); diff --git a/Code/Mantid/Framework/DataHandling/test/LoadEventNexusTest.h b/Code/Mantid/Framework/DataHandling/test/LoadEventNexusTest.h index 50df523abbc6fa4c9a08f97c5c7e0c6663f2a47f..a752a96a0d8f8b69234d86649325676f7388e121 100644 --- a/Code/Mantid/Framework/DataHandling/test/LoadEventNexusTest.h +++ b/Code/Mantid/Framework/DataHandling/test/LoadEventNexusTest.h @@ -125,7 +125,6 @@ public: it = logMap.begin(); it2 = logMap2.begin(); - Kernel::DateAndTime start = it->first; for (; it != logMap.end(); ) { //Same times within a millisecond diff --git a/Code/Mantid/Framework/DataObjects/src/CompressedWorkspace2D.cpp b/Code/Mantid/Framework/DataObjects/src/CompressedWorkspace2D.cpp index 17f1d69fc386111a6cc7b575ba437b08d3be38a4..98ca0f4b293c852cfd108cb19c71b6b8c06bfda5 100644 --- a/Code/Mantid/Framework/DataObjects/src/CompressedWorkspace2D.cpp +++ b/Code/Mantid/Framework/DataObjects/src/CompressedWorkspace2D.cpp @@ -138,21 +138,21 @@ CompressedWorkspace2D::CompressedPointer CompressedWorkspace2D::compressBlock(Ma { ManagedHistogram1D * spec = dynamic_cast<ManagedHistogram1D *>(block->getSpectrum(startIndex + i)); MantidVec& X = spec->directDataX(); - MantidVec::iterator it = std::copy(X.begin(),X.end(),m_inBuffer.begin() + j); + std::copy(X.begin(),X.end(),m_inBuffer.begin() + j); j += m_XLength; } for(size_t i=0;i<m_vectorsPerBlock;i++) { ManagedHistogram1D * spec = dynamic_cast<ManagedHistogram1D *>(block->getSpectrum(startIndex + i)); MantidVec& Y = spec->directDataY(); - MantidVec::iterator it = std::copy(Y.begin(),Y.end(),m_inBuffer.begin() + j); + std::copy(Y.begin(),Y.end(),m_inBuffer.begin() + j); j += m_YLength; } for(size_t i=0;i<m_vectorsPerBlock;i++) { ManagedHistogram1D * spec = dynamic_cast<ManagedHistogram1D *>(block->getSpectrum(startIndex + i)); MantidVec& E = spec->directDataE(); - MantidVec::iterator it = std::copy(E.begin(),E.end(),m_inBuffer.begin() + j); + std::copy(E.begin(),E.end(),m_inBuffer.begin() + j); j += m_YLength; } diff --git a/Code/Mantid/Framework/DataObjects/test/EventWorkspaceTest.h b/Code/Mantid/Framework/DataObjects/test/EventWorkspaceTest.h index 3873488e9d9c04406141f44945e4e915df9fa4fa..28ce567abc83c27e69faba1e1bb96715c7816974 100644 --- a/Code/Mantid/Framework/DataObjects/test/EventWorkspaceTest.h +++ b/Code/Mantid/Framework/DataObjects/test/EventWorkspaceTest.h @@ -568,28 +568,16 @@ public: //But the Y is still 2.0 TS_ASSERT_DELTA( ew2->dataY(0)[1], 2.0, 1e-6); - int mem1 = memory_usage(); - int mem2 = 0; int last = 100; //Read more; memory use should be the same? for (int i=last; i<last+100;i++) data1 = ew2->dataE(i); -//#ifndef WIN32 -// mem2 = memory_usage(); -// TS_ASSERT_LESS_THAN( mem2-mem1, 10); //Memory usage should be ~the same. -//#endif - //Do it some more - last=200; mem1=mem2; + last=200; for (int i=last; i<last+100;i++) data1 = ew2->dataE(i); -//#ifndef WIN32 -// mem2 = memory_usage(); -// TS_ASSERT_LESS_THAN( mem2-mem1, 10); //Memory usage should be ~the same. -//#endif - } diff --git a/Code/Mantid/Framework/Geometry/src/Crystal/IndexingUtils.cpp b/Code/Mantid/Framework/Geometry/src/Crystal/IndexingUtils.cpp index f40e62a8c8f0138dc56c17d2b9d617ec759351b5..2a02072ef8f02fb74625117efea8582f1dc46aac 100644 --- a/Code/Mantid/Framework/Geometry/src/Crystal/IndexingUtils.cpp +++ b/Code/Mantid/Framework/Geometry/src/Crystal/IndexingUtils.cpp @@ -184,7 +184,6 @@ double IndexingUtils::Find_UB( DblMatrix & UB, required_tolerance ); double fit_error = 0; - int num_indexed; std::vector<V3D> miller_ind; std::vector<V3D> indexed_qs; miller_ind.reserve( q_vectors.size() ); @@ -207,8 +206,8 @@ double IndexingUtils::Find_UB( DblMatrix & UB, try { - num_indexed = GetIndexedPeaks( UB, some_qs, required_tolerance, - miller_ind, indexed_qs, fit_error ); + GetIndexedPeaks( UB, some_qs, required_tolerance, + miller_ind, indexed_qs, fit_error ); Matrix<double> temp_UB(3,3,false); fit_error = Optimize_UB( temp_UB, miller_ind, indexed_qs ); UB = temp_UB; @@ -223,8 +222,8 @@ double IndexingUtils::Find_UB( DblMatrix & UB, { try { - num_indexed = GetIndexedPeaks( UB, q_vectors, required_tolerance, - miller_ind, indexed_qs, fit_error ); + GetIndexedPeaks( UB, q_vectors, required_tolerance, + miller_ind, indexed_qs, fit_error ); Matrix<double> temp_UB(3,3,false); fit_error = Optimize_UB( temp_UB, miller_ind, indexed_qs ); UB = temp_UB; @@ -237,8 +236,8 @@ double IndexingUtils::Find_UB( DblMatrix & UB, // Regardless of how we got the UB, find the // sum-squared errors for the indexing in // HKL space. - num_indexed = GetIndexedPeaks( UB, q_vectors, required_tolerance, - miller_ind, indexed_qs, fit_error ); + GetIndexedPeaks( UB, q_vectors, required_tolerance, + miller_ind, indexed_qs, fit_error ); return fit_error; } @@ -421,7 +420,6 @@ double IndexingUtils::Find_UB( DblMatrix & UB, Matrix<double> temp_UB(3,3,false); double fit_error; - int num_indexed = 0; while ( num_initial < sorted_qs.size() ) { num_initial = round(1.5 * (double)num_initial + 3); @@ -433,8 +431,8 @@ double IndexingUtils::Find_UB( DblMatrix & UB, for ( size_t i = some_qs.size(); i < num_initial; i++ ) some_qs.push_back( sorted_qs[i] ); - num_indexed = GetIndexedPeaks( UB, some_qs, required_tolerance, - miller_ind, indexed_qs, fit_error ); + GetIndexedPeaks( UB, some_qs, required_tolerance, + miller_ind, indexed_qs, fit_error ); try { @@ -450,8 +448,8 @@ double IndexingUtils::Find_UB( DblMatrix & UB, if ( q_vectors.size() >= 5 ) // try one last refinement using all peaks { - num_indexed = GetIndexedPeaks( UB, q_vectors, required_tolerance, - miller_ind, indexed_qs, fit_error ); + GetIndexedPeaks( UB, q_vectors, required_tolerance, + miller_ind, indexed_qs, fit_error ); try { fit_error = Optimize_UB( temp_UB, miller_ind, indexed_qs ); diff --git a/Code/Mantid/Framework/Geometry/test/InstrumentRayTracerTest.h b/Code/Mantid/Framework/Geometry/test/InstrumentRayTracerTest.h index 6404f30cca1ecb5bb93f04639312dfb5fc3d45fc..447018c42f8d0a2ad362f0043ed079753d9721b7 100644 --- a/Code/Mantid/Framework/Geometry/test/InstrumentRayTracerTest.h +++ b/Code/Mantid/Framework/Geometry/test/InstrumentRayTracerTest.h @@ -40,15 +40,13 @@ public: void test_That_Constructor_Throws_Invalid_Argument_On_Giving_A_Null_Instrument() { - InstrumentRayTracer *rayTracker(NULL); - TS_ASSERT_THROWS(rayTracker = new InstrumentRayTracer(boost::shared_ptr<Instrument>()), std::invalid_argument); + TS_ASSERT_THROWS(new InstrumentRayTracer(boost::shared_ptr<Instrument>()), std::invalid_argument); } void test_That_Constructor_Throws_Invalid_Argument_On_Giving_An_Instrument_With_No_Source() { Instrument_sptr testInst(new Instrument("empty")); - InstrumentRayTracer *rayTracker(NULL); - TS_ASSERT_THROWS(rayTracker = new InstrumentRayTracer(testInst), std::invalid_argument); + TS_ASSERT_THROWS(new InstrumentRayTracer(testInst), std::invalid_argument); } void test_That_A_Trace_For_A_Ray_That_Intersects_Many_Components_Gives_These_Components_As_A_Result() diff --git a/Code/Mantid/Framework/ICat/test/SearchTest.h b/Code/Mantid/Framework/ICat/test/SearchTest.h index 2339cc00047d5523c843992e47f1672e7a04dfed..19f6a90f2efd8f97785ec6765e9fec95136cf5a2 100644 --- a/Code/Mantid/Framework/ICat/test/SearchTest.h +++ b/Code/Mantid/Framework/ICat/test/SearchTest.h @@ -12,10 +12,15 @@ using namespace Mantid::ICat; class SearchTest: public CxxTest::TestSuite { public: + + SearchTest() + { + Mantid::API::FrameworkManager::Instance(); + } void testInit() { - Mantid::Kernel::ConfigService::Instance().setString("default.facility", "ISIS"); + Mantid::Kernel::ConfigService::Instance().setString("default.facility", "ISIS"); CSearch searchobj; Login loginobj; diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/ThreadSchedulerMutexes.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/ThreadSchedulerMutexes.h index daae6352c1b717df80d1072e8d8809508b9088ff..12400d51ab09e6d23c05bdff0b4bf5cb0437eade 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/ThreadSchedulerMutexes.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/ThreadSchedulerMutexes.h @@ -57,7 +57,6 @@ namespace Kernel UNUSED_ARG(threadnum); Task * temp = NULL; - std::set<Mutex *>::iterator mutexes_end = m_mutexes.end(); m_queueLock.lock(); // Check the size within the same locking block; otherwise the size may change before you get the next item. diff --git a/Code/Mantid/Framework/Kernel/src/Quat.cpp b/Code/Mantid/Framework/Kernel/src/Quat.cpp index a1ce1c25271b9f3290bc849843b63cdfd66b5c30..61457c214db8828a080488ccdb1d69f424b78133 100644 --- a/Code/Mantid/Framework/Kernel/src/Quat.cpp +++ b/Code/Mantid/Framework/Kernel/src/Quat.cpp @@ -270,8 +270,6 @@ void Quat::operator()(const V3D& rX, const V3D& rY, const V3D& rZ) //Find the axis that rotates oYr onto rY V3D ax2 = roY.cross_prod(rY); double angle2 = roY.angle(rY); - double sign = 1.0; - if (ax2.scalar_prod(rX) < 0) { sign = -1.0; }; Quat Q2(angle2 * 180.0/M_PI, ax2); //Final = those two rotations in succession; Q1 is done first. @@ -279,14 +277,6 @@ void Quat::operator()(const V3D& rX, const V3D& rY, const V3D& rZ) //Set it this->operator()(final); - - /* - std::cout << "Angle1 is: " << angle1 << "; axis " << ax1 << " ... "; - std::cout << "Q1 is: " << Q1 << "\n"; - std::cout << "Angle2 is: " << angle2 << "; axis " << ax2 << " ... "; - std::cout << "Q2 is: " << Q2 << "\n"; - std::cout << "Final is: " << final << "\n"; - */ } //! Destructor diff --git a/Code/Mantid/Framework/Kernel/test/ConfigServiceTest.h b/Code/Mantid/Framework/Kernel/test/ConfigServiceTest.h index b11c3f8ca81ecfb3f4a9ce2ce3db409554ba5af7..bdb745468e30c7e6e33844235f6d9ef7e93c315f 100644 --- a/Code/Mantid/Framework/Kernel/test/ConfigServiceTest.h +++ b/Code/Mantid/Framework/Kernel/test/ConfigServiceTest.h @@ -177,9 +177,9 @@ public: { //Mantid.legs is defined in the properties script as 6 int value = 0; - int retVal = ConfigService::Instance().getValue("ManagedWorkspace.DataBlockSize",value); + ConfigService::Instance().getValue("ManagedWorkspace.DataBlockSize",value); double dblValue = 0; - retVal = ConfigService::Instance().getValue("ManagedWorkspace.DataBlockSize",dblValue); + ConfigService::Instance().getValue("ManagedWorkspace.DataBlockSize",dblValue); TS_ASSERT_EQUALS(value, 4000); TS_ASSERT_EQUALS(dblValue, 4000.0); diff --git a/Code/Mantid/Framework/Kernel/test/DateAndTimeTest.h b/Code/Mantid/Framework/Kernel/test/DateAndTimeTest.h index dc609ba8ef7fef07327aa33b1525b39b9dda33c0..62d17837becfc7379be107a3edb793f901847d0c 100644 --- a/Code/Mantid/Framework/Kernel/test/DateAndTimeTest.h +++ b/Code/Mantid/Framework/Kernel/test/DateAndTimeTest.h @@ -287,7 +287,6 @@ public: void test_time_t_support() { - DateAndTime cur = DateAndTime::get_current_time(); DateAndTime t; std::time_t current = time (NULL); t.set_from_time_t( current ); @@ -421,8 +420,8 @@ public: { boost::posix_time::ptime time(boost::posix_time::not_a_date_time); DateAndTime dt(time); - TS_ASSERT_THROWS(std::tm tm = boost::posix_time::to_tm(time), std::out_of_range); - TS_ASSERT_THROWS_NOTHING(std::tm tm2 = dt.to_tm()); + TS_ASSERT_THROWS(boost::posix_time::to_tm(time), std::out_of_range); + TS_ASSERT_THROWS_NOTHING(dt.to_tm()); } void test_duration_limits() diff --git a/Code/Mantid/Framework/Kernel/test/PropertyManagerTest.h b/Code/Mantid/Framework/Kernel/test/PropertyManagerTest.h index 8e48c54b787ad0fb0569d5c72ade848bdfd14ea3..cfcf4afb146e2249dba390ababd72e13a0630bdc 100644 --- a/Code/Mantid/Framework/Kernel/test/PropertyManagerTest.h +++ b/Code/Mantid/Framework/Kernel/test/PropertyManagerTest.h @@ -205,14 +205,16 @@ public: TS_ASSERT_THROWS_NOTHING( i = manager->getProperty("aprop") ); TS_ASSERT_EQUALS( i, 1 ); double dd(0.0); - TS_ASSERT_THROWS( dd= manager->getProperty("aprop"), std::runtime_error ); + TS_ASSERT_THROWS( dd = manager->getProperty("aprop"), std::runtime_error ); + TS_ASSERT_EQUALS(dd, 0.0); // If dd is bot used you get a compiler warning std::string s = manager->getProperty("aprop"); TS_ASSERT( ! s.compare("1") ); double d(0.0); TS_ASSERT_THROWS_NOTHING( d = manager->getProperty("anotherProp") ); TS_ASSERT_EQUALS( d, 1.11 ); - int ii; + int ii(0); TS_ASSERT_THROWS( ii = manager->getProperty("anotherprop"), std::runtime_error ); + TS_ASSERT_EQUALS(ii, 0); // Compiler warning if ii is not used std::string ss = manager->getProperty("anotherprop"); // Note that some versions of boost::lexical_cast > 1.34 give a string such as // 9.9900000000000002 rather than 9.99. Converting back to a double however does diff --git a/Code/Mantid/Framework/Kernel/test/ThreadPoolRunnableTest.h b/Code/Mantid/Framework/Kernel/test/ThreadPoolRunnableTest.h index 7625847e5008ca48f80b008bf74f04d24f1f1f37..2558a1a94f209508c9c11ad33cf27e30a6a417af 100644 --- a/Code/Mantid/Framework/Kernel/test/ThreadPoolRunnableTest.h +++ b/Code/Mantid/Framework/Kernel/test/ThreadPoolRunnableTest.h @@ -23,8 +23,7 @@ public: void test_constructor() { - ThreadPoolRunnable * tpr; - TS_ASSERT_THROWS( tpr = new ThreadPoolRunnable(0, NULL), std::invalid_argument); + TS_ASSERT_THROWS( new ThreadPoolRunnable(0, NULL), std::invalid_argument); } //======================================================================================= diff --git a/Code/Mantid/Framework/Kernel/test/ThreadSchedulerMutexesTest.h b/Code/Mantid/Framework/Kernel/test/ThreadSchedulerMutexesTest.h index 0557b83623037fe0d7ad0212fd92331ab66fc24c..2abadc31b2555ca7db99e3693d7ecb76ab7f5a68 100644 --- a/Code/Mantid/Framework/Kernel/test/ThreadSchedulerMutexesTest.h +++ b/Code/Mantid/Framework/Kernel/test/ThreadSchedulerMutexesTest.h @@ -150,8 +150,7 @@ public: Timer tim1; for (size_t i=0; i < num; i++) { - Task * task; - task = sc.pop(0); + sc.pop(0); } //std::cout << tim1.elapsed() << " secs to pop." << std::endl; TS_ASSERT_EQUALS( sc.size(), 0); @@ -172,8 +171,7 @@ public: Timer tim1; for (size_t i=0; i < num; i++) { - Task * task; - task = sc.pop(0); + sc.pop(0); } //std::cout << tim1.elapsed() << " secs to pop." << std::endl; TS_ASSERT_EQUALS( sc.size(), 0); diff --git a/Code/Mantid/Framework/MDAlgorithms/test/SimulateMDDTest.h b/Code/Mantid/Framework/MDAlgorithms/test/SimulateMDDTest.h index c2e77c227379cfbe5b3e7ac6fe148b68456f4970..f045affdd19a6c61e9fae5753fb0807f33aeb085 100644 --- a/Code/Mantid/Framework/MDAlgorithms/test/SimulateMDDTest.h +++ b/Code/Mantid/Framework/MDAlgorithms/test/SimulateMDDTest.h @@ -223,12 +223,6 @@ public: boost::dynamic_pointer_cast<MDHistoWorkspace>(AnalysisDataService::Instance().retrieve(FakeWSname)) ); TS_ASSERT_EQUALS( outCut->getNPoints(),16); - // Test output of quadratic in energy transfer model - double expected_residual = 42.4907; - double residual = alg.getProperty("Residual"); - -// TS_ASSERT_DELTA(residual, expected_residual, 1e-03); - // test bg Exponential model in energy transfer with same data alg.setPropertyValue("BackgroundModel","ExpEnTrans"); alg.setPropertyValue("BackgroundModelP1", "1.0" ); @@ -236,15 +230,6 @@ public: alg.setPropertyValue("BackgroundModelP3", "-0.5" ); TS_ASSERT_THROWS_NOTHING(alg.execute()); - // Test output of model - expected_residual = 12.3237; - residual = alg.getProperty("Residual"); - -// TS_ASSERT_DELTA(residual, expected_residual, 1e-03); - - // test incorrect model name - Does not throw as expected - //alg.setPropertyValue("BackgroundModel","notAmodel"); - //TS_ASSERT_THROWS(alg.execute(), std::invalid_argument); AnalysisDataService::Instance().remove(FakeWSname); } void testTidyUp() diff --git a/Code/Mantid/Framework/MDEvents/src/BinToMDHistoWorkspace.cpp b/Code/Mantid/Framework/MDEvents/src/BinToMDHistoWorkspace.cpp index 0a40d9626b76bdc85d54ae0825d288c9064964d2..783b05c4d6fcc9cca9338b20c5495dfc7b747284 100644 --- a/Code/Mantid/Framework/MDEvents/src/BinToMDHistoWorkspace.cpp +++ b/Code/Mantid/Framework/MDEvents/src/BinToMDHistoWorkspace.cpp @@ -386,9 +386,6 @@ namespace MDEvents // Create the threadpool with: all CPUs, a progress reporter ThreadPool tp(ts, 0, prog); - // Big efficiency gain is obtained by grouping a few bins per task. - size_t binsPerTask = 100; - // For progress reporting, the approx # of tasks if (prog) prog->setNumSteps( int(outWS->getNPoints()/100) ); @@ -406,6 +403,9 @@ namespace MDEvents int numPoints = int(outWS->getNPoints()); + // Big efficiency gain is obtained by grouping a few bins per task. + size_t binsPerTask = 100; (void)binsPerTask; // Avoid a compiler warning on gcc 4.6 + // Run in OpenMP with dynamic scheduling and a smallish chunk size (binsPerTask) // Right now, not parallel for file-backed systems. bool fileBacked = (ws->getBoxController()->getFile() != NULL); @@ -435,10 +435,6 @@ namespace MDEvents } bin.m_index = linear_index; - bool dimensionsUsed[nd]; - for (size_t d=0; d<nd; d++) - dimensionsUsed[d] = (d<3); - // Check if the bin is in the ImplicitFunction (if any) bool binContained = true; if (implicitFunction) diff --git a/Code/Mantid/Framework/MDEvents/src/LoadSQW.cpp b/Code/Mantid/Framework/MDEvents/src/LoadSQW.cpp index fa1613ef43b3303bddcc19c6b648fb6f92a555ae..d42df5c71ec406f3e904050ab68917244ff71a15 100644 --- a/Code/Mantid/Framework/MDEvents/src/LoadSQW.cpp +++ b/Code/Mantid/Framework/MDEvents/src/LoadSQW.cpp @@ -191,7 +191,6 @@ namespace Mantid // For tracking when to split boxes size_t eventsAdded = 0; - size_t lastNumBoxes = ws->getBoxController()->getTotalNumMDBoxes(); BoxController_sptr bc = ws->getBoxController(); DiskMRU & mru = bc->getDiskMRU(); @@ -269,7 +268,6 @@ namespace Mantid mru.flushCache(); // Flush memory Mantid::API::MemoryManager::Instance().releaseFreeMemory(); - lastNumBoxes = bc->getTotalNumMDBoxes(); eventsAdded = 0; } diff --git a/Code/Mantid/Framework/MDEvents/src/MDEventWorkspace.cpp b/Code/Mantid/Framework/MDEvents/src/MDEventWorkspace.cpp index e0f08becbfdc8e37ef5aec8736af2c7cdb5f71e2..e02b2014d35f1acf5468f47e869c052fa388eb59 100644 --- a/Code/Mantid/Framework/MDEvents/src/MDEventWorkspace.cpp +++ b/Code/Mantid/Framework/MDEvents/src/MDEventWorkspace.cpp @@ -190,7 +190,7 @@ namespace MDEvents this->data->getBoxes(boxes, depth, true); typename std::vector<IMDBox<MDE,nd>*>::iterator it; typename std::vector<IMDBox<MDE,nd>*>::iterator it_end = boxes.end(); - for (it = boxes.begin(); it != boxes.end(); it++) + for (it = boxes.begin(); it != it_end; it++) { IMDBox<MDE,nd>* box = *it; if (box->getNPoints() > 0) diff --git a/Code/Mantid/Framework/MDEvents/test/MDBoxIteratorTest.h b/Code/Mantid/Framework/MDEvents/test/MDBoxIteratorTest.h index fbf643e73f3812b3f5c5a085e0d9b10a16945375..00435fadf881a93974d70459591e975dca531571 100644 --- a/Code/Mantid/Framework/MDEvents/test/MDBoxIteratorTest.h +++ b/Code/Mantid/Framework/MDEvents/test/MDBoxIteratorTest.h @@ -81,8 +81,7 @@ public: void test_ctor_with_null_box_fails() { typedef MDBoxIterator<MDLeanEvent<1>,1> boxit_t; - boxit_t * it; - TS_ASSERT_THROWS_ANYTHING( it = new boxit_t(NULL, 10, false); ); + TS_ASSERT_THROWS_ANYTHING( new boxit_t(NULL, 10, false); ); } //-------------------------------------------------------------------------------------- @@ -611,12 +610,10 @@ public: // Now we still need to iterate through the vector to do anything, so this is a more fair comparison size_t counter = 0; - IMDBox<MDLeanEvent<3>,3> * box; std::vector< IMDBox<MDLeanEvent<3>,3> * >::iterator it; std::vector< IMDBox<MDLeanEvent<3>,3> * >::iterator it_end = boxes.end(); for (it = boxes.begin(); it != it_end; it++) { - box = *it; counter++; } diff --git a/Code/Mantid/Framework/Nexus/inc/MantidNexus/NexusClasses.h b/Code/Mantid/Framework/Nexus/inc/MantidNexus/NexusClasses.h index a6130613016f5bdbfbc779df9f0d31633f7d98a9..b0ed39279558f5c8f30298b26e02a1906d81046a 100644 --- a/Code/Mantid/Framework/Nexus/inc/MantidNexus/NexusClasses.h +++ b/Code/Mantid/Framework/Nexus/inc/MantidNexus/NexusClasses.h @@ -679,14 +679,12 @@ namespace Mantid value.openLocal(); Kernel::TimeSeriesProperty<double>* logv = new Kernel::TimeSeriesProperty<double>(logName); value.load(); - int prev_index = 0; for(int i=0;i<value.dim0();i++) { if (i == 0 || value[i] != value[i-1] || times[i] != times[i-1]) { Kernel::DateAndTime t = start_t + boost::posix_time::seconds(int(times[i])); logv->addValue(t,value[i]); - prev_index = i; } } return logv; diff --git a/Code/Mantid/Framework/Nexus/src/NexusFileIO.cpp b/Code/Mantid/Framework/Nexus/src/NexusFileIO.cpp index 267365b95bb1022e7588497fee013ed3b8006c21..6c642d3863ba620228c5fb92155269c70821bbaf 100644 --- a/Code/Mantid/Framework/Nexus/src/NexusFileIO.cpp +++ b/Code/Mantid/Framework/Nexus/src/NexusFileIO.cpp @@ -136,9 +136,8 @@ using namespace DataObjects; //----------------------------------------------------------------------------------------------- int NexusFileIO::closeNexusFile() { - NXstatus status; - status=NXclosegroup(fileID); - status=NXclose(&fileID); + NXclosegroup(fileID); + NXclose(&fileID); return(0); } @@ -609,21 +608,20 @@ using namespace DataObjects; /** Write out an array to the open file. */ void NexusFileIO::NXwritedata( const char * name, int datatype, int rank, int * dims_array, void * data, bool compress) const { - NXstatus status; if (compress) { // We'll use the same slab/buffer size as the size of the array - status=NXcompmakedata(fileID, name, datatype, rank, dims_array, m_nexuscompression, dims_array); + NXcompmakedata(fileID, name, datatype, rank, dims_array, m_nexuscompression, dims_array); } else { // Write uncompressed. - status=NXmakedata(fileID, name, datatype, rank, dims_array); + NXmakedata(fileID, name, datatype, rank, dims_array); } - status=NXopendata(fileID, name); - status=NXputdata(fileID, data ); - status=NXclosedata(fileID); + NXopendata(fileID, name); + NXputdata(fileID, data ); + NXclosedata(fileID); } //------------------------------------------------------------------------------------- @@ -833,9 +831,8 @@ using namespace DataObjects; { // see if the given attribute name is in the current level // return true if it is. - NXstatus status; int length=NX_MAXNAMELEN,type; - status=NXinitattrdir(fileID); + NXinitattrdir(fileID); char aname[NX_MAXNAMELEN]; // char avalue[NX_MAXNAMELEN]; // value is not restricted to this, but it is a reasonably large value while(NXgetnextattr(fileID,aname,&length,&type)==NX_OK) @@ -854,7 +851,7 @@ using namespace DataObjects; // find the X values for spectra. If uniform, the spectra number is ignored. // NXstatus status; - int rank,dim[2],type,nx; + int rank,dim[2],type; //open workspace group status=NXopengroup(fileID,"workspace","NXdata"); @@ -865,11 +862,6 @@ using namespace DataObjects; if(status==NX_ERROR) return(2); status=NXgetinfo(fileID, &rank, dim, &type); - // non-uniform X has 2D axis1 data - if(rank==2) - nx=dim[1]; - else - nx=dim[0]; if(rank==1) { status=NXgetdata(fileID,&xValues[0]); diff --git a/Code/Mantid/Framework/PythonAPI/src/FrameworkManagerProxy.cpp b/Code/Mantid/Framework/PythonAPI/src/FrameworkManagerProxy.cpp index 5d59d6815b17661ad9cf6f1c004437bd057ac0d3..dc0d26ebf790afd3ca349f30846ee6c9873a4dc9 100644 --- a/Code/Mantid/Framework/PythonAPI/src/FrameworkManagerProxy.cpp +++ b/Code/Mantid/Framework/PythonAPI/src/FrameworkManagerProxy.cpp @@ -196,8 +196,6 @@ std::vector<std::string> * FrameworkManagerProxy::getPropertyOrder(const API::IA std::sort(properties.begin(), properties.end(), PropertyOrdering()); // generate the sanitized names - PropertyVector::const_iterator pIter = properties.begin(); - PropertyVector::const_iterator pEnd = properties.end(); std::vector<std::string>* names = new std::vector<std::string>(); names->reserve(properties.size()); size_t numProps = properties.size(); @@ -225,8 +223,6 @@ std::string FrameworkManagerProxy::createAlgorithmDocs(const std::string& algNam std::sort(properties.begin(), properties.end(), PropertyOrdering()); // generate the sanitized names - PropertyVector::const_iterator pIter = properties.begin(); - PropertyVector::const_iterator pEnd = properties.end(); StringVector names(properties.size()); size_t numProps = properties.size(); for ( size_t i = 0; i < numProps; ++i) diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectDataAnalysis.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectDataAnalysis.cpp index d06720d1be95f0ae41be0fad790b51d18bc25b08..7c2f011ef1992e60d39465c2ac083878cbf05567 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectDataAnalysis.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectDataAnalysis.cpp @@ -1284,18 +1284,15 @@ void IndirectDataAnalysis::fixItem() void IndirectDataAnalysis::unFixItem() { QtBrowserItem* item(NULL); - QtDoublePropertyManager* dblMng(NULL); int pageNo = m_uiForm.tabWidget->currentIndex(); if ( pageNo == 3 ) { // FuryFit item = m_ffTree->currentItem(); - dblMng = m_ffDblMng; } else if ( pageNo == 4 ) { // Convolution Fit item = m_cfTree->currentItem(); - dblMng = m_cfDblMng; } QtProperty* prop = item->property(); diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp index a5401dfd6836aa97ee68868b0c095cb773d8e5f2..c89c241afdcedc16b2b8c5e1ddf8e2d4806e5829 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp @@ -2740,9 +2740,7 @@ void MuonAnalysis::changeRun(int amountToChange) */ void MuonAnalysis::separateMuonFile(QString ¤tFile, int &runNumberSize, int &runNumber) { - //QString currentFile = m_uiForm.mwRunFiles->getFirstFilename(); int firstFileNumber(-1); - int lastFileNumber(-1); //Find where the run number begins for (int i = 0; i<currentFile.size(); i++) @@ -2754,15 +2752,6 @@ void MuonAnalysis::separateMuonFile(QString ¤tFile, int &runNumberSize, in } } - //Find where the run number ends - for (int i = firstFileNumber; i<currentFile.size(); i++) - { - if(currentFile[i].isDigit()) - { - lastFileNumber = i; - } - } - //Get the run number, +1 because we want the firstFileNumberIncluded and -1 again because array starts at 0 runNumberSize = currentFile.size() - firstFileNumber + 1 - 1; runNumber = currentFile.right(runNumberSize).toInt(); @@ -2900,4 +2889,4 @@ void MuonAnalysis::groupFittedWorkspaces(QString workspaceName) } }//namespace MantidQT -}//namespace CustomInterfaces \ No newline at end of file +}//namespace CustomInterfaces