more warning fixes

This commit is contained in:
Mike Kinney
2022-01-24 18:39:17 +00:00
parent caaa235c5d
commit 7c362af3de
27 changed files with 74 additions and 69 deletions

View File

@@ -102,7 +102,7 @@ void Channels::initDefaultChannel(ChannelIndex chIndex)
CryptoKey Channels::getKey(ChannelIndex chIndex)
{
Channel &ch = getByIndex(chIndex);
ChannelSettings &channelSettings = ch.settings;
const ChannelSettings &channelSettings = ch.settings;
assert(ch.has_settings);
CryptoKey k;
@@ -206,7 +206,7 @@ void Channels::setChannel(const Channel &c)
const char *Channels::getName(size_t chIndex)
{
// Convert the short "" representation for Default into a usable string
ChannelSettings &channelSettings = getByIndex(chIndex).settings;
const ChannelSettings &channelSettings = getByIndex(chIndex).settings;
const char *channelName = channelSettings.name;
if (!*channelName) { // emptystring
// Per mesh.proto spec, if bandwidth is specified we must ignore modemConfig enum, we assume that in that case

View File

@@ -26,9 +26,12 @@ class Channels
ChannelIndex activeChannelIndex = 0;
/// the precomputed hashes for each of our channels, or -1 for invalid
int16_t hashes[MAX_NUM_CHANNELS];
int16_t hashes[MAX_NUM_CHANNELS] = {};
public:
Channels() {}
/// Well known channel names
static const char *adminChannel, *gpioChannel, *serialChannel;
@@ -134,4 +137,4 @@ class Channels
};
/// Singleton channel table
extern Channels channels;
extern Channels channels;

View File

@@ -18,7 +18,7 @@ class MeshPacketQueue
bool replaceLowerPriorityPacket(MeshPacket *mp);
public:
MeshPacketQueue(size_t _maxLen);
explicit MeshPacketQueue(size_t _maxLen);
/** enqueue a packet, return false if full */
bool enqueue(MeshPacket *p);
@@ -30,4 +30,4 @@ class MeshPacketQueue
/** Attempt to find and remove a packet from this queue. Returns the packet which was removed from the queue */
MeshPacket *remove(NodeNum from, PacketId id);
};
};

View File

@@ -16,7 +16,7 @@ class RadioLibRF95: public SX1278 {
\param mod Instance of Module that will be used to communicate with the %LoRa chip.
*/
RadioLibRF95(Module* mod);
explicit RadioLibRF95(Module* mod);
// basic methods

View File

@@ -13,7 +13,7 @@ struct GlobalPacketId {
bool operator==(const GlobalPacketId &p) const { return node == p.node && id == p.id; }
GlobalPacketId(const MeshPacket *p)
explicit GlobalPacketId(const MeshPacket *p)
{
node = getFrom(p);
id = p->id;
@@ -45,7 +45,7 @@ struct PendingPacket {
bool wantRoute = false;
PendingPacket() {}
PendingPacket(MeshPacket *p);
explicit PendingPacket(MeshPacket *p);
};
class GlobalPacketIdHashFunction

View File

@@ -19,9 +19,8 @@ template <class T> class TypedQueue
concurrency::OSThread *reader = NULL;
public:
explicit TypedQueue(int maxElements)
explicit TypedQueue(int maxElements) : h(xQueueCreate(maxElements, sizeof(T)))
{
h = xQueueCreate(maxElements, sizeof(T));
assert(h);
}

View File

@@ -130,8 +130,8 @@ static void taskCreateCert(void *parameter)
void createSSLCert()
{
bool runLoop = false;
if (isWifiAvailable() && !isCertReady) {
bool runLoop = false;
// Create a new process just to handle creating the cert.
// This is a workaround for Bug: https://github.com/fhessel/esp32_https_server/issues/48

View File

@@ -13,7 +13,7 @@ class WiFiServerAPI : public StreamAPI
WiFiClient client;
public:
WiFiServerAPI(WiFiClient &_client);
explicit WiFiServerAPI(WiFiClient &_client);
virtual ~WiFiServerAPI();