summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/citra/emu_window/emu_window_glfw.cpp6
-rw-r--r--src/citra_qt/bootmanager.cpp2
-rw-r--r--src/citra_qt/hotkeys.cpp4
-rw-r--r--src/citra_qt/main.cpp8
-rw-r--r--src/common/chunk_file.h24
-rw-r--r--src/common/common_funcs.h2
-rw-r--r--src/common/console_listener.cpp10
-rw-r--r--src/common/extended_trace.cpp24
-rw-r--r--src/common/fifo_queue.h4
-rw-r--r--src/common/file_util.cpp24
-rw-r--r--src/common/file_util.h4
-rw-r--r--src/common/linear_disk_cache.h2
-rw-r--r--src/common/log_manager.cpp4
-rw-r--r--src/common/mem_arena.cpp20
-rw-r--r--src/common/memory_util.cpp10
-rw-r--r--src/common/misc.cpp4
-rw-r--r--src/common/platform.h2
-rw-r--r--src/common/string_util.cpp8
-rw-r--r--src/common/thread_queue_list.h12
-rw-r--r--src/common/timer.cpp6
-rw-r--r--src/common/utf8.cpp24
-rw-r--r--src/core/core_timing.cpp12
-rw-r--r--src/video_core/renderer_opengl/gl_shader_util.cpp10
-rw-r--r--src/video_core/video_core.cpp4
24 files changed, 115 insertions, 115 deletions
diff --git a/src/citra/emu_window/emu_window_glfw.cpp b/src/citra/emu_window/emu_window_glfw.cpp
index 697bf4693..982619126 100644
--- a/src/citra/emu_window/emu_window_glfw.cpp
+++ b/src/citra/emu_window/emu_window_glfw.cpp
@@ -76,9 +76,9 @@ EmuWindow_GLFW::EmuWindow_GLFW() {
76 std::string window_title = Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc); 76 std::string window_title = Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc);
77 m_render_window = glfwCreateWindow(VideoCore::kScreenTopWidth, 77 m_render_window = glfwCreateWindow(VideoCore::kScreenTopWidth,
78 (VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight), 78 (VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight),
79 window_title.c_str(), NULL, NULL); 79 window_title.c_str(), nullptr, nullptr);
80 80
81 if (m_render_window == NULL) { 81 if (m_render_window == nullptr) {
82 ERROR_LOG(GUI, "Failed to create GLFW window! Exiting..."); 82 ERROR_LOG(GUI, "Failed to create GLFW window! Exiting...");
83 exit(1); 83 exit(1);
84 } 84 }
@@ -123,7 +123,7 @@ void EmuWindow_GLFW::MakeCurrent() {
123 123
124/// Releases (dunno if this is the "right" word) the GLFW context from the caller thread 124/// Releases (dunno if this is the "right" word) the GLFW context from the caller thread
125void EmuWindow_GLFW::DoneCurrent() { 125void EmuWindow_GLFW::DoneCurrent() {
126 glfwMakeContextCurrent(NULL); 126 glfwMakeContextCurrent(nullptr);
127} 127}
128 128
129void EmuWindow_GLFW::ReloadSetKeymaps() { 129void EmuWindow_GLFW::ReloadSetKeymaps() {
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp
index 9bf079919..9a29f974b 100644
--- a/src/citra_qt/bootmanager.cpp
+++ b/src/citra_qt/bootmanager.cpp
@@ -230,7 +230,7 @@ QByteArray GRenderWindow::saveGeometry()
230{ 230{
231 // If we are a top-level widget, store the current geometry 231 // If we are a top-level widget, store the current geometry
232 // otherwise, store the last backup 232 // otherwise, store the last backup
233 if (parent() == NULL) 233 if (parent() == nullptr)
234 return ((QGLWidget*)this)->saveGeometry(); 234 return ((QGLWidget*)this)->saveGeometry();
235 else 235 else
236 return geometry; 236 return geometry;
diff --git a/src/citra_qt/hotkeys.cpp b/src/citra_qt/hotkeys.cpp
index bbaa4a8dc..5d0b52e4f 100644
--- a/src/citra_qt/hotkeys.cpp
+++ b/src/citra_qt/hotkeys.cpp
@@ -5,7 +5,7 @@
5 5
6struct Hotkey 6struct Hotkey
7{ 7{
8 Hotkey() : shortcut(NULL), context(Qt::WindowShortcut) {} 8 Hotkey() : shortcut(nullptr), context(Qt::WindowShortcut) {}
9 9
10 QKeySequence keyseq; 10 QKeySequence keyseq;
11 QShortcut* shortcut; 11 QShortcut* shortcut;
@@ -81,7 +81,7 @@ QShortcut* GetHotkey(const QString& group, const QString& action, QWidget* widge
81 Hotkey& hk = hotkey_groups[group][action]; 81 Hotkey& hk = hotkey_groups[group][action];
82 82
83 if (!hk.shortcut) 83 if (!hk.shortcut)
84 hk.shortcut = new QShortcut(hk.keyseq, widget, NULL, NULL, hk.context); 84 hk.shortcut = new QShortcut(hk.keyseq, widget, nullptr, nullptr, hk.context);
85 85
86 return hk.shortcut; 86 return hk.shortcut;
87} 87}
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index d5554d917..430a4ece4 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -131,7 +131,7 @@ GMainWindow::GMainWindow()
131GMainWindow::~GMainWindow() 131GMainWindow::~GMainWindow()
132{ 132{
133 // will get automatically deleted otherwise 133 // will get automatically deleted otherwise
134 if (render_window->parent() == NULL) 134 if (render_window->parent() == nullptr)
135 delete render_window; 135 delete render_window;
136} 136}
137 137
@@ -213,14 +213,14 @@ void GMainWindow::OnOpenHotkeysDialog()
213void GMainWindow::ToggleWindowMode() 213void GMainWindow::ToggleWindowMode()
214{ 214{
215 bool enable = ui.action_Popout_Window_Mode->isChecked(); 215 bool enable = ui.action_Popout_Window_Mode->isChecked();
216 if (enable && render_window->parent() != NULL) 216 if (enable && render_window->parent() != nullptr)
217 { 217 {
218 ui.horizontalLayout->removeWidget(render_window); 218 ui.horizontalLayout->removeWidget(render_window);
219 render_window->setParent(NULL); 219 render_window->setParent(nullptr);
220 render_window->setVisible(true); 220 render_window->setVisible(true);
221 render_window->RestoreGeometry(); 221 render_window->RestoreGeometry();
222 } 222 }
223 else if (!enable && render_window->parent() == NULL) 223 else if (!enable && render_window->parent() == nullptr)
224 { 224 {
225 render_window->BackupGeometry(); 225 render_window->BackupGeometry();
226 ui.horizontalLayout->addWidget(render_window); 226 ui.horizontalLayout->addWidget(render_window);
diff --git a/src/common/chunk_file.h b/src/common/chunk_file.h
index 609784076..32af74594 100644
--- a/src/common/chunk_file.h
+++ b/src/common/chunk_file.h
@@ -204,11 +204,11 @@ public:
204 { 204 {
205 for (auto it = x.begin(), end = x.end(); it != end; ++it) 205 for (auto it = x.begin(), end = x.end(); it != end; ++it)
206 { 206 {
207 if (it->second != NULL) 207 if (it->second != nullptr)
208 delete it->second; 208 delete it->second;
209 } 209 }
210 } 210 }
211 T *dv = NULL; 211 T *dv = nullptr;
212 DoMap(x, dv); 212 DoMap(x, dv);
213 } 213 }
214 214
@@ -264,11 +264,11 @@ public:
264 { 264 {
265 for (auto it = x.begin(), end = x.end(); it != end; ++it) 265 for (auto it = x.begin(), end = x.end(); it != end; ++it)
266 { 266 {
267 if (it->second != NULL) 267 if (it->second != nullptr)
268 delete it->second; 268 delete it->second;
269 } 269 }
270 } 270 }
271 T *dv = NULL; 271 T *dv = nullptr;
272 DoMultimap(x, dv); 272 DoMultimap(x, dv);
273 } 273 }
274 274
@@ -320,7 +320,7 @@ public:
320 template<class T> 320 template<class T>
321 void Do(std::vector<T *> &x) 321 void Do(std::vector<T *> &x)
322 { 322 {
323 T *dv = NULL; 323 T *dv = nullptr;
324 DoVector(x, dv); 324 DoVector(x, dv);
325 } 325 }
326 326
@@ -369,7 +369,7 @@ public:
369 template<class T> 369 template<class T>
370 void Do(std::deque<T *> &x) 370 void Do(std::deque<T *> &x)
371 { 371 {
372 T *dv = NULL; 372 T *dv = nullptr;
373 DoDeque(x, dv); 373 DoDeque(x, dv);
374 } 374 }
375 375
@@ -395,7 +395,7 @@ public:
395 template<class T> 395 template<class T>
396 void Do(std::list<T *> &x) 396 void Do(std::list<T *> &x)
397 { 397 {
398 T *dv = NULL; 398 T *dv = nullptr;
399 Do(x, dv); 399 Do(x, dv);
400 } 400 }
401 401
@@ -433,7 +433,7 @@ public:
433 { 433 {
434 for (auto it = x.begin(), end = x.end(); it != end; ++it) 434 for (auto it = x.begin(), end = x.end(); it != end; ++it)
435 { 435 {
436 if (*it != NULL) 436 if (*it != nullptr)
437 delete *it; 437 delete *it;
438 } 438 }
439 } 439 }
@@ -518,7 +518,7 @@ public:
518 void DoClass(T *&x) { 518 void DoClass(T *&x) {
519 if (mode == MODE_READ) 519 if (mode == MODE_READ)
520 { 520 {
521 if (x != NULL) 521 if (x != nullptr)
522 delete x; 522 delete x;
523 x = new T(); 523 x = new T();
524 } 524 }
@@ -567,7 +567,7 @@ public:
567 { 567 {
568 if (mode == MODE_READ) 568 if (mode == MODE_READ)
569 { 569 {
570 cur->next = 0; 570 cur->next = nullptr;
571 list_cur = cur; 571 list_cur = cur;
572 if (prev) 572 if (prev)
573 prev->next = cur; 573 prev->next = cur;
@@ -586,13 +586,13 @@ public:
586 if (mode == MODE_READ) 586 if (mode == MODE_READ)
587 { 587 {
588 if (prev) 588 if (prev)
589 prev->next = 0; 589 prev->next = nullptr;
590 if (list_end) 590 if (list_end)
591 *list_end = prev; 591 *list_end = prev;
592 if (list_cur) 592 if (list_cur)
593 { 593 {
594 if (list_start == list_cur) 594 if (list_start == list_cur)
595 list_start = 0; 595 list_start = nullptr;
596 do 596 do
597 { 597 {
598 LinkedListItem<T>* next = list_cur->next; 598 LinkedListItem<T>* next = list_cur->next;
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h
index d84ec4c42..1139dc3b8 100644
--- a/src/common/common_funcs.h
+++ b/src/common/common_funcs.h
@@ -106,7 +106,7 @@ inline u64 _rotr64(u64 x, unsigned int shift){
106 // Restore the global locale 106 // Restore the global locale
107 _configthreadlocale(_DISABLE_PER_THREAD_LOCALE); 107 _configthreadlocale(_DISABLE_PER_THREAD_LOCALE);
108 } 108 }
109 else if(new_locale != NULL) 109 else if(new_locale != nullptr)
110 { 110 {
111 // Configure the thread to set the locale only for this thread 111 // Configure the thread to set the locale only for this thread
112 _configthreadlocale(_ENABLE_PER_THREAD_LOCALE); 112 _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
diff --git a/src/common/console_listener.cpp b/src/common/console_listener.cpp
index d7f27c358..b6042796d 100644
--- a/src/common/console_listener.cpp
+++ b/src/common/console_listener.cpp
@@ -16,7 +16,7 @@
16ConsoleListener::ConsoleListener() 16ConsoleListener::ConsoleListener()
17{ 17{
18#ifdef _WIN32 18#ifdef _WIN32
19 hConsole = NULL; 19 hConsole = nullptr;
20 bUseColor = true; 20 bUseColor = true;
21#else 21#else
22 bUseColor = isatty(fileno(stdout)); 22 bUseColor = isatty(fileno(stdout));
@@ -66,19 +66,19 @@ void ConsoleListener::UpdateHandle()
66void ConsoleListener::Close() 66void ConsoleListener::Close()
67{ 67{
68#ifdef _WIN32 68#ifdef _WIN32
69 if (hConsole == NULL) 69 if (hConsole == nullptr)
70 return; 70 return;
71 FreeConsole(); 71 FreeConsole();
72 hConsole = NULL; 72 hConsole = nullptr;
73#else 73#else
74 fflush(NULL); 74 fflush(nullptr);
75#endif 75#endif
76} 76}
77 77
78bool ConsoleListener::IsOpen() 78bool ConsoleListener::IsOpen()
79{ 79{
80#ifdef _WIN32 80#ifdef _WIN32
81 return (hConsole != NULL); 81 return (hConsole != nullptr);
82#else 82#else
83 return true; 83 return true;
84#endif 84#endif
diff --git a/src/common/extended_trace.cpp b/src/common/extended_trace.cpp
index bf61ac1d1..cf7c346d4 100644
--- a/src/common/extended_trace.cpp
+++ b/src/common/extended_trace.cpp
@@ -82,7 +82,7 @@ static void InitSymbolPath( PSTR lpszSymbolPath, PCSTR lpszIniPath )
82 } 82 }
83 83
84 // Add user defined path 84 // Add user defined path
85 if ( lpszIniPath != NULL ) 85 if ( lpszIniPath != nullptr )
86 if ( lpszIniPath[0] != '\0' ) 86 if ( lpszIniPath[0] != '\0' )
87 { 87 {
88 strcat( lpszSymbolPath, ";" ); 88 strcat( lpszSymbolPath, ";" );
@@ -138,7 +138,7 @@ static BOOL GetFunctionInfoFromAddresses( ULONG fnAddress, ULONG stackAddress, L
138 DWORD dwSymSize = 10000; 138 DWORD dwSymSize = 10000;
139 TCHAR lpszUnDSymbol[BUFFERSIZE]=_T("?"); 139 TCHAR lpszUnDSymbol[BUFFERSIZE]=_T("?");
140 CHAR lpszNonUnicodeUnDSymbol[BUFFERSIZE]="?"; 140 CHAR lpszNonUnicodeUnDSymbol[BUFFERSIZE]="?";
141 LPTSTR lpszParamSep = NULL; 141 LPTSTR lpszParamSep = nullptr;
142 LPTSTR lpszParsed = lpszUnDSymbol; 142 LPTSTR lpszParsed = lpszUnDSymbol;
143 PIMAGEHLP_SYMBOL pSym = (PIMAGEHLP_SYMBOL)GlobalAlloc( GMEM_FIXED, dwSymSize ); 143 PIMAGEHLP_SYMBOL pSym = (PIMAGEHLP_SYMBOL)GlobalAlloc( GMEM_FIXED, dwSymSize );
144 144
@@ -187,13 +187,13 @@ static BOOL GetFunctionInfoFromAddresses( ULONG fnAddress, ULONG stackAddress, L
187 187
188 // Let's go through the stack, and modify the function prototype, and insert the actual 188 // Let's go through the stack, and modify the function prototype, and insert the actual
189 // parameter values from the stack 189 // parameter values from the stack
190 if ( _tcsstr( lpszUnDSymbol, _T("(void)") ) == NULL && _tcsstr( lpszUnDSymbol, _T("()") ) == NULL) 190 if ( _tcsstr( lpszUnDSymbol, _T("(void)") ) == nullptr && _tcsstr( lpszUnDSymbol, _T("()") ) == nullptr)
191 { 191 {
192 ULONG index = 0; 192 ULONG index = 0;
193 for( ; ; index++ ) 193 for( ; ; index++ )
194 { 194 {
195 lpszParamSep = _tcschr( lpszParsed, _T(',') ); 195 lpszParamSep = _tcschr( lpszParsed, _T(',') );
196 if ( lpszParamSep == NULL ) 196 if ( lpszParamSep == nullptr )
197 break; 197 break;
198 198
199 *lpszParamSep = _T('\0'); 199 *lpszParamSep = _T('\0');
@@ -205,7 +205,7 @@ static BOOL GetFunctionInfoFromAddresses( ULONG fnAddress, ULONG stackAddress, L
205 } 205 }
206 206
207 lpszParamSep = _tcschr( lpszParsed, _T(')') ); 207 lpszParamSep = _tcschr( lpszParsed, _T(')') );
208 if ( lpszParamSep != NULL ) 208 if ( lpszParamSep != nullptr )
209 { 209 {
210 *lpszParamSep = _T('\0'); 210 *lpszParamSep = _T('\0');
211 211
@@ -248,7 +248,7 @@ static BOOL GetSourceInfoFromAddress( UINT address, LPTSTR lpszSourceInfo )
248 PCSTR2LPTSTR( lineInfo.FileName, lpszFileName ); 248 PCSTR2LPTSTR( lineInfo.FileName, lpszFileName );
249 TCHAR fname[_MAX_FNAME]; 249 TCHAR fname[_MAX_FNAME];
250 TCHAR ext[_MAX_EXT]; 250 TCHAR ext[_MAX_EXT];
251 _tsplitpath(lpszFileName, NULL, NULL, fname, ext); 251 _tsplitpath(lpszFileName, nullptr, nullptr, fname, ext);
252 _stprintf( lpszSourceInfo, _T("%s%s(%d)"), fname, ext, lineInfo.LineNumber ); 252 _stprintf( lpszSourceInfo, _T("%s%s(%d)"), fname, ext, lineInfo.LineNumber );
253 ret = TRUE; 253 ret = TRUE;
254 } 254 }
@@ -332,11 +332,11 @@ void StackTrace( HANDLE hThread, const char* lpszMessage, FILE *file )
332 hProcess, 332 hProcess,
333 hThread, 333 hThread,
334 &callStack, 334 &callStack,
335 NULL, 335 nullptr,
336 NULL, 336 nullptr,
337 SymFunctionTableAccess, 337 SymFunctionTableAccess,
338 SymGetModuleBase, 338 SymGetModuleBase,
339 NULL); 339 nullptr);
340 340
341 if ( index == 0 ) 341 if ( index == 0 )
342 continue; 342 continue;
@@ -389,11 +389,11 @@ void StackTrace(HANDLE hThread, const char* lpszMessage, FILE *file, DWORD eip,
389 hProcess, 389 hProcess,
390 hThread, 390 hThread,
391 &callStack, 391 &callStack,
392 NULL, 392 nullptr,
393 NULL, 393 nullptr,
394 SymFunctionTableAccess, 394 SymFunctionTableAccess,
395 SymGetModuleBase, 395 SymGetModuleBase,
396 NULL); 396 nullptr);
397 397
398 if ( index == 0 ) 398 if ( index == 0 )
399 continue; 399 continue;
diff --git a/src/common/fifo_queue.h b/src/common/fifo_queue.h
index 2c18285d4..b426e6596 100644
--- a/src/common/fifo_queue.h
+++ b/src/common/fifo_queue.h
@@ -57,7 +57,7 @@ public:
57 // advance the read pointer 57 // advance the read pointer
58 m_read_ptr = m_read_ptr->next; 58 m_read_ptr = m_read_ptr->next;
59 // set the next element to NULL to stop the recursive deletion 59 // set the next element to NULL to stop the recursive deletion
60 tmpptr->next = NULL; 60 tmpptr->next = nullptr;
61 delete tmpptr; // this also deletes the element 61 delete tmpptr; // this also deletes the element
62 } 62 }
63 63
@@ -86,7 +86,7 @@ private:
86 class ElementPtr 86 class ElementPtr
87 { 87 {
88 public: 88 public:
89 ElementPtr() : current(NULL), next(NULL) {} 89 ElementPtr() : current(nullptr), next(nullptr) {}
90 90
91 ~ElementPtr() 91 ~ElementPtr()
92 { 92 {
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index b6dec838c..6c4860503 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -140,7 +140,7 @@ bool CreateDir(const std::string &path)
140{ 140{
141 INFO_LOG(COMMON, "CreateDir: directory %s", path.c_str()); 141 INFO_LOG(COMMON, "CreateDir: directory %s", path.c_str());
142#ifdef _WIN32 142#ifdef _WIN32
143 if (::CreateDirectory(Common::UTF8ToTStr(path).c_str(), NULL)) 143 if (::CreateDirectory(Common::UTF8ToTStr(path).c_str(), nullptr))
144 return true; 144 return true;
145 DWORD error = GetLastError(); 145 DWORD error = GetLastError();
146 if (error == ERROR_ALREADY_EXISTS) 146 if (error == ERROR_ALREADY_EXISTS)
@@ -423,7 +423,7 @@ u32 ScanDirectoryTree(const std::string &directory, FSTEntry& parentEntry)
423 FSTEntry entry; 423 FSTEntry entry;
424 const std::string virtualName(Common::TStrToUTF8(ffd.cFileName)); 424 const std::string virtualName(Common::TStrToUTF8(ffd.cFileName));
425#else 425#else
426 struct dirent dirent, *result = NULL; 426 struct dirent dirent, *result = nullptr;
427 427
428 DIR *dirp = opendir(directory.c_str()); 428 DIR *dirp = opendir(directory.c_str());
429 if (!dirp) 429 if (!dirp)
@@ -491,7 +491,7 @@ bool DeleteDirRecursively(const std::string &directory)
491 { 491 {
492 const std::string virtualName(Common::TStrToUTF8(ffd.cFileName)); 492 const std::string virtualName(Common::TStrToUTF8(ffd.cFileName));
493#else 493#else
494 struct dirent dirent, *result = NULL; 494 struct dirent dirent, *result = nullptr;
495 DIR *dirp = opendir(directory.c_str()); 495 DIR *dirp = opendir(directory.c_str());
496 if (!dirp) 496 if (!dirp)
497 return false; 497 return false;
@@ -552,7 +552,7 @@ void CopyDir(const std::string &source_path, const std::string &dest_path)
552 if (!FileUtil::Exists(source_path)) return; 552 if (!FileUtil::Exists(source_path)) return;
553 if (!FileUtil::Exists(dest_path)) FileUtil::CreateFullPath(dest_path); 553 if (!FileUtil::Exists(dest_path)) FileUtil::CreateFullPath(dest_path);
554 554
555 struct dirent dirent, *result = NULL; 555 struct dirent dirent, *result = nullptr;
556 DIR *dirp = opendir(source_path.c_str()); 556 DIR *dirp = opendir(source_path.c_str());
557 if (!dirp) return; 557 if (!dirp) return;
558 558
@@ -586,11 +586,11 @@ std::string GetCurrentDir()
586{ 586{
587 char *dir; 587 char *dir;
588 // Get the current working directory (getcwd uses malloc) 588 // Get the current working directory (getcwd uses malloc)
589 if (!(dir = __getcwd(NULL, 0))) { 589 if (!(dir = __getcwd(nullptr, 0))) {
590 590
591 ERROR_LOG(COMMON, "GetCurrentDirectory failed: %s", 591 ERROR_LOG(COMMON, "GetCurrentDirectory failed: %s",
592 GetLastErrorMsg()); 592 GetLastErrorMsg());
593 return NULL; 593 return nullptr;
594 } 594 }
595 std::string strDir = dir; 595 std::string strDir = dir;
596 free(dir); 596 free(dir);
@@ -626,7 +626,7 @@ std::string& GetExeDirectory()
626 if (DolphinPath.empty()) 626 if (DolphinPath.empty())
627 { 627 {
628 TCHAR Dolphin_exe_Path[2048]; 628 TCHAR Dolphin_exe_Path[2048];
629 GetModuleFileName(NULL, Dolphin_exe_Path, 2048); 629 GetModuleFileName(nullptr, Dolphin_exe_Path, 2048);
630 DolphinPath = Common::TStrToUTF8(Dolphin_exe_Path); 630 DolphinPath = Common::TStrToUTF8(Dolphin_exe_Path);
631 DolphinPath = DolphinPath.substr(0, DolphinPath.find_last_of('\\')); 631 DolphinPath = DolphinPath.substr(0, DolphinPath.find_last_of('\\'));
632 } 632 }
@@ -826,7 +826,7 @@ void SplitFilename83(const std::string& filename, std::array<char, 9>& short_nam
826} 826}
827 827
828IOFile::IOFile() 828IOFile::IOFile()
829 : m_file(NULL), m_good(true) 829 : m_file(nullptr), m_good(true)
830{} 830{}
831 831
832IOFile::IOFile(std::FILE* file) 832IOFile::IOFile(std::FILE* file)
@@ -834,7 +834,7 @@ IOFile::IOFile(std::FILE* file)
834{} 834{}
835 835
836IOFile::IOFile(const std::string& filename, const char openmode[]) 836IOFile::IOFile(const std::string& filename, const char openmode[])
837 : m_file(NULL), m_good(true) 837 : m_file(nullptr), m_good(true)
838{ 838{
839 Open(filename, openmode); 839 Open(filename, openmode);
840} 840}
@@ -845,7 +845,7 @@ IOFile::~IOFile()
845} 845}
846 846
847IOFile::IOFile(IOFile&& other) 847IOFile::IOFile(IOFile&& other)
848 : m_file(NULL), m_good(true) 848 : m_file(nullptr), m_good(true)
849{ 849{
850 Swap(other); 850 Swap(other);
851} 851}
@@ -880,14 +880,14 @@ bool IOFile::Close()
880 if (!IsOpen() || 0 != std::fclose(m_file)) 880 if (!IsOpen() || 0 != std::fclose(m_file))
881 m_good = false; 881 m_good = false;
882 882
883 m_file = NULL; 883 m_file = nullptr;
884 return m_good; 884 return m_good;
885} 885}
886 886
887std::FILE* IOFile::ReleaseHandle() 887std::FILE* IOFile::ReleaseHandle()
888{ 888{
889 std::FILE* const ret = m_file; 889 std::FILE* const ret = m_file;
890 m_file = NULL; 890 m_file = nullptr;
891 return ret; 891 return ret;
892} 892}
893 893
diff --git a/src/common/file_util.h b/src/common/file_util.h
index 72b80be8a..beaf7174a 100644
--- a/src/common/file_util.h
+++ b/src/common/file_util.h
@@ -202,11 +202,11 @@ public:
202 return WriteArray(reinterpret_cast<const char*>(data), length); 202 return WriteArray(reinterpret_cast<const char*>(data), length);
203 } 203 }
204 204
205 bool IsOpen() { return NULL != m_file; } 205 bool IsOpen() { return nullptr != m_file; }
206 206
207 // m_good is set to false when a read, write or other function fails 207 // m_good is set to false when a read, write or other function fails
208 bool IsGood() { return m_good; } 208 bool IsGood() { return m_good; }
209 operator void*() { return m_good ? m_file : NULL; } 209 operator void*() { return m_good ? m_file : nullptr; }
210 210
211 std::FILE* ReleaseHandle(); 211 std::FILE* ReleaseHandle();
212 212
diff --git a/src/common/linear_disk_cache.h b/src/common/linear_disk_cache.h
index f4263f72a..bb1b5174f 100644
--- a/src/common/linear_disk_cache.h
+++ b/src/common/linear_disk_cache.h
@@ -70,7 +70,7 @@ public:
70 // good header, read some key/value pairs 70 // good header, read some key/value pairs
71 K key; 71 K key;
72 72
73 V *value = NULL; 73 V *value = nullptr;
74 u32 value_size; 74 u32 value_size;
75 u32 entry_number; 75 u32 entry_number;
76 76
diff --git a/src/common/log_manager.cpp b/src/common/log_manager.cpp
index 2ef7d98c0..39b1924c7 100644
--- a/src/common/log_manager.cpp
+++ b/src/common/log_manager.cpp
@@ -21,7 +21,7 @@ void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, const char*
21 va_end(args); 21 va_end(args);
22} 22}
23 23
24LogManager *LogManager::m_logManager = NULL; 24LogManager *LogManager::m_logManager = nullptr;
25 25
26LogManager::LogManager() 26LogManager::LogManager()
27{ 27{
@@ -141,7 +141,7 @@ void LogManager::Init()
141void LogManager::Shutdown() 141void LogManager::Shutdown()
142{ 142{
143 delete m_logManager; 143 delete m_logManager;
144 m_logManager = NULL; 144 m_logManager = nullptr;
145} 145}
146 146
147LogContainer::LogContainer(const char* shortName, const char* fullName, bool enable) 147LogContainer::LogContainer(const char* shortName, const char* fullName, bool enable)
diff --git a/src/common/mem_arena.cpp b/src/common/mem_arena.cpp
index 67dbaf509..7d4fda0e2 100644
--- a/src/common/mem_arena.cpp
+++ b/src/common/mem_arena.cpp
@@ -30,7 +30,7 @@
30#endif 30#endif
31 31
32#ifdef IOS 32#ifdef IOS
33void* globalbase = NULL; 33void* globalbase = nullptr;
34#endif 34#endif
35 35
36#ifdef ANDROID 36#ifdef ANDROID
@@ -121,7 +121,7 @@ void MemArena::GrabLowMemSpace(size_t size)
121{ 121{
122#ifdef _WIN32 122#ifdef _WIN32
123#ifndef _XBOX 123#ifndef _XBOX
124 hMemoryMapping = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, (DWORD)(size), NULL); 124 hMemoryMapping = CreateFileMapping(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, (DWORD)(size), nullptr);
125 GetSystemInfo(&sysInfo); 125 GetSystemInfo(&sysInfo);
126#endif 126#endif
127#elif defined(ANDROID) 127#elif defined(ANDROID)
@@ -178,7 +178,7 @@ void *MemArena::CreateView(s64 offset, size_t size, void *base)
178#ifdef _XBOX 178#ifdef _XBOX
179 size = roundup(size); 179 size = roundup(size);
180 // use 64kb pages 180 // use 64kb pages
181 void * ptr = VirtualAlloc(NULL, size, MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE); 181 void * ptr = VirtualAlloc(nullptr, size, MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE);
182 return ptr; 182 return ptr;
183#else 183#else
184 size = roundup(size); 184 size = roundup(size);
@@ -243,8 +243,8 @@ u8* MemArena::Find4GBBase()
243 return base; 243 return base;
244#else 244#else
245#ifdef IOS 245#ifdef IOS
246 void* base = NULL; 246 void* base = nullptr;
247 if (globalbase == NULL){ 247 if (globalbase == nullptr){
248 base = mmap(0, 0x08000000, PROT_READ | PROT_WRITE, 248 base = mmap(0, 0x08000000, PROT_READ | PROT_WRITE,
249 MAP_ANON | MAP_SHARED, -1, 0); 249 MAP_ANON | MAP_SHARED, -1, 0);
250 if (base == MAP_FAILED) { 250 if (base == MAP_FAILED) {
@@ -357,7 +357,7 @@ bail:
357 if (views[j].out_ptr_low && *views[j].out_ptr_low) 357 if (views[j].out_ptr_low && *views[j].out_ptr_low)
358 { 358 {
359 arena->ReleaseView(*views[j].out_ptr_low, views[j].size); 359 arena->ReleaseView(*views[j].out_ptr_low, views[j].size);
360 *views[j].out_ptr_low = NULL; 360 *views[j].out_ptr_low = nullptr;
361 } 361 }
362 if (*views[j].out_ptr) 362 if (*views[j].out_ptr)
363 { 363 {
@@ -369,7 +369,7 @@ bail:
369 arena->ReleaseView(*views[j].out_ptr, views[j].size); 369 arena->ReleaseView(*views[j].out_ptr, views[j].size);
370 } 370 }
371#endif 371#endif
372 *views[j].out_ptr = NULL; 372 *views[j].out_ptr = nullptr;
373 } 373 }
374 } 374 }
375 return false; 375 return false;
@@ -415,7 +415,7 @@ u8 *MemoryMap_Setup(const MemoryView *views, int num_views, u32 flags, MemArena
415#elif defined(_WIN32) 415#elif defined(_WIN32)
416 // Try a whole range of possible bases. Return once we got a valid one. 416 // Try a whole range of possible bases. Return once we got a valid one.
417 u32 max_base_addr = 0x7FFF0000 - 0x10000000; 417 u32 max_base_addr = 0x7FFF0000 - 0x10000000;
418 u8 *base = NULL; 418 u8 *base = nullptr;
419 419
420 for (u32 base_addr = 0x01000000; base_addr < max_base_addr; base_addr += 0x400000) 420 for (u32 base_addr = 0x01000000; base_addr < max_base_addr; base_addr += 0x400000)
421 { 421 {
@@ -463,8 +463,8 @@ void MemoryMap_Shutdown(const MemoryView *views, int num_views, u32 flags, MemAr
463 arena->ReleaseView(*views[i].out_ptr_low, views[i].size); 463 arena->ReleaseView(*views[i].out_ptr_low, views[i].size);
464 if (*views[i].out_ptr && (views[i].out_ptr_low && *views[i].out_ptr != *views[i].out_ptr_low)) 464 if (*views[i].out_ptr && (views[i].out_ptr_low && *views[i].out_ptr != *views[i].out_ptr_low))
465 arena->ReleaseView(*views[i].out_ptr, views[i].size); 465 arena->ReleaseView(*views[i].out_ptr, views[i].size);
466 *views[i].out_ptr = NULL; 466 *views[i].out_ptr = nullptr;
467 if (views[i].out_ptr_low) 467 if (views[i].out_ptr_low)
468 *views[i].out_ptr_low = NULL; 468 *views[i].out_ptr_low = nullptr;
469 } 469 }
470} 470}
diff --git a/src/common/memory_util.cpp b/src/common/memory_util.cpp
index b6f66e4e1..93da5500b 100644
--- a/src/common/memory_util.cpp
+++ b/src/common/memory_util.cpp
@@ -93,7 +93,7 @@ void* AllocateMemoryPages(size_t size)
93 // printf("Mapped memory at %p (size %ld)\n", ptr, 93 // printf("Mapped memory at %p (size %ld)\n", ptr,
94 // (unsigned long)size); 94 // (unsigned long)size);
95 95
96 if (ptr == NULL) 96 if (ptr == nullptr)
97 PanicAlert("Failed to allocate raw memory"); 97 PanicAlert("Failed to allocate raw memory");
98 98
99 return ptr; 99 return ptr;
@@ -104,7 +104,7 @@ void* AllocateAlignedMemory(size_t size,size_t alignment)
104#ifdef _WIN32 104#ifdef _WIN32
105 void* ptr = _aligned_malloc(size,alignment); 105 void* ptr = _aligned_malloc(size,alignment);
106#else 106#else
107 void* ptr = NULL; 107 void* ptr = nullptr;
108#ifdef ANDROID 108#ifdef ANDROID
109 ptr = memalign(alignment, size); 109 ptr = memalign(alignment, size);
110#else 110#else
@@ -116,7 +116,7 @@ void* AllocateAlignedMemory(size_t size,size_t alignment)
116 // printf("Mapped memory at %p (size %ld)\n", ptr, 116 // printf("Mapped memory at %p (size %ld)\n", ptr,
117 // (unsigned long)size); 117 // (unsigned long)size);
118 118
119 if (ptr == NULL) 119 if (ptr == nullptr)
120 PanicAlert("Failed to allocate aligned memory"); 120 PanicAlert("Failed to allocate aligned memory");
121 121
122 return ptr; 122 return ptr;
@@ -130,7 +130,7 @@ void FreeMemoryPages(void* ptr, size_t size)
130 130
131 if (!VirtualFree(ptr, 0, MEM_RELEASE)) 131 if (!VirtualFree(ptr, 0, MEM_RELEASE))
132 PanicAlert("FreeMemoryPages failed!\n%s", GetLastErrorMsg()); 132 PanicAlert("FreeMemoryPages failed!\n%s", GetLastErrorMsg());
133 ptr = NULL; // Is this our responsibility? 133 ptr = nullptr; // Is this our responsibility?
134 134
135#else 135#else
136 munmap(ptr, size); 136 munmap(ptr, size);
@@ -184,7 +184,7 @@ std::string MemUsage()
184 // Print information about the memory usage of the process. 184 // Print information about the memory usage of the process.
185 185
186 hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processID); 186 hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processID);
187 if (NULL == hProcess) return "MemUsage Error"; 187 if (nullptr == hProcess) return "MemUsage Error";
188 188
189 if (GetProcessMemoryInfo(hProcess, &pmc, sizeof(pmc))) 189 if (GetProcessMemoryInfo(hProcess, &pmc, sizeof(pmc)))
190 Ret = Common::StringFromFormat("%s K", Common::ThousandSeparate(pmc.WorkingSetSize / 1024, 7).c_str()); 190 Ret = Common::StringFromFormat("%s K", Common::ThousandSeparate(pmc.WorkingSetSize / 1024, 7).c_str());
diff --git a/src/common/misc.cpp b/src/common/misc.cpp
index cf6df44e8..bc9d26188 100644
--- a/src/common/misc.cpp
+++ b/src/common/misc.cpp
@@ -23,9 +23,9 @@ const char* GetLastErrorMsg()
23#ifdef _WIN32 23#ifdef _WIN32
24 static __declspec(thread) char err_str[buff_size] = {}; 24 static __declspec(thread) char err_str[buff_size] = {};
25 25
26 FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 26 FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, nullptr, GetLastError(),
27 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 27 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
28 err_str, buff_size, NULL); 28 err_str, buff_size, nullptr);
29#else 29#else
30 static __thread char err_str[buff_size] = {}; 30 static __thread char err_str[buff_size] = {};
31 31
diff --git a/src/common/platform.h b/src/common/platform.h
index d9f095433..53d98fe74 100644
--- a/src/common/platform.h
+++ b/src/common/platform.h
@@ -77,7 +77,7 @@
77inline struct tm* localtime_r(const time_t *clock, struct tm *result) { 77inline struct tm* localtime_r(const time_t *clock, struct tm *result) {
78 if (localtime_s(result, clock) == 0) 78 if (localtime_s(result, clock) == 0)
79 return result; 79 return result;
80 return NULL; 80 return nullptr;
81} 81}
82 82
83#else 83#else
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp
index dcec9275f..7fb7ede5e 100644
--- a/src/common/string_util.cpp
+++ b/src/common/string_util.cpp
@@ -31,7 +31,7 @@ std::string ToUpper(std::string str) {
31// faster than sscanf 31// faster than sscanf
32bool AsciiToHex(const char* _szValue, u32& result) 32bool AsciiToHex(const char* _szValue, u32& result)
33{ 33{
34 char *endptr = NULL; 34 char *endptr = nullptr;
35 const u32 value = strtoul(_szValue, &endptr, 16); 35 const u32 value = strtoul(_szValue, &endptr, 16);
36 36
37 if (!endptr || *endptr) 37 if (!endptr || *endptr)
@@ -69,7 +69,7 @@ bool CharArrayFromFormatV(char* out, int outsize, const char* format, va_list ar
69 // will be present in the middle of a multibyte sequence. 69 // will be present in the middle of a multibyte sequence.
70 // 70 //
71 // This is why we lookup an ANSI (cp1252) locale here and use _vsnprintf_l. 71 // This is why we lookup an ANSI (cp1252) locale here and use _vsnprintf_l.
72 static locale_t c_locale = NULL; 72 static locale_t c_locale = nullptr;
73 if (!c_locale) 73 if (!c_locale)
74 c_locale = _create_locale(LC_ALL, ".1252"); 74 c_locale = _create_locale(LC_ALL, ".1252");
75 writtenCount = _vsnprintf_l(out, outsize, format, c_locale, args); 75 writtenCount = _vsnprintf_l(out, outsize, format, c_locale, args);
@@ -92,7 +92,7 @@ bool CharArrayFromFormatV(char* out, int outsize, const char* format, va_list ar
92std::string StringFromFormat(const char* format, ...) 92std::string StringFromFormat(const char* format, ...)
93{ 93{
94 va_list args; 94 va_list args;
95 char *buf = NULL; 95 char *buf = nullptr;
96#ifdef _WIN32 96#ifdef _WIN32
97 int required = 0; 97 int required = 0;
98 98
@@ -162,7 +162,7 @@ std::string StripQuotes(const std::string& s)
162 162
163bool TryParse(const std::string &str, u32 *const output) 163bool TryParse(const std::string &str, u32 *const output)
164{ 164{
165 char *endptr = NULL; 165 char *endptr = nullptr;
166 166
167 // Reset errno to a value other than ERANGE 167 // Reset errno to a value other than ERANGE
168 errno = 0; 168 errno = 0;
diff --git a/src/common/thread_queue_list.h b/src/common/thread_queue_list.h
index 59efbce4c..7e3b620c7 100644
--- a/src/common/thread_queue_list.h
+++ b/src/common/thread_queue_list.h
@@ -37,7 +37,7 @@ struct ThreadQueueList {
37 ~ThreadQueueList() { 37 ~ThreadQueueList() {
38 for (int i = 0; i < NUM_QUEUES; ++i) 38 for (int i = 0; i < NUM_QUEUES; ++i)
39 { 39 {
40 if (queues[i].data != NULL) 40 if (queues[i].data != nullptr)
41 free(queues[i].data); 41 free(queues[i].data);
42 } 42 }
43 } 43 }
@@ -46,7 +46,7 @@ struct ThreadQueueList {
46 int contains(const IdType uid) { 46 int contains(const IdType uid) {
47 for (int i = 0; i < NUM_QUEUES; ++i) 47 for (int i = 0; i < NUM_QUEUES; ++i)
48 { 48 {
49 if (queues[i].data == NULL) 49 if (queues[i].data == nullptr)
50 continue; 50 continue;
51 51
52 Queue *cur = &queues[i]; 52 Queue *cur = &queues[i];
@@ -133,7 +133,7 @@ struct ThreadQueueList {
133 inline void clear() { 133 inline void clear() {
134 for (int i = 0; i < NUM_QUEUES; ++i) 134 for (int i = 0; i < NUM_QUEUES; ++i)
135 { 135 {
136 if (queues[i].data != NULL) 136 if (queues[i].data != nullptr)
137 free(queues[i].data); 137 free(queues[i].data);
138 } 138 }
139 memset(queues, 0, sizeof(queues)); 139 memset(queues, 0, sizeof(queues));
@@ -147,7 +147,7 @@ struct ThreadQueueList {
147 147
148 inline void prepare(u32 priority) { 148 inline void prepare(u32 priority) {
149 Queue *cur = &queues[priority]; 149 Queue *cur = &queues[priority];
150 if (cur->next == NULL) 150 if (cur->next == nullptr)
151 link(priority, INITIAL_CAPACITY); 151 link(priority, INITIAL_CAPACITY);
152 } 152 }
153 153
@@ -176,7 +176,7 @@ private:
176 176
177 for (int i = (int) priority - 1; i >= 0; --i) 177 for (int i = (int) priority - 1; i >= 0; --i)
178 { 178 {
179 if (queues[i].next != NULL) 179 if (queues[i].next != nullptr)
180 { 180 {
181 cur->next = queues[i].next; 181 cur->next = queues[i].next;
182 queues[i].next = cur; 182 queues[i].next = cur;
@@ -193,7 +193,7 @@ private:
193 int size = cur->end - cur->first; 193 int size = cur->end - cur->first;
194 if (size >= cur->capacity - 2) { 194 if (size >= cur->capacity - 2) {
195 IdType *new_data = (IdType *)realloc(cur->data, cur->capacity * 2 * sizeof(IdType)); 195 IdType *new_data = (IdType *)realloc(cur->data, cur->capacity * 2 * sizeof(IdType));
196 if (new_data != NULL) { 196 if (new_data != nullptr) {
197 cur->capacity *= 2; 197 cur->capacity *= 2;
198 cur->data = new_data; 198 cur->data = new_data;
199 } 199 }
diff --git a/src/common/timer.cpp b/src/common/timer.cpp
index ded4a344e..4a797f751 100644
--- a/src/common/timer.cpp
+++ b/src/common/timer.cpp
@@ -25,7 +25,7 @@ u32 Timer::GetTimeMs()
25 return timeGetTime(); 25 return timeGetTime();
26#else 26#else
27 struct timeval t; 27 struct timeval t;
28 (void)gettimeofday(&t, NULL); 28 (void)gettimeofday(&t, nullptr);
29 return ((u32)(t.tv_sec * 1000 + t.tv_usec / 1000)); 29 return ((u32)(t.tv_sec * 1000 + t.tv_usec / 1000));
30#endif 30#endif
31} 31}
@@ -183,7 +183,7 @@ std::string Timer::GetTimeFormatted()
183 return StringFromFormat("%s:%03i", tmp, tp.millitm); 183 return StringFromFormat("%s:%03i", tmp, tp.millitm);
184#else 184#else
185 struct timeval t; 185 struct timeval t;
186 (void)gettimeofday(&t, NULL); 186 (void)gettimeofday(&t, nullptr);
187 return StringFromFormat("%s:%03d", tmp, (int)(t.tv_usec / 1000)); 187 return StringFromFormat("%s:%03d", tmp, (int)(t.tv_usec / 1000));
188#endif 188#endif
189} 189}
@@ -197,7 +197,7 @@ double Timer::GetDoubleTime()
197 (void)::ftime(&tp); 197 (void)::ftime(&tp);
198#else 198#else
199 struct timeval t; 199 struct timeval t;
200 (void)gettimeofday(&t, NULL); 200 (void)gettimeofday(&t, nullptr);
201#endif 201#endif
202 // Get continuous timestamp 202 // Get continuous timestamp
203 u64 TmpSeconds = Common::Timer::GetTimeSinceJan1970(); 203 u64 TmpSeconds = Common::Timer::GetTimeSinceJan1970();
diff --git a/src/common/utf8.cpp b/src/common/utf8.cpp
index be4ebc855..66a2f6339 100644
--- a/src/common/utf8.cpp
+++ b/src/common/utf8.cpp
@@ -281,28 +281,28 @@ int u8_read_escape_sequence(const char *str, u32 *dest)
281 do { 281 do {
282 digs[dno++] = str[i++]; 282 digs[dno++] = str[i++];
283 } while (octal_digit(str[i]) && dno < 3); 283 } while (octal_digit(str[i]) && dno < 3);
284 ch = strtol(digs, NULL, 8); 284 ch = strtol(digs, nullptr, 8);
285 } 285 }
286 else if (str[0] == 'x') { 286 else if (str[0] == 'x') {
287 while (hex_digit(str[i]) && dno < 2) { 287 while (hex_digit(str[i]) && dno < 2) {
288 digs[dno++] = str[i++]; 288 digs[dno++] = str[i++];
289 } 289 }
290 if (dno > 0) 290 if (dno > 0)
291 ch = strtol(digs, NULL, 16); 291 ch = strtol(digs, nullptr, 16);
292 } 292 }
293 else if (str[0] == 'u') { 293 else if (str[0] == 'u') {
294 while (hex_digit(str[i]) && dno < 4) { 294 while (hex_digit(str[i]) && dno < 4) {
295 digs[dno++] = str[i++]; 295 digs[dno++] = str[i++];
296 } 296 }
297 if (dno > 0) 297 if (dno > 0)
298 ch = strtol(digs, NULL, 16); 298 ch = strtol(digs, nullptr, 16);
299 } 299 }
300 else if (str[0] == 'U') { 300 else if (str[0] == 'U') {
301 while (hex_digit(str[i]) && dno < 8) { 301 while (hex_digit(str[i]) && dno < 8) {
302 digs[dno++] = str[i++]; 302 digs[dno++] = str[i++];
303 } 303 }
304 if (dno > 0) 304 if (dno > 0)
305 ch = strtol(digs, NULL, 16); 305 ch = strtol(digs, nullptr, 16);
306 } 306 }
307 *dest = ch; 307 *dest = ch;
308 308
@@ -353,7 +353,7 @@ const char *u8_strchr(const char *s, u32 ch, int *charn)
353 lasti = i; 353 lasti = i;
354 (*charn)++; 354 (*charn)++;
355 } 355 }
356 return NULL; 356 return nullptr;
357} 357}
358 358
359const char *u8_memchr(const char *s, u32 ch, size_t sz, int *charn) 359const char *u8_memchr(const char *s, u32 ch, size_t sz, int *charn)
@@ -378,7 +378,7 @@ const char *u8_memchr(const char *s, u32 ch, size_t sz, int *charn)
378 lasti = i; 378 lasti = i;
379 (*charn)++; 379 (*charn)++;
380 } 380 }
381 return NULL; 381 return nullptr;
382} 382}
383 383
384int u8_is_locale_utf8(const char *locale) 384int u8_is_locale_utf8(const char *locale)
@@ -419,35 +419,35 @@ bool UTF8StringHasNonASCII(const char *utf8string) {
419 419
420std::string ConvertWStringToUTF8(const wchar_t *wstr) { 420std::string ConvertWStringToUTF8(const wchar_t *wstr) {
421 int len = (int)wcslen(wstr); 421 int len = (int)wcslen(wstr);
422 int size = (int)WideCharToMultiByte(CP_UTF8, 0, wstr, len, 0, 0, NULL, NULL); 422 int size = (int)WideCharToMultiByte(CP_UTF8, 0, wstr, len, 0, 0, nullptr, nullptr);
423 std::string s; 423 std::string s;
424 s.resize(size); 424 s.resize(size);
425 if (size > 0) { 425 if (size > 0) {
426 WideCharToMultiByte(CP_UTF8, 0, wstr, len, &s[0], size, NULL, NULL); 426 WideCharToMultiByte(CP_UTF8, 0, wstr, len, &s[0], size, nullptr, nullptr);
427 } 427 }
428 return s; 428 return s;
429} 429}
430 430
431std::string ConvertWStringToUTF8(const std::wstring &wstr) { 431std::string ConvertWStringToUTF8(const std::wstring &wstr) {
432 int len = (int)wstr.size(); 432 int len = (int)wstr.size();
433 int size = (int)WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), len, 0, 0, NULL, NULL); 433 int size = (int)WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), len, 0, 0, nullptr, nullptr);
434 std::string s; 434 std::string s;
435 s.resize(size); 435 s.resize(size);
436 if (size > 0) { 436 if (size > 0) {
437 WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), len, &s[0], size, NULL, NULL); 437 WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), len, &s[0], size, nullptr, nullptr);
438 } 438 }
439 return s; 439 return s;
440} 440}
441 441
442void ConvertUTF8ToWString(wchar_t *dest, size_t destSize, const std::string &source) { 442void ConvertUTF8ToWString(wchar_t *dest, size_t destSize, const std::string &source) {
443 int len = (int)source.size(); 443 int len = (int)source.size();
444 int size = (int)MultiByteToWideChar(CP_UTF8, 0, source.c_str(), len, NULL, 0); 444 int size = (int)MultiByteToWideChar(CP_UTF8, 0, source.c_str(), len, nullptr, 0);
445 MultiByteToWideChar(CP_UTF8, 0, source.c_str(), len, dest, std::min((int)destSize, size)); 445 MultiByteToWideChar(CP_UTF8, 0, source.c_str(), len, dest, std::min((int)destSize, size));
446} 446}
447 447
448std::wstring ConvertUTF8ToWString(const std::string &source) { 448std::wstring ConvertUTF8ToWString(const std::string &source) {
449 int len = (int)source.size(); 449 int len = (int)source.size();
450 int size = (int)MultiByteToWideChar(CP_UTF8, 0, source.c_str(), len, NULL, 0); 450 int size = (int)MultiByteToWideChar(CP_UTF8, 0, source.c_str(), len, nullptr, 0);
451 std::wstring str; 451 std::wstring str;
452 str.resize(size); 452 str.resize(size);
453 if (size > 0) { 453 if (size > 0) {
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp
index 558c6cbf7..bf8acf41f 100644
--- a/src/core/core_timing.cpp
+++ b/src/core/core_timing.cpp
@@ -67,7 +67,7 @@ s64 idledCycles;
67static std::recursive_mutex externalEventSection; 67static std::recursive_mutex externalEventSection;
68 68
69// Warning: not included in save state. 69// Warning: not included in save state.
70void(*advanceCallback)(int cyclesExecuted) = NULL; 70void(*advanceCallback)(int cyclesExecuted) = nullptr;
71 71
72void SetClockFrequencyMHz(int cpuMhz) 72void SetClockFrequencyMHz(int cpuMhz)
73{ 73{
@@ -231,7 +231,7 @@ void ClearPendingEvents()
231 231
232void AddEventToQueue(Event* ne) 232void AddEventToQueue(Event* ne)
233{ 233{
234 Event* prev = NULL; 234 Event* prev = nullptr;
235 Event** pNext = &first; 235 Event** pNext = &first;
236 for (;;) 236 for (;;)
237 { 237 {
@@ -327,7 +327,7 @@ s64 UnscheduleThreadsafeEvent(int event_type, u64 userdata)
327 } 327 }
328 if (!tsFirst) 328 if (!tsFirst)
329 { 329 {
330 tsLast = NULL; 330 tsLast = nullptr;
331 return result; 331 return result;
332 } 332 }
333 333
@@ -433,7 +433,7 @@ void RemoveThreadsafeEvent(int event_type)
433 } 433 }
434 if (!tsFirst) 434 if (!tsFirst)
435 { 435 {
436 tsLast = NULL; 436 tsLast = nullptr;
437 return; 437 return;
438 } 438 }
439 Event *prev = tsFirst; 439 Event *prev = tsFirst;
@@ -495,7 +495,7 @@ void MoveEvents()
495 AddEventToQueue(tsFirst); 495 AddEventToQueue(tsFirst);
496 tsFirst = next; 496 tsFirst = next;
497 } 497 }
498 tsLast = NULL; 498 tsLast = nullptr;
499 499
500 // Move free events to threadsafe pool 500 // Move free events to threadsafe pool
501 while (allocatedTsEvents > 0 && eventPool) 501 while (allocatedTsEvents > 0 && eventPool)
@@ -614,7 +614,7 @@ void DoState(PointerWrap &p)
614 // These (should) be filled in later by the modules. 614 // These (should) be filled in later by the modules.
615 event_types.resize(n, EventType(AntiCrashCallback, "INVALID EVENT")); 615 event_types.resize(n, EventType(AntiCrashCallback, "INVALID EVENT"));
616 616
617 p.DoLinkedList<BaseEvent, GetNewEvent, FreeEvent, Event_DoState>(first, (Event **)NULL); 617 p.DoLinkedList<BaseEvent, GetNewEvent, FreeEvent, Event_DoState>(first, (Event **)nullptr);
618 p.DoLinkedList<BaseEvent, GetNewTsEvent, FreeTsEvent, Event_DoState>(tsFirst, &tsLast); 618 p.DoLinkedList<BaseEvent, GetNewTsEvent, FreeTsEvent, Event_DoState>(tsFirst, &tsLast);
619 619
620 p.Do(g_clock_rate_arm11); 620 p.Do(g_clock_rate_arm11);
diff --git a/src/video_core/renderer_opengl/gl_shader_util.cpp b/src/video_core/renderer_opengl/gl_shader_util.cpp
index a0eb0418c..fdac9ae1a 100644
--- a/src/video_core/renderer_opengl/gl_shader_util.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_util.cpp
@@ -22,7 +22,7 @@ GLuint LoadShaders(const char* vertex_shader, const char* fragment_shader) {
22 // Compile Vertex Shader 22 // Compile Vertex Shader
23 DEBUG_LOG(GPU, "Compiling vertex shader."); 23 DEBUG_LOG(GPU, "Compiling vertex shader.");
24 24
25 glShaderSource(vertex_shader_id, 1, &vertex_shader, NULL); 25 glShaderSource(vertex_shader_id, 1, &vertex_shader, nullptr);
26 glCompileShader(vertex_shader_id); 26 glCompileShader(vertex_shader_id);
27 27
28 // Check Vertex Shader 28 // Check Vertex Shader
@@ -31,14 +31,14 @@ GLuint LoadShaders(const char* vertex_shader, const char* fragment_shader) {
31 31
32 if (info_log_length > 1) { 32 if (info_log_length > 1) {
33 std::vector<char> vertex_shader_error(info_log_length); 33 std::vector<char> vertex_shader_error(info_log_length);
34 glGetShaderInfoLog(vertex_shader_id, info_log_length, NULL, &vertex_shader_error[0]); 34 glGetShaderInfoLog(vertex_shader_id, info_log_length, nullptr, &vertex_shader_error[0]);
35 DEBUG_LOG(GPU, "%s", &vertex_shader_error[0]); 35 DEBUG_LOG(GPU, "%s", &vertex_shader_error[0]);
36 } 36 }
37 37
38 // Compile Fragment Shader 38 // Compile Fragment Shader
39 DEBUG_LOG(GPU, "Compiling fragment shader."); 39 DEBUG_LOG(GPU, "Compiling fragment shader.");
40 40
41 glShaderSource(fragment_shader_id, 1, &fragment_shader, NULL); 41 glShaderSource(fragment_shader_id, 1, &fragment_shader, nullptr);
42 glCompileShader(fragment_shader_id); 42 glCompileShader(fragment_shader_id);
43 43
44 // Check Fragment Shader 44 // Check Fragment Shader
@@ -47,7 +47,7 @@ GLuint LoadShaders(const char* vertex_shader, const char* fragment_shader) {
47 47
48 if (info_log_length > 1) { 48 if (info_log_length > 1) {
49 std::vector<char> fragment_shader_error(info_log_length); 49 std::vector<char> fragment_shader_error(info_log_length);
50 glGetShaderInfoLog(fragment_shader_id, info_log_length, NULL, &fragment_shader_error[0]); 50 glGetShaderInfoLog(fragment_shader_id, info_log_length, nullptr, &fragment_shader_error[0]);
51 DEBUG_LOG(GPU, "%s", &fragment_shader_error[0]); 51 DEBUG_LOG(GPU, "%s", &fragment_shader_error[0]);
52 } 52 }
53 53
@@ -65,7 +65,7 @@ GLuint LoadShaders(const char* vertex_shader, const char* fragment_shader) {
65 65
66 if (info_log_length > 1) { 66 if (info_log_length > 1) {
67 std::vector<char> program_error(info_log_length); 67 std::vector<char> program_error(info_log_length);
68 glGetProgramInfoLog(program_id, info_log_length, NULL, &program_error[0]); 68 glGetProgramInfoLog(program_id, info_log_length, nullptr, &program_error[0]);
69 DEBUG_LOG(GPU, "%s", &program_error[0]); 69 DEBUG_LOG(GPU, "%s", &program_error[0]);
70 } 70 }
71 71
diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp
index c779771c5..b581ff4da 100644
--- a/src/video_core/video_core.cpp
+++ b/src/video_core/video_core.cpp
@@ -17,8 +17,8 @@
17 17
18namespace VideoCore { 18namespace VideoCore {
19 19
20EmuWindow* g_emu_window = NULL; ///< Frontend emulator window 20EmuWindow* g_emu_window = nullptr; ///< Frontend emulator window
21RendererBase* g_renderer = NULL; ///< Renderer plugin 21RendererBase* g_renderer = nullptr; ///< Renderer plugin
22int g_current_frame = 0; 22int g_current_frame = 0;
23 23
24/// Initialize the video core 24/// Initialize the video core