Skip to content

Commit

Permalink
make the compiler happy
Browse files Browse the repository at this point in the history
  • Loading branch information
lionkor committed Feb 5, 2024
1 parent a0241d1 commit 5468e5c
Show file tree
Hide file tree
Showing 12 changed files with 106 additions and 82 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ set(PRJ_HEADERS
include/Value.h
include/VehicleData.h
include/Network.h
include/Env.h
)
# add all source files (.cpp) to this, except the one with main()
set(PRJ_SOURCES
Expand All @@ -66,6 +67,7 @@ set(PRJ_SOURCES
src/Value.cpp
src/VehicleData.cpp
src/Network.cpp
src/Env.cpp
)

find_package(Lua REQUIRED)
Expand Down Expand Up @@ -96,14 +98,15 @@ set(PRJ_LIBRARIES
${LUA_LIBRARIES}
zstd::libzstd_static
Boost::thread
Boost::json
glm::glm
)

# add dependency find_package calls and similar here
find_package(fmt CONFIG REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(doctest CONFIG REQUIRED)
find_package(Boost REQUIRED COMPONENTS thread)
find_package(Boost REQUIRED COMPONENTS thread json)
find_package(httplib CONFIG REQUIRED)
find_package(libzip CONFIG REQUIRED)
find_package(RapidJSON CONFIG REQUIRED)
Expand Down
4 changes: 4 additions & 0 deletions include/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
#include <cstring>
#include <deque>
#include <filesystem>
#include <fmt/chrono.h>
#include <fmt/format.h>
#include <fmt/ostream.h>
#include <fmt/ranges.h>
#include <fmt/std.h>
#include <functional>
#include <memory>
#include <mutex>
Expand Down
4 changes: 2 additions & 2 deletions include/Plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "Error.h"
#include "Value.h"
#include <filesystem>
#include <future>
#include <utility>
#include <variant>
Expand All @@ -17,7 +18,7 @@ class Plugin {
/// Self-managing pointer type of this plugin.
using Pointer = std::unique_ptr<Plugin>;
/// Allocates a Plugin of the specific derived plugin type.
template<typename T, typename... Args>
template <typename T, typename... Args>
static Pointer make_pointer(Args&&... args) {
return std::unique_ptr<Plugin>(new T(std::forward<Args>(args)...));
}
Expand Down Expand Up @@ -65,4 +66,3 @@ class Plugin {
/// should be returned regardless.
virtual size_t memory_usage() const = 0;
};

5 changes: 1 addition & 4 deletions include/TConsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
#include <unordered_map>
#include <vector>

class TLuaEngine;

class TConsole {
public:
TConsole();
Expand All @@ -41,7 +39,7 @@ class TConsole {

void Write(const std::string& str);
void WriteRaw(const std::string& str);
void InitializeLuaConsole(TLuaEngine& Engine);
// void InitializeLuaConsole(TLuaEngine& Engine);
void BackupOldLog();
void StartLoggingToFile();
Commandline& Internal() { return *mCommandline; }
Expand Down Expand Up @@ -81,7 +79,6 @@ class TConsole {
std::unique_ptr<Commandline> mCommandline { nullptr };
std::vector<std::string> mCachedLuaHistory;
std::vector<std::string> mCachedRegularHistory;
TLuaEngine* mLuaEngine { nullptr };
bool mIsLuaConsole { false };
bool mFirstTime { true };
std::string mStateId;
Expand Down
6 changes: 3 additions & 3 deletions src/FileWatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ void FileWatcher::on_tick(const boost::system::error_code& err) {
timer->expires_at(timer->expires_at() + *m_seconds);

if (err) {
l::error("FileWatcher encountered error: {}", err.message());
beammp_errorf("FileWatcher encountered error: {}", err.message());
// TODO: Should any further action be taken?
} else {
try {
check_files();
} catch (const std::exception& e) {
l::error("FileWatcher exception while checking files: {}", e.what());
beammp_errorf("FileWatcher exception while checking files: {}", e.what());
}
try {
check_directories();
} catch (const std::exception& e) {
l::error("FileWatcher exception while checking directories: {}", e.what());
beammp_errorf("FileWatcher exception while checking directories: {}", e.what());
}
}
// finally start the timer again, deadline has already been set at the beginning
Expand Down
Loading

0 comments on commit 5468e5c

Please sign in to comment.