From fec5f2778e6ec27dc6c4272a720e744fc5c902ec Mon Sep 17 00:00:00 2001 From: James R <justsomejames2@gmail.com> Date: Sun, 12 Sep 2021 18:53:51 -0700 Subject: [PATCH] Fix compiler warnings --- src/filesrch.c | 2 +- src/filesrch.h | 2 +- src/lua_hudlib.c | 10 ++++++---- src/sdl/i_system.c | 2 +- src/w_wad.h | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/filesrch.c b/src/filesrch.c index e5c9b21589..b4039e5263 100644 --- a/src/filesrch.c +++ b/src/filesrch.c @@ -13,6 +13,7 @@ /// FS_FOUND #include <stdio.h> +#include <errno.h> #ifdef __GNUC__ #include <dirent.h> #endif @@ -33,7 +34,6 @@ #if defined (_WIN32) && defined (_MSC_VER) -#include <errno.h> #include <io.h> #include <tchar.h> diff --git a/src/filesrch.h b/src/filesrch.h index e358d79935..9d5f31bbb8 100644 --- a/src/filesrch.h +++ b/src/filesrch.h @@ -31,7 +31,7 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want INT32 pathisdirectory(const char *path); INT32 samepaths(const char *path1, const char *path2); -boolean concatpaths(const char *path, const char *startpath); +INT32 concatpaths(const char *path, const char *startpath); #ifndef AVOID_ERRNO extern int direrror; diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 25f513e65f..fca832053b 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -401,14 +401,16 @@ static int camera_set(lua_State *L) case camera_x: case camera_y: return luaL_error(L, LUA_QL("camera_t") " field " LUA_QS " should not be set directly. Use " LUA_QL("P_TryCameraMove") " or " LUA_QL("P_TeleportCameraMove") " instead.", camera_opt[field]); - case camera_chase: + case camera_chase: { + INT32 chase = luaL_checkboolean(L, 3); if (cam == &camera) - CV_SetValue(&cv_chasecam, (INT32)luaL_checkboolean(L, 3)); + CV_SetValue(&cv_chasecam, chase); else if (cam == &camera2) - CV_SetValue(&cv_chasecam2, (INT32)luaL_checkboolean(L, 3)); + CV_SetValue(&cv_chasecam2, chase); else // ??? this should never happen, but ok - cam->chase = luaL_checkboolean(L, 3); + cam->chase = chase; break; + } case camera_aiming: cam->aiming = luaL_checkangle(L, 3); break; diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index a3908c5701..2ec28ebc82 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -550,7 +550,7 @@ static void I_StartupConsole(void) void I_GetConsoleEvents(void) { // we use this when sending back commands - event_t ev = {0,0,0,0}; + event_t ev = {0}; char key = 0; ssize_t d; diff --git a/src/w_wad.h b/src/w_wad.h index 3958f7faff..949bab9fec 100644 --- a/src/w_wad.h +++ b/src/w_wad.h @@ -152,7 +152,7 @@ void W_InitMultipleFiles(char **filenames); #define W_FileHasFolders(wadfile) ((wadfile)->type == RET_PK3 || (wadfile)->type == RET_FOLDER) -boolean W_IsPathToFolderValid(const char *path); +INT32 W_IsPathToFolderValid(const char *path); char *W_GetFullFolderPath(const char *path); const char *W_CheckNameForNumPwad(UINT16 wad, UINT16 lump); -- GitLab