From eb963583eeeff3aa8d9bd1a5ce814b58294af1c2 Mon Sep 17 00:00:00 2001 From: croghostrider Date: Mon, 25 Apr 2022 11:30:53 -0700 Subject: [PATCH] Fix last CodeFactor Style issues (#202) * fix malformed whitespace * fix trailing spaces fix trailing spaces --- .github/workflows/cmake-arm.yml | 8 ++++---- .github/workflows/cmake-native.yml | 6 +++--- .github/workflows/codeql-analysis.yml | 2 +- src/knx/application_layer.cpp | 2 +- src/knx/application_layer.h | 1 - src/knx/bau_systemB_coupler.cpp | 1 - src/knx/device_object.cpp | 1 - src/knx/dptconvert.cpp | 2 -- src/knx/interface_object.h | 1 - src/knx/knx_ip_frame.h | 3 --- src/knx/knx_value.h | 1 - src/knx/memory.cpp | 1 - src/knx/rf_physical_layer_cc1101.cpp | 2 -- src/knx/secure_application_layer.h | 3 --- src/knx/security_interface_object.cpp | 1 - src/knx/tpuart_data_link_layer.cpp | 1 - src/knx/transport_layer.cpp | 1 - src/knx/usb_tunnel_interface.cpp | 2 -- 18 files changed, 9 insertions(+), 30 deletions(-) diff --git a/.github/workflows/cmake-arm.yml b/.github/workflows/cmake-arm.yml index 4767ae3..59b6cd5 100644 --- a/.github/workflows/cmake-arm.yml +++ b/.github/workflows/cmake-arm.yml @@ -22,7 +22,7 @@ jobs: - name: Install bare metal ARM toolchain run: sudo apt-get install binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib - + - name: Show toolchain version run: arm-none-eabi-gcc --version @@ -36,8 +36,8 @@ jobs: # access regardless of the host operating system shell: bash working-directory: ${{runner.workspace}}/build - # Note the current convention is to use the -S and -B options here to specify source - # and build directories, but this is only available with CMake 3.13 and higher. + # Note the current convention is to use the -S and -B options here to specify source + # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE/examples/knx-cc1310 -DCMAKE_BUILD_TYPE=$BUILD_TYPE @@ -50,6 +50,6 @@ jobs: # - name: Test # working-directory: ${{runner.workspace}}/build # shell: bash - # Execute tests defined by the CMake configuration. + # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail # run: ctest -C $BUILD_TYPE diff --git a/.github/workflows/cmake-native.yml b/.github/workflows/cmake-native.yml index 5629c97..5e835d1 100644 --- a/.github/workflows/cmake-native.yml +++ b/.github/workflows/cmake-native.yml @@ -27,8 +27,8 @@ jobs: # access regardless of the host operating system shell: bash working-directory: ${{runner.workspace}}/build - # Note the current convention is to use the -S and -B options here to specify source - # and build directories, but this is only available with CMake 3.13 and higher. + # Note the current convention is to use the -S and -B options here to specify source + # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE @@ -41,6 +41,6 @@ jobs: # - name: Test # working-directory: ${{runner.workspace}}/build # shell: bash - # Execute tests defined by the CMake configuration. + # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail # run: ctest -C $BUILD_TYPE diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 43c3eb8..b7521a2 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -47,7 +47,7 @@ jobs: with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. + # By default, queries listed here will override any specified in a config file. # Prefix the list here with "+" to use these queries and those in the config file. # queries: ./path/to/local/query, your-org/your-repo/queries@main diff --git a/src/knx/application_layer.cpp b/src/knx/application_layer.cpp index 581f8bd..5e5f6b5 100644 --- a/src/knx/application_layer.cpp +++ b/src/knx/application_layer.cpp @@ -347,7 +347,7 @@ void ApplicationLayer::dataConnectedConfirm(uint16_t tsap) void ApplicationLayer::dataConnectedConfirm(uint16_t tsap, const SecurityControl& secCtrl) { - + //FIXME: implement dataConnectedConfirm DataSecurity } #pragma endregion void ApplicationLayer::groupValueReadRequest(AckType ack, uint16_t asap, Priority priority, HopCountType hopType, const SecurityControl& secCtrl) diff --git a/src/knx/application_layer.h b/src/knx/application_layer.h index c2d4578..327aed1 100644 --- a/src/knx/application_layer.h +++ b/src/knx/application_layer.h @@ -157,7 +157,6 @@ class ApplicationLayer #pragma endregion protected: - #pragma region hooks void dataGroupIndication(HopCountType hopType, Priority priority, uint16_t tsap, APDU& apdu, const SecurityControl &secCtrl); void dataGroupConfirm(AckType ack, HopCountType hopType, Priority priority, uint16_t tsap, diff --git a/src/knx/bau_systemB_coupler.cpp b/src/knx/bau_systemB_coupler.cpp index c649378..d9e92ce 100644 --- a/src/knx/bau_systemB_coupler.cpp +++ b/src/knx/bau_systemB_coupler.cpp @@ -21,7 +21,6 @@ BauSystemBCoupler::BauSystemBCoupler(Platform& platform) : #ifdef USE_DATASECURE _memory.addSaveRestore(&_secIfObj); #endif - } ApplicationLayer& BauSystemBCoupler::applicationLayer() diff --git a/src/knx/device_object.cpp b/src/knx/device_object.cpp index 91e88be..4c83211 100644 --- a/src/knx/device_object.cpp +++ b/src/knx/device_object.cpp @@ -91,7 +91,6 @@ DeviceObject::DeviceObject() #ifdef USE_RF new DataProperty(PID_RF_DOMAIN_ADDRESS_CEMI_SERVER, true, PDT_GENERIC_06, 1, ReadLv3 | WriteLv3), #endif - }; initializeProperties(sizeof(properties), properties); } diff --git a/src/knx/dptconvert.cpp b/src/knx/dptconvert.cpp index 6fc644f..424fa90 100644 --- a/src/knx/dptconvert.cpp +++ b/src/knx/dptconvert.cpp @@ -135,7 +135,6 @@ int KNX_Decode_Value(uint8_t* payload, size_t payload_length, const Dpt& datatyp int KNX_Encode_Value(const KNXValue& value, uint8_t* payload, size_t payload_length, const Dpt& datatype) { - if (datatype.mainGroup == 1 && datatype.subGroup >= 1 && datatype.subGroup <= 23 && datatype.subGroup != 20 && !datatype.index) return valueToBusValueBinary(value, payload, payload_length, datatype); // DPT 2.* - Binary Control @@ -1553,7 +1552,6 @@ int valueToBusValueRGBW(const KNXValue& value, uint8_t* payload, size_t payload_ case 1: // Mask bits unsigned8ToPayload(payload, payload_length, 5, (uint8_t)value, 0x0f); break; - } return true; } diff --git a/src/knx/interface_object.h b/src/knx/interface_object.h index 302c9d4..47b1124 100644 --- a/src/knx/interface_object.h +++ b/src/knx/interface_object.h @@ -188,7 +188,6 @@ class InterfaceObject : public SaveRestore uint16_t saveSize() override; protected: - /** * Intializes the Property-array the the supplied values. */ diff --git a/src/knx/knx_ip_frame.h b/src/knx/knx_ip_frame.h index f486774..f8a421f 100644 --- a/src/knx/knx_ip_frame.h +++ b/src/knx/knx_ip_frame.h @@ -29,9 +29,6 @@ enum KnxIpServiceType TunnelingAck = 0x421, RoutingIndication = 0x530, RoutingLostMessage = 0x531, - - - }; class KnxIpFrame diff --git a/src/knx/knx_value.h b/src/knx/knx_value.h index e0e5792..b59c6cf 100644 --- a/src/knx/knx_value.h +++ b/src/knx/knx_value.h @@ -49,7 +49,6 @@ class KNXValue KNXValue& operator=(const float value); private: - bool boolValue() const; uint8_t ucharValue() const; uint16_t ushortValue() const; diff --git a/src/knx/memory.cpp b/src/knx/memory.cpp index 54b3f84..5d33148 100644 --- a/src/knx/memory.cpp +++ b/src/knx/memory.cpp @@ -162,7 +162,6 @@ void Memory::writeMemory() //save to size of the memoryblock for tableobject too, so that we can rebuild the usedList and freeList if (_tableObjects[i]->_data != nullptr) { - MemoryBlock* block = findBlockInList(_usedList, _tableObjects[i]->_data); if (block == nullptr) { diff --git a/src/knx/rf_physical_layer_cc1101.cpp b/src/knx/rf_physical_layer_cc1101.cpp index c3de950..38134f2 100644 --- a/src/knx/rf_physical_layer_cc1101.cpp +++ b/src/knx/rf_physical_layer_cc1101.cpp @@ -679,7 +679,6 @@ void RfPhysicalLayerCC1101::loop() bytesLeft -= (32 - 1); pByteIndex += (32 - 1); } - } } @@ -719,7 +718,6 @@ void RfPhysicalLayerCC1101::loop() packetStartTime = millis(); syncStart = true; } - } } break; diff --git a/src/knx/secure_application_layer.h b/src/knx/secure_application_layer.h index e3ebf05..5b213b3 100644 --- a/src/knx/secure_application_layer.h +++ b/src/knx/secure_application_layer.h @@ -21,7 +21,6 @@ class BusAccessUnit; */ class SecureApplicationLayer : public ApplicationLayer { - public: /** * The constructor. @@ -56,8 +55,6 @@ class SecureApplicationLayer : public ApplicationLayer void dataConnectedRequest(uint16_t tsap, Priority priority, APDU& apdu, const SecurityControl& secCtrl) override; // apdu must be valid until it was confirmed private: - - enum class AddrType : uint8_t { group, diff --git a/src/knx/security_interface_object.cpp b/src/knx/security_interface_object.cpp index e3feba1..bf0cdde 100644 --- a/src/knx/security_interface_object.cpp +++ b/src/knx/security_interface_object.cpp @@ -490,7 +490,6 @@ uint16_t SecurityInterfaceObject::getNumberOfElements(PropertyID propId) uint64_t SecurityInterfaceObject::getLastValidSequenceNumber(uint16_t deviceAddr) { - // Get number of entries for this property uint16_t numElements = getNumberOfElements(PID_SECURITY_INDIVIDUAL_ADDRESS_TABLE); diff --git a/src/knx/tpuart_data_link_layer.cpp b/src/knx/tpuart_data_link_layer.cpp index c32d460..1de2eb2 100644 --- a/src/knx/tpuart_data_link_layer.cpp +++ b/src/knx/tpuart_data_link_layer.cpp @@ -616,7 +616,6 @@ bool TpUartDataLinkLayer::sendSingleFrameByte() void TpUartDataLinkLayer::addFrameTxQueue(CemiFrame& frame) { - _tx_queue_frame_t* tx_frame = new _tx_queue_frame_t; tx_frame->length = frame.telegramLengthtTP(); tx_frame->data = new uint8_t[tx_frame->length]; diff --git a/src/knx/transport_layer.cpp b/src/knx/transport_layer.cpp index 1e3a7f8..78d7157 100644 --- a/src/knx/transport_layer.cpp +++ b/src/knx/transport_layer.cpp @@ -343,7 +343,6 @@ void TransportLayer::dataIndividualConfirm(AckType ack, uint16_t destination, Ho A5(destination); break; } - } break; case Disconnect: diff --git a/src/knx/usb_tunnel_interface.cpp b/src/knx/usb_tunnel_interface.cpp index b2e197f..83889ea 100644 --- a/src/knx/usb_tunnel_interface.cpp +++ b/src/knx/usb_tunnel_interface.cpp @@ -63,7 +63,6 @@ void UsbTunnelInterface::loop() handleHidReportRxQueue(); rxHaveCompletePacket = false; } - } /* USB TX */ @@ -136,7 +135,6 @@ void UsbTunnelInterface::loadNextTxFrame(uint8_t** sendBuffer, uint16_t* sendBuf } println(""); #endif - } void UsbTunnelInterface::sendKnxHidReport(ProtocolIdType protId, ServiceIdType servId, uint8_t* data, uint16_t length)