Add compiler flags '-Wall -Wextra -Wpedantic'

Fix warnings as a result.

Signed-off-by: Jacob Perron <jacobmperron@gmail.com>
This commit is contained in:
Jacob Perron 2019-08-30 00:53:13 -07:00 committed by Jacob Perron
parent c1c0ce6ea9
commit dce7336bbe
7 changed files with 25 additions and 30 deletions

View file

@ -10,19 +10,13 @@ namespace create {
bool SerialStream::startSensorStream() {
// Request from Create that we want a stream containing all packets
uint8_t numPackets = data->getNumPackets();
const uint8_t numPackets = data->getNumPackets();
std::vector<uint8_t> packetIDs = data->getPacketIDs();
uint8_t streamReq[2 + numPackets];
streamReq[0] = OC_STREAM;
streamReq[1] = numPackets;
int i = 2;
for (std::vector<uint8_t>::iterator it = packetIDs.begin(); it != packetIDs.end(); ++it) {
streamReq[i] = *it;
i++;
}
packetIDs.insert(packetIDs.begin(), numPackets);
packetIDs.insert(packetIDs.begin(), OC_STREAM);
// Start streaming data
send(streamReq, 2 + numPackets);
send(packetIDs.data(), packetIDs.size());
expectedNumBytes = data->getTotalDataBytes() + numPackets;