diff options
| -rw-r--r-- | src/citra_qt/debugger/profiler.cpp | 2 | ||||
| -rw-r--r-- | src/citra_qt/debugger/profiler.h | 2 | ||||
| -rw-r--r-- | src/common/chunk_file.h | 4 | ||||
| -rw-r--r-- | src/common/memory_util.cpp | 21 | ||||
| -rw-r--r-- | src/core/core_timing.cpp | 2 |
5 files changed, 9 insertions, 22 deletions
diff --git a/src/citra_qt/debugger/profiler.cpp b/src/citra_qt/debugger/profiler.cpp index 043f20659..4f6ba0e1f 100644 --- a/src/citra_qt/debugger/profiler.cpp +++ b/src/citra_qt/debugger/profiler.cpp | |||
| @@ -150,7 +150,7 @@ void ProfilerWidget::setProfilingInfoUpdateEnabled(bool enable) | |||
| 150 | 150 | ||
| 151 | class MicroProfileWidget : public QWidget { | 151 | class MicroProfileWidget : public QWidget { |
| 152 | public: | 152 | public: |
| 153 | MicroProfileWidget(QWidget* parent = 0); | 153 | MicroProfileWidget(QWidget* parent = nullptr); |
| 154 | 154 | ||
| 155 | protected: | 155 | protected: |
| 156 | void paintEvent(QPaintEvent* ev) override; | 156 | void paintEvent(QPaintEvent* ev) override; |
diff --git a/src/citra_qt/debugger/profiler.h b/src/citra_qt/debugger/profiler.h index 85c27a43e..036054740 100644 --- a/src/citra_qt/debugger/profiler.h +++ b/src/citra_qt/debugger/profiler.h | |||
| @@ -53,7 +53,7 @@ class MicroProfileDialog : public QWidget { | |||
| 53 | Q_OBJECT | 53 | Q_OBJECT |
| 54 | 54 | ||
| 55 | public: | 55 | public: |
| 56 | MicroProfileDialog(QWidget* parent = 0); | 56 | MicroProfileDialog(QWidget* parent = nullptr); |
| 57 | 57 | ||
| 58 | /// Returns a QAction that can be used to toggle visibility of this dialog. | 58 | /// Returns a QAction that can be used to toggle visibility of this dialog. |
| 59 | QAction* toggleViewAction(); | 59 | QAction* toggleViewAction(); |
diff --git a/src/common/chunk_file.h b/src/common/chunk_file.h index 8be0b1109..1e1bcff31 100644 --- a/src/common/chunk_file.h +++ b/src/common/chunk_file.h | |||
| @@ -575,10 +575,10 @@ public: | |||
| 575 | } | 575 | } |
| 576 | 576 | ||
| 577 | template<class T, LinkedListItem<T>* (*TNew)(), void (*TFree)(LinkedListItem<T>*), void (*TDo)(PointerWrap&, T*)> | 577 | template<class T, LinkedListItem<T>* (*TNew)(), void (*TFree)(LinkedListItem<T>*), void (*TDo)(PointerWrap&, T*)> |
| 578 | void DoLinkedList(LinkedListItem<T>*& list_start, LinkedListItem<T>** list_end=0) | 578 | void DoLinkedList(LinkedListItem<T>*& list_start, LinkedListItem<T>** list_end = nullptr) |
| 579 | { | 579 | { |
| 580 | LinkedListItem<T>* list_cur = list_start; | 580 | LinkedListItem<T>* list_cur = list_start; |
| 581 | LinkedListItem<T>* prev = 0; | 581 | LinkedListItem<T>* prev = nullptr; |
| 582 | 582 | ||
| 583 | while (true) | 583 | while (true) |
| 584 | { | 584 | { |
diff --git a/src/common/memory_util.cpp b/src/common/memory_util.cpp index 5ef784224..07c7f79c8 100644 --- a/src/common/memory_util.cpp +++ b/src/common/memory_util.cpp | |||
| @@ -28,9 +28,9 @@ | |||
| 28 | void* AllocateExecutableMemory(size_t size, bool low) | 28 | void* AllocateExecutableMemory(size_t size, bool low) |
| 29 | { | 29 | { |
| 30 | #if defined(_WIN32) | 30 | #if defined(_WIN32) |
| 31 | void* ptr = VirtualAlloc(0, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); | 31 | void* ptr = VirtualAlloc(nullptr, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); |
| 32 | #else | 32 | #else |
| 33 | static char *map_hint = 0; | 33 | static char* map_hint = nullptr; |
| 34 | #if defined(ARCHITECTURE_X64) && !defined(MAP_32BIT) | 34 | #if defined(ARCHITECTURE_X64) && !defined(MAP_32BIT) |
| 35 | // This OS has no flag to enforce allocation below the 4 GB boundary, | 35 | // This OS has no flag to enforce allocation below the 4 GB boundary, |
| 36 | // but if we hint that we want a low address it is very likely we will | 36 | // but if we hint that we want a low address it is very likely we will |
| @@ -49,9 +49,6 @@ void* AllocateExecutableMemory(size_t size, bool low) | |||
| 49 | , -1, 0); | 49 | , -1, 0); |
| 50 | #endif /* defined(_WIN32) */ | 50 | #endif /* defined(_WIN32) */ |
| 51 | 51 | ||
| 52 | // printf("Mapped executable memory at %p (size %ld)\n", ptr, | ||
| 53 | // (unsigned long)size); | ||
| 54 | |||
| 55 | #ifdef _WIN32 | 52 | #ifdef _WIN32 |
| 56 | if (ptr == nullptr) | 53 | if (ptr == nullptr) |
| 57 | { | 54 | { |
| @@ -69,7 +66,6 @@ void* AllocateExecutableMemory(size_t size, bool low) | |||
| 69 | { | 66 | { |
| 70 | map_hint += size; | 67 | map_hint += size; |
| 71 | map_hint = (char*)round_page(map_hint); /* round up to the next page */ | 68 | map_hint = (char*)round_page(map_hint); /* round up to the next page */ |
| 72 | // printf("Next map will (hopefully) be at %p\n", map_hint); | ||
| 73 | } | 69 | } |
| 74 | } | 70 | } |
| 75 | #endif | 71 | #endif |
| @@ -85,18 +81,15 @@ void* AllocateExecutableMemory(size_t size, bool low) | |||
| 85 | void* AllocateMemoryPages(size_t size) | 81 | void* AllocateMemoryPages(size_t size) |
| 86 | { | 82 | { |
| 87 | #ifdef _WIN32 | 83 | #ifdef _WIN32 |
| 88 | void* ptr = VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE); | 84 | void* ptr = VirtualAlloc(nullptr, size, MEM_COMMIT, PAGE_READWRITE); |
| 89 | #else | 85 | #else |
| 90 | void* ptr = mmap(0, size, PROT_READ | PROT_WRITE, | 86 | void* ptr = mmap(nullptr, size, PROT_READ | PROT_WRITE, |
| 91 | MAP_ANON | MAP_PRIVATE, -1, 0); | 87 | MAP_ANON | MAP_PRIVATE, -1, 0); |
| 92 | 88 | ||
| 93 | if (ptr == MAP_FAILED) | 89 | if (ptr == MAP_FAILED) |
| 94 | ptr = nullptr; | 90 | ptr = nullptr; |
| 95 | #endif | 91 | #endif |
| 96 | 92 | ||
| 97 | // printf("Mapped memory at %p (size %ld)\n", ptr, | ||
| 98 | // (unsigned long)size); | ||
| 99 | |||
| 100 | if (ptr == nullptr) | 93 | if (ptr == nullptr) |
| 101 | LOG_ERROR(Common_Memory, "Failed to allocate raw memory"); | 94 | LOG_ERROR(Common_Memory, "Failed to allocate raw memory"); |
| 102 | 95 | ||
| @@ -117,9 +110,6 @@ void* AllocateAlignedMemory(size_t size,size_t alignment) | |||
| 117 | #endif | 110 | #endif |
| 118 | #endif | 111 | #endif |
| 119 | 112 | ||
| 120 | // printf("Mapped memory at %p (size %ld)\n", ptr, | ||
| 121 | // (unsigned long)size); | ||
| 122 | |||
| 123 | if (ptr == nullptr) | 113 | if (ptr == nullptr) |
| 124 | LOG_ERROR(Common_Memory, "Failed to allocate aligned memory"); | 114 | LOG_ERROR(Common_Memory, "Failed to allocate aligned memory"); |
| 125 | 115 | ||
| @@ -131,11 +121,8 @@ void FreeMemoryPages(void* ptr, size_t size) | |||
| 131 | if (ptr) | 121 | if (ptr) |
| 132 | { | 122 | { |
| 133 | #ifdef _WIN32 | 123 | #ifdef _WIN32 |
| 134 | |||
| 135 | if (!VirtualFree(ptr, 0, MEM_RELEASE)) | 124 | if (!VirtualFree(ptr, 0, MEM_RELEASE)) |
| 136 | LOG_ERROR(Common_Memory, "FreeMemoryPages failed!\n%s", GetLastErrorMsg()); | 125 | LOG_ERROR(Common_Memory, "FreeMemoryPages failed!\n%s", GetLastErrorMsg()); |
| 137 | ptr = nullptr; // Is this our responsibility? | ||
| 138 | |||
| 139 | #else | 126 | #else |
| 140 | munmap(ptr, size); | 127 | munmap(ptr, size); |
| 141 | #endif | 128 | #endif |
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index 20f2da0fe..56615502c 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp | |||
| @@ -207,7 +207,7 @@ void ScheduleEvent_Threadsafe(s64 cycles_into_future, int event_type, u64 userda | |||
| 207 | Event* new_event = GetNewTsEvent(); | 207 | Event* new_event = GetNewTsEvent(); |
| 208 | new_event->time = GetTicks() + cycles_into_future; | 208 | new_event->time = GetTicks() + cycles_into_future; |
| 209 | new_event->type = event_type; | 209 | new_event->type = event_type; |
| 210 | new_event->next = 0; | 210 | new_event->next = nullptr; |
| 211 | new_event->userdata = userdata; | 211 | new_event->userdata = userdata; |
| 212 | if (!ts_first) | 212 | if (!ts_first) |
| 213 | ts_first = new_event; | 213 | ts_first = new_event; |