Skip to content

Commit

Permalink
refs #3868. Various code analysis fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartcampbell committed Dec 30, 2011
1 parent 4564706 commit ff72ffb
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
4 changes: 3 additions & 1 deletion Code/Mantid/MantidQt/API/src/MantidColorMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include <QRgb>
#include <limits>

#include <boost/math/special_functions/fpclassify.hpp>

//--------------------------------------
// Public member functions
//--------------------------------------
Expand Down Expand Up @@ -198,7 +200,7 @@ void MantidColorMap::setupDefaultMap()
double MantidColorMap::normalize(const QwtDoubleInterval &interval, double value) const
{
// nan numbers have the property that nan != nan, treat nan as being invalid
if( interval.isNull() || m_num_colors == 0 || value != value )
if( interval.isNull() || m_num_colors == 0 || boost::math::isnan(value) )
return m_nan;

const double width = interval.width();
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/MantidQt/CustomInterfaces/src/Indirect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ void Indirect::closeEvent(QCloseEvent* close)
void Indirect::handleDirectoryChange(Mantid::Kernel::ConfigValChangeNotification_ptr pNf)
{
std::string key = pNf->key();
std::string preValue = pNf->preValue();
std::string curValue = pNf->curValue();
// std::string preValue = pNf->preValue(); // Unused
// std::string curValue = pNf->curValue(); // Unused

if ( key == "datasearch.directories" || key == "defaultsave.directory" )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ void IndirectDataAnalysis::closeEvent(QCloseEvent*)
void IndirectDataAnalysis::handleDirectoryChange(Mantid::Kernel::ConfigValChangeNotification_ptr pNf)
{
std::string key = pNf->key();
std::string preValue = pNf->preValue();
std::string curValue = pNf->curValue();
// std::string preValue = pNf->preValue(); // Unused
// std::string curValue = pNf->curValue(); // Unused

if ( key == "defaultsave.directory" )
{
Expand Down Expand Up @@ -2235,7 +2235,7 @@ void IndirectDataAnalysis::confitPlotGuess(QtProperty*)
confitPlotInput();
}

std::string inputName = m_cfInputWS->getName();
// std::string inputName = m_cfInputWS->getName(); // Unused

const size_t binIndexLow = m_cfInputWS->binIndexOf(m_cfDblMng->value(m_cfProp["StartX"]));
const size_t binIndexHigh = m_cfInputWS->binIndexOf(m_cfDblMng->value(m_cfProp["EndX"]));
Expand Down
5 changes: 3 additions & 2 deletions Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -910,13 +910,14 @@ void MuonAnalysis::inputFileChanged_MWRunFiles()

m_previousFilename = m_uiForm.mwRunFiles->getFirstFilename();

int difference(0);
int appendSeparator(-1);
appendSeparator = m_previousFilename.find("-");

if (appendSeparator != -1)
{
//if a range has been selected then opent hem all
int difference(0);

//if a range has been selected then open them all
//first split into files
QString currentFile = m_uiForm.mwRunFiles->getText();//m_previousFilename; // m_uiForm.mwRunFiles->getFirstFilename();

Expand Down
4 changes: 1 addition & 3 deletions Code/Mantid/MantidQt/SliceViewer/src/main_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ static void addPeak(size_t num, double x, double y, double z, double radius)
IMDWorkspace_sptr makeDemoData(bool binned = false)
{
// Create a fake workspace
size_t numBins;

numBins=100;
//size_t numBins = 100;

// ---- Start with empty MDEW ----
FrameworkManager::Instance().exec("CreateMDWorkspace", 16,
Expand Down

0 comments on commit ff72ffb

Please sign in to comment.