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;