Skip to content

Commit

Permalink
Refs #3868. Fixing cppcheck warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Reuter committed Jan 6, 2012
1 parent 347320d commit f2e4ec5
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
20 changes: 20 additions & 0 deletions Code/Mantid/MantidPlot/src/Mantid/AlgorithmHistoryWindow.cpp
Expand Up @@ -28,6 +28,12 @@ using namespace Mantid::API;
Mantid::Kernel::Logger& AlgorithmHistoryWindow::g_log = Mantid::Kernel::Logger::get("AlgorithmHistoryWindow");
Mantid::Kernel::Logger& AlgHistoryTreeWidget::g_log = Mantid::Kernel::Logger::get("AlgHistoryTreeWidget");

AlgExecSummaryGrpBox::AlgExecSummaryGrpBox(QWidget *w) : QGroupBox(w),
m_execDurationlabel(NULL),m_execDurationEdit(NULL),
m_Datelabel(NULL),m_execDateTimeEdit(NULL), m_algexecDuration()
{
}

AlgExecSummaryGrpBox::AlgExecSummaryGrpBox(QString title,QWidget*w)
: QGroupBox(title,w), m_execDurationlabel(NULL),m_execDurationEdit(NULL),
m_Datelabel(NULL),m_execDateTimeEdit(NULL), m_algexecDuration()
Expand Down Expand Up @@ -99,6 +105,13 @@ void AlgExecSummaryGrpBox::setData(const double execDuration,const Mantid::Kerne
if(datetimeEdit)datetimeEdit->setText(str);

}

AlgEnvHistoryGrpBox::AlgEnvHistoryGrpBox(QWidget *w) : QGroupBox(w),
m_osNameLabel(NULL),m_osNameEdit(NULL),m_osVersionLabel(NULL),m_osVersionEdit(NULL),
m_frmworkVersionLabel(NULL),m_frmwkVersnEdit(NULL)
{
}

AlgEnvHistoryGrpBox::AlgEnvHistoryGrpBox(QString title,QWidget*w):QGroupBox(title,w),
m_osNameLabel(NULL),m_osNameEdit(NULL),m_osVersionLabel(NULL),m_osVersionEdit(NULL),
m_frmworkVersionLabel(NULL),m_frmwkVersnEdit(NULL)
Expand Down Expand Up @@ -169,6 +182,13 @@ AlgHistScriptButton::AlgHistScriptButton(QString title,QWidget* w):QPushButton(t
AlgHistScriptButton::~AlgHistScriptButton()
{
}

AlgorithmHistoryWindow::AlgorithmHistoryWindow(QWidget *parent) : MantidDialog(parent),
m_scriptButton(NULL),m_Historytree(NULL),m_histPropWindow(NULL),
m_execSumGrpBox(NULL),m_envHistGrpBox(NULL),m_wsName("")
{
}

AlgorithmHistoryWindow::AlgorithmHistoryWindow(QWidget *parent,const boost::shared_ptr<const Workspace> wsptr):
MantidDialog(parent),m_algHist(wsptr->getHistory().getAlgorithmHistories()),m_histPropWindow(NULL),m_execSumGrpBox(NULL),m_envHistGrpBox(NULL),m_wsName(wsptr->getName().c_str())
{
Expand Down
6 changes: 3 additions & 3 deletions Code/Mantid/MantidPlot/src/Mantid/AlgorithmHistoryWindow.h
Expand Up @@ -64,7 +64,7 @@ class AlgExecSummaryGrpBox: public QGroupBox
{
Q_OBJECT
public:
AlgExecSummaryGrpBox(QWidget*w):QGroupBox(w){}
AlgExecSummaryGrpBox(QWidget*w);
AlgExecSummaryGrpBox(QString,QWidget*w);
~AlgExecSummaryGrpBox();
void setData(const double execDuration,const Mantid::Kernel::DateAndTime execDate);
Expand All @@ -83,7 +83,7 @@ class AlgEnvHistoryGrpBox: public QGroupBox
{
Q_OBJECT
public:
AlgEnvHistoryGrpBox(QWidget*w):QGroupBox(w){}
AlgEnvHistoryGrpBox(QWidget*w);
AlgEnvHistoryGrpBox(QString,QWidget*w);
~AlgEnvHistoryGrpBox();

Expand Down Expand Up @@ -116,7 +116,7 @@ class AlgorithmHistoryWindow: public MantidQt::API::MantidDialog
signals:
void updateAlgorithmHistoryWindow(QString algName);
public:
AlgorithmHistoryWindow(QWidget *parent) : MantidQt::API::MantidDialog(parent){}
AlgorithmHistoryWindow(QWidget *parent);
AlgorithmHistoryWindow(QWidget *parent,const boost::shared_ptr<const Mantid::API::Workspace>);
~AlgorithmHistoryWindow();
private slots:
Expand Down
Expand Up @@ -33,6 +33,8 @@ QwtPlot(parent),m_curve(NULL)
m_colors << Qt::red<< Qt::green << Qt::blue << Qt::cyan << Qt::magenta << Qt::yellow << Qt::gray;
m_colors << Qt::darkRed<< Qt::darkGreen << Qt::darkBlue << Qt::darkCyan << Qt::darkMagenta << Qt::darkYellow << Qt::darkGray;
m_colorIndex = 0;
m_x0 = 0;
m_y0 = 0;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/MantidPlot/src/Mantid/MantidDock.cpp
Expand Up @@ -1406,7 +1406,7 @@ void MantidDockWidget::treeSelectionChanged()

//------------ MantidTreeWidget -----------------------//

MantidTreeWidget::MantidTreeWidget(QWidget *w, MantidUI *mui):QTreeWidget(w),m_mantidUI(mui)
MantidTreeWidget::MantidTreeWidget(QWidget *w, MantidUI *mui):QTreeWidget(w),m_mantidUI(mui),m_sortScheme()
{
setObjectName("WorkspaceTree");
setSelectionMode(QAbstractItemView::ExtendedSelection);
Expand Down
6 changes: 4 additions & 2 deletions Code/Mantid/MantidPlot/src/Mantid/MantidMatrix.cpp
Expand Up @@ -41,6 +41,8 @@
#include <algorithm>
#include <limits>

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

using namespace Mantid;
using namespace Mantid::API;
using namespace Mantid::Kernel;
Expand Down Expand Up @@ -172,7 +174,7 @@ void MantidMatrix::viewChanged(int index)
/// Checks if d is not infinity or a NaN
bool isANumber(volatile const double& d)
{
return d != std::numeric_limits<double>::infinity() && d == d;
return d != std::numeric_limits<double>::infinity() && !boost::math::isnan(d);
}

void MantidMatrix::setup(Mantid::API::MatrixWorkspace_sptr ws, int start, int end)
Expand Down Expand Up @@ -718,7 +720,7 @@ QwtDoubleRect MantidMatrix::boundingRect()
}

//----------------------------------------------------------------------------
MantidMatrixFunction::MantidMatrixFunction(MantidMatrix* wsm):m_matrix(wsm){}
MantidMatrixFunction::MantidMatrixFunction(MantidMatrix* wsm):m_matrix(wsm),m_dx(0),m_dy(0),m_outside(0){}

void MantidMatrixFunction::init()
{
Expand Down

0 comments on commit f2e4ec5

Please sign in to comment.