summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2015-01-05 22:10:56 -0500
committerGravatar bunnei2015-01-05 22:10:56 -0500
commit9b83f0e15859ed56a8e25f204484d2cd34b74f16 (patch)
tree5c04821a59dfbb0ae16d18aa8c1f014a51b44bec
parentMerge pull request #422 from lioncash/bxj (diff)
parentSilence some -Wsign-compare warnings. (diff)
downloadyuzu-9b83f0e15859ed56a8e25f204484d2cd34b74f16.tar.gz
yuzu-9b83f0e15859ed56a8e25f204484d2cd34b74f16.tar.xz
yuzu-9b83f0e15859ed56a8e25f204484d2cd34b74f16.zip
Merge pull request #272 from rohit-n/sign-compare
Silence some -Wsign-compare warnings.
-rw-r--r--src/citra_qt/debugger/graphics_cmdlists.cpp4
-rw-r--r--src/citra_qt/debugger/graphics_framebuffer.cpp16
-rw-r--r--src/citra_qt/debugger/graphics_framebuffer.hxx4
-rw-r--r--src/core/hle/service/soc_u.cpp8
4 files changed, 16 insertions, 16 deletions
diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics_cmdlists.cpp
index 753cc25da..708b805a7 100644
--- a/src/citra_qt/debugger/graphics_cmdlists.cpp
+++ b/src/citra_qt/debugger/graphics_cmdlists.cpp
@@ -229,7 +229,7 @@ void GPUCommandListModel::OnPicaTraceFinished(const Pica::DebugUtils::PicaTrace&
229 cmd_id < PICA_REG_INDEX(reg_name) + sizeof(decltype(Pica::registers.reg_name)) / 4) 229 cmd_id < PICA_REG_INDEX(reg_name) + sizeof(decltype(Pica::registers.reg_name)) / 4)
230 230
231void GPUCommandListWidget::OnCommandDoubleClicked(const QModelIndex& index) { 231void GPUCommandListWidget::OnCommandDoubleClicked(const QModelIndex& index) {
232 const int command_id = list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toInt(); 232 const unsigned int command_id = list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toUInt();
233 if (COMMAND_IN_RANGE(command_id, texture0) || 233 if (COMMAND_IN_RANGE(command_id, texture0) ||
234 COMMAND_IN_RANGE(command_id, texture1) || 234 COMMAND_IN_RANGE(command_id, texture1) ||
235 COMMAND_IN_RANGE(command_id, texture2)) { 235 COMMAND_IN_RANGE(command_id, texture2)) {
@@ -255,7 +255,7 @@ void GPUCommandListWidget::OnCommandDoubleClicked(const QModelIndex& index) {
255void GPUCommandListWidget::SetCommandInfo(const QModelIndex& index) { 255void GPUCommandListWidget::SetCommandInfo(const QModelIndex& index) {
256 QWidget* new_info_widget; 256 QWidget* new_info_widget;
257 257
258 const int command_id = list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toInt(); 258 const unsigned int command_id = list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toUInt();
259 if (COMMAND_IN_RANGE(command_id, texture0) || 259 if (COMMAND_IN_RANGE(command_id, texture0) ||
260 COMMAND_IN_RANGE(command_id, texture1) || 260 COMMAND_IN_RANGE(command_id, texture1) ||
261 COMMAND_IN_RANGE(command_id, texture2)) { 261 COMMAND_IN_RANGE(command_id, texture2)) {
diff --git a/src/citra_qt/debugger/graphics_framebuffer.cpp b/src/citra_qt/debugger/graphics_framebuffer.cpp
index a9e9de652..7ef699f37 100644
--- a/src/citra_qt/debugger/graphics_framebuffer.cpp
+++ b/src/citra_qt/debugger/graphics_framebuffer.cpp
@@ -158,7 +158,7 @@ void GraphicsFramebufferWidget::OnFramebufferAddressChanged(qint64 new_value)
158 } 158 }
159} 159}
160 160
161void GraphicsFramebufferWidget::OnFramebufferWidthChanged(int new_value) 161void GraphicsFramebufferWidget::OnFramebufferWidthChanged(unsigned int new_value)
162{ 162{
163 if (framebuffer_width != new_value) { 163 if (framebuffer_width != new_value) {
164 framebuffer_width = new_value; 164 framebuffer_width = new_value;
@@ -168,7 +168,7 @@ void GraphicsFramebufferWidget::OnFramebufferWidthChanged(int new_value)
168 } 168 }
169} 169}
170 170
171void GraphicsFramebufferWidget::OnFramebufferHeightChanged(int new_value) 171void GraphicsFramebufferWidget::OnFramebufferHeightChanged(unsigned int new_value)
172{ 172{
173 if (framebuffer_height != new_value) { 173 if (framebuffer_height != new_value) {
174 framebuffer_height = new_value; 174 framebuffer_height = new_value;
@@ -227,8 +227,8 @@ void GraphicsFramebufferWidget::OnUpdate()
227 { 227 {
228 QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); 228 QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32);
229 u32* color_buffer = (u32*)Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address)); 229 u32* color_buffer = (u32*)Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address));
230 for (unsigned y = 0; y < framebuffer_height; ++y) { 230 for (unsigned int y = 0; y < framebuffer_height; ++y) {
231 for (unsigned x = 0; x < framebuffer_width; ++x) { 231 for (unsigned int x = 0; x < framebuffer_width; ++x) {
232 u32 value = *(color_buffer + x + y * framebuffer_width); 232 u32 value = *(color_buffer + x + y * framebuffer_width);
233 233
234 decoded_image.setPixel(x, y, qRgba((value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF, 255/*value >> 24*/)); 234 decoded_image.setPixel(x, y, qRgba((value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF, 255/*value >> 24*/));
@@ -242,8 +242,8 @@ void GraphicsFramebufferWidget::OnUpdate()
242 { 242 {
243 QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); 243 QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32);
244 u8* color_buffer = Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address)); 244 u8* color_buffer = Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address));
245 for (unsigned y = 0; y < framebuffer_height; ++y) { 245 for (unsigned int y = 0; y < framebuffer_height; ++y) {
246 for (unsigned x = 0; x < framebuffer_width; ++x) { 246 for (unsigned int x = 0; x < framebuffer_width; ++x) {
247 u8* pixel_pointer = color_buffer + x * 3 + y * 3 * framebuffer_width; 247 u8* pixel_pointer = color_buffer + x * 3 + y * 3 * framebuffer_width;
248 248
249 decoded_image.setPixel(x, y, qRgba(pixel_pointer[0], pixel_pointer[1], pixel_pointer[2], 255/*value >> 24*/)); 249 decoded_image.setPixel(x, y, qRgba(pixel_pointer[0], pixel_pointer[1], pixel_pointer[2], 255/*value >> 24*/));
@@ -257,8 +257,8 @@ void GraphicsFramebufferWidget::OnUpdate()
257 { 257 {
258 QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32); 258 QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32);
259 u32* color_buffer = (u32*)Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address)); 259 u32* color_buffer = (u32*)Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address));
260 for (unsigned y = 0; y < framebuffer_height; ++y) { 260 for (unsigned int y = 0; y < framebuffer_height; ++y) {
261 for (unsigned x = 0; x < framebuffer_width; ++x) { 261 for (unsigned int x = 0; x < framebuffer_width; ++x) {
262 u16 value = *(u16*)(((u8*)color_buffer) + x * 2 + y * framebuffer_width * 2); 262 u16 value = *(u16*)(((u8*)color_buffer) + x * 2 + y * framebuffer_width * 2);
263 u8 r = Color::Convert5To8((value >> 11) & 0x1F); 263 u8 r = Color::Convert5To8((value >> 11) & 0x1F);
264 u8 g = Color::Convert5To8((value >> 6) & 0x1F); 264 u8 g = Color::Convert5To8((value >> 6) & 0x1F);
diff --git a/src/citra_qt/debugger/graphics_framebuffer.hxx b/src/citra_qt/debugger/graphics_framebuffer.hxx
index 56215761e..02813525c 100644
--- a/src/citra_qt/debugger/graphics_framebuffer.hxx
+++ b/src/citra_qt/debugger/graphics_framebuffer.hxx
@@ -62,8 +62,8 @@ public:
62public slots: 62public slots:
63 void OnFramebufferSourceChanged(int new_value); 63 void OnFramebufferSourceChanged(int new_value);
64 void OnFramebufferAddressChanged(qint64 new_value); 64 void OnFramebufferAddressChanged(qint64 new_value);
65 void OnFramebufferWidthChanged(int new_value); 65 void OnFramebufferWidthChanged(unsigned int new_value);
66 void OnFramebufferHeightChanged(int new_value); 66 void OnFramebufferHeightChanged(unsigned int new_value);
67 void OnFramebufferFormatChanged(int new_value); 67 void OnFramebufferFormatChanged(int new_value);
68 void OnUpdate(); 68 void OnUpdate();
69 69
diff --git a/src/core/hle/service/soc_u.cpp b/src/core/hle/service/soc_u.cpp
index 8e7abcf9c..f502c6afe 100644
--- a/src/core/hle/service/soc_u.cpp
+++ b/src/core/hle/service/soc_u.cpp
@@ -308,11 +308,11 @@ static void Socket(Service::Interface* self) {
308 308
309 u32 socket_handle = static_cast<u32>(::socket(domain, type, protocol)); 309 u32 socket_handle = static_cast<u32>(::socket(domain, type, protocol));
310 310
311 if (socket_handle != SOCKET_ERROR_VALUE) 311 if ((s32)socket_handle != SOCKET_ERROR_VALUE)
312 open_sockets[socket_handle] = { socket_handle, true }; 312 open_sockets[socket_handle] = { socket_handle, true };
313 313
314 int result = 0; 314 int result = 0;
315 if (socket_handle == SOCKET_ERROR_VALUE) 315 if ((s32)socket_handle == SOCKET_ERROR_VALUE)
316 result = TranslateError(GET_ERRNO); 316 result = TranslateError(GET_ERRNO);
317 317
318 cmd_buffer[1] = result; 318 cmd_buffer[1] = result;
@@ -436,11 +436,11 @@ static void Accept(Service::Interface* self) {
436 socklen_t addr_len = sizeof(addr); 436 socklen_t addr_len = sizeof(addr);
437 u32 ret = static_cast<u32>(::accept(socket_handle, &addr, &addr_len)); 437 u32 ret = static_cast<u32>(::accept(socket_handle, &addr, &addr_len));
438 438
439 if (ret != SOCKET_ERROR_VALUE) 439 if ((s32)ret != SOCKET_ERROR_VALUE)
440 open_sockets[ret] = { ret, true }; 440 open_sockets[ret] = { ret, true };
441 441
442 int result = 0; 442 int result = 0;
443 if (ret == SOCKET_ERROR_VALUE) { 443 if ((s32)ret == SOCKET_ERROR_VALUE) {
444 result = TranslateError(GET_ERRNO); 444 result = TranslateError(GET_ERRNO);
445 } else { 445 } else {
446 CTRSockAddr ctr_addr = CTRSockAddr::FromPlatform(addr); 446 CTRSockAddr ctr_addr = CTRSockAddr::FromPlatform(addr);