Commit 68dedca4 authored by Jan Möbius's avatar Jan Möbius

Fixed cppcheck warnings

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13299 383ad7c9-94d9-4d36-a494-682f7c89f535
parent bea0a2ac
......@@ -310,7 +310,7 @@ bool LicenseManager::authenticate() {
processor = QString(pCPU);
// free memory
delete pCPU;
free(pCPU);
#else
QFile cpuinfo("/proc/cpuinfo");
......
......@@ -73,6 +73,7 @@ namespace Viewer {
animation_(false),
glState_(0),
objectMarker_(0),
currentViewingDirection_(0),
rotationLocked_(false),
orthoWidth_(2.0),
nearPlane_(0.01),
......
......@@ -49,6 +49,7 @@
TreeItemObjectSelection::TreeItemObjectSelection(int _id, QString _name, DataType _type, TreeItemObjectSelection* _parent) :
id_(_id),
dataType_(_type),
visible_(true),
name_(_name),
parentItem_(_parent)
{
......
......@@ -226,7 +226,7 @@ void CoreWidget::showAboutWidget( ) {
aboutWidget_->OpenFlipperAbout->append(tr("CPU Brand:\t\t ") + QString(pCPU) );
// free memory
delete pCPU;
free(pCPU);
int physicalCPUS = 0;
......@@ -337,7 +337,7 @@ void CoreWidget::showAboutWidget( ) {
aboutWidget_->OpenFlipperAbout->append(tr("OS Version:\t\t ") + QString(p) );
delete(p);
free(p);
#else
QFile versionInfo("/proc/version");
......@@ -525,7 +525,7 @@ void CoreWidget::showAboutWidget( ) {
types += typeName( currentType ) + "\t\t typeId: " + QString::number(currentType.value()) + "\n";
// Advance to next type ( Indices are bits so multiply by to to get next bit)
currentType++;
++currentType;
}
aboutWidget_->OpenFlipperAbout->append( types );
......
......@@ -121,7 +121,7 @@ void CoreWidget::slotContextHomeView() {
void CoreWidget::slotSwitchWheels(bool _state) {
std::vector< glViewer* >::iterator it = examiner_widgets_.begin();
for(; it != examiner_widgets_.end(); it++)
for(; it != examiner_widgets_.end(); ++it)
_state ? (*it)->slotShowWheels() : (*it)->slotHideWheels();
}
......@@ -129,7 +129,7 @@ void CoreWidget::slotSwitchWheels(bool _state) {
void CoreWidget::slotSwitchNavigation(bool _egomode) {
std::vector< glViewer* >::iterator it = examiner_widgets_.begin();
for(; it != examiner_widgets_.end(); it++) {
for(; it != examiner_widgets_.end(); ++it) {
_egomode ? (*it)->navigationMode(glViewer::FIRSTPERSON_NAVIGATION) :
(*it)->navigationMode(glViewer::NORMAL_NAVIGATION);
}
......
......@@ -69,6 +69,8 @@ CursorPainter::CursorPainter (QObject *_parent) :
enabled_(false),
mouseIn_(false),
forceNative_(false),
xOff_(0),
yOff_(0),
texture_(0),
hasCursor_(false)
{
......
......@@ -1678,7 +1678,6 @@ void glViewer::handleNormalNavigation( QMouseEvent* _event ) {
if (_event->buttons() & (Qt::LeftButton | Qt::MidButton)) {
QPoint newPoint2D = pos;
double value_x, value_y;
ACG::Vec3d newPoint3D;
bool newPoint_hitSphere = mapToSphere(newPoint2D, newPoint3D);
......@@ -1689,7 +1688,7 @@ void glViewer::handleNormalNavigation( QMouseEvent* _event ) {
if ((_event->buttons() & Qt::LeftButton) && (_event->buttons() & Qt::MidButton)) {
switch (projectionMode()) {
case PERSPECTIVE_PROJECTION: {
value_y = properties_.sceneRadius() * ((newPoint2D.y() - lastPoint2D_.y())) * 3.0 / (double) glHeight();
double value_y = properties_.sceneRadius() * ((newPoint2D.y() - lastPoint2D_.y())) * 3.0 / (double) glHeight();
translate(ACG::Vec3d(0.0, 0.0, value_y * factor));
updateGL();
emit viewChanged();
......@@ -1697,7 +1696,7 @@ void glViewer::handleNormalNavigation( QMouseEvent* _event ) {
}
case ORTHOGRAPHIC_PROJECTION: {
value_y = ((newPoint2D.y() - lastPoint2D_.y())) * properties_.orthoWidth() / (double) glHeight();
double value_y = ((newPoint2D.y() - lastPoint2D_.y())) * properties_.orthoWidth() / (double) glHeight();
properties_.orthoWidth( properties_.orthoWidth() - value_y * factor );
updateProjectionMatrix();
updateGL();
......@@ -1715,6 +1714,7 @@ 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 ) {
......
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