Skip to content

Commit

Permalink
Fix MinGW warnings, push to 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallJoker committed Nov 16, 2024
1 parent a2d0b06 commit 3ac9a04
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/core/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h> // getenv
#include <time.h>
#ifndef _WIN32
#include <unistd.h>
#endif
Expand Down Expand Up @@ -86,7 +87,7 @@ void Logger::doLogStartup()
{
time_t timestamp_now = time(NULL);
struct tm *tm_info = localtime(&timestamp_now);
printf("Time: %lu | %s", timestamp_now, asctime(tm_info));
printf("Time: %zu | %s", timestamp_now, asctime(tm_info));

startup_time = timestamp_now;

Expand Down Expand Up @@ -134,7 +135,7 @@ void Logger::operator()(LogLevel ll, const char *fmt, ...)

time_t timestamp_now = time(NULL);
if (1) {
fprintf(stream, "%4lu", timestamp_now - startup_time);
fprintf(stream, "%4zu", timestamp_now - startup_time);
} else {
// Print current time
struct tm *tm_info = localtime(&timestamp_now);
Expand Down
6 changes: 5 additions & 1 deletion src/core/script/script_environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ int Script::l_register_event(lua_State *L)
MESSY_CPP_EXCEPTIONS_START
Script *script = get_script(L);

int event_id = luaL_checkinteger(L, 1);
int event_id_raw = luaL_checkinteger(L, 1);
uint16_t event_id = (uint16_t)event_id_raw;
if (event_id_raw != event_id || event_id_raw == UINT16_MAX)
luaL_error(L, "event id=%d is out of range", event_id);

(void)luaL_checkinteger(L, 2); // flags (TODO)

auto &defs = script->m_emgr->getDefs();
Expand Down
2 changes: 1 addition & 1 deletion src/core/script/scriptevent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ScriptEvent::ScriptEvent(u16 event_id)

ScriptEvent::ScriptEvent(ScriptEvent &&other)
{
std::swap(event_id, other.event_id);
event_id = other.event_id;
std::swap(data, other.data);
}

Expand Down
2 changes: 1 addition & 1 deletion src/version.cpp.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

const char *VERSION_STRING = "OpenEdits v1.2.2-${GIT_SHA1} (${CMAKE_BUILD_TYPE})";
const char *VERSION_STRING = "OpenEdits v1.3.0-${GIT_SHA1} (${CMAKE_BUILD_TYPE})";

0 comments on commit 3ac9a04

Please sign in to comment.