From f8fa0e5f76f45e8e058505bc3dd9891258f295d7 Mon Sep 17 00:00:00 2001 From: BC Ko Date: Sat, 28 Aug 2021 16:33:13 -0700 Subject: [PATCH] documenation cleanup: appfat --- Source/appfat.cpp | 25 ------------------------- Source/appfat.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/Source/appfat.cpp b/Source/appfat.cpp index be0e4645e..f9d7da5e3 100644 --- a/Source/appfat.cpp +++ b/Source/appfat.cpp @@ -58,11 +58,6 @@ void FreeDlg() } // namespace -/** - * @brief Terminates the game and displays an error message box. - * @param pszFmt Optional error message. - * @param ... (see printf) - */ void app_fatal(const char *pszFmt, ...) { va_list va; @@ -78,11 +73,6 @@ void app_fatal(const char *pszFmt, ...) diablo_quit(1); } -/** - * @brief Displays a warning message box based on the given formatted error message. - * @param pszFmt Error message format - * @param ... Additional parameters for message format - */ void DrawDlg(const char *pszFmt, ...) { char text[256]; @@ -96,21 +86,12 @@ void DrawDlg(const char *pszFmt, ...) } #ifdef _DEBUG -/** - * @brief Show an error and exit the application. - * @param nLineNo The line number of the assertion - * @param pszFile File name where the assertion is located - * @param pszFail Fail message - */ void assert_fail(int nLineNo, const char *pszFile, const char *pszFail) { app_fatal("assertion failed (%s:%i)\n%s", pszFile, nLineNo, pszFail); } #endif -/** - * @brief Terminates the game and displays an error dialog box based on the given dialog_id. - */ void ErrDlg(const char *title, const char *error, const char *logFilePath, int logLineNr) { char text[1024]; @@ -123,9 +104,6 @@ void ErrDlg(const char *title, const char *error, const char *logFilePath, int l app_fatal(nullptr); } -/** - * @brief Terminates the game with an insert CD error dialog. - */ void InsertCDDlg() { char text[1024]; @@ -142,9 +120,6 @@ void InsertCDDlg() app_fatal(nullptr); } -/** - * @brief Terminates the game with a read-only directory error dialog. - */ void DirErrorDlg(const char *error) { char text[1024]; diff --git a/Source/appfat.h b/Source/appfat.h index 9d4709963..53d3facb1 100644 --- a/Source/appfat.h +++ b/Source/appfat.h @@ -26,13 +26,41 @@ namespace devilution { #define assert(exp) (void)((exp) || (assert_fail(__LINE__, __FILE__, #exp), 0)) #endif +/** + * @brief Terminates the game and displays an error message box. + * @param pszFmt Optional error message. + * @param ... (see printf) + */ [[noreturn]] void app_fatal(const char *pszFmt, ...) DVL_PRINTF_ATTRIBUTE(1, 2); + +/** + * @brief Displays a warning message box based on the given formatted error message. + * @param pszFmt Error message format + * @param ... Additional parameters for message format + */ void DrawDlg(const char *pszFmt, ...) DVL_PRINTF_ATTRIBUTE(1, 2); #ifdef _DEBUG +/** + * @brief Show an error and exit the application. + * @param nLineNo The line number of the assertion + * @param pszFile File name where the assertion is located + * @param pszFail Fail message + */ [[noreturn]] void assert_fail(int nLineNo, const char *pszFile, const char *pszFail); #endif +/** + * @brief Terminates the game and displays an error dialog box based on the given dialog_id. + */ [[noreturn]] void ErrDlg(const char *title, const char *error, const char *logFilePath, int logLineNr); + +/** + * @brief Terminates the game with an insert CD error dialog. + */ [[noreturn]] void InsertCDDlg(); + +/** + * @brief Terminates the game with a read-only directory error dialog. + */ [[noreturn]] void DirErrorDlg(const char *error); } // namespace devilution