most of the changes needed to build native on Windows

This commit is contained in:
Kevin Hester 2021-05-25 05:08:57 +08:00
parent 4e8e85c9f1
commit abe95ae1a4
6 changed files with 4 additions and 11 deletions

View File

@ -7,8 +7,6 @@
#include <time.h> #include <time.h>
#include <cstring> #include <cstring>
using namespace std;
/** /**
* A printer that doesn't go anywhere * A printer that doesn't go anywhere
*/ */

View File

@ -44,8 +44,6 @@ class Screen
#define BRIGHTNESS_DEFAULT 150 #define BRIGHTNESS_DEFAULT 150
#endif #endif
using namespace std;
namespace graphics namespace graphics
{ {

View File

@ -4,8 +4,6 @@
#include <queue> #include <queue>
#include <unordered_set> #include <unordered_set>
using namespace std;
/// We clear our old flood record five minute after we see the last of it /// We clear our old flood record five minute after we see the last of it
#define FLOOD_EXPIRE_TIME (5 * 60 * 1000L) #define FLOOD_EXPIRE_TIME (5 * 60 * 1000L)
@ -23,7 +21,7 @@ struct PacketRecord {
class PacketRecordHashFunction class PacketRecordHashFunction
{ {
public: public:
size_t operator()(const PacketRecord &p) const { return (hash<NodeNum>()(p.sender)) ^ (hash<PacketId>()(p.id)); } size_t operator()(const PacketRecord &p) const { return (std::hash<NodeNum>()(p.sender)) ^ (std::hash<PacketId>()(p.id)); }
}; };
/// Order packet records by arrival time, we want the oldest packets to be in the front of our heap /// 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. /** FIXME: really should be a std::unordered_set with the key being sender,id.
* This would make checking packets in wasSeenRecently faster. * This would make checking packets in wasSeenRecently faster.
*/ */
vector<PacketRecord> recentPackets; std::vector<PacketRecord> recentPackets;
// priority_queue<PacketRecord, vector<PacketRecord>, PacketRecordOrderFunction> arrivalTimes; // priority_queue<PacketRecord, vector<PacketRecord>, PacketRecordOrderFunction> arrivalTimes;
// unordered_set<PacketRecord, PacketRecordHashFunction> recentPackets; // unordered_set<PacketRecord, PacketRecordHashFunction> recentPackets;

View File

@ -51,7 +51,7 @@ struct PendingPacket {
class GlobalPacketIdHashFunction class GlobalPacketIdHashFunction
{ {
public: public:
size_t operator()(const GlobalPacketId &p) const { return (hash<NodeNum>()(p.node)) ^ (hash<PacketId>()(p.id)); } size_t operator()(const GlobalPacketId &p) const { return (std::hash<NodeNum>()(p.node)) ^ (std::hash<PacketId>()(p.id)); }
}; };
/** /**
@ -60,7 +60,7 @@ class GlobalPacketIdHashFunction
class ReliableRouter : public FloodingRouter class ReliableRouter : public FloodingRouter
{ {
private: private:
unordered_map<GlobalPacketId, PendingPacket, GlobalPacketIdHashFunction> pending; std::unordered_map<GlobalPacketId, PendingPacket, GlobalPacketIdHashFunction> pending;
public: public:
/** /**

View File

@ -1 +0,0 @@
../nrf52/wifi-stubs.cpp