Commit 586b9044 authored by Jan Möbius's avatar Jan Möbius

Fixed cppcheck warnings

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13336 383ad7c9-94d9-4d36-a494-682f7c89f535
parent fea814bb
......@@ -273,7 +273,7 @@ private:
UINT uiStart, uiLen;
UINT uiSize;
inline UINT pos(UINT i)
inline UINT pos(UINT i) const
{
UINT t = uiStart + i;
if (t >= uiLen) t -= uiLen;
......@@ -285,8 +285,8 @@ private:
{ pStack = new UINT[uiSize];}
~RingStack() {delete [] pStack;}
UINT length() {return uiLen;} // current stack length
UINT size() {return uiSize;} // reserved stack size i.e. maximum length
UINT length() const {return uiLen;} // current stack length
UINT size() const {return uiSize;} // reserved stack size i.e. maximum length
inline void push(UINT v)
{
......
......@@ -148,7 +148,11 @@ QtApplication::QtApplication(int _argc, char** _argv)
: QApplication(_argc, _argv),
record_(false),
playback_(false),
play_loop_(false)
play_loop_(false),
eventnr_(0),
timer_id_(0),
dialog_(0),
mainWidget_(0)
{
// create new macro Dialog
// dialog_ = new QtMacroDialog(0, "MacroDialog");
......@@ -170,7 +174,6 @@ QtApplication::QtApplication(int _argc, char** _argv)
}
//-----------------------------------------------------------------------------
......
......@@ -1011,6 +1011,7 @@ void Core::multiViewMode( int _mode ) {
default:
emit log(LOGERR,tr("Requested illegal multiview mode!"));
break;
}
}
......
......@@ -484,6 +484,7 @@ bool defaultPerspectiveProjectionMode(int _viewer){
return OpenFlipperSettings().value(entry,false).toBool();
default:
std::cerr << "defaultProjectionMode: illegal viewer id: " << _viewer << std::endl;
break;
}
return true;
......
......@@ -1714,13 +1714,12 @@ void glViewer::handleNormalNavigation( QMouseEvent* _event ) {
else if ((_event->buttons() & Qt::MidButton) || (!allowRotation_ && (_event->buttons() & Qt::LeftButton)) ) {
ACG::Vec3d translation;
double value_x, value_y;
// if start depth is 1, no object was hit when starting translation
if ( startDepth_ == 1 ) {
value_x = properties_.sceneRadius() * ((newPoint2D.x() - lastPoint2D_.x())) * 2.0 / (double) glWidth();
value_y = properties_.sceneRadius() * ((newPoint2D.y() - lastPoint2D_.y())) * 2.0 / (double) glHeight();
double value_x = properties_.sceneRadius() * ((newPoint2D.x() - lastPoint2D_.x())) * 2.0 / (double) glWidth();
double value_y = properties_.sceneRadius() * ((newPoint2D.y() - lastPoint2D_.y())) * 2.0 / (double) glHeight();
translation = ACG::Vec3d(value_x * factor, -value_y * factor, 0.0);
} else {
......
......@@ -46,9 +46,13 @@
#include <iostream>
///Constructor
ShortcutButton::ShortcutButton(QWidget* _parent) : QPushButton(_parent)
ShortcutButton::ShortcutButton(QWidget* _parent) :
QPushButton(_parent),
key_(-1),
oldKey_(-1),
checked_(false),
firstPress_(true)
{
key_ = -1;
setCheckable(true);
}
......
......@@ -57,7 +57,18 @@
#include <QTextStream>
#include <QSyntaxHighlighter>
ScriptingPlugin::ScriptingPlugin() {
ScriptingPlugin::ScriptingPlugin() :
lastProblemLine_(0),
lastError_(""),
errorTimer_(0),
descrLayout_(0),
scriptWidget_(0),
statusBar_(0),
highlighterCurrent_(0),
highlighterLive_(0),
highlighterList_(0),
lastFile_("")
{
}
......
......@@ -61,6 +61,16 @@
#define TEXTUREDATA "TextureData"
TextureControlPlugin::TextureControlPlugin() :
settingsDialog_(0),
textureMenu_(0),
actionGroup_(0),
contextMenu_(0)
{
}
void TextureControlPlugin::slotTextureAdded( QString _textureName , QString _filename , uint _dimension , int _id)
{
// Get the new object
......
......@@ -148,7 +148,7 @@ class TextureControlPlugin : public QObject, BaseInterface, BackupInterface, Tex
public :
/// Constructor
TextureControlPlugin() {};
TextureControlPlugin();
/// Destructor
~TextureControlPlugin() {delete(settingsDialog_);};
......
......@@ -79,7 +79,7 @@ class Context {
void parse (QByteArray _xml);
/// Returns all available elements
const QVector<Element *>& elements () { return elements_; };
const QVector<Element *>& elements () const { return elements_; };
/// Returns all available elements for a given category
QVector<Element *> elements (QString _category);
......
......@@ -81,22 +81,22 @@ class Element {
QString name () const { return name_; };
/// Element category
const QString &category () { return category_; };
const QString &category () const { return category_; };
/// Short description
const QString &shortDescription () { return shortDesc_; };
const QString &shortDescription () const { return shortDesc_; };
/// Long description
const QString &longDescription () { return longDesc_; };
const QString &longDescription () const { return longDesc_; };
/// Inputs
const QVector<Input *> &inputs () { return inputs_; };
const QVector<Input *> &inputs () const { return inputs_; };
/// Outputs
const QVector<Output *> &outputs () { return outputs_; };
const QVector<Output *> &outputs () const { return outputs_; };
/// Functions
const QVector <Function*> &functions () { return functions_; };
const QVector <Function*> &functions () const { return functions_; };
/// Scenegraph input
Input *dataIn () { return dataIn_; };
......@@ -148,4 +148,4 @@ class Element {
}
//=============================================================================
#endif
\ No newline at end of file
#endif
......@@ -80,10 +80,10 @@ class Function {
QString name () const { return name_; };
/// Short description
const QString &shortDescription () { return shortDesc_; };
const QString &shortDescription () const { return shortDesc_; };
/// Long description
const QString &longDescription () { return longDesc_; };
const QString &longDescription () const { return longDesc_; };
/// Start element of this function
Element *start () const { return start_; };
......@@ -108,4 +108,4 @@ class Function {
}
//=============================================================================
#endif
\ No newline at end of file
#endif
......@@ -61,7 +61,7 @@ InOut::InOut (Element *_e) :
//------------------------------------------------------------------------------
/// Type
QString InOut::typeString ()
QString InOut::typeString () const
{
if (name_ == "data")
return "data";
......
......@@ -66,22 +66,22 @@ class InOut {
InOut (Element *_e);
/// Name
const QString &name () { return name_; };
const QString &name () const { return name_; };
/// Short description
const QString &shortDescription () { return shortDesc_; };
const QString &shortDescription () const { return shortDesc_; };
/// Long description
const QString &longDescription () { return longDesc_; };
const QString &longDescription () const { return longDesc_; };
/// Element of this input/output
const Element * element () { return element_; };
const Element * element () const { return element_; };
/// Parsed hints for this input/output type
QMap<QString, QString> hints () const { return hints_; };
/// Type
QString typeString ();
QString typeString () const;
friend class Context;
......
......@@ -86,7 +86,7 @@ class ElementInput : public ElementInOut {
void setValue (QString _value);
/// Returns value set by user
QString value () { return value_; };
QString value () const { return value_; };
/// Add connection
void addConnection (Connection *_conn);
......@@ -104,7 +104,7 @@ class ElementInput : public ElementInOut {
void setForceAsk (bool _set) { forceAsk_ = _set; };
/// Return "ForceAsk" flag
bool isForceAskSet () { return forceAsk_; };
bool isForceAskSet () const { return forceAsk_; };
/// VSI::Input state passthrough
unsigned int state ();
......
......@@ -76,7 +76,8 @@ namespace VSI {
/// Constructor
WayFind::WayFind(GraphicsScene *_scene) :
scene_ (_scene),
counter_ (0)
counter_ (0),
ll_(0)
{
}
......
......@@ -69,7 +69,7 @@ bool TreeItem::dataType(DataType _type) {
return true;
}
return ( dataType_ & _type);
return ( (dataType_ & _type) );
}
//--------------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment