Browse Source

Fix possible ununitialized but used variables

QGC4.4
Don Gagne 11 years ago
parent
commit
20f9040b42
  1. 3
      src/comm/MAVLinkSimulationLink.cc
  2. 2
      src/ui/configuration/FlightModeConfig.cc

3
src/comm/MAVLinkSimulationLink.cc

@ -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;
uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
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
for (int i=0; i<size; i++)

2
src/ui/configuration/FlightModeConfig.cc

@ -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)
{
qDebug() << chan << val;
size_t highlightIndex;
size_t highlightIndex = _cModes; // initialize to unreachable index
for (size_t i=0; i<_cModes; i++) {
if (val < _rgModePWMBoundary[i]) {

Loading…
Cancel
Save