supress cppcheck false warnings
This commit is contained in:
parent
55213b9e87
commit
ecac0a3d81
@ -25,7 +25,7 @@ struct PollinSwitch : Switch {
|
|||||||
: Switch(nullptr, [group, channel]{
|
: Switch(nullptr, [group, channel]{
|
||||||
// copy id from string into a new pointer, to avoid memory leaks
|
// copy id from string into a new pointer, to avoid memory leaks
|
||||||
return (new string{Protocol_1::buildId(group, channel)})->c_str();
|
return (new string{Protocol_1::buildId(group, channel)})->c_str();
|
||||||
}()), group(group), channel(channel) {
|
}()), group(group), channel(channel) { // cppcheck-suppress [selfInitialization]
|
||||||
if (!name) name = (new string{string(man).append(" ").append(id)})->c_str();
|
if (!name) name = (new string{string(man).append(" ").append(id)})->c_str();
|
||||||
mainDevice = &DeviceConfig::create(id).withName(name).withManufacturer(man).withArea(area).withParent(gatewayDevice);
|
mainDevice = &DeviceConfig::create(id).withName(name).withManufacturer(man).withArea(area).withParent(gatewayDevice);
|
||||||
withStateTopic();
|
withStateTopic();
|
||||||
@ -41,8 +41,8 @@ struct PollinSwitch : Switch {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct EasyHomeSwitch : Switch {
|
struct EasyHomeSwitch : Switch {
|
||||||
uint32_t on[8] = { 4326554, 4537114, 4767530, 4972714 };
|
uint32_t on[8] = { 4326554, 4537114, 4767530, 4972714, 0, 0, 0, 0 };
|
||||||
uint32_t off[8] = { 4483146, 4626810, 4661562, 4819642 };
|
uint32_t off[8] = { 4483146, 4626810, 4661562, 4819642, 0, 0, 0, 0 };
|
||||||
|
|
||||||
EasyHomeSwitch(const char remotePosition, uint32_t on[4], uint32_t off[4], const char* name = nullptr, const char* area = nullptr)
|
EasyHomeSwitch(const char remotePosition, uint32_t on[4], uint32_t off[4], const char* name = nullptr, const char* area = nullptr)
|
||||||
: Switch(nullptr, [remotePosition] {
|
: Switch(nullptr, [remotePosition] {
|
||||||
@ -50,8 +50,8 @@ struct EasyHomeSwitch : Switch {
|
|||||||
(*uId) += tolower(remotePosition);
|
(*uId) += tolower(remotePosition);
|
||||||
return uId->c_str();
|
return uId->c_str();
|
||||||
}()) {
|
}()) {
|
||||||
memcpy(&this->on[4], on, 4 * sizeof(uint32_t));
|
memcpy(&this->on[4], on, 4 * sizeof(uint32_t)); // cppcheck-suppress [overlappingWriteFunction]
|
||||||
memcpy(&this->off[4], off, 4 * sizeof(uint32_t));
|
memcpy(&this->off[4], off, 4 * sizeof(uint32_t)); // cppcheck-suppress [overlappingWriteFunction]
|
||||||
if (!name) {
|
if (!name) {
|
||||||
auto n = new string("Easy Home ");
|
auto n = new string("Easy Home ");
|
||||||
(*n) += remotePosition;
|
(*n) += remotePosition;
|
||||||
|
|||||||
@ -21,7 +21,7 @@ lib_deps =
|
|||||||
https://git.hodos.ro/libraries/serial-reader.git@^1.0.0
|
https://git.hodos.ro/libraries/serial-reader.git@^1.0.0
|
||||||
build_flags = -D DEBUG_RAW=0
|
build_flags = -D DEBUG_RAW=0
|
||||||
check_tool = cppcheck
|
check_tool = cppcheck
|
||||||
check_flags = --enable=all cppcheck: --suppress=*:*/.pio/*
|
check_flags = --enable=all cppcheck: --suppress=*:*/.pio/* --inline-suppr
|
||||||
check_skip_packages = yes
|
check_skip_packages = yes
|
||||||
|
|
||||||
[env:huzzah]
|
[env:huzzah]
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
#include <Arduino.h>
|
|
||||||
#include <RCSwitch.h>
|
#include <RCSwitch.h>
|
||||||
#include <SerialReader.h>
|
#include <SerialReader.h>
|
||||||
#include "pins.h"
|
#include "pins.h"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user