Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.

Commit 3e5e303

Browse files
committed
Fix OS X compilation issues
1 parent 19f4ee1 commit 3e5e303

5 files changed

Lines changed: 8 additions & 7 deletions

File tree

src/environment/Settings.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include <nlohmann/json.hpp>
2020
#include <iomanip>
21+
#include <sstream>
2122
#include "Settings.h"
2223
#include "src/Logger.h"
2324
#include "src/platform/Platform.h"
@@ -36,7 +37,7 @@ Settings::Settings(const std::string &settingsFile)
3637
colorTable.push_back({"BLUE", 0xFF0000A0});
3738
colorTable.push_back({"GREEN", 0xFF008000});
3839
colorTable.push_back({"YELLOW", 0xFF808000});
39-
40+
4041
database = std::make_shared<json>();
4142
init();
4243
load();
@@ -183,7 +184,7 @@ uint32_t Settings::colorStringToInt(std::string colString, const char* colDefaul
183184
return i->second;
184185
}
185186
}
186-
187+
187188
if ((cstr[0] == '#') && (cstr.size() >= 7)) {
188189
cstr.erase(0,1);
189190
uint32_t c = 0;
@@ -197,7 +198,7 @@ uint32_t Settings::colorStringToInt(std::string colString, const char* colDefaul
197198
if (p == 6) c |= 0xFF000000;// make color opaque if alpha-channel not defined
198199
if (p) return c;
199200
}
200-
201+
201202
cstr = colDefault;
202203
for (auto i = colorTable.begin(); i != colorTable.end(); ++i) {
203204
if (cstr == i->first) {

src/environment/standalone/StandAloneEnvironment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class StandAloneEnvironment: public Environment {
4444
std::string getFontDirectory() override;
4545
std::string getProgramPath() override;
4646
std::string getSettingsDir() override;
47-
void sendUserFixesFilenameToXData(std::string filename);
47+
void sendUserFixesFilenameToXData(std::string filename) override;
4848
std::string getEarthTexturePath() override;
4949
void runInEnvironment(EnvironmentCallback cb) override;
5050
std::shared_ptr<xdata::XData> getNavData() override;

src/environment/xplane/XPlaneEnvironment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class XPlaneEnvironment: public Environment {
4949
std::string getFontDirectory() override;
5050
std::string getProgramPath() override;
5151
std::string getSettingsDir() override;
52-
void sendUserFixesFilenameToXData(std::string filename);
52+
void sendUserFixesFilenameToXData(std::string filename) override;
5353
std::string getEarthTexturePath() override;
5454
void runInEnvironment(EnvironmentCallback cb) override;
5555
std::shared_ptr<xdata::XData> getNavData() override;

src/libxdata/world/models/navaids/UserFix.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class UserFix {
4343
private:
4444
UserFix::Type type = UserFix::Type::NONE;
4545
std::string name;
46-
int elevation = 0;
4746
};
4847

4948
} /* namespace xdata */

src/maps/OverlayedUserFix.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818

1919
#include "OverlayedUserFix.h"
20+
#include <cstdlib>
2021

2122
namespace maps {
2223

@@ -149,7 +150,7 @@ void OverlayedUserFix::splitNameToLines() {
149150
std::size_t splitPos = 0;
150151
std::size_t centre = full_text.size() / 2;
151152
while (pos != std::string::npos) {
152-
if (abs(pos - centre) < abs(splitPos - centre)) {
153+
if (abs((int) pos - (int) centre) < abs((int) splitPos - (int) centre)) {
153154
splitPos = pos;
154155
}
155156
pos = full_text.find_first_of(" ,", pos + 1);

0 commit comments

Comments
 (0)