fix more warnings; add to CI; suppress some warnings

This commit is contained in:
Mike Kinney
2022-01-24 19:58:07 +00:00
parent 7c362af3de
commit 6883bc7afc
14 changed files with 51 additions and 27 deletions

View File

@@ -63,7 +63,6 @@ static void lsIdle()
// DEBUG_MSG("lsIdle begin ls_secs=%u\n", getPref_ls_secs());
#ifndef NO_ESP32
esp_sleep_source_t wakeCause2 = ESP_SLEEP_WAKEUP_UNDEFINED;
// Do we have more sleeping to do?
if (secsSlept < getPref_ls_secs()) {
@@ -73,7 +72,7 @@ static void lsIdle()
// If some other service would stall sleep, don't let sleep happen yet
if (doPreflightSleep()) {
setLed(false); // Never leave led on while in light sleep
wakeCause2 = doLightSleep(sleepTime * 1000LL);
esp_sleep_source_t wakeCause2 = doLightSleep(sleepTime * 1000LL);
switch (wakeCause2) {
case ESP_SLEEP_WAKEUP_TIMER:

View File

@@ -37,6 +37,6 @@ void *operator new(size_t size, SimpleAllocator &p);
*/
class AllocatorScope {
public:
AllocatorScope(SimpleAllocator &a);
explicit AllocatorScope(SimpleAllocator &a);
~AllocatorScope();
};

View File

@@ -99,7 +99,7 @@ template <class T> class MemoryPool : public Allocator<T>
~MemoryPool() { delete[] buf; }
/// Return a buffer for use by others
virtual void release(T *p)
void release(T *p)
{
assert(p >= buf &&
(size_t)(p - buf) <

View File

@@ -58,7 +58,7 @@ class PhoneAPI
// Call this when the client drops the connection, resets the state to STATE_SEND_NOTHING
// Unregisters our observer. A closed connection **can** be reopened by calling init again.
virtual void close();
void close();
/**
* Handle a ToRadio protobuf

View File

@@ -36,7 +36,7 @@ class HttpAPI : public PhoneAPI
protected:
/// Check the current underlying physical link to see if the client is currently connected
virtual bool checkIsConnected() { return true; } // FIXME, be smarter about this
virtual bool checkIsConnected() override { return true; } // FIXME, be smarter about this
};

View File

@@ -18,7 +18,7 @@ class WiFiServerAPI : public StreamAPI
virtual ~WiFiServerAPI();
/// override close to also shutdown the TCP link
virtual void close() override;
virtual void close();
protected:
/// We override this method to prevent publishing EVENT_SERIAL_CONNECTED/DISCONNECTED for wifi links (we want the board to

View File

@@ -10,10 +10,10 @@ protected:
/**
* Subclasses can use this as a hook to provide custom notifications for their transport (i.e. bluetooth notifies)
*/
virtual void onNowHasData(uint32_t fromRadioNum);
virtual void onNowHasData(uint32_t fromRadioNum) override;
/// Check the current underlying physical link to see if the client is currently connected
virtual bool checkIsConnected();
virtual bool checkIsConnected() override;
};
extern PhoneAPI *bluetoothPhoneAPI;
extern PhoneAPI *bluetoothPhoneAPI;

View File

@@ -87,8 +87,8 @@ int32_t RangeTestPlugin::runOnce()
DEBUG_MSG("Range Test Plugin - Disabled\n");
}
return (INT32_MAX);
#endif
return (INT32_MAX);
}
MeshPacket *RangeTestPluginRadio::allocReply()

View File

@@ -267,9 +267,10 @@ ProcessMessage StoreForwardPlugin::handleReceived(const MeshPacket &mp)
}
} else if ((p.payload.bytes[0] == 'S') && (p.payload.bytes[1] == 'F') && (p.payload.bytes[2] == 'm') &&
(p.payload.bytes[3] == 0x00)) {
strcpy(this->routerMessage, "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
"01234567890123456789012345678901234567890123456789012345678901234567890123456789"
"01234567890123456789012345678901234567890123456789012345678901234567890123456");
strlcpy(this->routerMessage, "01234567890123456789012345678901234567890123456789012345678901234567890123456789"
"01234567890123456789012345678901234567890123456789012345678901234567890123456789"
"01234567890123456789012345678901234567890123456789012345678901234567890123456",
sizeof(this->routerMessage));
storeForwardPlugin->sendMessage(getFrom(&mp), this->routerMessage);
} else {

View File

@@ -22,16 +22,16 @@ class StoreForwardPlugin : public SinglePortPlugin, private concurrency::OSThrea
{
// bool firstTime = 1;
bool busy = 0;
uint32_t busyTo;
char routerMessage[Constants_DATA_PAYLOAD_LEN];
uint32_t busyTo = 0;
char routerMessage[Constants_DATA_PAYLOAD_LEN] = {0};
uint32_t receivedRecord[50][2] = {{0}};
PacketHistoryStruct *packetHistory;
PacketHistoryStruct *packetHistory = 0;
uint32_t packetHistoryCurrent = 0;
PacketHistoryStruct *packetHistoryTXQueue;
uint32_t packetHistoryTXQueue_size;
PacketHistoryStruct *packetHistoryTXQueue = 0;
uint32_t packetHistoryTXQueue_size = 0;
uint32_t packetHistoryTXQueue_index = 0;
uint32_t packetTimeMax = 2000;