diff --git a/CMakeLists.txt b/CMakeLists.txt index 3010430..ea6120a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,8 +5,8 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_C_STANDARD 17) # CMake Settings -set(CMAKE_CXX_FLAGS "-O3 -fPIC -pedantic") -set(CMAKE_C_FLAGS "-O3 -fPIC -pedantic") +set(CMAKE_CXX_FLAGS "-O3 -fPIC -pedantic -Wall") +set(CMAKE_C_FLAGS "-O3 -fPIC -pedantic -Wall") set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64") diff --git a/src/tools.cpp b/src/tools.cpp index 0b6720e..49d7c98 100644 --- a/src/tools.cpp +++ b/src/tools.cpp @@ -1,5 +1,6 @@ #include "xpdraw/tools.h" +#include #include #include #include @@ -7,6 +8,13 @@ int xpVersion = -1; char xpPath[512]; char pluginPath[512]; +char str3[512]; + +char *xpd_tools_constr(const char *str1, const char *str2) { + strcpy(str3, str1); + strncat(str3, str2, sizeof(str3) - strlen(str3) - 1); + return str3; +} char *xpd_tools_plugin_fp() { XPLMEnableFeature("XPLM_USE_NATIVE_PATHS", 1); diff --git a/src/xpdraw/tools.h b/src/xpdraw/tools.h index 61af6ff..c2886d2 100644 --- a/src/xpdraw/tools.h +++ b/src/xpdraw/tools.h @@ -21,8 +21,6 @@ extern "C" { #endif -#include - /** * @brief Concentrate two C strings into one * @@ -30,11 +28,7 @@ extern "C" { * @param str2 * @return char* */ -inline char *xpd_tools_constr(const char *str1, const char *str2) { - char str3[256]; - strcpy(str3, str1); - return strncat(str3, str2, sizeof(str3) - strlen(str3) - 1); -} +char *xpd_tools_constr(const char *str1, const char *str2); /** * @brief Returns the plugin's current path. Forces XPLM_USE_NATIVE_PATHS to true!