From 361f8302441ca57f33077d3503cb1211c9b2130d Mon Sep 17 00:00:00 2001 From: Dedmen Miller Date: Wed, 27 Feb 2019 22:32:46 +0100 Subject: [PATCH] Fix Linux build problems --- src/EngineProfiling.cpp | 2 +- src/SignalSlot.hpp | 2 +- src/scriptProfiler.cpp | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/EngineProfiling.cpp b/src/EngineProfiling.cpp index 092ff30..b813f73 100644 --- a/src/EngineProfiling.cpp +++ b/src/EngineProfiling.cpp @@ -52,7 +52,7 @@ extern "C" { if (sdp.content.length() < 64 || !x || !*x || x->get()->size() < 16) return; - r_string name = getScriptName(sdp.content, sdp.sourcefile, 32); + r_string name(getScriptName(sdp.content, sdp.sourcefile, 32)); if (!name.empty() && name != ""sv) addScopeInstruction(*x, name); } diff --git a/src/SignalSlot.hpp b/src/SignalSlot.hpp index 3fa117f..5a96997 100644 --- a/src/SignalSlot.hpp +++ b/src/SignalSlot.hpp @@ -21,7 +21,7 @@ class Signal { std::vector emit(Args... args) const { std::vector returnData; if (slots.empty()) - return; + return {}; for (auto& slot : slots) { returnData.push_back(slot(args...)); } diff --git a/src/scriptProfiler.cpp b/src/scriptProfiler.cpp index c69f24c..9dae310 100644 --- a/src/scriptProfiler.cpp +++ b/src/scriptProfiler.cpp @@ -10,8 +10,10 @@ #endif #include "ProfilerAdapter.hpp" #include "AdapterArmaDiag.hpp" +#ifdef WITH_BROFILER #include "AdapterBrofiler.hpp" #include "Event.h" +#endif #include "AdapterChrome.hpp" #include "AdapterTracy.hpp" #include @@ -669,7 +671,7 @@ game_value compileRedirect2(game_state& state, game_value_parameter message) { auto& funcPath = bodyCode->instructions->front()->sdp.sourcefile; //#TODO pass instructions to getScriptName and check if there is a "scriptName" or "scopeName" unary command call - r_string scriptName = getScriptName(str, funcPath, 32); + r_string scriptName(getScriptName(str, funcPath, 32)); //if (scriptName.empty()) scriptName = "";