Fix MinGW warnings (fixes #4731)

This commit is contained in:
Dennis Felsing 2022-02-18 12:21:48 +01:00
parent c8363bc96f
commit ded32c4334
3 changed files with 11 additions and 7 deletions

View file

@ -223,6 +223,7 @@ static void logger_file(const char *line, void *user)
aio_unlock(logfile);
}
#if !defined(CONF_FAMILY_WINDOWS)
static void logger_file_no_newline(const char *line, void *user)
{
ASYNCIO *logfile = (ASYNCIO *)user;
@ -230,8 +231,7 @@ static void logger_file_no_newline(const char *line, void *user)
aio_write_unlocked(logfile, line, str_length(line));
aio_unlock(logfile);
}
#if defined(CONF_FAMILY_WINDOWS)
#else
static void logger_stdout_sync(const char *line, void *user)
{
size_t length = str_length(line);
@ -2122,7 +2122,7 @@ static inline time_t filetime_to_unixtime(LPFILETIME filetime)
li.QuadPart -= 11644473600LL; // Windows epoch is in the past
t = li.QuadPart;
return t == li.QuadPart ? t : (time_t)-1;
return t == (time_t)li.QuadPart ? t : (time_t)-1;
}
#endif
@ -2613,8 +2613,8 @@ void str_append(char *dst, const char *src, int dst_size)
void str_copy(char *dst, const char *src, int dst_size)
{
strncpy(dst, src, dst_size - 1);
dst[dst_size - 1] = 0; /* assure null termination */
dst[0] = '\0';
strncat(dst, src, dst_size - 1);
str_utf8_fix_truncation(dst);
}

View file

@ -788,7 +788,7 @@ int CGraphicsBackend_SDL_OpenGL::Init(const char *pName, int *pScreen, int *pWid
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, g_Config.m_GfxOpenGLMajor);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, g_Config.m_GfxOpenGLMinor);
dbg_msg("gfx", "Created OpenGL %zu.%zu context.", (size_t)g_Config.m_GfxOpenGLMajor, (size_t)g_Config.m_GfxOpenGLMinor);
dbg_msg("gfx", "Created OpenGL %d.%d context.", g_Config.m_GfxOpenGLMajor, g_Config.m_GfxOpenGLMinor);
if(m_BackendType == BACKEND_TYPE_OPENGL)
{

View file

@ -230,7 +230,11 @@ extern char *sqlite3_expanded_sql(sqlite3_stmt *pStmt) __attribute__((weak)); //
void CSqliteConnection::Print()
{
if(m_pStmt != nullptr && sqlite3_expanded_sql != nullptr)
if(m_pStmt != nullptr
#if defined(__GNUC__) && !defined(__MINGW32__)
&& sqlite3_expanded_sql != nullptr
#endif
)
{
char *pExpandedStmt = sqlite3_expanded_sql(m_pStmt);
dbg_msg("sql", "SQLite statement: %s", pExpandedStmt);