From abe95ae1a42cf8d3d00b068590c0abefcc4fc904 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Tue, 25 May 2021 05:08:57 +0800 Subject: [PATCH] most of the changes needed to build native on Windows --- src/RedirectablePrint.cpp | 2 -- src/graphics/Screen.h | 2 -- src/mesh/PacketHistory.h | 6 ++---- src/mesh/ReliableRouter.h | 4 ++-- src/portduino/wifi-stubs.cpp | 1 - src/{nrf52 => }/wifi-stubs.cpp | 0 6 files changed, 4 insertions(+), 11 deletions(-) delete mode 120000 src/portduino/wifi-stubs.cpp rename src/{nrf52 => }/wifi-stubs.cpp (100%) diff --git a/src/RedirectablePrint.cpp b/src/RedirectablePrint.cpp index ca6bdb142..3f920f641 100644 --- a/src/RedirectablePrint.cpp +++ b/src/RedirectablePrint.cpp @@ -7,8 +7,6 @@ #include #include -using namespace std; - /** * A printer that doesn't go anywhere */ diff --git a/src/graphics/Screen.h b/src/graphics/Screen.h index e17fda0d6..65e7b0a12 100644 --- a/src/graphics/Screen.h +++ b/src/graphics/Screen.h @@ -44,8 +44,6 @@ class Screen #define BRIGHTNESS_DEFAULT 150 #endif -using namespace std; - namespace graphics { diff --git a/src/mesh/PacketHistory.h b/src/mesh/PacketHistory.h index d390915a2..8deee092e 100644 --- a/src/mesh/PacketHistory.h +++ b/src/mesh/PacketHistory.h @@ -4,8 +4,6 @@ #include #include -using namespace std; - /// We clear our old flood record five minute after we see the last of it #define FLOOD_EXPIRE_TIME (5 * 60 * 1000L) @@ -23,7 +21,7 @@ struct PacketRecord { class PacketRecordHashFunction { public: - size_t operator()(const PacketRecord &p) const { return (hash()(p.sender)) ^ (hash()(p.id)); } + size_t operator()(const PacketRecord &p) const { return (std::hash()(p.sender)) ^ (std::hash()(p.id)); } }; /// Order packet records by arrival time, we want the oldest packets to be in the front of our heap @@ -54,7 +52,7 @@ class PacketHistory /** FIXME: really should be a std::unordered_set with the key being sender,id. * This would make checking packets in wasSeenRecently faster. */ - vector recentPackets; + std::vector recentPackets; // priority_queue, PacketRecordOrderFunction> arrivalTimes; // unordered_set recentPackets; diff --git a/src/mesh/ReliableRouter.h b/src/mesh/ReliableRouter.h index 7299d1c18..e0890ff28 100644 --- a/src/mesh/ReliableRouter.h +++ b/src/mesh/ReliableRouter.h @@ -51,7 +51,7 @@ struct PendingPacket { class GlobalPacketIdHashFunction { public: - size_t operator()(const GlobalPacketId &p) const { return (hash()(p.node)) ^ (hash()(p.id)); } + size_t operator()(const GlobalPacketId &p) const { return (std::hash()(p.node)) ^ (std::hash()(p.id)); } }; /** @@ -60,7 +60,7 @@ class GlobalPacketIdHashFunction class ReliableRouter : public FloodingRouter { private: - unordered_map pending; + std::unordered_map pending; public: /** diff --git a/src/portduino/wifi-stubs.cpp b/src/portduino/wifi-stubs.cpp deleted file mode 120000 index b90e66295..000000000 --- a/src/portduino/wifi-stubs.cpp +++ /dev/null @@ -1 +0,0 @@ -../nrf52/wifi-stubs.cpp \ No newline at end of file diff --git a/src/nrf52/wifi-stubs.cpp b/src/wifi-stubs.cpp similarity index 100% rename from src/nrf52/wifi-stubs.cpp rename to src/wifi-stubs.cpp