Skip to content

Commit

Permalink
Add optimization flags, fix compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
In-line committed Nov 27, 2016
1 parent c91e719 commit afe59d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wzero-as-null-pointer-constant -Weffc++ -Wunknown-pragmas")
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
set(CMAKE_CXX_FLAGS "-O2 -finline-functions")
set(CMAKE_SHARED_LINKER_FLAGS "-s")
endif()
endif()

Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ enum class ModuleFunctions
LastElement = MODEL_INDEXF
};
#define MODULE_CHECKS "module_checks"
bool moduleFunctions[(std::size_t)ModuleFunctions::LastElement];
bool moduleFunctions[(std::size_t)ModuleFunctions::LastElement + 1];
void loadConfiguration();

C_DLLEXPORT int Meta_Query(const char * /*ifvers */, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs)
Expand Down Expand Up @@ -192,7 +192,7 @@ void loadConfiguration()
const std::string logPrefix = "[Ultimate Unprecacher] ";
std::time_t curTime = std::time(nullptr);
auto localTime = std::localtime(&curTime);
SERVER_PRINT((*mapName + str_put_time(localTime, " %H:%M:%S - ") + str + "\n" ).c_str());
SERVER_PRINT((logPrefix + *mapName + str_put_time(localTime, " %H:%M:%S - ") + str + "\n" ).c_str());
});

module->getLoggerRef()->setFileFunction([&](const std::string &str)
Expand Down

0 comments on commit afe59d2

Please sign in to comment.