From 8fecd7bc0fe6774aad2dd456340ff78ec797ff5c Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Tue, 5 Aug 2014 00:50:50 -0700 Subject: [PATCH] Fixes for using unitialized variables reported by valgrind. --- src/comm/MAVLinkSimulationWaypointPlanner.cc | 2 ++ src/uas/UAS.cc | 4 ++-- src/ui/linechart/LinechartWidget.cc | 3 ++- src/ui/uas/UASQuickView.cc | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/comm/MAVLinkSimulationWaypointPlanner.cc b/src/comm/MAVLinkSimulationWaypointPlanner.cc index d85569741..448f49937 100644 --- a/src/comm/MAVLinkSimulationWaypointPlanner.cc +++ b/src/comm/MAVLinkSimulationWaypointPlanner.cc @@ -436,6 +436,8 @@ MAVLinkSimulationWaypointPlanner::MAVLinkSimulationWaypointPlanner(MAVLinkSimula link(parent), idle(false), current_active_wp_id(-1), + yawReached(false), + posReached(false), timestamp_lastoutside_orbit(0), timestamp_firstinside_orbit(0), waypoints(&waypoints1), diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 66d5725f7..83b1f6bf3 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -82,8 +82,8 @@ UAS::UAS(MAVLinkProtocol* protocol, QThread* thread, int id) : UASInterface(), lpVoltage(12.0f), currentCurrent(0.4f), batteryRemainingEstimateEnabled(false), - // chargeLevel not initialized - // timeRemaining not initialized + chargeLevel(-1), + timeRemaining(0), lowBattAlarm(false), startTime(QGC::groundTimeMilliseconds()), diff --git a/src/ui/linechart/LinechartWidget.cc b/src/ui/linechart/LinechartWidget.cc index 809c076b1..f630a3b13 100644 --- a/src/ui/linechart/LinechartWidget.cc +++ b/src/ui/linechart/LinechartWidget.cc @@ -72,7 +72,8 @@ LinechartWidget::LinechartWidget(int systemid, QWidget *parent) : QWidget(parent logging(false), logStartTime(0), updateTimer(new QTimer()), - selectedMAV(-1) + selectedMAV(-1), + lastTimestamp(0) { // Add elements defined in Qt Designer ui.setupUi(this); diff --git a/src/ui/uas/UASQuickView.cc b/src/ui/uas/UASQuickView.cc index 00183a96d..5f1d7891e 100644 --- a/src/ui/uas/UASQuickView.cc +++ b/src/ui/uas/UASQuickView.cc @@ -5,7 +5,8 @@ #include "UASQuickViewTextItem.h" #include #include -UASQuickView::UASQuickView(QWidget *parent) : QWidget(parent) +UASQuickView::UASQuickView(QWidget *parent) : QWidget(parent), + uas(NULL) { quickViewSelectDialog=0; m_columnCount=2; -- 2.22.0