From 15f5a35fd8ccc5ebc4e4a6c4eef30a3b2826bd06 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 21 Sep 2019 19:38:38 +0200 Subject: [PATCH] - removed all extern "C" from EDuke32 folder, plus some other dead code I noticed. --- source/duke3d/src/_functio.h | 63 +-------------------------------- source/duke3d/src/actors.h | 7 ---- source/duke3d/src/common_game.h | 8 ----- source/duke3d/src/function.h | 6 ---- source/duke3d/src/game.h | 6 ---- source/duke3d/src/gamedef.h | 8 ----- source/duke3d/src/gamedefs.h | 6 ---- source/duke3d/src/gameexec.cpp | 4 --- source/duke3d/src/gameexec.h | 16 --------- source/duke3d/src/global.cpp | 7 ---- source/duke3d/src/global.h | 8 ----- source/duke3d/src/grpscan.h | 8 ----- source/duke3d/src/menus.h | 15 -------- source/duke3d/src/osdcmds.h | 8 ----- source/duke3d/src/player.h | 12 ------- source/duke3d/src/premap.h | 8 ----- source/duke3d/src/savegame.h | 12 ------- source/duke3d/src/screentext.h | 7 ---- source/duke3d/src/sector.h | 8 ----- source/duke3d/src/sounds.h | 8 ----- 20 files changed, 1 insertion(+), 224 deletions(-) diff --git a/source/duke3d/src/_functio.h b/source/duke3d/src/_functio.h index fe9ace01b..0d51bb5bc 100644 --- a/source/duke3d/src/_functio.h +++ b/source/duke3d/src/_functio.h @@ -32,9 +32,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef function_private_h_ #define function_private_h_ -#ifdef __cplusplus -extern "C" { -#endif + // KEEPINSYNC lunatic/con_lang.lua char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN] = { @@ -282,65 +280,6 @@ static const char * mousedigitaldefaults[MAXMOUSEDIGITAL] = { }; -#if defined GEKKO -static const char * joystickdefaults[MAXJOYBUTTONSANDHATS] = - { - "Open", // A - "Fire", // B - "Run", // 1 - "Map", // 2 - "Previous_Weapon", // - - "Next_Weapon", // + - "", // Home - "Jump", // Z - "Crouch", // C - "Map", // X - "Run", // Y - "Jump", // L - "Quick_Kick", // R - "Crouch", // ZL - "Fire", // ZR - "Quick_Kick", // D-Pad Up - "Inventory_Right", // D-Pad Right - "Inventory", // D-Pad Down - "Inventory_Left", // D-Pad Left - }; - - -static const char * joystickclickeddefaults[MAXJOYBUTTONSANDHATS] = - { - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "Inventory", - }; - - -static const char * joystickanalogdefaults[MAXJOYAXES] = - { - "analog_strafing", - "analog_moving", - "analog_turning", - "analog_lookingupanddown", - }; - - -static const char * joystickdigitaldefaults[MAXJOYDIGITAL] = - { - }; -#endif -#endif -#ifdef __cplusplus -} #endif #endif diff --git a/source/duke3d/src/actors.h b/source/duke3d/src/actors.h index 1dcb1f996..379cf72de 100644 --- a/source/duke3d/src/actors.h +++ b/source/duke3d/src/actors.h @@ -25,10 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "player.h" -#ifdef __cplusplus -extern "C" { -#endif - #define MAXSLEEPDIST 16384 #define SLEEPTIME 1536 #define ZOFFSET (1<<8) @@ -487,9 +483,6 @@ EXTERN_INLINE_HEADER int G_CheckForSpaceFloor(int sectnum); EXTERN_INLINE_HEADER int A_CheckEnemySprite(void const * s); -#ifdef __cplusplus -} -#endif #if defined actors_c_ || !defined DISABLE_INLINING diff --git a/source/duke3d/src/common_game.h b/source/duke3d/src/common_game.h index 9b10ebf3d..3be771a64 100644 --- a/source/duke3d/src/common_game.h +++ b/source/duke3d/src/common_game.h @@ -12,10 +12,6 @@ #include "vfs.h" -#ifdef __cplusplus -extern "C" { -#endif - extern int g_useCwd; #ifndef APPNAME @@ -157,8 +153,4 @@ extern buildvfs_kfd S_OpenAudio(const char *fn, char searchfirst, uint8_t ismusi # define S_OpenAudio(fn, searchfirst, ismusic) kopen4loadfrommod(fn, searchfirst) #endif -#ifdef __cplusplus -} -#endif - #endif diff --git a/source/duke3d/src/function.h b/source/duke3d/src/function.h index 3ea45289c..3e79e7054 100644 --- a/source/duke3d/src/function.h +++ b/source/duke3d/src/function.h @@ -30,9 +30,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef function_public_h_ #define function_public_h_ -#ifdef __cplusplus -extern "C" { -#endif #define NUMGAMEFUNCTIONS 63 #define MAXGAMEFUNCLEN 32 @@ -107,7 +104,4 @@ enum GameFunction_t gamefunc_Third_Person_View, gamefunc_Toggle_Crouch, }; -#ifdef __cplusplus -} -#endif #endif diff --git a/source/duke3d/src/game.h b/source/duke3d/src/game.h index dd68169ab..820958edc 100644 --- a/source/duke3d/src/game.h +++ b/source/duke3d/src/game.h @@ -35,9 +35,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "mmulti.h" #include "network.h" -#ifdef __cplusplus -extern "C" { -#endif #ifndef ONLY_USERDEFS @@ -616,9 +613,6 @@ EXTERN_INLINE_HEADER void SetIfGreater(int32_t *variable, int32_t potentialValue #endif -#ifdef __cplusplus -} -#endif #ifndef ONLY_USERDEFS diff --git a/source/duke3d/src/gamedef.h b/source/duke3d/src/gamedef.h index 2cbb160bb..04f163d70 100644 --- a/source/duke3d/src/gamedef.h +++ b/source/duke3d/src/gamedef.h @@ -31,10 +31,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "common.h" // tokenlist #include "player.h" // projectile_t -#ifdef __cplusplus -extern "C" { -#endif - enum { LABEL_ACTION = 0x01, @@ -1404,8 +1400,4 @@ enum ScriptKeywords_t #endif -#ifdef __cplusplus -} -#endif - #endif // gamedef_h_ diff --git a/source/duke3d/src/gamedefs.h b/source/duke3d/src/gamedefs.h index 117b820b0..2d105bf63 100644 --- a/source/duke3d/src/gamedefs.h +++ b/source/duke3d/src/gamedefs.h @@ -30,9 +30,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef gamedefs_public_h_ #define gamedefs_public_h_ -#ifdef __cplusplus -extern "C" { -#endif // config file name #define SETUPFILENAME APPBASENAME ".cfg" @@ -64,8 +61,5 @@ extern "C" { #define DEFAULTJOYSTICKANALOGUESATURATE 9500 #endif -#ifdef __cplusplus -} -#endif #endif diff --git a/source/duke3d/src/gameexec.cpp b/source/duke3d/src/gameexec.cpp index 3d1193459..d9ecd6cd3 100644 --- a/source/duke3d/src/gameexec.cpp +++ b/source/duke3d/src/gameexec.cpp @@ -285,10 +285,6 @@ GAMEEXEC_STATIC GAMEEXEC_INLINE void P_ForceAngle(DukePlayer_t *pPlayer) #endif // wow, this function sucks -#ifdef __cplusplus -extern "C" -#endif -bool A_Dodge(spritetype * const); bool A_Dodge(spritetype * const pSprite) { if (A_CheckEnemySprite(pSprite) && pSprite->extra <= 0) // hack diff --git a/source/duke3d/src/gameexec.h b/source/duke3d/src/gameexec.h index 521ce5c9a..a227311e8 100644 --- a/source/duke3d/src/gameexec.h +++ b/source/duke3d/src/gameexec.h @@ -66,10 +66,6 @@ static FORCE_INLINE int32_t VM_OnEventWithReturn(int nEventID, int spriteNum, in return VM_HaveEvent(nEventID) ? VM_ExecuteEventWithValue(nEventID, spriteNum, playerNum, nReturn) : nReturn; } -#ifdef __cplusplus -extern "C" { -#endif - enum vmflags_t { VM_RETURN = 0x00000001, @@ -127,20 +123,8 @@ void VM_DrawTileSmall(int32_t x, int32_t y, int32_t tilenum, int32_t shade, int3 void G_GetTimeDate(int32_t * pValues); int G_StartTrack(int levelNum); -#ifdef LUNATIC -void G_ShowView(vec3_t vec, fix16_t a, fix16_t horiz, int sect, - int ix1, int iy1, int ix2, int iy2, bool unbiasedp); -void P_AddWeaponMaybeSwitchI(int32_t snum, int32_t weap); -void VM_FallSprite(int32_t i); -int32_t VM_ResetPlayer2(int32_t snum, int32_t flags); -int32_t VM_CheckSquished2(int32_t i, int32_t snum); -#endif void VM_UpdateAnim(int const spriteNum, int32_t * const pData); void VM_GetZRange(int const spriteNum, int32_t * const ceilhit, int32_t * const florhit, int const wallDist); -#ifdef __cplusplus -} -#endif - #endif diff --git a/source/duke3d/src/global.cpp b/source/duke3d/src/global.cpp index 3d5868721..2487d2f59 100644 --- a/source/duke3d/src/global.cpp +++ b/source/duke3d/src/global.cpp @@ -28,9 +28,6 @@ user_defs ud; const char *s_buildDate = "20120522"; -#ifdef __cplusplus -extern "C" { -#endif #ifndef EDUKE32_STANDALONE char g_volumeNames[MAXVOLUMES][33] = { "L.A. Meltdown", "Lunar Apocalypse", "Shrapnel City" }; @@ -134,7 +131,3 @@ char CheatKeys[2] = { sc_D, sc_N }; char g_setupFileName[BMAX_PATH] = SETUPFILENAME; -#ifdef __cplusplus -} -#endif - diff --git a/source/duke3d/src/global.h b/source/duke3d/src/global.h index 6df195e71..d3bc6cbd5 100644 --- a/source/duke3d/src/global.h +++ b/source/duke3d/src/global.h @@ -51,10 +51,6 @@ G_EXTERN int32_t *curipos[MAXINTERPOLATIONS]; G_EXTERN int32_t bakipos[MAXINTERPOLATIONS]; -#ifdef __cplusplus -extern "C" { -#endif - G_EXTERN int32_t duke3d_globalflags; // KEEPINSYNC astub.c (used values only) @@ -206,10 +202,6 @@ enum EXTERN_INLINE_HEADER void G_UpdateInterpolations(void); EXTERN_INLINE_HEADER void G_RestoreInterpolations(void); -#ifdef __cplusplus -} -#endif - #if defined global_c_ || !defined DISABLE_INLINING EXTERN_INLINE void G_UpdateInterpolations(void) //Stick at beginning of G_DoMoveThings diff --git a/source/duke3d/src/grpscan.h b/source/duke3d/src/grpscan.h index 8a343fa11..d3761e274 100644 --- a/source/duke3d/src/grpscan.h +++ b/source/duke3d/src/grpscan.h @@ -23,10 +23,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef grpscan_h_ #define grpscan_h_ -#ifdef __cplusplus -extern "C" { -#endif - #define MAXLISTNAMELEN 32 // List of internally-known GRP files @@ -101,8 +97,4 @@ extern grpfile_t * FindGroup(int32_t crcval); int32_t ScanGroups(void); void FreeGroups(void); -#ifdef __cplusplus -} -#endif - #endif diff --git a/source/duke3d/src/menus.h b/source/duke3d/src/menus.h index 081bbc614..df807f8a8 100644 --- a/source/duke3d/src/menus.h +++ b/source/duke3d/src/menus.h @@ -25,17 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" -#ifdef __cplusplus -extern "C" { -#endif - -#if defined EDUKE32_TOUCH_DEVICES -# define EDUKE32_SIMPLE_MENU -# define EDUKE32_ANDROID_MENU -#endif - -// #define EDUKE32_SIMPLE_MENU - enum MenuIndex_t { MENU_NULL = INT32_MIN, // sentinel for "do nothing" MENU_CLOSE = -2, // sentinel for "close the menu"/"no menu" @@ -527,8 +516,4 @@ extern MenuGameplayStemEntry g_MenuGameplayEntries[MAXMENUGAMEPLAYENTRIES]; extern MenuEntry_t ME_NEWGAMECUSTOMENTRIES[MAXMENUGAMEPLAYENTRIES]; extern MenuEntry_t ME_NEWGAMECUSTOMSUBENTRIES[MAXMENUGAMEPLAYENTRIES][MAXMENUGAMEPLAYENTRIES]; -#ifdef __cplusplus -} -#endif - #endif diff --git a/source/duke3d/src/osdcmds.h b/source/duke3d/src/osdcmds.h index 841e9ca43..ea91ed91b 100644 --- a/source/duke3d/src/osdcmds.h +++ b/source/duke3d/src/osdcmds.h @@ -23,10 +23,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef osdcmds_h_ #define osdcmds_h_ -#ifdef __cplusplus -extern "C" { -#endif - struct osdcmd_cheatsinfo { int32_t cheatnum; // -1 = none, else = see DoCheats() int32_t volume,level; @@ -43,9 +39,5 @@ extern const char *const ConsoleButtons[]; extern uint32_t cl_cheatmask; -#ifdef __cplusplus -} -#endif - #endif // osdcmds_h_ diff --git a/source/duke3d/src/player.h b/source/duke3d/src/player.h index 086340fb7..05b64e450 100644 --- a/source/duke3d/src/player.h +++ b/source/duke3d/src/player.h @@ -26,10 +26,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "build.h" #include "inv.h" -#ifdef __cplusplus -extern "C" { -#endif - extern int32_t g_mostConcurrentPlayers; #define MOVEFIFOSIZ 2 @@ -371,11 +367,7 @@ void P_EndLevel(void); void P_CheckWeaponI(int playerNum); int P_GetHudPal(const DukePlayer_t *pPlayer); int P_GetKneePal(const DukePlayer_t *pPlayer); -#ifdef __cplusplus -} int P_GetKneePal(const DukePlayer_t *pPlayer, int hudPal); -extern "C" { -#endif int P_GetOverheadPal(const DukePlayer_t *pPlayer); int Proj_GetDamage(projectile_t const *pProj); @@ -415,10 +407,6 @@ static inline int P_GetP(const void *pSprite) // Get the player index given an APLAYER sprite index. static inline int P_Get(int32_t spriteNum) { return P_GetP((uspriteptr_t)&sprite[spriteNum]); } -#ifdef __cplusplus -} -#endif - extern int portableBackupSave(const char *, const char *, int, int); #endif diff --git a/source/duke3d/src/premap.h b/source/duke3d/src/premap.h index 6e6a8ebe7..73bb59f8d 100644 --- a/source/duke3d/src/premap.h +++ b/source/duke3d/src/premap.h @@ -23,10 +23,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef premap_h_ #define premap_h_ -#ifdef __cplusplus -extern "C" { -#endif - extern int32_t g_levelTextTime; extern int32_t voting,vote_map,vote_episode; extern palette_t CrosshairColors; @@ -49,8 +45,4 @@ void G_ClearFIFO(void); void G_ResetInterpolations(void); int fragbarheight(void); -#ifdef __cplusplus -} -#endif - #endif diff --git a/source/duke3d/src/savegame.h b/source/duke3d/src/savegame.h index 9bf42b04c..eb7d29054 100644 --- a/source/duke3d/src/savegame.h +++ b/source/duke3d/src/savegame.h @@ -27,9 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "vfs.h" -#ifdef __cplusplus -extern "C" { -#endif #ifdef LUNATIC # define SV_MAJOR_VER 2 @@ -155,13 +152,4 @@ enum void G_Util_PtrToIdx(void *ptr, int32_t count, const void *base, int32_t mode); void G_Util_PtrToIdx2(void *ptr, int32_t count, size_t stride, const void *base, int32_t mode); -#ifdef LUNATIC -extern const char *(*El_SerializeGamevars)(int32_t *slenptr, int32_t levelnum); -void El_FreeSaveCode(void); -#endif - -#ifdef __cplusplus -} -#endif - #endif diff --git a/source/duke3d/src/screentext.h b/source/duke3d/src/screentext.h index 787341734..b18bfc15f 100644 --- a/source/duke3d/src/screentext.h +++ b/source/duke3d/src/screentext.h @@ -24,10 +24,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "menus.h" -#ifdef __cplusplus -extern "C" { -#endif - #define MAXUSERQUOTES 6 extern int32_t user_quote_time[MAXUSERQUOTES]; @@ -97,6 +93,3 @@ extern void G_AddCoordsFromRotation(vec2_t *coords, const vec2_t *unitDirection, extern vec2_t G_ScreenText(int32_t font, int32_t x, int32_t y, int32_t z, int32_t blockangle, int32_t charangle, const char *str, int32_t shade, int32_t pal, int32_t o, int32_t alpha, int32_t xspace, int32_t yline, int32_t xbetween, int32_t ybetween, int32_t f, int32_t x1, int32_t y1, int32_t x2, int32_t y2); extern vec2_t G_ScreenTextShadow(int32_t sx, int32_t sy, int32_t font, int32_t x, int32_t y, int32_t z, int32_t blockangle, int32_t charangle, const char *str, int32_t shade, int32_t pal, int32_t o, int32_t alpha, int32_t xspace, int32_t yline, int32_t xbetween, int32_t ybetween, int32_t f, int32_t x1, int32_t y1, int32_t x2, int32_t y2); -#ifdef __cplusplus -} -#endif diff --git a/source/duke3d/src/sector.h b/source/duke3d/src/sector.h index a2fea29ed..85c0ae998 100644 --- a/source/duke3d/src/sector.h +++ b/source/duke3d/src/sector.h @@ -29,10 +29,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "namesdyn.h" // for G_GetForcefieldPicnum() #include "player.h" // playerspawn_t -#ifdef __cplusplus -extern "C" { -#endif - #define MAXCYCLERS 1024 #define MAXANIMATES 1024 #define MAXANIMWALLS 512 @@ -172,10 +168,6 @@ static inline vec3_t G_GetCameraPosition(int32_t const i, int32_t const smoothra EXTERN_INLINE_HEADER int32_t G_CheckPlayerInSector(int32_t const sect); -#ifdef __cplusplus -} -#endif - #if defined sector_c_ || !defined DISABLE_INLINING EXTERN_INLINE int32_t G_CheckPlayerInSector(int32_t const sect) diff --git a/source/duke3d/src/sounds.h b/source/duke3d/src/sounds.h index b62f8390e..1eae0d1fe 100644 --- a/source/duke3d/src/sounds.h +++ b/source/duke3d/src/sounds.h @@ -31,10 +31,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sounds_common.h" -#ifdef __cplusplus -extern "C" { -#endif - // KEEPINSYNC lunatic/con_lang.lua #define MAXSOUNDS 4096 #define MAXSOUNDINSTANCES 8 @@ -101,8 +97,4 @@ static inline bool S_IsAmbientSFX(int spriteNum) return (sprite[spriteNum].picnum == MUSICANDSFX && sprite[spriteNum].lotag < 999); } -#ifdef __cplusplus -} -#endif - #endif