mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-15 06:50:06 +00:00
Silence some -Wsign-compare warnings.
This commit is contained in:
parent
84d11d7ff6
commit
c589d82052
@ -229,7 +229,7 @@ void GPUCommandListModel::OnPicaTraceFinished(const Pica::DebugUtils::PicaTrace&
|
|||||||
cmd_id < PICA_REG_INDEX(reg_name) + sizeof(decltype(Pica::registers.reg_name)) / 4)
|
cmd_id < PICA_REG_INDEX(reg_name) + sizeof(decltype(Pica::registers.reg_name)) / 4)
|
||||||
|
|
||||||
void GPUCommandListWidget::OnCommandDoubleClicked(const QModelIndex& index) {
|
void GPUCommandListWidget::OnCommandDoubleClicked(const QModelIndex& index) {
|
||||||
const int command_id = list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toInt();
|
const unsigned int command_id = list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toUInt();
|
||||||
if (COMMAND_IN_RANGE(command_id, texture0) ||
|
if (COMMAND_IN_RANGE(command_id, texture0) ||
|
||||||
COMMAND_IN_RANGE(command_id, texture1) ||
|
COMMAND_IN_RANGE(command_id, texture1) ||
|
||||||
COMMAND_IN_RANGE(command_id, texture2)) {
|
COMMAND_IN_RANGE(command_id, texture2)) {
|
||||||
@ -255,7 +255,7 @@ void GPUCommandListWidget::OnCommandDoubleClicked(const QModelIndex& index) {
|
|||||||
void GPUCommandListWidget::SetCommandInfo(const QModelIndex& index) {
|
void GPUCommandListWidget::SetCommandInfo(const QModelIndex& index) {
|
||||||
QWidget* new_info_widget;
|
QWidget* new_info_widget;
|
||||||
|
|
||||||
const int command_id = list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toInt();
|
const unsigned int command_id = list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toUInt();
|
||||||
if (COMMAND_IN_RANGE(command_id, texture0) ||
|
if (COMMAND_IN_RANGE(command_id, texture0) ||
|
||||||
COMMAND_IN_RANGE(command_id, texture1) ||
|
COMMAND_IN_RANGE(command_id, texture1) ||
|
||||||
COMMAND_IN_RANGE(command_id, texture2)) {
|
COMMAND_IN_RANGE(command_id, texture2)) {
|
||||||
|
@ -157,7 +157,7 @@ void GraphicsFramebufferWidget::OnFramebufferAddressChanged(qint64 new_value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsFramebufferWidget::OnFramebufferWidthChanged(int new_value)
|
void GraphicsFramebufferWidget::OnFramebufferWidthChanged(unsigned int new_value)
|
||||||
{
|
{
|
||||||
if (framebuffer_width != new_value) {
|
if (framebuffer_width != new_value) {
|
||||||
framebuffer_width = new_value;
|
framebuffer_width = new_value;
|
||||||
@ -167,7 +167,7 @@ void GraphicsFramebufferWidget::OnFramebufferWidthChanged(int new_value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsFramebufferWidget::OnFramebufferHeightChanged(int new_value)
|
void GraphicsFramebufferWidget::OnFramebufferHeightChanged(unsigned int new_value)
|
||||||
{
|
{
|
||||||
if (framebuffer_height != new_value) {
|
if (framebuffer_height != new_value) {
|
||||||
framebuffer_height = new_value;
|
framebuffer_height = new_value;
|
||||||
@ -225,8 +225,8 @@ void GraphicsFramebufferWidget::OnUpdate()
|
|||||||
{
|
{
|
||||||
QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32);
|
QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32);
|
||||||
u32* color_buffer = (u32*)Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address));
|
u32* color_buffer = (u32*)Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address));
|
||||||
for (unsigned y = 0; y < framebuffer_height; ++y) {
|
for (unsigned int y = 0; y < framebuffer_height; ++y) {
|
||||||
for (unsigned x = 0; x < framebuffer_width; ++x) {
|
for (unsigned int x = 0; x < framebuffer_width; ++x) {
|
||||||
u32 value = *(color_buffer + x + y * framebuffer_width);
|
u32 value = *(color_buffer + x + y * framebuffer_width);
|
||||||
|
|
||||||
decoded_image.setPixel(x, y, qRgba((value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF, 255/*value >> 24*/));
|
decoded_image.setPixel(x, y, qRgba((value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF, 255/*value >> 24*/));
|
||||||
@ -240,8 +240,8 @@ void GraphicsFramebufferWidget::OnUpdate()
|
|||||||
{
|
{
|
||||||
QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32);
|
QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32);
|
||||||
u8* color_buffer = Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address));
|
u8* color_buffer = Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address));
|
||||||
for (unsigned y = 0; y < framebuffer_height; ++y) {
|
for (unsigned int y = 0; y < framebuffer_height; ++y) {
|
||||||
for (unsigned x = 0; x < framebuffer_width; ++x) {
|
for (unsigned int x = 0; x < framebuffer_width; ++x) {
|
||||||
u8* pixel_pointer = color_buffer + x * 3 + y * 3 * framebuffer_width;
|
u8* pixel_pointer = color_buffer + x * 3 + y * 3 * framebuffer_width;
|
||||||
|
|
||||||
decoded_image.setPixel(x, y, qRgba(pixel_pointer[0], pixel_pointer[1], pixel_pointer[2], 255/*value >> 24*/));
|
decoded_image.setPixel(x, y, qRgba(pixel_pointer[0], pixel_pointer[1], pixel_pointer[2], 255/*value >> 24*/));
|
||||||
@ -255,8 +255,8 @@ void GraphicsFramebufferWidget::OnUpdate()
|
|||||||
{
|
{
|
||||||
QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32);
|
QImage decoded_image(framebuffer_width, framebuffer_height, QImage::Format_ARGB32);
|
||||||
u32* color_buffer = (u32*)Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address));
|
u32* color_buffer = (u32*)Memory::GetPointer(Pica::PAddrToVAddr(framebuffer_address));
|
||||||
for (unsigned y = 0; y < framebuffer_height; ++y) {
|
for (unsigned int y = 0; y < framebuffer_height; ++y) {
|
||||||
for (unsigned x = 0; x < framebuffer_width; ++x) {
|
for (unsigned int x = 0; x < framebuffer_width; ++x) {
|
||||||
u16 value = *(u16*)(((u8*)color_buffer) + x * 2 + y * framebuffer_width * 2);
|
u16 value = *(u16*)(((u8*)color_buffer) + x * 2 + y * framebuffer_width * 2);
|
||||||
u8 r = (value >> 11) & 0x1F;
|
u8 r = (value >> 11) & 0x1F;
|
||||||
u8 g = (value >> 6) & 0x1F;
|
u8 g = (value >> 6) & 0x1F;
|
||||||
|
@ -62,8 +62,8 @@ public:
|
|||||||
public slots:
|
public slots:
|
||||||
void OnFramebufferSourceChanged(int new_value);
|
void OnFramebufferSourceChanged(int new_value);
|
||||||
void OnFramebufferAddressChanged(qint64 new_value);
|
void OnFramebufferAddressChanged(qint64 new_value);
|
||||||
void OnFramebufferWidthChanged(int new_value);
|
void OnFramebufferWidthChanged(unsigned int new_value);
|
||||||
void OnFramebufferHeightChanged(int new_value);
|
void OnFramebufferHeightChanged(unsigned int new_value);
|
||||||
void OnFramebufferFormatChanged(int new_value);
|
void OnFramebufferFormatChanged(int new_value);
|
||||||
void OnUpdate();
|
void OnUpdate();
|
||||||
|
|
||||||
|
@ -308,11 +308,11 @@ static void Socket(Service::Interface* self) {
|
|||||||
|
|
||||||
u32 socket_handle = static_cast<u32>(::socket(domain, type, protocol));
|
u32 socket_handle = static_cast<u32>(::socket(domain, type, protocol));
|
||||||
|
|
||||||
if (socket_handle != SOCKET_ERROR_VALUE)
|
if ((s32)socket_handle != SOCKET_ERROR_VALUE)
|
||||||
open_sockets[socket_handle] = { socket_handle, true };
|
open_sockets[socket_handle] = { socket_handle, true };
|
||||||
|
|
||||||
int result = 0;
|
int result = 0;
|
||||||
if (socket_handle == SOCKET_ERROR_VALUE)
|
if ((s32)socket_handle == SOCKET_ERROR_VALUE)
|
||||||
result = TranslateError(GET_ERRNO);
|
result = TranslateError(GET_ERRNO);
|
||||||
|
|
||||||
cmd_buffer[1] = result;
|
cmd_buffer[1] = result;
|
||||||
@ -436,11 +436,11 @@ static void Accept(Service::Interface* self) {
|
|||||||
socklen_t addr_len = sizeof(addr);
|
socklen_t addr_len = sizeof(addr);
|
||||||
u32 ret = static_cast<u32>(::accept(socket_handle, &addr, &addr_len));
|
u32 ret = static_cast<u32>(::accept(socket_handle, &addr, &addr_len));
|
||||||
|
|
||||||
if (ret != SOCKET_ERROR_VALUE)
|
if ((s32)ret != SOCKET_ERROR_VALUE)
|
||||||
open_sockets[ret] = { ret, true };
|
open_sockets[ret] = { ret, true };
|
||||||
|
|
||||||
int result = 0;
|
int result = 0;
|
||||||
if (ret == SOCKET_ERROR_VALUE) {
|
if ((s32)ret == SOCKET_ERROR_VALUE) {
|
||||||
result = TranslateError(GET_ERRNO);
|
result = TranslateError(GET_ERRNO);
|
||||||
} else {
|
} else {
|
||||||
CTRSockAddr ctr_addr = CTRSockAddr::FromPlatform(addr);
|
CTRSockAddr ctr_addr = CTRSockAddr::FromPlatform(addr);
|
||||||
|
Loading…
Reference in New Issue
Block a user