From 5957d07448b7915e7c657ee2a697bc8779688776 Mon Sep 17 00:00:00 2001 From: bjorn Date: Fri, 13 Dec 2019 03:41:35 -0800 Subject: [PATCH] Fix warnings; --- src/core/fs.c | 2 +- src/lib/lua-cjson/lua_cjson.c | 2 ++ src/modules/graphics/opengl.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/fs.c b/src/core/fs.c index d3b83455..a62b7925 100644 --- a/src/core/fs.c +++ b/src/core/fs.c @@ -282,7 +282,7 @@ bool fs_stat(const char* path, FileInfo* info) { if (info) { info->size = (uint64_t) stats.st_size; info->lastModified = (uint64_t) stats.st_mtime; - info->type = (stats.st_mode & S_IFDIR) ? FILE_DIRECTORY : FILE_REGULAR; + info->type = S_ISDIR(stats.st_mode) ? FILE_DIRECTORY : FILE_REGULAR; } return true; diff --git a/src/lib/lua-cjson/lua_cjson.c b/src/lib/lua-cjson/lua_cjson.c index ffd2afe6..8da5c604 100644 --- a/src/lib/lua-cjson/lua_cjson.c +++ b/src/lib/lua-cjson/lua_cjson.c @@ -67,6 +67,8 @@ #ifdef _WIN32 #define strncasecmp _strnicmp +#else +#include #endif #define DEFAULT_SPARSE_CONVERT 0 diff --git a/src/modules/graphics/opengl.c b/src/modules/graphics/opengl.c index 5282b8da..fdde9d5b 100644 --- a/src/modules/graphics/opengl.c +++ b/src/modules/graphics/opengl.c @@ -1536,7 +1536,7 @@ void lovrTextureReplacePixels(Texture* texture, TextureData* textureData, uint32 uint32_t height = textureData->height; bool overflow = (x + width > maxWidth) || (y + height > maxHeight); lovrAssert(!overflow, "Trying to replace pixels outside the texture's bounds"); - lovrAssert(mipmap >= 0 && mipmap < texture->mipmapCount, "Invalid mipmap level %d", mipmap); + lovrAssert(mipmap < texture->mipmapCount, "Invalid mipmap level %d", mipmap); GLenum glFormat = convertTextureFormat(textureData->format); GLenum glInternalFormat = convertTextureFormatInternal(textureData->format, texture->srgb); GLenum binding = (texture->type == TEXTURE_CUBE) ? GL_TEXTURE_CUBE_MAP_POSITIVE_X + slice : texture->target;