diff options
| author | 2014-12-20 11:59:18 -0500 | |
|---|---|---|
| committer | 2014-12-20 11:59:18 -0500 | |
| commit | 2b0d7a1d293ca28f6a9022b220720bf8b57a47e8 (patch) | |
| tree | 363f962b88f1b3c8b4f9f36ad46dd3b10addde6b | |
| parent | Merge pull request #317 from yuriks/make_unique (diff) | |
| parent | Clean up some warnings (diff) | |
| download | yuzu-2b0d7a1d293ca28f6a9022b220720bf8b57a47e8.tar.gz yuzu-2b0d7a1d293ca28f6a9022b220720bf8b57a47e8.tar.xz yuzu-2b0d7a1d293ca28f6a9022b220720bf8b57a47e8.zip | |
Merge pull request #315 from chinhodado/master
Clean up some warnings
| -rw-r--r-- | src/citra_qt/debugger/callstack.cpp | 4 | ||||
| -rw-r--r-- | src/citra_qt/debugger/graphics_framebuffer.cpp | 12 | ||||
| -rw-r--r-- | src/citra_qt/util/spinbox.cpp | 2 | ||||
| -rw-r--r-- | src/core/file_sys/archive_backend.h | 11 | ||||
| -rw-r--r-- | src/core/hle/kernel/semaphore.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/kernel/semaphore.h | 2 | ||||
| -rw-r--r-- | src/core/loader/3dsx.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 4 |
8 files changed, 27 insertions, 20 deletions
diff --git a/src/citra_qt/debugger/callstack.cpp b/src/citra_qt/debugger/callstack.cpp index 895851be3..a9ec2f7fe 100644 --- a/src/citra_qt/debugger/callstack.cpp +++ b/src/citra_qt/debugger/callstack.cpp | |||
| @@ -27,10 +27,10 @@ void CallstackWidget::OnCPUStepped() | |||
| 27 | ARM_Interface* app_core = Core::g_app_core; | 27 | ARM_Interface* app_core = Core::g_app_core; |
| 28 | 28 | ||
| 29 | u32 sp = app_core->GetReg(13); //stack pointer | 29 | u32 sp = app_core->GetReg(13); //stack pointer |
| 30 | u32 addr, ret_addr, call_addr, func_addr; | 30 | u32 ret_addr, call_addr, func_addr; |
| 31 | 31 | ||
| 32 | int counter = 0; | 32 | int counter = 0; |
| 33 | for (int addr = 0x10000000; addr >= sp; addr -= 4) | 33 | for (u32 addr = 0x10000000; addr >= sp; addr -= 4) |
| 34 | { | 34 | { |
| 35 | ret_addr = Memory::Read32(addr); | 35 | ret_addr = Memory::Read32(addr); |
| 36 | call_addr = ret_addr - 4; //get call address??? | 36 | call_addr = ret_addr - 4; //get call address??? |
diff --git a/src/citra_qt/debugger/graphics_framebuffer.cpp b/src/citra_qt/debugger/graphics_framebuffer.cpp index ac47f298d..61b61ef6d 100644 --- a/src/citra_qt/debugger/graphics_framebuffer.cpp +++ b/src/citra_qt/debugger/graphics_framebuffer.cpp | |||
| @@ -224,8 +224,8 @@ void GraphicsFramebufferWidget::OnUpdate() | |||
| 224 | { | 224 | { |
| 225 | QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); | 225 | QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); |
| 226 | u32* color_buffer = (u32*)Memory::GetPointer(framebuffer_address); | 226 | u32* color_buffer = (u32*)Memory::GetPointer(framebuffer_address); |
| 227 | for (int y = 0; y < framebuffer_height; ++y) { | 227 | for (unsigned y = 0; y < framebuffer_height; ++y) { |
| 228 | for (int x = 0; x < framebuffer_width; ++x) { | 228 | for (unsigned x = 0; x < framebuffer_width; ++x) { |
| 229 | u32 value = *(color_buffer + x + y * framebuffer_width); | 229 | u32 value = *(color_buffer + x + y * framebuffer_width); |
| 230 | 230 | ||
| 231 | decoded_image.setPixel(x, y, qRgba((value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF, 255/*value >> 24*/)); | 231 | decoded_image.setPixel(x, y, qRgba((value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF, 255/*value >> 24*/)); |
| @@ -239,8 +239,8 @@ void GraphicsFramebufferWidget::OnUpdate() | |||
| 239 | { | 239 | { |
| 240 | QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); | 240 | QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); |
| 241 | u8* color_buffer = Memory::GetPointer(framebuffer_address); | 241 | u8* color_buffer = Memory::GetPointer(framebuffer_address); |
| 242 | for (int y = 0; y < framebuffer_height; ++y) { | 242 | for (unsigned y = 0; y < framebuffer_height; ++y) { |
| 243 | for (int x = 0; x < framebuffer_width; ++x) { | 243 | for (unsigned x = 0; x < framebuffer_width; ++x) { |
| 244 | u8* pixel_pointer = color_buffer + x * 3 + y * 3 * framebuffer_width; | 244 | u8* pixel_pointer = color_buffer + x * 3 + y * 3 * framebuffer_width; |
| 245 | 245 | ||
| 246 | decoded_image.setPixel(x, y, qRgba(pixel_pointer[0], pixel_pointer[1], pixel_pointer[2], 255/*value >> 24*/)); | 246 | decoded_image.setPixel(x, y, qRgba(pixel_pointer[0], pixel_pointer[1], pixel_pointer[2], 255/*value >> 24*/)); |
| @@ -254,8 +254,8 @@ void GraphicsFramebufferWidget::OnUpdate() | |||
| 254 | { | 254 | { |
| 255 | QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); | 255 | QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); |
| 256 | u32* color_buffer = (u32*)Memory::GetPointer(framebuffer_address); | 256 | u32* color_buffer = (u32*)Memory::GetPointer(framebuffer_address); |
| 257 | for (int y = 0; y < framebuffer_height; ++y) { | 257 | for (unsigned y = 0; y < framebuffer_height; ++y) { |
| 258 | for (int x = 0; x < framebuffer_width; ++x) { | 258 | for (unsigned x = 0; x < framebuffer_width; ++x) { |
| 259 | u16 value = *(u16*)(((u8*)color_buffer) + x * 2 + y * framebuffer_width * 2); | 259 | u16 value = *(u16*)(((u8*)color_buffer) + x * 2 + y * framebuffer_width * 2); |
| 260 | u8 r = (value >> 11) & 0x1F; | 260 | u8 r = (value >> 11) & 0x1F; |
| 261 | u8 g = (value >> 6) & 0x1F; | 261 | u8 g = (value >> 6) & 0x1F; |
diff --git a/src/citra_qt/util/spinbox.cpp b/src/citra_qt/util/spinbox.cpp index 9672168f5..24ea3a967 100644 --- a/src/citra_qt/util/spinbox.cpp +++ b/src/citra_qt/util/spinbox.cpp | |||
| @@ -238,7 +238,7 @@ QValidator::State CSpinBox::validate(QString& input, int& pos) const | |||
| 238 | if (!prefix.isEmpty() && input.left(prefix.length()) != prefix) | 238 | if (!prefix.isEmpty() && input.left(prefix.length()) != prefix) |
| 239 | return QValidator::Invalid; | 239 | return QValidator::Invalid; |
| 240 | 240 | ||
| 241 | unsigned strpos = prefix.length(); | 241 | int strpos = prefix.length(); |
| 242 | 242 | ||
| 243 | // Empty "numbers" allowed as intermediate values | 243 | // Empty "numbers" allowed as intermediate values |
| 244 | if (strpos >= input.length() - HasSign() - suffix.length()) | 244 | if (strpos >= input.length() - HasSign() - suffix.length()) |
diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h index 18c314884..d7959b2ca 100644 --- a/src/core/file_sys/archive_backend.h +++ b/src/core/file_sys/archive_backend.h | |||
| @@ -143,7 +143,16 @@ public: | |||
| 143 | case Char: | 143 | case Char: |
| 144 | return std::vector<u8>(string.begin(), string.end()); | 144 | return std::vector<u8>(string.begin(), string.end()); |
| 145 | case Wchar: | 145 | case Wchar: |
| 146 | return std::vector<u8>(u16str.begin(), u16str.end()); | 146 | { |
| 147 | // use two u8 for each character of u16str | ||
| 148 | std::vector<u8> to_return(u16str.size() * 2); | ||
| 149 | for (size_t i = 0; i < u16str.size(); ++i) { | ||
| 150 | u16 tmp_char = u16str.at(i); | ||
| 151 | to_return[i*2] = (tmp_char & 0xFF00) >> 8; | ||
| 152 | to_return[i*2 + 1] = (tmp_char & 0x00FF); | ||
| 153 | } | ||
| 154 | return to_return; | ||
| 155 | } | ||
| 147 | case Empty: | 156 | case Empty: |
| 148 | return {}; | 157 | return {}; |
| 149 | default: | 158 | default: |
diff --git a/src/core/hle/kernel/semaphore.cpp b/src/core/hle/kernel/semaphore.cpp index 6f56da8a9..f955d1957 100644 --- a/src/core/hle/kernel/semaphore.cpp +++ b/src/core/hle/kernel/semaphore.cpp | |||
| @@ -20,8 +20,8 @@ public: | |||
| 20 | static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::Semaphore; } | 20 | static Kernel::HandleType GetStaticHandleType() { return Kernel::HandleType::Semaphore; } |
| 21 | Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::Semaphore; } | 21 | Kernel::HandleType GetHandleType() const override { return Kernel::HandleType::Semaphore; } |
| 22 | 22 | ||
| 23 | u32 max_count; ///< Maximum number of simultaneous holders the semaphore can have | 23 | s32 max_count; ///< Maximum number of simultaneous holders the semaphore can have |
| 24 | u32 available_count; ///< Number of free slots left in the semaphore | 24 | s32 available_count; ///< Number of free slots left in the semaphore |
| 25 | std::queue<Handle> waiting_threads; ///< Threads that are waiting for the semaphore | 25 | std::queue<Handle> waiting_threads; ///< Threads that are waiting for the semaphore |
| 26 | std::string name; ///< Name of semaphore (optional) | 26 | std::string name; ///< Name of semaphore (optional) |
| 27 | 27 | ||
| @@ -49,8 +49,8 @@ public: | |||
| 49 | 49 | ||
| 50 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 50 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 51 | 51 | ||
| 52 | ResultCode CreateSemaphore(Handle* handle, u32 initial_count, | 52 | ResultCode CreateSemaphore(Handle* handle, s32 initial_count, |
| 53 | u32 max_count, const std::string& name) { | 53 | s32 max_count, const std::string& name) { |
| 54 | 54 | ||
| 55 | if (initial_count > max_count) | 55 | if (initial_count > max_count) |
| 56 | return ResultCode(ErrorDescription::InvalidCombination, ErrorModule::Kernel, | 56 | return ResultCode(ErrorDescription::InvalidCombination, ErrorModule::Kernel, |
diff --git a/src/core/hle/kernel/semaphore.h b/src/core/hle/kernel/semaphore.h index f0075fdb8..ad474b875 100644 --- a/src/core/hle/kernel/semaphore.h +++ b/src/core/hle/kernel/semaphore.h | |||
| @@ -18,7 +18,7 @@ namespace Kernel { | |||
| 18 | * @param name Optional name of semaphore | 18 | * @param name Optional name of semaphore |
| 19 | * @return ResultCode of the error | 19 | * @return ResultCode of the error |
| 20 | */ | 20 | */ |
| 21 | ResultCode CreateSemaphore(Handle* handle, u32 initial_count, u32 max_count, const std::string& name = "Unknown"); | 21 | ResultCode CreateSemaphore(Handle* handle, s32 initial_count, s32 max_count, const std::string& name = "Unknown"); |
| 22 | 22 | ||
| 23 | /** | 23 | /** |
| 24 | * Releases a certain number of slots from a semaphore. | 24 | * Releases a certain number of slots from a semaphore. |
diff --git a/src/core/loader/3dsx.cpp b/src/core/loader/3dsx.cpp index 0437e5374..3d84fc5da 100644 --- a/src/core/loader/3dsx.cpp +++ b/src/core/loader/3dsx.cpp | |||
| @@ -223,9 +223,7 @@ int THREEDSXReader::Load3DSXFile(const std::string& filename, u32 base_addr) | |||
| 223 | LOG_INFO(Loader, "Loading 3DSX file %s...", filename.c_str()); | 223 | LOG_INFO(Loader, "Loading 3DSX file %s...", filename.c_str()); |
| 224 | FileUtil::IOFile file(filename, "rb"); | 224 | FileUtil::IOFile file(filename, "rb"); |
| 225 | if (file.IsOpen()) { | 225 | if (file.IsOpen()) { |
| 226 | 226 | THREEDSXReader::Load3DSXFile(filename, 0x00100000); | |
| 227 | THREEDSXReader reader; | ||
| 228 | reader.Load3DSXFile(filename, 0x00100000); | ||
| 229 | Kernel::LoadExec(0x00100000); | 227 | Kernel::LoadExec(0x00100000); |
| 230 | } else { | 228 | } else { |
| 231 | return ResultStatus::Error; | 229 | return ResultStatus::Error; |
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index e2caeeb8f..e20d7adb7 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp | |||
| @@ -240,14 +240,14 @@ MathUtil::Rectangle<unsigned> RendererOpenGL::GetViewportExtent() { | |||
| 240 | MathUtil::Rectangle<unsigned> viewport_extent; | 240 | MathUtil::Rectangle<unsigned> viewport_extent; |
| 241 | if (window_aspect_ratio > emulation_aspect_ratio) { | 241 | if (window_aspect_ratio > emulation_aspect_ratio) { |
| 242 | // Window is narrower than the emulation content => apply borders to the top and bottom | 242 | // Window is narrower than the emulation content => apply borders to the top and bottom |
| 243 | unsigned viewport_height = std::round(emulation_aspect_ratio * framebuffer_width); | 243 | unsigned viewport_height = static_cast<unsigned>(std::round(emulation_aspect_ratio * framebuffer_width)); |
| 244 | viewport_extent.left = 0; | 244 | viewport_extent.left = 0; |
| 245 | viewport_extent.top = (framebuffer_height - viewport_height) / 2; | 245 | viewport_extent.top = (framebuffer_height - viewport_height) / 2; |
| 246 | viewport_extent.right = viewport_extent.left + framebuffer_width; | 246 | viewport_extent.right = viewport_extent.left + framebuffer_width; |
| 247 | viewport_extent.bottom = viewport_extent.top + viewport_height; | 247 | viewport_extent.bottom = viewport_extent.top + viewport_height; |
| 248 | } else { | 248 | } else { |
| 249 | // Otherwise, apply borders to the left and right sides of the window. | 249 | // Otherwise, apply borders to the left and right sides of the window. |
| 250 | unsigned viewport_width = std::round(framebuffer_height / emulation_aspect_ratio); | 250 | unsigned viewport_width = static_cast<unsigned>(std::round(framebuffer_height / emulation_aspect_ratio)); |
| 251 | viewport_extent.left = (framebuffer_width - viewport_width) / 2; | 251 | viewport_extent.left = (framebuffer_width - viewport_width) / 2; |
| 252 | viewport_extent.top = 0; | 252 | viewport_extent.top = 0; |
| 253 | viewport_extent.right = viewport_extent.left + viewport_width; | 253 | viewport_extent.right = viewport_extent.left + viewport_width; |