--- hatari/src/gui-sdl/dlgAlert.c 2019/04/01 07:15:00 1.1.1.5 +++ hatari/src/gui-sdl/dlgAlert.c 2019/04/09 08:48:53 1.1.1.8 @@ -16,7 +16,7 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License (gpl.txt) for more details. */ -const char DlgAlert_rcsid[] = "Hatari $Id: dlgAlert.c,v 1.1.1.5 2019/04/01 07:15:00 root Exp $"; +const char DlgAlert_fileid[] = "Hatari dlgAlert.c : " __DATE__ " " __TIME__; #include @@ -32,11 +32,8 @@ static char dlglines[MAX_LINES][50+1]; #ifdef ALERT_HOOKS // The alert hook functions - extern int HookedAlertNotice(const char* szMessage); // Must return TRUE if OK clicked, FALSE otherwise - extern int HookedAlertQuery(const char* szMessage); // Must return TRUE if OK clicked, FALSE otherwise - - // Runtime switch to activate/deactivate alert hooks - bool useAlertHooks = FALSE; + extern int HookedAlertNotice(const char* szMessage); // Must return true if OK clicked, false otherwise + extern int HookedAlertQuery(const char* szMessage); // Must return true if OK clicked, false otherwise #endif #define DLGALERT_OK 5 @@ -57,11 +54,11 @@ static SGOBJ alertdlg[] = /*-----------------------------------------------------------------------*/ -/* - Breaks long string to several strings of max_width, divided by '\0', - sets text_width to the longest line width and returns the number of lines - you need to display the strings. -*/ +/** + * Breaks long string to several strings of max_width, divided by '\0', + * sets text_width to the longest line width and returns the number of lines + * you need to display the strings. + */ static int DlgAlert_FormatTextToBox(char *text, int max_width, int *text_width) { int columns = 0; @@ -122,9 +119,9 @@ static int DlgAlert_FormatTextToBox(char /*-----------------------------------------------------------------------*/ -/* - Show the "alert" dialog. Return TRUE if user pressed "OK". -*/ +/** + * Show the "alert" dialog. Return true if user pressed "OK". + */ static int DlgAlert_ShowDlg(const char *text) { static int maxlen = sizeof(dlglines[0])-1; @@ -156,7 +153,7 @@ static int DlgAlert_ShowDlg(const char * free(orig_t); if (SDLGui_SetScreen(sdlscrn)) - return FALSE; + return false; SDLGui_CenterDlg(alertdlg); SDL_GetMouseState(&nOldMouseX, &nOldMouseY); @@ -174,17 +171,13 @@ static int DlgAlert_ShowDlg(const char * /*-----------------------------------------------------------------------*/ -/* - Show a "notice" dialog: (only one button) -*/ +/** + * Show a "notice" dialog: (only one button) + */ int DlgAlert_Notice(const char *text) { #ifdef ALERT_HOOKS - // If activated, used the hooked function instead - if (useAlertHooks) - { - return HookedAlertNotice(text); - } + return HookedAlertNotice(text); #endif /* Hide "cancel" button: */ @@ -200,17 +193,13 @@ int DlgAlert_Notice(const char *text) /*-----------------------------------------------------------------------*/ -/* - Show a "query" dialog: (two buttons), return true for OK -*/ +/** + * Show a "query" dialog: (two buttons), return true for OK + */ int DlgAlert_Query(const char *text) { #ifdef ALERT_HOOKS - // If activated, used the hooked function instead - if (useAlertHooks) - { - return HookedAlertQuery(text); - } + return HookedAlertQuery(text); #endif /* Show "cancel" button: */