From 20c2087e080d8d402b387b0283e408a8123f1ae4 Mon Sep 17 00:00:00 2001 From: consti10 Date: Sun, 13 Aug 2023 23:02:24 +0200 Subject: [PATCH] optimize imports --- WBLib.cmake | 3 +- executables/example_hello.cpp | 2 +- executables/example_pollute.cpp | 2 +- executables/example_udp.cpp | 8 ++--- executables/injection_rate_test.cpp | 2 +- executables/test_txrx.cpp | 2 +- executables/unit_test.cpp | 2 +- src/Encryption.cpp | 2 +- src/FECStream.cpp | 5 ++-- src/HelperSources/NonceSeqNrHelper.h | 4 +-- src/HelperSources/SchedulingHelper.hpp | 6 ++-- src/HelperSources/SeqNrHelper.hpp | 2 +- src/HelperSources/SequenceNumberDebugger.hpp | 7 +++-- src/HelperSources/SocketHelper.hpp | 15 +++++----- src/Ieee80211Header.hpp | 28 ++++++++--------- src/RSSIAccumulator.hpp | 2 +- src/RadiotapHeader.hpp | 30 +++++++++---------- src/SignalQualityAccumulator.hpp | 2 +- src/WBStreamRx.h | 2 +- src/wifibroadcast_spdlog.cpp | 5 ++++ ...adcast-spdlog.h => wifibroadcast_spdlog.h} | 6 ++-- ...fake.cpp => wifibroadcast_spdlog_fake.cpp} | 2 +- ...log-fake.h => wifibroadcast_spdlog_fake.h} | 0 23 files changed, 75 insertions(+), 64 deletions(-) create mode 100644 src/wifibroadcast_spdlog.cpp rename src/{wifibroadcast-spdlog.h => wifibroadcast_spdlog.h} (89%) rename src/{wifibroadcast-spdlog-fake.cpp => wifibroadcast_spdlog_fake.cpp} (82%) rename src/{wifibroadcast-spdlog-fake.h => wifibroadcast_spdlog_fake.h} (100%) diff --git a/WBLib.cmake b/WBLib.cmake index f710100b..918e51e4 100644 --- a/WBLib.cmake +++ b/WBLib.cmake @@ -32,7 +32,8 @@ target_sources(wifibroadcast PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src/Ieee80211Header.hpp ${CMAKE_CURRENT_LIST_DIR}/src/RadiotapHeader.hpp ${CMAKE_CURRENT_LIST_DIR}/src/RSSIAccumulator.hpp - ${CMAKE_CURRENT_LIST_DIR}/src/wifibroadcast-spdlog-fake.cpp + ${CMAKE_CURRENT_LIST_DIR}/src/wifibroadcast_spdlog.cpp + ${CMAKE_CURRENT_LIST_DIR}/src/wifibroadcast_spdlog_fake.cpp ${CMAKE_CURRENT_LIST_DIR}/src/Encryption.cpp ) target_include_directories(wifibroadcast PUBLIC diff --git a/executables/example_hello.cpp b/executables/example_hello.cpp index b8f6afcb..4a74fc6b 100644 --- a/executables/example_hello.cpp +++ b/executables/example_hello.cpp @@ -5,7 +5,7 @@ #include "../src/WBStreamRx.h" #include "../src/WBStreamTx.h" #include "../src/WBTxRx.h" -#include "../src/wifibroadcast-spdlog.h" +#include "../src/wifibroadcast_spdlog.h" #include "RandomBufferPot.hpp" /** diff --git a/executables/example_pollute.cpp b/executables/example_pollute.cpp index a3c44197..6244c51b 100644 --- a/executables/example_pollute.cpp +++ b/executables/example_pollute.cpp @@ -5,7 +5,7 @@ #include "../src/WBStreamRx.h" #include "../src/WBStreamTx.h" #include "../src/WBTxRx.h" -#include "../src/wifibroadcast-spdlog.h" +#include "../src/wifibroadcast_spdlog.h" #include "RandomBufferPot.hpp" /** diff --git a/executables/example_udp.cpp b/executables/example_udp.cpp index a18c0c12..2a3ef62d 100644 --- a/executables/example_udp.cpp +++ b/executables/example_udp.cpp @@ -2,15 +2,15 @@ // Created by consti10 on 30.06.23. // +#include "../src/HelperSources/SocketHelper.hpp" +#include "../src/HelperSources/TimeHelper.hpp" #include "../src/WBStreamRx.h" #include "../src/WBStreamTx.h" #include "../src/WBTxRx.h" -#include "../src/wifibroadcast-spdlog.h" -#include "../src/HelperSources/SocketHelper.hpp" -#include "RandomBufferPot.hpp" -#include "../src/HelperSources/TimeHelper.hpp" #include "../src/legacy/WBStreamRxUDP.h" #include "../src/legacy/WBStreamTxUDP.h" +#include "../src/wifibroadcast_spdlog.h" +#include "RandomBufferPot.hpp" /** * Simple example application that uses UDP as data input / output diff --git a/executables/injection_rate_test.cpp b/executables/injection_rate_test.cpp index 095feb12..d3fac151 100644 --- a/executables/injection_rate_test.cpp +++ b/executables/injection_rate_test.cpp @@ -5,7 +5,7 @@ #include "../src/WBStreamRx.h" #include "../src/WBStreamTx.h" #include "../src/WBTxRx.h" -#include "../src/wifibroadcast-spdlog.h" +#include "../src/wifibroadcast_spdlog.h" #include "DummyStreamGenerator.hpp" #include "RandomBufferPot.hpp" #include "Rates.hpp" diff --git a/executables/test_txrx.cpp b/executables/test_txrx.cpp index bbce76b4..7c1c7715 100644 --- a/executables/test_txrx.cpp +++ b/executables/test_txrx.cpp @@ -5,7 +5,7 @@ #include "../src/WBStreamRx.h" #include "../src/WBStreamTx.h" #include "../src/WBTxRx.h" -#include "../src/wifibroadcast-spdlog.h" +#include "../src/wifibroadcast_spdlog.h" #include "RandomBufferPot.hpp" int main(int argc, char *const *argv) { diff --git a/executables/unit_test.cpp b/executables/unit_test.cpp index 8651a776..3c809a4c 100644 --- a/executables/unit_test.cpp +++ b/executables/unit_test.cpp @@ -30,7 +30,7 @@ #include "../src/Encryption.h" #include "../src/HelperSources/Helper.hpp" #include "../src/Ieee80211Header.hpp" -#include "../src/wifibroadcast-spdlog.h" +#include "../src/wifibroadcast_spdlog.h" // Simple unit testing for the FEC lib that doesn't require wifi cards diff --git a/src/Encryption.cpp b/src/Encryption.cpp index 86156d7a..db5743d9 100644 --- a/src/Encryption.cpp +++ b/src/Encryption.cpp @@ -8,7 +8,7 @@ #include #include -#include "wifibroadcast-spdlog.h" +#include "wifibroadcast_spdlog.h" wb::KeyPairTxRx wb::generate_keypair_random() { KeyPairTxRx ret{}; diff --git a/src/FECStream.cpp b/src/FECStream.cpp index ba6adac2..20cbad5b 100644 --- a/src/FECStream.cpp +++ b/src/FECStream.cpp @@ -2,11 +2,12 @@ // Created by consti10 on 30.06.23. // +#include "FECStream.h" + #include #include "FEC.hpp" -#include "FECStream.h" -#include "wifibroadcast-spdlog.h" +#include "wifibroadcast_spdlog.h" void FECEncoder::encode_block( std::vector>> data_packets, diff --git a/src/HelperSources/NonceSeqNrHelper.h b/src/HelperSources/NonceSeqNrHelper.h index 822b2668..00505a7b 100644 --- a/src/HelperSources/NonceSeqNrHelper.h +++ b/src/HelperSources/NonceSeqNrHelper.h @@ -6,10 +6,10 @@ #define WIFIBROADCAST_NONCESEQNRHELPER_H #include -#include #include +#include -#include "../wifibroadcast-spdlog.h" +#include "../wifibroadcast_spdlog.h" #include "StringHelper.hpp" // Helper for dealing with sequence number diff --git a/src/HelperSources/SchedulingHelper.hpp b/src/HelperSources/SchedulingHelper.hpp index 953d6f3b..9c3d8c46 100644 --- a/src/HelperSources/SchedulingHelper.hpp +++ b/src/HelperSources/SchedulingHelper.hpp @@ -8,9 +8,11 @@ #include #include #include -#include + #include -#include "../wifibroadcast-spdlog.h" +#include + +#include "../wifibroadcast_spdlog.h" namespace SchedulingHelper { static void printCurrentThreadPriority(const std::string& name) { diff --git a/src/HelperSources/SeqNrHelper.hpp b/src/HelperSources/SeqNrHelper.hpp index 74fa66f1..112d9270 100644 --- a/src/HelperSources/SeqNrHelper.hpp +++ b/src/HelperSources/SeqNrHelper.hpp @@ -9,7 +9,7 @@ #include #include -#include "../wifibroadcast-spdlog.h" +#include "../wifibroadcast_spdlog.h" namespace seq_nr{ diff --git a/src/HelperSources/SequenceNumberDebugger.hpp b/src/HelperSources/SequenceNumberDebugger.hpp index ad8f333b..a095427f 100644 --- a/src/HelperSources/SequenceNumberDebugger.hpp +++ b/src/HelperSources/SequenceNumberDebugger.hpp @@ -5,12 +5,13 @@ #ifndef WIFIBROADCAST_SRC_HELPERSOURCES_SEQUENCENUMBERDEBUGGER_H_ #define WIFIBROADCAST_SRC_HELPERSOURCES_SEQUENCENUMBERDEBUGGER_H_ -#include +#include #include #include -#include +#include + +#include "../wifibroadcast_spdlog.h" #include "StringHelper.hpp" -#include "../wifibroadcast-spdlog.h" /** * Debug the n lost packets and the n of packet gaps by for a continuous stream of packets with increasing sequence number. diff --git a/src/HelperSources/SocketHelper.hpp b/src/HelperSources/SocketHelper.hpp index 43717f30..570017fb 100644 --- a/src/HelperSources/SocketHelper.hpp +++ b/src/HelperSources/SocketHelper.hpp @@ -5,23 +5,24 @@ #ifndef WIFIBROADCAST_SOCKETHELPER_HPP #define WIFIBROADCAST_SOCKETHELPER_HPP -#include -#include -#include #include +#include #include +#include #include -#include #include -#include -#include +#include +#include #include + +#include #include +#include #include +#include "../wifibroadcast_spdlog.h" #include "Helper.hpp" #include "TimeHelper.hpp" -#include "../wifibroadcast-spdlog.h" namespace SocketHelper { struct UDPConfig{ diff --git a/src/Ieee80211Header.hpp b/src/Ieee80211Header.hpp index 17243dcb..947f6c9f 100644 --- a/src/Ieee80211Header.hpp +++ b/src/Ieee80211Header.hpp @@ -1,27 +1,27 @@ #ifndef __WIFIBROADCAST_IEEE80211_HEADER_HPP__ #define __WIFIBROADCAST_IEEE80211_HEADER_HPP__ -#include -#include -#include -#include -#include -#include -#include -#include #include #include +#include +#include #include -#include -#include -#include -#include +#include +#include + #include -#include #include +#include +#include +#include +#include +#include +#include +#include +#include -#include "wifibroadcast-spdlog.h" #include "HelperSources/StringHelper.hpp" +#include "wifibroadcast_spdlog.h" // Helper for dealing with the IEEE80211 header in wifibroadcast / openhd // Usefully references: diff --git a/src/RSSIAccumulator.hpp b/src/RSSIAccumulator.hpp index 2374e42d..120ac17d 100644 --- a/src/RSSIAccumulator.hpp +++ b/src/RSSIAccumulator.hpp @@ -8,7 +8,7 @@ #include #include "TimeHelper.hpp" -#include "wifibroadcast-spdlog.h" +#include "wifibroadcast_spdlog.h" /** * Helper to accumulate RSSI values diff --git a/src/RadiotapHeader.hpp b/src/RadiotapHeader.hpp index bab3fb0d..bb10cb29 100644 --- a/src/RadiotapHeader.hpp +++ b/src/RadiotapHeader.hpp @@ -7,28 +7,28 @@ extern "C" { #include "external/radiotap/radiotap.h" }; +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include #include -#include -#include #include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include +#include #include #include -#include -#include -#include -#include -#include "wifibroadcast-spdlog.h" +#include "wifibroadcast_spdlog.h" // everything must be in little endian byte order http://www.radiotap.org/ static_assert(__BYTE_ORDER == __LITTLE_ENDIAN, "This code is written for little endian only !"); diff --git a/src/SignalQualityAccumulator.hpp b/src/SignalQualityAccumulator.hpp index 51ad939c..baec879b 100644 --- a/src/SignalQualityAccumulator.hpp +++ b/src/SignalQualityAccumulator.hpp @@ -8,7 +8,7 @@ #include #include "TimeHelper.hpp" -#include "wifibroadcast-spdlog.h" +#include "wifibroadcast_spdlog.h" /** * Helper to accumulate (rtl8812au) signal quality values diff --git a/src/WBStreamRx.h b/src/WBStreamRx.h index 8ea3408c..db516bd6 100644 --- a/src/WBStreamRx.h +++ b/src/WBStreamRx.h @@ -14,7 +14,7 @@ #include "HelperSources/TimeHelper.hpp" #include "SimpleStream.hpp" #include "WBTxRx.h" -#include "wifibroadcast-spdlog.h" +#include "wifibroadcast_spdlog.h" /** * Receiver for a (multiplexed) wifbroadcast stream diff --git a/src/wifibroadcast_spdlog.cpp b/src/wifibroadcast_spdlog.cpp new file mode 100644 index 00000000..3255c935 --- /dev/null +++ b/src/wifibroadcast_spdlog.cpp @@ -0,0 +1,5 @@ +// +// Created by consti10 on 13.08.23. +// + +#include "wifibroadcast_spdlog.h" \ No newline at end of file diff --git a/src/wifibroadcast-spdlog.h b/src/wifibroadcast_spdlog.h similarity index 89% rename from src/wifibroadcast-spdlog.h rename to src/wifibroadcast_spdlog.h index 95b90ba5..42381794 100644 --- a/src/wifibroadcast-spdlog.h +++ b/src/wifibroadcast_spdlog.h @@ -5,9 +5,9 @@ #ifndef WIFIBROADCAST_SRC_WIFIBROADCAST_SPDLOG_H_ #define WIFIBROADCAST_SRC_WIFIBROADCAST_SPDLOG_H_ -#include "wifibroadcast-spdlog-fake.h" +//#include "wifibroadcast-spdlog-fake.h" -/*#include +#include #include #include @@ -30,5 +30,5 @@ static std::shared_ptr get_default() { return create_or_get("wifibroadcast"); } -}*/ +} #endif // WIFIBROADCAST_SRC_WIFIBROADCAST_SPDLOG_H_ diff --git a/src/wifibroadcast-spdlog-fake.cpp b/src/wifibroadcast_spdlog_fake.cpp similarity index 82% rename from src/wifibroadcast-spdlog-fake.cpp rename to src/wifibroadcast_spdlog_fake.cpp index 67c64476..1cc3d965 100644 --- a/src/wifibroadcast-spdlog-fake.cpp +++ b/src/wifibroadcast_spdlog_fake.cpp @@ -2,7 +2,7 @@ // Created by consti10 on 13.08.23. // -#include "wifibroadcast-spdlog-fake.h" +#include "wifibroadcast_spdlog_fake.h" void spdlog::logger::lool() { diff --git a/src/wifibroadcast-spdlog-fake.h b/src/wifibroadcast_spdlog_fake.h similarity index 100% rename from src/wifibroadcast-spdlog-fake.h rename to src/wifibroadcast_spdlog_fake.h