🎨 Mark noreturn functions as such
This commit is contained in:
parent
3945e79426
commit
fbd86cd3c5
12 changed files with 13 additions and 35 deletions
|
|
@ -12,20 +12,16 @@ DEVILUTION_BEGIN_NAMESPACE
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
void TriggerBreak();
|
||||
#define TraceLastError SDL_GetError
|
||||
void app_fatal(const char *pszFmt, ...);
|
||||
[[noreturn]] void app_fatal(const char *pszFmt, ...);
|
||||
void DrawDlg(const char *pszFmt, ...);
|
||||
#ifdef _DEBUG
|
||||
void assert_fail(int nLineNo, const char *pszFile, const char *pszFail);
|
||||
[[noreturn]] void assert_fail(int nLineNo, const char *pszFile, const char *pszFail);
|
||||
#endif
|
||||
void DDErrMsg(DWORD error_code, int log_line_nr, const char *log_file_path);
|
||||
void DSErrMsg(DWORD error_code, int log_line_nr, const char *log_file_path);
|
||||
void ErrDlg(const char *title, const char *error, const char *log_file_path, int log_line_nr);
|
||||
void FileErrDlg(const char *error);
|
||||
void DiskFreeDlg(const char *error);
|
||||
void InsertCDDlg();
|
||||
void DirErrorDlg(const char *error);
|
||||
[[noreturn]] void ErrDlg(const char *title, const char *error, const char *log_file_path, int log_line_nr);
|
||||
[[noreturn]] void FileErrDlg(const char *error);
|
||||
[[noreturn]] void InsertCDDlg();
|
||||
[[noreturn]] void DirErrorDlg(const char *error);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ BOOL was_snd_init = false;
|
|||
extern void plrctrls_every_frame();
|
||||
extern void plrctrls_after_game_logic();
|
||||
|
||||
static void print_help_and_exit()
|
||||
[[noreturn]] static void print_help_and_exit()
|
||||
{
|
||||
printInConsole("Options:\n");
|
||||
printInConsole(" %-20s %-30s\n", "-h, --help", "Print this message and exit");
|
||||
|
|
@ -1659,7 +1659,6 @@ void LoadLvlGFX()
|
|||
break;
|
||||
default:
|
||||
app_fatal("LoadLvlGFX");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1718,7 +1717,6 @@ void CreateLevel(int lvldir)
|
|||
break;
|
||||
default:
|
||||
app_fatal("CreateLevel");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ extern Options sgOptions;
|
|||
|
||||
void FreeGameMem();
|
||||
BOOL StartGame(BOOL bNewGame, BOOL bSinglePlayer);
|
||||
void diablo_quit(int exitStatus);
|
||||
[[noreturn]] void diablo_quit(int exitStatus);
|
||||
int DiabloMain(int argc, char **argv);
|
||||
BOOL TryIconCurs();
|
||||
void diablo_pause_game();
|
||||
|
|
|
|||
|
|
@ -671,7 +671,7 @@ BYTE *DiabloAllocPtr(DWORD dwBytes)
|
|||
if (buf == NULL) {
|
||||
const char *text = "System memory exhausted.\n"
|
||||
"Make sure you have at least 64MB of free system memory before running the game";
|
||||
ERR_DLG("Out of Memory Error", text);
|
||||
ErrDlg("Out of Memory Error", text, __FILE__, __LINE__);
|
||||
}
|
||||
|
||||
return buf;
|
||||
|
|
|
|||
|
|
@ -5158,22 +5158,16 @@ void M_FallenFear(int x, int y)
|
|||
|
||||
const char *GetMonsterTypeText(const MonsterData &monsterData)
|
||||
{
|
||||
const char *type = nullptr;
|
||||
|
||||
switch (monsterData.mMonstClass) {
|
||||
case MC_ANIMAL:
|
||||
type = "Animal";
|
||||
break;
|
||||
return "Animal";
|
||||
case MC_DEMON:
|
||||
type = "Demon";
|
||||
break;
|
||||
|
||||
return "Demon";
|
||||
case MC_UNDEAD:
|
||||
type = "Undead";
|
||||
break;
|
||||
return "Undead";
|
||||
}
|
||||
|
||||
return type;
|
||||
app_fatal("Unknown mMonstClass %d", monsterData.mMonstClass);
|
||||
}
|
||||
|
||||
void PrintMonstHistory(int mt)
|
||||
|
|
|
|||
|
|
@ -370,7 +370,6 @@ static _BLOCKENTRY *mpqapi_new_block(int *block_index)
|
|||
}
|
||||
|
||||
app_fatal("Out of free block entries");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void mpqapi_alloc_block(uint32_t block_offset, uint32_t block_size)
|
||||
|
|
|
|||
|
|
@ -537,7 +537,6 @@ static BOOL delta_get_item(TCmdGItem *pI, BYTE bLevel)
|
|||
}
|
||||
|
||||
app_fatal("delta:1");
|
||||
break;
|
||||
}
|
||||
|
||||
if ((pI->wCI & CF_PREGEN) == 0)
|
||||
|
|
|
|||
|
|
@ -317,7 +317,6 @@ void LoadPlrGFX(int pnum, player_graphic gfxflag)
|
|||
break;
|
||||
default:
|
||||
app_fatal("PLR:2");
|
||||
break;
|
||||
}
|
||||
|
||||
sprintf(pszName, "PlrGFX\\%s\\%s\\%s%s.CL2", cs, prefix, prefix, szCel);
|
||||
|
|
@ -2062,7 +2061,6 @@ StartNewLvl(int pnum, int fom, int lvl)
|
|||
break;
|
||||
default:
|
||||
app_fatal("StartNewLvl");
|
||||
break;
|
||||
}
|
||||
|
||||
if (pnum == myplr) {
|
||||
|
|
@ -3865,7 +3863,6 @@ void SyncPlrAnim(int pnum)
|
|||
break;
|
||||
default:
|
||||
app_fatal("SyncPlrAnim");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,6 @@ int ObjIndex(int x, int y)
|
|||
return oi;
|
||||
}
|
||||
app_fatal("ObjIndex: Active object not found at (%d,%d)", x, y);
|
||||
return -1;
|
||||
}
|
||||
|
||||
void AddSKingObjs()
|
||||
|
|
|
|||
|
|
@ -916,7 +916,6 @@ void CheckTriggers()
|
|||
break;
|
||||
default:
|
||||
app_fatal("Unknown trigger msg");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,7 +114,6 @@ TSnd *sound_file_load(const char *path, bool stream)
|
|||
|
||||
if (!SFileOpenFile(path, &file)) {
|
||||
ErrDlg("SFileOpenFile failed", path, __FILE__, __LINE__);
|
||||
return NULL;
|
||||
}
|
||||
pSnd = (TSnd *)DiabloAllocPtr(sizeof(TSnd));
|
||||
memset(pSnd, 0, sizeof(TSnd));
|
||||
|
|
|
|||
2
defs.h
2
defs.h
|
|
@ -175,8 +175,6 @@
|
|||
#define commitment(exp, value) (void)((exp) || (app_fatal("%s: %s was %i", __func__, #exp, value), 0))
|
||||
#endif
|
||||
|
||||
#define ERR_DLG(title, text) ErrDlg(title, text, __FILE__, __LINE__)
|
||||
|
||||
// To apply to certain functions which have local variables aligned by 1 for unknown yet reason
|
||||
#if (_MSC_VER == 1200)
|
||||
#define ALIGN_BY_1 __declspec(align(1))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue