From 468c2c65e6e619913fa53ea18054c489027c675f Mon Sep 17 00:00:00 2001 From: Olli Date: Sun, 22 May 2016 15:35:13 +0200 Subject: [PATCH] Code clean up Removed unused variables Removed VC_EXTRALEAN Set _WIN32_WINNT and WIN32_LEAN_AND_MEAN --- ModeS/ModeS2.cpp | 6 ++---- ModeS/ModeS2.h | 10 +++++----- ModeS/stdafx.h | 5 ----- ModeS/targetver.h | 2 ++ 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/ModeS/ModeS2.cpp b/ModeS/ModeS2.cpp index 661f6db..53e288c 100644 --- a/ModeS/ModeS2.cpp +++ b/ModeS/ModeS2.cpp @@ -5,8 +5,6 @@ vector EQUIPEMENT_CODES = { "H", "L", "E", "G", "W", "Q", "S" }; vector ICAO_MODES = { "EB", "EL", "ET", "ED", "LF", "EH", "LK", "LO", "LIM", "LIR" }; -bool initialLoad { false }; - void doInitialLoad(string message) { if (regex_match(message, regex("^([A-z,]+)[|]([A-z,]+)[|]([0-9]{1,3})$"))) @@ -175,9 +173,8 @@ void CModeS::OnRadarTargetPositionUpdate(CRadarTarget RadarTarget) void CModeS::OnTimer(int Counter) { - if (!initialLoad && fUpdateString.valid()) { + if (fUpdateString.valid()) { if (fUpdateString.wait_for(chrono::milliseconds(0)) == future_status::ready) { - initialLoad = true; try { string UpdateString = fUpdateString.get(); doInitialLoad(UpdateString); @@ -188,6 +185,7 @@ void CModeS::OnTimer(int Counter) catch (...) { MessageBox(NULL, "Unhandled Exception while loading data from server", "Mode S", MB_OK | MB_ICONWARNING); } + fUpdateString = future(); } } } diff --git a/ModeS/ModeS2.h b/ModeS/ModeS2.h index b6796cc..cdec7d0 100644 --- a/ModeS/ModeS2.h +++ b/ModeS/ModeS2.h @@ -29,8 +29,6 @@ class CModeS : const char* mode_s_code = "1000"; - clock_t delayedStart; - future fUpdateString; void OnGetTagItem(CFlightPlan FlightPlan, EuroScopePlugIn::CRadarTarget RadarTarget, @@ -47,8 +45,10 @@ class CModeS : RECT Area); void OnRadarTargetPositionUpdate(CRadarTarget RadarTarget); - void OnTimer(int Counter); - - CRadarScreen * OnRadarScreenCreated(const char * sDisplayName, bool NeedRadarContent, bool GeoReferenced, bool CanBeSaved, bool CanBeCreated); + CRadarScreen * OnRadarScreenCreated(const char * sDisplayName, + bool NeedRadarContent, + bool GeoReferenced, + bool CanBeSaved, + bool CanBeCreated); }; diff --git a/ModeS/stdafx.h b/ModeS/stdafx.h index 9ef402e..0990719 100644 --- a/ModeS/stdafx.h +++ b/ModeS/stdafx.h @@ -3,10 +3,5 @@ // are changed infrequently #pragma once - -#ifndef VC_EXTRALEAN -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers -#endif - #include "targetver.h" #include diff --git a/ModeS/targetver.h b/ModeS/targetver.h index 87c0086..268b27f 100644 --- a/ModeS/targetver.h +++ b/ModeS/targetver.h @@ -5,4 +5,6 @@ // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. +#define WIN32_LEAN_AND_MEAN +#define _WIN32_WINNT 0x0600 #include