make use of const in parameters
This commit is contained in:
parent
93962a9de4
commit
7f4da40f21
|
@ -113,7 +113,7 @@ const char log_fatal[] = "FATAL: ";
|
|||
const char log_unkwn[] = "???? : ";
|
||||
|
||||
// Do not use EmuLogOutput function outside of this file.
|
||||
void EmuLogOutput(CXBXR_MODULE cxbxr_module, LOG_LEVEL level, const char *szWarningMessage, va_list argp)
|
||||
void EmuLogOutput(CXBXR_MODULE cxbxr_module, LOG_LEVEL level, const char *szWarningMessage, const va_list argp)
|
||||
{
|
||||
LOG_THREAD_INIT;
|
||||
|
||||
|
@ -148,7 +148,7 @@ void EmuLogOutput(CXBXR_MODULE cxbxr_module, LOG_LEVEL level, const char *szWarn
|
|||
|
||||
fflush(stdout);
|
||||
}
|
||||
inline void EmuLogOutputEx(CXBXR_MODULE cxbxr_module, LOG_LEVEL level, const char *szWarningMessage, ...)
|
||||
inline void EmuLogOutputEx(const CXBXR_MODULE cxbxr_module, const LOG_LEVEL level, const char *szWarningMessage, ...)
|
||||
{
|
||||
va_list argp;
|
||||
va_start(argp, szWarningMessage);
|
||||
|
@ -248,7 +248,7 @@ void log_init_popup_msg()
|
|||
g_disablePopupMessages = vSettings.bFullScreen;
|
||||
}
|
||||
|
||||
MsgDlgRet CxbxMessageBox(const char* msg, MsgDlgRet ret_default, UINT uType, HWND hWnd)
|
||||
MsgDlgRet CxbxMessageBox(const char* msg, const MsgDlgRet ret_default, const UINT uType, const HWND hWnd)
|
||||
{
|
||||
// If user is using exclusive fullscreen, we need to refrain all popups.
|
||||
if (g_disablePopupMessages) {
|
||||
|
@ -275,7 +275,7 @@ MsgDlgRet CxbxMessageBox(const char* msg, MsgDlgRet ret_default, UINT uType, HWN
|
|||
}
|
||||
}
|
||||
|
||||
MsgDlgRet CxbxPopupMessageEx(void* hwnd, CXBXR_MODULE cxbxr_module, LOG_LEVEL level, MsgDlgIcon icon, MsgDlgButtons buttons, MsgDlgRet ret_default, const char *message, ...)
|
||||
MsgDlgRet CxbxPopupMessageEx(const void* hwnd, const CXBXR_MODULE cxbxr_module, const LOG_LEVEL level, const MsgDlgIcon icon, const MsgDlgButtons buttons, const MsgDlgRet ret_default, const char *message, ...)
|
||||
{
|
||||
char Buffer[1024];
|
||||
va_list argp;
|
||||
|
@ -284,7 +284,7 @@ MsgDlgRet CxbxPopupMessageEx(void* hwnd, CXBXR_MODULE cxbxr_module, LOG_LEVEL le
|
|||
// If there's no message, then return default value.
|
||||
if (!message) {
|
||||
uType |= MB_ICONERROR | MB_OK;
|
||||
(void)CxbxMessageBox("message is null pointer", ret_default, uType, reinterpret_cast<HWND>(hwnd));
|
||||
(void)CxbxMessageBox("message is null pointer", ret_default, uType, (const HWND)hwnd);
|
||||
return ret_default;
|
||||
}
|
||||
|
||||
|
@ -337,7 +337,7 @@ MsgDlgRet CxbxPopupMessageEx(void* hwnd, CXBXR_MODULE cxbxr_module, LOG_LEVEL le
|
|||
|
||||
EmuLogOutputEx(cxbxr_module, level, "Popup : %s", Buffer);
|
||||
|
||||
return CxbxMessageBox(Buffer, ret_default, uType, reinterpret_cast<HWND>(hwnd));
|
||||
return CxbxMessageBox(Buffer, ret_default, uType, (const HWND)hwnd);
|
||||
}
|
||||
|
||||
const bool needs_escape(const wint_t _char)
|
||||
|
|
|
@ -166,7 +166,7 @@ typedef enum class _MsgDlgRet {
|
|||
RET_NO
|
||||
} MsgDlgRet;
|
||||
|
||||
MsgDlgRet CxbxPopupMessageEx(void* hwnd, CXBXR_MODULE cxbxr_module, LOG_LEVEL level, MsgDlgIcon icon, MsgDlgButtons buttons, MsgDlgRet ret_default, const char* message, ...);
|
||||
MsgDlgRet CxbxPopupMessageEx(const void* hwnd, const CXBXR_MODULE cxbxr_module, const LOG_LEVEL level, const MsgDlgIcon icon, const MsgDlgButtons buttons, const MsgDlgRet ret_default, const char* message, ...);
|
||||
|
||||
#define CxbxPopupMessage(hwnd, level, icon, buttons, ret_default, fmt, ...) CxbxPopupMessageEx(hwnd, LOG_PREFIX, level, icon, buttons, ret_default, fmt, ## __VA_ARGS__)
|
||||
#define CxbxPopupMsgUnknown(hwnd, level, buttons, ret_default, fmt, ...) CxbxPopupMessage(hwnd, level, MsgDlgIcon::Unknown, buttons, ret_default, fmt, ## __VA_ARGS__)
|
||||
|
@ -182,7 +182,7 @@ MsgDlgRet CxbxPopupMessageEx(void* hwnd, CXBXR_MODULE cxbxr_module, LOG_LEVEL le
|
|||
#define CxbxPopupMsgFatalSimple(hwnd, fmt, ...) CxbxPopupMsgFatal(hwnd, MsgDlgButtons::OK, MsgDlgRet::RET_OK, fmt, ## __VA_ARGS__)
|
||||
|
||||
// For LOG_TEST_CASE
|
||||
extern inline void EmuLogOutputEx(CXBXR_MODULE cxbxr_module, LOG_LEVEL level, const char *szWarningMessage, ...);
|
||||
extern inline void EmuLogOutputEx(const CXBXR_MODULE cxbxr_module, const LOG_LEVEL level, const char *szWarningMessage, ...);
|
||||
|
||||
#define LOG_TEST_CASE(message) do { \
|
||||
static bool bTestCaseLogged = false; \
|
||||
|
|
|
@ -228,7 +228,7 @@ class EmuShared : public Mutex
|
|||
// * Log Level value Accessors
|
||||
// ******************************************************************
|
||||
void GetLogPopupTestCase(bool *value) { Lock(); *value = m_core.bLogPopupTestCase; Unlock(); }
|
||||
void SetLogPopupTestCase(bool value) { Lock(); m_core.bLogPopupTestCase = value; Unlock(); }
|
||||
void SetLogPopupTestCase(const bool value) { Lock(); m_core.bLogPopupTestCase = value; Unlock(); }
|
||||
|
||||
// ******************************************************************
|
||||
// * File storage location
|
||||
|
|
Loading…
Reference in New Issue