mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-09 11:27:29 +00:00
more warning fixes
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -13,7 +13,7 @@ class WiFiServerAPI : public StreamAPI
|
||||
WiFiClient client;
|
||||
|
||||
public:
|
||||
WiFiServerAPI(WiFiClient &_client);
|
||||
explicit WiFiServerAPI(WiFiClient &_client);
|
||||
|
||||
virtual ~WiFiServerAPI();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user