Commit 20f9040b authored by Don Gagne's avatar Don Gagne

Fix possible ununitialized but used variables

parent 017e564a
...@@ -677,6 +677,9 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size) ...@@ -677,6 +677,9 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size)
int streampointer = 0; int streampointer = 0;
uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
int bufferlength = 0; int bufferlength = 0;
// Initialize drop count to 0 so it isn't referenced uninitialized when returned at the bottom of this function
comm.packet_rx_drop_count = 0;
// Output all bytes as hex digits // Output all bytes as hex digits
for (int i=0; i<size; i++) for (int i=0; i<size; i++)
......
...@@ -222,7 +222,7 @@ void FlightModeConfig::remoteControlChannelRawChanged(int chan, float val) ...@@ -222,7 +222,7 @@ void FlightModeConfig::remoteControlChannelRawChanged(int chan, float val)
if (chan == _modeSwitchRCChannel) if (chan == _modeSwitchRCChannel)
{ {
qDebug() << chan << val; qDebug() << chan << val;
size_t highlightIndex; size_t highlightIndex = _cModes; // initialize to unreachable index
for (size_t i=0; i<_cModes; i++) { for (size_t i=0; i<_cModes; i++) {
if (val < _rgModePWMBoundary[i]) { if (val < _rgModePWMBoundary[i]) {
......
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