Skip to content

Commit

Permalink
Clear most MSVC (64 bit build) warnings up to API. Re #4473.
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellTaylor committed Feb 13, 2012
1 parent 0e3b05f commit 39425f5
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 10 deletions.
12 changes: 12 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/AlgorithmProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ namespace Mantid
//-------------------------------------------------------------------------
class IAlgorithm;

#ifdef _WIN32
#pragma warning( push )
// Disable 'multiple assignment operators specified' warning for this class
// - it's not an accident that we have more than one
#pragma warning( disable: 4522 )
#endif

/**
Define an algorithm property that can be used to supply an algorithm object
to a subsequent algorithm. It is a specialized version of PropertyWithValue
Expand Down Expand Up @@ -90,6 +97,11 @@ namespace Mantid
/// The string used to create the underlying algorithm
std::string m_algStr;
};

#ifdef _WIN32
#pragma warning ( pop ) // Re-enable the warning about multiple assignment operators
#endif

} // namespace API
} // namespace Mantid

Expand Down
12 changes: 12 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/FileProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ namespace Mantid
{
namespace API
{

#ifdef _WIN32
#pragma warning( push )
// Disable 'multiple assignment operators specified' warning for this class
// - it's not an accident that we have more than one
#pragma warning( disable: 4522 )
#endif

/**
A specialized class for dealing with file properties. Mantid allows multiple
search paths to be defined so that each of these is used when attempting to
Expand Down Expand Up @@ -90,6 +98,10 @@ class DLLExport FileProperty : public Kernel::PropertyWithValue<std::string>
FileProperty& operator=( const FileProperty& right );
};

#ifdef _WIN32
#pragma warning ( pop ) // Re-enable the warning about multiple assignment operators
#endif

}
}

Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/test/AlgorithmHistoryTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class AlgorithmHistoryTest : public CxxTest::TestSuite
Algorithm *testInput = new testalg;
testInput->initialize();
testInput->setPropertyValue("arg2_param", "5");
AlgorithmHistory history(testInput, 10000.,1.5);
AlgorithmHistory history(testInput);

IAlgorithm_sptr compareAlg = history.createAlgorithm();
TS_ASSERT_EQUALS(compareAlg->name(), testInput->name());
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/API/test/WorkspaceHistoryTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ class WorkspaceHistoryTest : public CxxTest::TestSuite
simplesum2.execute();

WorkspaceHistory history;
AlgorithmHistory alg1(&simplesum, 1000.0,1.0);
AlgorithmHistory alg2(&simplesum2, 1000.0,1.0);
AlgorithmHistory alg1(&simplesum);
AlgorithmHistory alg2(&simplesum2);
history.addHistory(alg1);
history.addHistory(alg2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class NearestNeighboursTestPerformance : public CxxTest::TestSuite
NearestNeighbours nn(m_instrument, *spectramap);
for(size_t i = 0; i < 2000; i++)
{
nn.neighbours(1, true, 8.0);
nn.neighbours(1, true, 8);
}
}
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#ifndef MANTID_PHYSICALCONSTANTS_H_
#define MANTID_PHYSICALCONSTANTS_H_
#include <cfloat>

#ifndef M_PI
#define M_PI 3.1415926535897932384626433832795
#endif
#include <cmath>

//NAN is not defined in visual c++
#ifdef _MSC_VER
#define INFINITY (DBL_MAX+DBL_MAX)
#define NAN (INFINITY-INFINITY)
#endif

namespace Mantid
{

Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/NexusCPP/src/NeXusFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ string File::getStrData() {
{
this->getData(value);
}
catch (Exception& e)
catch (Exception&)
{
delete[] value;
throw;
Expand Down Expand Up @@ -1176,7 +1176,7 @@ string File::getStrAttr(const AttrInfo & info) {
{
this->getAttr(info, value, info.length+1);
}
catch (Exception& e)
catch (Exception&)
{
//Avoid memory leak
delete [] value;
Expand Down

0 comments on commit 39425f5

Please sign in to comment.