Skip to content

Commit 3a1d249

Browse files
committed
fix cppcheck warnings
1 parent c72f6d3 commit 3a1d249

File tree

78 files changed

+189
-132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+189
-132
lines changed

src/BaseClasses/ANT_BaseAnt.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ void BaseAnt::getResponse(AntResponse &response) {
1515
response.setFrameData(_response.getFrameData());
1616
}
1717

18+
// cppcheck-suppress unusedFunction
1819
void BaseAnt::readPacketUntilAvailable() {
1920
while (!(getResponse().isAvailable() || getResponse().isError())) {
2021
// read some more

src/BaseClasses/ANT_BaseAntWithCallbacks.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <BaseClasses/ANT_BaseAntWithCallbacks.h>
22

3+
// cppcheck-suppress unusedFunction
34
void BaseAntWithCallbacks::loop() {
45
if (loopTop())
56
loopBottom();

src/BaseClasses/ANT_BaseSpiAnt.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ void BaseSpiAnt<S, I, O>::send(AntRequest &request) {
145145
}
146146

147147
template<class S, class I, class O>
148+
// cppcheck-suppress unusedFunction
148149
void BaseSpiAnt<S, I, O>::resetRadio() {
149150
setHostMsgReady(1);
150151
setHostSRdy(1);

src/RX/ANT_AntResponse.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ void AntResponse::setChecksum(uint8_t checksum) {
3232
_checksum = checksum;
3333
}
3434

35+
// cppcheck-suppress unusedFunction
3536
uint8_t AntResponse::getPacketLength() {
3637
return _length - ANT_MSG_OVERHEAD_LENGTH;
3738
}

src/RX/ANT_AntRxDataResponse.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ uint8_t* AntRxDataResponse::getData() {
1414
return getFrameData();
1515
}
1616

17+
// cppcheck-suppress unusedFunction
1718
uint8_t AntRxDataResponse::getDataOffset() {
1819
return ANT_MSG_FRONT_OVERHEAD;
1920
}
2021

22+
// cppcheck-suppress unusedFunction
2123
uint16_t AntRxDataResponse::getDeviceNumber() {
2224
if (getFlagByte() & LIB_CONFIG_CHANNEL_ID) {
2325
return AntRxDataResponse::getData(EXTENDEDDATA_DEVICENUMBER_LSB_BYTE) | (AntRxDataResponse::getData(EXTENDEDDATA_DEVICENUMBER_MSB_BYTE) << EXTENDEDDATA_DEVICENUMBER_MSB_SHIFT);
@@ -26,6 +28,7 @@ uint16_t AntRxDataResponse::getDeviceNumber() {
2628
}
2729
}
2830

31+
// cppcheck-suppress unusedFunction
2932
uint8_t AntRxDataResponse::getDeviceType() {
3033
if (getFlagByte() & LIB_CONFIG_CHANNEL_ID) {
3134
return AntRxDataResponse::getData(EXTENDEDDATA_DEVICETYPE_BYTE);
@@ -34,6 +37,7 @@ uint8_t AntRxDataResponse::getDeviceType() {
3437
}
3538
}
3639

40+
// cppcheck-suppress unusedFunction
3741
uint8_t AntRxDataResponse::getTransmissionType() {
3842
if (getFlagByte() & LIB_CONFIG_CHANNEL_ID) {
3943
return AntRxDataResponse::getData(EXTENDEDDATA_TRANSMISSIONTYPE_BYTE);
@@ -42,6 +46,7 @@ uint8_t AntRxDataResponse::getTransmissionType() {
4246
}
4347
}
4448

49+
// cppcheck-suppress unusedFunction
4550
uint8_t AntRxDataResponse::getMeasurementType() {
4651
if (getFlagByte() & LIB_CONFIG_RSSI) {
4752
uint8_t offset = 0;
@@ -54,6 +59,7 @@ uint8_t AntRxDataResponse::getMeasurementType() {
5459
}
5560
}
5661

62+
// cppcheck-suppress unusedFunction
5763
int8_t AntRxDataResponse::getRSSIValue() {
5864
if (getFlagByte() & LIB_CONFIG_RSSI) {
5965
uint8_t offset = 0;
@@ -66,6 +72,7 @@ int8_t AntRxDataResponse::getRSSIValue() {
6672
}
6773
}
6874

75+
// cppcheck-suppress unusedFunction
6976
int8_t AntRxDataResponse::getThresholdConfigurationValue() {
7077
if (getFlagByte() & LIB_CONFIG_RSSI) {
7178
uint8_t offset = 0;
@@ -78,6 +85,7 @@ int8_t AntRxDataResponse::getThresholdConfigurationValue() {
7885
}
7986
}
8087

88+
// cppcheck-suppress unusedFunction
8189
uint16_t AntRxDataResponse::getRxTimestamp() {
8290
if (getFlagByte() & LIB_CONFIG_RX_TIMESTAMP) {
8391
uint8_t offset = 0;

src/RX/Data/ANT_AcknowledgedData.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ AcknowledgedData::AcknowledgedData() : AntRxDataResponse() {
66

77
}
88

9+
// cppcheck-suppress unusedFunction
910
uint8_t AcknowledgedData::getChannelNumber() {
1011
return AntRxDataResponse::getData(0);
1112
}

src/RX/Data/ANT_AdvancedBurstData.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ uint8_t AdvancedBurstData::getChannelNumber() {
1010
return AntRxDataResponse::getData(0) & ADVANCED_BURST_DATA_CHANNEL_MASK;
1111
}
1212

13+
// cppcheck-suppress unusedFunction
1314
uint8_t AdvancedBurstData::getSequenceNumber() {
1415
return (AntRxDataResponse::getData(0) & ~ADVANCED_BURST_DATA_CHANNEL_MASK) >> ADVANCED_BURST_DATA_SEQUENCENUMBER_SHIFT;
1516
}
1617

17-
1818
uint8_t AdvancedBurstData::getData(uint8_t index) {
1919
// skip channel byte
2020
return AntRxDataResponse::getData(index + 1);

src/RX/Data/ANT_BroadcastData.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
#include <ANT_private_defines.h>
44

5-
BroadcastData::BroadcastData() : AntRxDataResponse() {
6-
7-
}
5+
BroadcastData::BroadcastData() : AntRxDataResponse() {}
86

97
uint8_t BroadcastData::getChannelNumber() {
108
return AntRxDataResponse::getData(0);

src/RX/Status/ANT_AdvancedBurstCapabilitiesConfiguration.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ AdvancedBurstCapabilitiesConfiguration::AdvancedBurstCapabilitiesConfiguration()
44

55
}
66

7+
// cppcheck-suppress unusedFunction
78
uint8_t AdvancedBurstCapabilitiesConfiguration::getMsgType() {
89
return getFrameData()[0];
910
}
1011

12+
// cppcheck-suppress unusedFunction
1113
uint8_t AdvancedBurstCapabilitiesConfiguration::getSupportedMaxPacketLength() {
1214
return getFrameData()[1];
1315
}
1416

17+
// cppcheck-suppress unusedFunction
1518
uint32_t AdvancedBurstCapabilitiesConfiguration::getSupportedFeatures() {
1619
uint8_t* frame = getFrameData();
1720
return ( frame[2] ) + ( frame[3] << BITS_IN_BYTE ) + ( frame[4] << BITS_IN_SHORT );
@@ -21,17 +24,20 @@ uint8_t AdvancedBurstCapabilitiesConfiguration::enable() {
2124
return getFrameData()[1];
2225
}
2326

27+
// cppcheck-suppress unusedFunction
2428
uint8_t AdvancedBurstCapabilitiesConfiguration::getMaxPacketLength() {
2529
return getFrameData()[2];
2630
}
2731

32+
// cppcheck-suppress unusedFunction
2833
uint32_t AdvancedBurstCapabilitiesConfiguration::getRequiredFeatures() {
2934
uint32_t features = getFrameData()[3];
3035
features |= getFrameData()[4] << BITS_IN_BYTE;
3136
features |= getFrameData()[5] << BITS_IN_SHORT;
3237
return features;
3338
}
3439

40+
// cppcheck-suppress unusedFunction
3541
uint32_t AdvancedBurstCapabilitiesConfiguration::getOptionalFeatures() {
3642
uint32_t features = getFrameData()[6];
3743
features |= getFrameData()[7] << BITS_IN_BYTE;

src/RX/Status/ANT_AntVersion.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#include <RX/Status/ANT_AntVersion.h>
22

3-
AntVersion::AntVersion() : AntResponse() {
4-
5-
}
3+
AntVersion::AntVersion() : AntResponse() {}
64

5+
// cppcheck-suppress unusedFunction
76
uint8_t AntVersion::getVersionByte(uint8_t pos) {
87
return getFrameData()[pos];
98
}

src/RX/Status/ANT_Capabilities.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
#include <RX/Status/ANT_Capabilities.h>
22

3-
Capabilities::Capabilities() : AntResponse() {
4-
5-
}
3+
Capabilities::Capabilities() : AntResponse() {}
64

5+
// cppcheck-suppress unusedFunction
76
uint8_t Capabilities::getMaxChannels() {
87
return getFrameData()[0];
98
}
109

10+
// cppcheck-suppress unusedFunction
1111
uint8_t Capabilities::getMaxNetworks() {
1212
return getFrameData()[1];
1313
}
1414

15+
// cppcheck-suppress unusedFunction
1516
uint8_t Capabilities::getStandardOptions() {
1617
return getFrameData()[2];
1718
}
1819

20+
// cppcheck-suppress unusedFunction
1921
uint8_t Capabilities::getAdvancedOptions(uint8_t pos) {
2022
if ( pos == 0 )
2123
{
@@ -35,6 +37,7 @@ uint8_t Capabilities::getAdvancedOptions(uint8_t pos) {
3537
}
3638
}
3739

40+
// cppcheck-suppress unusedFunction
3841
uint8_t Capabilities::getMaxSensRcoreChannels() {
3942
return getFrameData()[5];
4043
}

src/RX/Status/ANT_ChannelEventResponse.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ uint8_t ChannelEventResponse::getCode() {
1616
return getFrameData()[2];
1717
}
1818

19+
// cppcheck-suppress unusedFunction
1920
uint8_t ChannelEventResponse::getExtendedEventParameters() {
2021
if (getLength() > 3){
2122
return getFrameData()[3];

src/RX/Status/ANT_ChannelStatus.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@ uint8_t ChannelStatus::getChannelNumber() {
1010
return getFrameData()[0];
1111
}
1212

13+
// cppcheck-suppress unusedFunction
1314
uint8_t ChannelStatus::getChannelState() {
1415
return getFrameData()[1] & CHANNEL_STATUS_STATE_MASK;
1516
}
1617

18+
// cppcheck-suppress unusedFunction
1719
uint8_t ChannelStatus::getNetworkNumber() {
1820
return ( getFrameData()[1] >> CHANNEL_STATUS_NETWORK_NUMBER_SHIFT ) & CHANNEL_STATUS_NETWORK_NUMBER_MASK;
1921
}
2022

23+
// cppcheck-suppress unusedFunction
2124
uint8_t ChannelStatus::getChannelType() {
2225
return getFrameData()[1] >> CHANNEL_STATUS_CHANNEL_TYPE_SHIFT;
2326
}

src/RX/Status/ANT_EncryptionModeParameters.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ EncryptionModeParameters::EncryptionModeParameters() : AntResponse() {
44

55
}
66

7+
// cppcheck-suppress unusedFunction
78
uint8_t EncryptionModeParameters::getRequestedModeParameter() {
89
return getFrameData()[0];
910
}
1011

12+
// cppcheck-suppress unusedFunction
1113
uint8_t EncryptionModeParameters::getMaxSupportedEncryptionMode() {
1214
return getFrameData()[1];
1315
}
1416

17+
// cppcheck-suppress unusedFunction
1518
uint32_t EncryptionModeParameters::getUniqueIdentifier() {
1619
uint32_t identifier = getFrameData()[1];
1720
identifier |= getFrameData()[2] << BITS_IN_BYTE;
@@ -20,6 +23,7 @@ uint32_t EncryptionModeParameters::getUniqueIdentifier() {
2023
return identifier;
2124
}
2225

26+
// cppcheck-suppress unusedFunction
2327
char* EncryptionModeParameters::getUserInformationString() {
2428
return (char*)(getFrameData() + 1); // skip mode parameter
2529
}

src/RX/Status/ANT_EventFilter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ uint8_t EventFilter::getChannelNumber() {
88
return getFrameData()[0];
99
}
1010

11+
// cppcheck-suppress unusedFunction
1112
uint16_t EventFilter::getEventFilter() {
1213
uint16_t filter = getFrameData()[1];
1314
filter |= getFrameData()[2] << 8;

src/RX/Status/ANT_SelectiveDataUpdateMaskSetting.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ SelectiveDataUpdateMaskSetting::SelectiveDataUpdateMaskSetting() : AntResponse()
44

55
}
66

7+
// cppcheck-suppress unusedFunction
78
uint8_t SelectiveDataUpdateMaskSetting::getSDUMaskNumber() {
89
return getFrameData()[0];
910
}
1011

12+
// cppcheck-suppress unusedFunction
1113
uint8_t* SelectiveDataUpdateMaskSetting::getSDUMask() {
1214
return getFrameData() + 1;
1315
}

src/RX/Status/ANT_StartUpMessage.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ StartUpMessage::StartUpMessage() : AntResponse() {
44

55
}
66

7+
// cppcheck-suppress unusedFunction
78
uint8_t StartUpMessage::getMessage() {
89
return getFrameData()[0];
910
}

src/TX/ANT_AntTxDataRequest.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
AntTxDataRequest::AntTxDataRequest(uint8_t msgId) : AntRequest(msgId) {}
44

5+
// cppcheck-suppress unusedFunction
56
void AntTxDataRequest::setDataBuffer(uint8_t* dataPtr) {
67
_data = dataPtr;
78
}
@@ -14,6 +15,7 @@ void AntTxDataRequest::setDataLength(uint8_t length) {
1415
_dataLength = length;
1516
}
1617

18+
// cppcheck-suppress unusedFunction
1719
uint8_t AntTxDataRequest::getDataBufferLength() {
1820
return _dataLength;
1921
}

src/TX/Config/ANT_AddChannelIdToList.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,27 @@ void AddChannelIdToList::setListIndex(uint8_t listIndex) {
3535
_listIndex = listIndex;
3636
}
3737

38+
// cppcheck-suppress unusedFunction
3839
uint8_t AddChannelIdToList::getChannel() {
3940
return _channel;
4041
}
4142

43+
// cppcheck-suppress unusedFunction
4244
uint16_t AddChannelIdToList::getDeviceNumber() {
4345
return _deviceNumber;
4446
}
4547

48+
// cppcheck-suppress unusedFunction
4649
uint8_t AddChannelIdToList::getDeviceType() {
4750
return _deviceType;
4851
}
4952

53+
// cppcheck-suppress unusedFunction
5054
uint8_t AddChannelIdToList::getTransmissionType() {
5155
return _transmissionType;
5256
}
5357

58+
// cppcheck-suppress unusedFunction
5459
uint8_t AddChannelIdToList::getListIndex() {
5560
return _listIndex;
5661
}

src/TX/Config/ANT_AddEncryptionIdToList.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ uint8_t AddEncryptionIdToList::getChannel() {
2828
return _channel;
2929
}
3030

31+
// cppcheck-suppress unusedFunction
3132
uint32_t AddEncryptionIdToList::getEncryptionId() {
3233
return _encryptionId;
3334
}

src/TX/Config/ANT_AssignChannel.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ void AssignChannel::setChannelNetwork(uint8_t network) {
2525
_network = network;
2626
}
2727

28+
// cppcheck-suppress unusedFunction
2829
void AssignChannel::setExtendedAssignment(uint8_t extended) {
2930
_extended = extended;
3031
}
@@ -37,10 +38,12 @@ uint8_t AssignChannel::getChannelType() {
3738
return _channelType;
3839
}
3940

41+
// cppcheck-suppress unusedFunction
4042
uint8_t AssignChannel::getChannelNetwork() {
4143
return _network;
4244
}
4345

46+
// cppcheck-suppress unusedFunction
4447
uint8_t AssignChannel::getExtendedAssignment() {
4548
return _extended;
4649
}

src/TX/Config/ANT_ChannelId.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ uint8_t ChannelId::getTransmissionType() {
5757
return _transmissionType;
5858
}
5959

60+
// cppcheck-suppress unusedFunction
6061
bool ChannelId::getPairingBit() {
6162
return _pairingBit;
6263
}

src/TX/Config/ANT_ChannelPeriod.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ uint8_t ChannelPeriod::getChannel() {
2424
return _channel;
2525
}
2626

27+
// cppcheck-suppress unusedFunction
2728
uint16_t ChannelPeriod::getPeriod() {
2829
return _period;
2930
}

src/TX/Config/ANT_ChannelRfFrequency.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ uint8_t ChannelRfFrequency::getChannel() {
2424
return _channel;
2525
}
2626

27+
// cppcheck-suppress unusedFunction
2728
uint8_t ChannelRfFrequency::getRfFrequency() {
2829
return _frequency;
2930
}

src/TX/Config/ANT_ChannelSearchPriority.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ uint8_t ChannelSearchPriority::getChannel() {
2323
return _channel;
2424
}
2525

26+
// cppcheck-suppress unusedFunction
2627
uint8_t ChannelSearchPriority::getPriority() {
2728
return _priority;
2829
}

0 commit comments

Comments
 (0)