LogWindow: Convert #define macros into typed constants

This commit is contained in:
Lioncash 2016-10-02 18:13:08 -04:00
parent 2e4ef57b47
commit a7b19e23b3
1 changed files with 4 additions and 4 deletions

View File

@ -30,9 +30,9 @@
#include "DolphinWX/WxUtils.h"
// Milliseconds between msgQueue flushes to wxTextCtrl
#define UPDATETIME 200
constexpr int UPDATE_TIME_MS = 200;
// Max size of msgQueue, old messages will be discarded when there are too many.
#define MSGQUEUE_MAX_SIZE 100
constexpr size_t MSGQUEUE_MAX_SIZE = 100;
CLogWindow::CLogWindow(CFrame* parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
long style, const wxString& name)
@ -48,7 +48,7 @@ CLogWindow::CLogWindow(CFrame* parent, wxWindowID id, const wxPoint& pos, const
CreateGUIControls();
m_LogTimer.SetOwner(this);
m_LogTimer.Start(UPDATETIME);
m_LogTimer.Start(UPDATE_TIME_MS);
}
void CLogWindow::CreateGUIControls()
@ -292,7 +292,7 @@ void CLogWindow::UpdateLog()
// the GUI will lock up, which could be an issue if new messages are flooding in faster than
// this function can render them to the screen.
// So we limit this function to processing MSGQUEUE_MAX_SIZE messages each time it's called.
for (int num = 0; num < MSGQUEUE_MAX_SIZE; num++)
for (size_t num = 0; num < MSGQUEUE_MAX_SIZE; num++)
{
u8 log_level;
wxString log_msg;