From 94abaa13cdc1d4fcdbd822794173d567c861a55e Mon Sep 17 00:00:00 2001 From: erysdren Date: Fri, 12 Jul 2024 15:29:23 -0500 Subject: [PATCH] Fix building with MSVC (#74) * (hopefully) fix compilation on MSVC based on https://github.com/erysdren/ROTTEN/commit/fd118e1 * stuff i missed * inexplicable cppcheck failure * CMakeLists: add some comments explaining MSVC stuff * rt_sound.c: remove unnecessary include * Presumably this isn't needed, if this branch works --- CMakeLists.txt | 8 +++ README.md | 1 - rott/dosutil.c | 4 +- rott/m_misc2.c | 4 ++ rott/modexlib.c | 4 +- rott/rt_def.h | 17 ++++- rott/rt_game.c | 2 +- rott/rt_main.c | 5 ++ rott/rt_menu.c | 178 ++++++++++++++++++++++++------------------------ rott/rt_sound.c | 2 - rott/rt_str.h | 4 +- rott/rt_view.c | 2 +- 12 files changed, 130 insertions(+), 101 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4540f3..9e2d124 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,14 @@ target_link_libraries(${TARADINO_EXEC} PRIVATE SDL2::Main SDL2::Mixer) target_compile_definitions(${TARADINO_EXEC} PRIVATE PACKAGE_STRING="${TARADINO_TITLE} ${CMAKE_PROJECT_VERSION}") target_compile_definitions(${TARADINO_EXEC} PRIVATE PACKAGE_TARNAME="${CMAKE_PROJECT_NAME}") +if(MSVC) + set_property(TARGET ${TARADINO_EXEC} PROPERTY C_STANDARD 17) + # silence warnings about POSIX functions + target_compile_options(${TARADINO_EXEC} PUBLIC -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -Dstrcasecmp=_stricmp -Dalloca=_alloca) + # silence unsigned/signed and integer truncation warnings + target_compile_options(${TARADINO_EXEC} PRIVATE /wd4267 /wd4244) +endif() + if(${TARADINO_SHAREWARE}) target_compile_definitions(${TARADINO_EXEC} PRIVATE SHAREWARE=1) endif() diff --git a/README.md b/README.md index 4fcd7a6..56a37dc 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ library named SDL_mixer. - Demos go out of sync. - No netplay support. -- Won't build with MSVC. ## Building diff --git a/rott/dosutil.c b/rott/dosutil.c index fac600d..297e3a2 100644 --- a/rott/dosutil.c +++ b/rott/dosutil.c @@ -24,6 +24,7 @@ int _argc; char **_argv; +#ifndef _MSC_VER long filelength(int handle) { struct stat buf; @@ -47,6 +48,7 @@ char *strlwr(char *s) return s; } +#endif char *strupr(char *s) { @@ -161,7 +163,7 @@ void DisplayTextSplash(byte *text, int l) printf ("\033[m"); } -#if !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__HAIKU__) +#if !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__HAIKU__) && !defined(_MSC_VER) #include void print_stack (int level) diff --git a/rott/m_misc2.c b/rott/m_misc2.c index a36c2ad..7f4cb6d 100644 --- a/rott/m_misc2.c +++ b/rott/m_misc2.c @@ -24,6 +24,10 @@ #include #include +#ifdef _MSC_VER +#include +#endif + #include "m_misc2.h" // Create a directory diff --git a/rott/modexlib.c b/rott/modexlib.c index 5aabf8a..7459f13 100644 --- a/rott/modexlib.c +++ b/rott/modexlib.c @@ -413,7 +413,7 @@ void EnableScreenStretch(void) iGLOBAL_SCREENWIDTH, iGLOBAL_SCREENHEIGHT, 8, 0, 0, 0, 0); } - displayofs = unstretch_sdl_surface->pixels + + displayofs = (byte *)unstretch_sdl_surface->pixels + (displayofs - (byte *)sdl_surface->pixels); bufferofs = unstretch_sdl_surface->pixels; page1start = unstretch_sdl_surface->pixels; @@ -426,7 +426,7 @@ void DisableScreenStretch(void) { if (iGLOBAL_SCREENWIDTH <= 320 || !StretchScreen) return; - displayofs = sdl_surface->pixels + + displayofs = (byte *)sdl_surface->pixels + (displayofs - (byte *)unstretch_sdl_surface->pixels); bufferofs = sdl_surface->pixels; page1start = sdl_surface->pixels; diff --git a/rott/rt_def.h b/rott/rt_def.h index 21b1757..72e6f8d 100644 --- a/rott/rt_def.h +++ b/rott/rt_def.h @@ -28,10 +28,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "develop.h" #include "rt_fixed.h" -#include #include #include + +#ifndef _MSC_VER +#include #include +#else +#include +#define R_OK 4 +#define W_OK 2 +#define F_OK 0 +#endif + #include #include @@ -48,6 +57,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define CURDIR "./" #endif +#ifdef _MSC_VER +#define __attribute__(...) +#endif + #if defined(__GNUC__) || defined(__clang__) #define PRINTF_ATTR(fmt, first) __attribute__((format(printf, fmt, first))) #define PRINTF_ARG_ATTR(x) __attribute__((format_arg(x))) @@ -123,12 +136,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define arrlen(array) (sizeof(array) / sizeof(*array)) +#ifndef _MSC_VER char *strupr(char *); char *itoa(int, char *, int); char *ltoa(long, char *, int); char *ultoa(unsigned long, char *, int); char getch(void); long filelength(int handle); +#endif #define STUB_FUNCTION fprintf(stderr,"STUB: %s at " __FILE__ ", line %d, thread %d\n",__FUNCTION__,__LINE__,getpid()) diff --git a/rott/rt_game.c b/rott/rt_game.c index 332df2a..5ef05ec 100644 --- a/rott/rt_game.c +++ b/rott/rt_game.c @@ -4450,7 +4450,7 @@ player->yzangle=0; IN_UserInput (VBLCOUNTER*60); MainMenu[savegame].active = 0; - MainMenu[viewscores].routine = (menuptr)CP_ViewScores; + MainMenu[viewscores].routine = (menuptr){.vv = CP_ViewScores}; MainMenu[viewscores].texture[6] = '7'; MainMenu[viewscores].texture[7] = '\0'; MainMenu[viewscores].letter = 'V'; diff --git a/rott/rt_main.c b/rott/rt_main.c index b47d4d3..ecbcb3b 100644 --- a/rott/rt_main.c +++ b/rott/rt_main.c @@ -72,6 +72,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "music.h" #include "fx_man.h" +#ifdef _MSC_VER +#include +#include +#endif + #include "vgatext.h" volatile int oldtime; diff --git a/rott/rt_menu.c b/rott/rt_menu.c index c3c7946..6da7da1 100644 --- a/rott/rt_menu.c +++ b/rott/rt_menu.c @@ -376,15 +376,15 @@ CP_MenuNames MainMenuNames[] = CP_iteminfo MainItems = { MENU_X, MENU_Y + 1, 9, STARTITEM, 32, MainMenuNames, mn_largefont }; CP_itemtype MainMenu[] = { - { CP_CursorLocation, "mm_opt1\0", 'N', (menuptr)CP_NewGame }, - { CP_Active, "battle\0", 'C', (menuptr)CP_BattleModes }, - { CP_Active, "mm_opt2\0", 'R', (menuptr)CP_LoadGame }, - { CP_Inactive, "mm_opt3\0", 'S', (menuptr)CP_SaveGame }, - { CP_Active, "mm_opt5\0", 'O', (menuptr)CP_ControlMenu }, - { CP_Active, "ordrinfo\0", 'O', (menuptr)CP_OrderInfo }, - { CP_Active, "mm_opt7\0", 'V', (menuptr)CP_ViewScores }, - { CP_Active, "mm_opt8\0", 'B', (menuptr)NULL }, - { CP_Active, "mm_opt9\0", 'Q', (menuptr)CP_Quit } + { CP_CursorLocation, "mm_opt1\0", 'N', { .vv = CP_NewGame } }, + { CP_Active, "battle\0", 'C', { .vv = CP_BattleModes } }, + { CP_Active, "mm_opt2\0", 'R', { .iii = CP_LoadGame } }, + { CP_Inactive, "mm_opt3\0", 'S', { .iv = CP_SaveGame } }, + { CP_Active, "mm_opt5\0", 'O', { .vv = CP_ControlMenu } }, + { CP_Active, "ordrinfo\0", 'O', { .vv = CP_OrderInfo } }, + { CP_Active, "mm_opt7\0", 'V', { .vv = CP_ViewScores } }, + { CP_Active, "mm_opt8\0", 'B', { .vv = NULL } }, + { CP_Active, "mm_opt9\0", 'Q', { .vi = CP_Quit } } }; @@ -426,9 +426,9 @@ CP_itemtype CtlMenu[] = { CP_Inactive, "ctl_jen\0", 'J', {NULL} }, { CP_Inactive, "ctl_jp2\0", 'U', {NULL} }, { CP_Inactive, "ctl_gpd\0", 'G', {NULL} }, - { CP_Inactive, "ctl_thr\0", 'A', (menuptr)DoThreshold }, - { CP_Inactive, "ctl_mse\0", 'M', (menuptr)MouseSensitivity }, - { CP_Active, "ctl_cus\0", 'C', (menuptr)CP_Custom } + { CP_Inactive, "ctl_thr\0", 'A', { .vv = DoThreshold } }, + { CP_Inactive, "ctl_mse\0", 'M',{ .vv = MouseSensitivity } }, + { CP_Active, "ctl_cus\0", 'C', { .vv = CP_Custom } } }; CP_iteminfo CusItems = { 32, CST_Y + 13 * 2, 9, -1, 0, NULL, mn_largefont }; @@ -499,11 +499,10 @@ CP_MenuNames CustomMenuNames[] = CP_iteminfo CustomItems = {32, 64, 3, 0, 24, CustomMenuNames, mn_largefont }; -CP_itemtype CustomMenu[] = -{ - {2, "custom1\0", 'C', (menuptr)CP_Keyboard}, - {1, "custom2\0", 'C', (menuptr)CP_Mouse}, - {1, "custom3\0", 'C', (menuptr)CP_Joystick} +CP_itemtype CustomMenu[] = { + { 2, "custom1\0", 'C', { .vv = CP_Keyboard } }, + { 1, "custom2\0", 'C', { .vv = CP_Mouse } }, + { 1, "custom3\0", 'C', { .vv = CP_Joystick } } }; #define KEYNAMEINDEX 21 @@ -539,27 +538,27 @@ CP_iteminfo NormalKeyItems = { NORMALKEY_X, 17, 21, 0, 16, NormalKeyNames, mn_ti CP_itemtype NormalKeyMenu[] = { - { 2, "\0", 'L', (menuptr)DefineKey }, - { 1, "\0", 'R', (menuptr)DefineKey }, - { 1, "\0", 'F', (menuptr)DefineKey }, - { 1, "\0", 'B', (menuptr)DefineKey }, - { 1, "\0", 'R', (menuptr)DefineKey }, - { 1, "\0", 'O', (menuptr)DefineKey }, - { 1, "\0", 'F', (menuptr)DefineKey }, - { 1, "\0", 'S', (menuptr)DefineKey }, - { 1, "\0", 'S', (menuptr)DefineKey }, - { 1, "\0", 'S', (menuptr)DefineKey }, - { 1, "\0", 'L', (menuptr)DefineKey }, - { 1, "\0", 'L', (menuptr)DefineKey }, - { 1, "\0", 'A', (menuptr)DefineKey }, - { 1, "\0", 'A', (menuptr)DefineKey }, - { 1, "\0", 'T', (menuptr)DefineKey }, - { 1, "\0", 'D', (menuptr)DefineKey }, - { 1, "\0", 'V', (menuptr)DefineKey }, - { 1, "\0", 'A', (menuptr)DefineKey }, - { 1, "\0", 'A', (menuptr)DefineKey }, - { 1, "\0", 'S', (menuptr)DefineKey }, - { 1, "\0", 'D', (menuptr)DefineKey } + { 2, "\0", 'L', { .vv = DefineKey } }, + { 1, "\0", 'R', { .vv = DefineKey } }, + { 1, "\0", 'F', { .vv = DefineKey } }, + { 1, "\0", 'B', { .vv = DefineKey } }, + { 1, "\0", 'R', { .vv = DefineKey } }, + { 1, "\0", 'O', { .vv = DefineKey } }, + { 1, "\0", 'F', { .vv = DefineKey } }, + { 1, "\0", 'S', { .vv = DefineKey } }, + { 1, "\0", 'S', { .vv = DefineKey } }, + { 1, "\0", 'S', { .vv = DefineKey } }, + { 1, "\0", 'L', { .vv = DefineKey } }, + { 1, "\0", 'L', { .vv = DefineKey } }, + { 1, "\0", 'A', { .vv = DefineKey } }, + { 1, "\0", 'A', { .vv = DefineKey } }, + { 1, "\0", 'T', { .vv = DefineKey } }, + { 1, "\0", 'D', { .vv = DefineKey } }, + { 1, "\0", 'V', { .vv = DefineKey } }, + { 1, "\0", 'A', { .vv = DefineKey } }, + { 1, "\0", 'A', { .vv = DefineKey } }, + { 1, "\0", 'S', { .vv = DefineKey } }, + { 1, "\0", 'D', { .vv = DefineKey } } }; #define NUMCONTROLNAMES 21 @@ -640,12 +639,12 @@ CP_iteminfo MouseBtnItems = { 19, 52, 6, 0, 11, MouseBtnNames, mn_8x8font }; CP_itemtype MouseBtnMenu[] = { - { 2, "\0", 'B', (menuptr)DefineMouseBtn }, - { 1, "\0", 'B', (menuptr)DefineMouseBtn }, - { 1, "\0", 'B', (menuptr)DefineMouseBtn }, - { 1, "\0", 'D', (menuptr)DefineMouseBtn }, - { 1, "\0", 'D', (menuptr)DefineMouseBtn }, - { 1, "\0", 'D', (menuptr)DefineMouseBtn } + { 2, "\0", 'B', { .vv = DefineMouseBtn } }, + { 1, "\0", 'B', { .vv = DefineMouseBtn } }, + { 1, "\0", 'B', { .vv = DefineMouseBtn } }, + { 1, "\0", 'D', { .vv = DefineMouseBtn } }, + { 1, "\0", 'D', { .vv = DefineMouseBtn } }, + { 1, "\0", 'D', { .vv = DefineMouseBtn } } }; @@ -667,14 +666,14 @@ CP_iteminfo JoyBtnItems = { 19, 48, 8, 0, 11, JoyBtnNames, mn_8x8font }; CP_itemtype JoyBtnMenu[] = { - { 2, "\0", 'B', (menuptr)DefineJoyBtn }, - { 1, "\0", 'B', (menuptr)DefineJoyBtn }, - { 1, "\0", 'B', (menuptr)DefineJoyBtn }, - { 1, "\0", 'B', (menuptr)DefineJoyBtn }, - { 1, "\0", 'D', (menuptr)DefineJoyBtn }, - { 1, "\0", 'D', (menuptr)DefineJoyBtn }, - { 1, "\0", 'D', (menuptr)DefineJoyBtn }, - { 1, "\0", 'D', (menuptr)DefineJoyBtn } + { 2, "\0", 'B', { .vv = DefineJoyBtn } }, + { 1, "\0", 'B', { .vv = DefineJoyBtn } }, + { 1, "\0", 'B', { .vv = DefineJoyBtn } }, + { 1, "\0", 'B', { .vv = DefineJoyBtn } }, + { 1, "\0", 'D', { .vv = DefineJoyBtn } }, + { 1, "\0", 'D', { .vv = DefineJoyBtn } }, + { 1, "\0", 'D', { .vv = DefineJoyBtn } }, + { 1, "\0", 'D', { .vv = DefineJoyBtn } } }; CP_MenuNames PlayerMenuNames[] = @@ -711,12 +710,11 @@ CP_iteminfo ControlMItems = {32, 48-8, 5, 0, 32, ControlMMenuNames, mn_largefont CP_itemtype ControlMMenu[] = { - {2, "cntl\0", 'C', (menuptr)CP_Control}, - {1, "uopt\0", 'U', (menuptr)CP_OptionsMenu}, - {1, "euopt\0", 'E', (menuptr)CP_ExtOptionsMenu},//bna added - {1, "muvolumn\0", 'M', (menuptr)MusicVolume}, - {1, "fxvolumn\0", 'S', (menuptr)FXVolume} - + { 2, "cntl\0", 'C', { .vv = CP_Control } }, + { 1, "uopt\0", 'U', { .vv = CP_OptionsMenu } }, + { 1, "euopt\0", 'E', { .vv = CP_ExtOptionsMenu } }, // bna added + { 1, "muvolumn\0", 'M', { .vv = MusicVolume } }, + { 1, "fxvolumn\0", 'S', { .vv = FXVolume } } }; CP_MenuNames OptionsNames[] = @@ -760,11 +758,11 @@ CP_itemtype OptionsMenu[] = {1, "lightdim\0",'L', {NULL}}, {1, "bobbin\0", 'B', {NULL}}, {1, "fandc\0", 'F', {NULL}}, - {1, "double\0", 'D', (menuptr)CP_DoubleClickSpeed}, - {1, "menuspd\0", 'M', (menuptr)MenuFlipSpeed}, - {1, "detail\0", 'D', (menuptr)CP_DetailMenu}, - {1, "vlevel\0", 'V', (menuptr)CP_ViolenceMenu}, - {1, "\0", 'S', (menuptr)CP_ScreenSize} + {1, "double\0", 'D', { .vv = CP_DoubleClickSpeed }}, + {1, "menuspd\0", 'M', { .vv = MenuFlipSpeed }}, + {1, "detail\0", 'D', { .vv = CP_DetailMenu }}, + {1, "vlevel\0", 'V', { .vv = CP_ViolenceMenu }}, + {1, "\0", 'S', { .vv = CP_ScreenSize }} }; CP_MenuNames DetailMenuNames[] = @@ -794,9 +792,9 @@ CP_iteminfo BattleItems = { 32, 19, 3, 0, 24, BattleMenuNames, mn_largefont }; CP_itemtype BattleMenu[] = { - {2, "bplay\0", 'P', (menuptr)BattleNoTeams}, - {1, "playteam\0", 'P', (menuptr)BattleTeams}, - {1, "comopt\0", 'C', (menuptr)CP_BattleOptions} + {2, "bplay\0", 'P', { .vv = BattleNoTeams }}, + {1, "playteam\0", 'P', { .vv = BattleTeams }}, + {1, "comopt\0", 'C', { .vv = CP_BattleOptions }} }; CP_MenuNames ViolenceMenuNames[] = @@ -827,8 +825,8 @@ CP_iteminfo VItems = { 32, MP_Y, 2, 0, 24, VMenuNames, mn_largefont }; CP_itemtype VMenu[] = { - {2, "msetv\0", 'S', (menuptr)CP_ViolenceLevel}, - {1, "mepass\0", 'E', (menuptr)CP_PWMenu} + {2, "msetv\0", 'S', { .vv = CP_ViolenceLevel }}, + {1, "mepass\0", 'E', { .vv = CP_PWMenu }} }; CP_MenuNames ModeMenuNames[] = @@ -848,15 +846,15 @@ CP_iteminfo ModeItems = { MENU_X, MENU_Y + 1, 9, 0, 24, ModeMenuNames, mn_largef CP_itemtype ModeMenu[] = { - {CP_CursorLocation, "normal\0", 'N', (menuptr)CP_BattleMenu}, - {CP_Active, "scorem\0", 'S', (menuptr)CP_BattleMenu}, - {CP_Active, "collect\0", 'C', (menuptr)CP_BattleMenu}, - {CP_Active, "scaven\0", 'S', (menuptr)CP_BattleMenu}, - {CP_Active, "hunter\0", 'H', (menuptr)CP_BattleMenu}, - {CP_Active, "tag\0", 'T', (menuptr)CP_BattleMenu}, - {CP_Active, "eluder\0", 'E', (menuptr)CP_BattleMenu}, - {CP_Active, "deluder\0", 'D', (menuptr)CP_BattleMenu}, - {CP_Active, "captriad\0", 'C', (menuptr)CP_BattleMenu} + {CP_CursorLocation, "normal\0", 'N', { .vv = CP_BattleMenu }}, + {CP_Active, "scorem\0", 'S', { .vv = CP_BattleMenu }}, + {CP_Active, "collect\0", 'C', { .vv = CP_BattleMenu }}, + {CP_Active, "scaven\0", 'S', { .vv = CP_BattleMenu }}, + {CP_Active, "hunter\0", 'H', { .vv = CP_BattleMenu }}, + {CP_Active, "tag\0", 'T', { .vv = CP_BattleMenu }}, + {CP_Active, "eluder\0", 'E', { .vv = CP_BattleMenu }}, + {CP_Active, "deluder\0", 'D', { .vv = CP_BattleMenu }}, + {CP_Active, "captriad\0", 'C', { .vv = CP_BattleMenu }} }; CP_MenuNames BOptNames[] = @@ -876,15 +874,15 @@ CP_iteminfo BOptItems = { MENU_X, MENU_Y + 1, 9, 0, 24, BOptNames, mn_largefont CP_itemtype BOptMenu[] = { - {2, "gravity\0", 'G', (menuptr)CP_GravityOptions}, - {1, "speed\0", 'S', (menuptr)CP_SpeedOptions}, - {1, "ammoper\0", 'A', (menuptr)CP_AmmoPerWeaponOptions}, - {1, "hitp\0", 'H', (menuptr)CP_HitPointsOptions}, - {1, "radical\0", 'R', (menuptr)CP_SpawnControlOptions}, - {1, "lightl\0", 'L', (menuptr)CP_LightLevelOptions}, - {1, "pntgoal\0", 'P', (menuptr)CP_PointGoalOptions}, - {1, "danger\0", 'D', (menuptr)CP_DangerOptions}, - {1, "timel\0", 'T', (menuptr)CP_TimeLimitOptions} + {2, "gravity\0", 'G', {.vv = CP_GravityOptions}}, + {1, "speed\0", 'S', {.vv = CP_SpeedOptions}}, + {1, "ammoper\0", 'A', {.vv = CP_AmmoPerWeaponOptions}}, + {1, "hitp\0", 'H', {.vv = CP_HitPointsOptions}}, + {1, "radical\0", 'R', {.vv = CP_SpawnControlOptions}}, + {1, "lightl\0", 'L', {.vv = CP_LightLevelOptions}}, + {1, "pntgoal\0", 'P', {.vv = CP_PointGoalOptions}}, + {1, "danger\0", 'D', {.vv = CP_DangerOptions}}, + {1, "timel\0", 'T', {.vv = CP_TimeLimitOptions}} }; CP_MenuNames GravityMenuNames[] = @@ -1536,7 +1534,7 @@ void SetUpControlPanel (void) if ( consoleplayer != 0 ) { - MainMenu[battlemode].routine = (menuptr)BattleGamePlayerSetup; + MainMenu[battlemode].routine = (menuptr) { .vv = BattleGamePlayerSetup}; } } } @@ -3158,7 +3156,7 @@ void AdjustMenuStruct { MainMenu[ savegame ].active = CP_Inactive; - MainMenu[ viewscores ].routine = (menuptr)CP_ViewScores; + MainMenu[ viewscores ].routine = (menuptr){.vv = CP_ViewScores}; MainMenu[ viewscores ].texture[ 6 ] = '7'; MainMenu[ viewscores ].texture[ 7 ] = '\0'; MainMenu[ viewscores ].letter = 'V'; @@ -5000,7 +4998,7 @@ void MenuFixup MainMenu[ viewscores ].texture[ 6 ] = '1'; MainMenu[ viewscores ].texture[ 7 ] = '0'; MainMenu[ viewscores ].texture[ 8 ] = '\0'; - MainMenu[ viewscores ].routine = (menuptr)CP_EndGame; + MainMenu[ viewscores ].routine = (menuptr) { .vv = CP_EndGame }; MainMenu[ viewscores ].letter = 'E'; strcpy (MainMenuNames[ viewscores ] , "END GAME"); MainMenu[ savegame ].active = CP_Active; @@ -6339,7 +6337,7 @@ void DrawTimeLimitOptionDescription( int w ) #define TURN_OFF_BATTLE_MODE( x ) \ ModeMenu[ ( x ) - 1 ].active = CP_SemiActive; \ - ModeMenu[ ( x ) - 1 ].routine = (menuptr)NULL; + ModeMenu[ ( x ) - 1 ].routine = (menuptr) { .vv = NULL }; //**************************************************************************** diff --git a/rott/rt_sound.c b/rott/rt_sound.c index e72617c..395a927 100644 --- a/rott/rt_sound.c +++ b/rott/rt_sound.c @@ -33,8 +33,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include -#include - #include "rt_cfg.h" #include "isr.h" #include "develop.h" diff --git a/rott/rt_str.h b/rott/rt_str.h index 9a2b5b7..125dbbf 100644 --- a/rott/rt_str.h +++ b/rott/rt_str.h @@ -26,9 +26,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef _rt_str_public #define _rt_str_public +#include "rt_def.h" #include "lumpy.h" - //*************************************************************************** // // GLOBALS @@ -78,7 +78,7 @@ void US_ClippedPrint (int x, int y, const char *s); void VWB_DrawPropString (const char *string); void VW_MeasurePropString (const char *string, int *width, int *height); -void US_MeasureStr (int *width, int *height, const char * s, ...) __attribute__((format(printf,3,4))); +void US_MeasureStr(int *width, int *height, const char *s, ...) PRINTF_ATTR(3, 4); void VW_DrawPropString (const char *string); diff --git a/rott/rt_view.c b/rott/rt_view.c index 057d794..f76297f 100644 --- a/rott/rt_view.c +++ b/rott/rt_view.c @@ -508,7 +508,7 @@ void LoadColorMap( void ) #define LIGHTLEVELEND 223 void SetupLightLevels ( void ) { - int glevel; + int glevel = 0; periodic=false; fog=0;