Skip to content

Commit

Permalink
Clear more MSVC compiler warnings. Re #4473.
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellTaylor committed Feb 14, 2012
1 parent 394db9f commit 3b2ba51
Show file tree
Hide file tree
Showing 23 changed files with 23 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/Algorithms/src/ApplyDeadTimeCorr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void ApplyDeadTimeCorr::exec()

setProperty("OutputWorkspace", outputWs);
}
catch(std::runtime_error& ex)
catch(std::runtime_error&)
{
throw std::invalid_argument("Invalid argument for algorithm.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ namespace Algorithms

ifs.close();

} catch (std::ifstream::failure & e){
} catch (std::ifstream::failure&){
// b. Using faking offset/calibration
g_log.error() << "Open calibration/offset file " << calfilename << " error " << std::endl;
g_log.notice() << "Using default detector offset/calibration" << std::endl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ namespace Mantid
}
}
//catch all exceptions because the solid angle calculation is optional
catch(std::exception & e)
catch(std::exception&)
{
g_log.warning(
"Precision warning: Can't find detector geometry " + name() +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ DECLARE_ALGORITHM(StripVanadiumPeaks2)
"If the input workspace is an EventWorkspace, then the output must be different (and will be made into a Workspace2D)." );

BoundedValidator<int> *min = new BoundedValidator<int>();
min->setLower(1.0);
min->setLower(1);
// The estimated width of a peak in terms of number of channels
declareProperty("FWHM", 7, min,
"The number of points covered, on average, by the fwhm of a peak. Passed through to FindPeaks. Default 7." );
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/Algorithms/src/TOFSANSResolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ void TOFSANSResolution::exec()

const double dwl_over_wl = 3.9560*getTOFResolution(itev->m_tof)/(1000.0*(L1+L2)*itev->m_tof);
const double dq_over_q = std::sqrt(dTheta2/(theta*theta)+dwl_over_wl*dwl_over_wl);

PARALLEL_CRITICAL(iq) /* Write to shared memory - must protect */
if (iq>=0 && iq < xLength-1 && !dq_over_q!=dq_over_q && dq_over_q>0)
if (iq>=0 && iq < xLength-1 && !boost::math::isnan(dq_over_q) && dq_over_q>0)
{
DxOut[iq] += q*dq_over_q*itev->m_weight;
XNorm[iq] += itev->m_weight;
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/Algorithms/src/XDataConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace Mantid

const int numSpectra = static_cast<int>(inputWS->getNumberHistograms());
const size_t numYValues = inputWS->blocksize();
const int numXValues = getNewXSize(inputWS);
const size_t numXValues = getNewXSize(inputWS);
m_sharedX = API::WorkspaceHelpers::sharedXData(inputWS);
// Create the new workspace
MatrixWorkspace_sptr outputWS = WorkspaceFactory::Instance().create(inputWS, numSpectra, numXValues, numYValues);
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/Algorithms/test/CropWorkspaceTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class CropWorkspaceTest : public CxxTest::TestSuite
EventWorkspace_sptr test_in = WorkspaceCreationHelper::CreateEventWorkspace(36, 50, 50, 0.0, 2., 2);
//Fake a d-spacing unit in the data.
test_in->getAxis(0)->unit() =UnitFactory::Instance().create("TOF");
test_in->setInstrument( ComponentCreationHelper::createTestInstrumentCylindrical(4.0, false) );
test_in->setInstrument( ComponentCreationHelper::createTestInstrumentCylindrical(4, false) );
//Add it to the workspace
AnalysisDataService::Instance().add(wsName, test_in);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace Crystal

const double STEPS_PER_ANGSTROM = 100; // resolution of lamda table

const int NUM_WAVELENGTHS = std::ceil( MAX_WAVELENGTH * STEPS_PER_ANGSTROM);
const int NUM_WAVELENGTHS = static_cast<int>(std::ceil( MAX_WAVELENGTH * STEPS_PER_ANGSTROM));

const double radtodeg_half = 180.0/M_PI/2.;
/** Calculates anvred correction factors for attenuation due to absorption and scattering in a spherical sample.
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/Crystal/inc/MantidCrystal/SaveHKL.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace Crystal

const double STEPS_PER_ANGSTROM = 100; // resolution of lamda table

const int NUM_WAVELENGTHS = std::ceil( MAX_WAVELENGTH * STEPS_PER_ANGSTROM);
const int NUM_WAVELENGTHS = static_cast<int>(std::ceil( MAX_WAVELENGTH * STEPS_PER_ANGSTROM));

const double radtodeg_half = 180.0/M_PI/2.;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace Crystal

const double STEPS_PER_ANGSTROM = 100; // resolution of lamda table

const int NUM_WAVELENGTHS = std::ceil( MAX_WAVELENGTH * STEPS_PER_ANGSTROM);
const int NUM_WAVELENGTHS = static_cast<int>(std::ceil( MAX_WAVELENGTH * STEPS_PER_ANGSTROM));

const double radtodeg_half = 180.0/M_PI/2.;

Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/Crystal/src/PeakIntegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ void PeakIntegration::cluster(double **matrix, int m, int n, int **mask)
{
for (int j=0; j<n; j++)
{
mask[i][j] = 0.0;
mask[i][j] = 0;
if(matrix[i][j] > max)
{
max = matrix[i][j];
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/Crystal/src/SaveHKL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ namespace Crystal
if (append)
{
out.open( filename.c_str(), std::ios::in|std::ios::out|std::ios::ate);
long pos = out.tellp();
std::streamoff pos = out.tellp();
out.seekp (28);
out >> firstrun;
out.seekp (pos - 110);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ namespace DataHandling
std::string value = "";

// 2. Loop to find
for (size_t i = 0; i < att->length(); i ++){
for (unsigned long i = 0; i < att->length(); ++i){
Poco::XML::Node* cNode = att->item(i);
if (cNode->localName().compare(attributename) == 0){
value = cNode->getNodeValue();
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/DataHandling/src/LoadEventNexus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ class LoadBankFromDiskTask : public Task
// First, get info about the event_time_zero field in this bank
file.openData("event_time_zero");
}
catch (::NeXus::Exception & e)
catch (::NeXus::Exception&)
{
// Field not found error is most likely.
// Use the "proton_charge" das logs.
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/DataHandling/src/LoadNexusLogs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ namespace Mantid
{
file.openGroup("Veto_pulse", "NXgroup");
}
catch (::NeXus::Exception & e)
catch (::NeXus::Exception&)
{
// No group. This is common in older files
return;
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/DataObjects/src/EventList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ namespace DataObjects
case WEIGHTED:
return weightedEvents[event_number];
case WEIGHTED_NOTIME:
return WeightedEvent(weightedEventsNoTime[event_number].tof(), 0., weightedEventsNoTime[event_number].weight(), weightedEventsNoTime[event_number].errorSquared());
return WeightedEvent(weightedEventsNoTime[event_number].tof(), 0, weightedEventsNoTime[event_number].weight(), weightedEventsNoTime[event_number].errorSquared());
}
throw std::runtime_error("EventList: invalid event type value was found.");
}
Expand Down
1 change: 0 additions & 1 deletion Code/Mantid/Framework/ICat/test/ICatTestHelper.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "ICatTestHelper.h"
#include "MantidICat/ICatExport.h"

namespace ICatTestHelper
{
Expand Down
3 changes: 1 addition & 2 deletions Code/Mantid/Framework/ICat/test/ICatTestHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
#include "MantidICat/CatalogLogin.h"
#include "MantidICat/Session.h"
#include "MantidKernel/ConfigService.h"
#include "MantidICat/ICatExport.h"

namespace ICatTestHelper
{
/// Skip all unit tests if ICat server is down
EXPORT_OPT_MANTID_ICAT bool skipTests();
bool skipTests();
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ namespace MDAlgorithms
}
}
}
catch (CompareFailsException & e)
catch (CompareFailsException&)
{
// Boxes must release events if the check fails
mdbox1->releaseEvents();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace MDEvents
void BoxControllerSettingsAlgorithm::initBoxControllerProps(const std::string & SplitInto, int SplitThreshold, int MaxRecursionDepth)
{
BoundedValidator<int> *mustBePositive = new BoundedValidator<int> ();
mustBePositive->setLower(0.0);
mustBePositive->setLower(0);
BoundedValidator<int> *mustBeMoreThen1 = new BoundedValidator<int> ();
mustBeMoreThen1->setLower(1);

Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/MDEvents/src/SliceMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ namespace MDEvents
declareProperty("TakeMaxRecursionDepthFromInput", true, "Copy the maximum recursion depth from the input workspace.");

BoundedValidator<int> *mustBePositiveInteger = new BoundedValidator<int>();
mustBePositiveInteger->setLower(0.0);
mustBePositiveInteger->setLower(0);

declareProperty("MaxRecursionDepth", 1000, mustBePositiveInteger,
"Sets the maximum recursion depth to use. Can be used to constrain the workspaces internal structure");
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/MDEvents/test/MDBoxTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class MDBoxTest : public CxxTest::TestSuite
ev.setCenter(0, 2.0);
ev.setCenter(1, 3.0);

int num = 5e5;
int num = 500000;
PARALLEL_FOR_NO_WSP_CHECK()
for (int i=0; i < num; i++)
{
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/MDEvents/test/MDGridBoxTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,7 @@ class MDGridBoxTestPerformance : public CxxTest::TestSuite
box3b = MDEventsTestHelper::makeRecursiveMDGridBox<3>(5,1);

// Make the list of fake events, random dist.
size_t num = 1e6;
size_t num = 1000000;
events.clear();

boost::mt19937 rng;
Expand Down

0 comments on commit 3b2ba51

Please sign in to comment.