Skip to content

Commit

Permalink
Code clean up
Browse files Browse the repository at this point in the history
Removed unused variables
Removed VC_EXTRALEAN
Set _WIN32_WINNT and WIN32_LEAN_AND_MEAN
  • Loading branch information
ogruetzmann committed May 22, 2016
1 parent fa8531b commit 468c2c6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
6 changes: 2 additions & 4 deletions ModeS/ModeS2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
vector<string> EQUIPEMENT_CODES = { "H", "L", "E", "G", "W", "Q", "S" };
vector<string> 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})$")))
Expand Down Expand Up @@ -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);
Expand All @@ -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<string>();
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions ModeS/ModeS2.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class CModeS :

const char* mode_s_code = "1000";

clock_t delayedStart;

future<string> fUpdateString;

void OnGetTagItem(CFlightPlan FlightPlan, EuroScopePlugIn::CRadarTarget RadarTarget,
Expand All @@ -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);
};
5 changes: 0 additions & 5 deletions ModeS/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Windows.h>
2 changes: 2 additions & 0 deletions ModeS/targetver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <SDKDDKVer.h>

0 comments on commit 468c2c6

Please sign in to comment.