mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-05 14:31:24 +12:00
Explicitly downcast integers
This commit is contained in:
parent
d57124d075
commit
503e023815
5 changed files with 22 additions and 22 deletions
|
@ -206,7 +206,7 @@ class shared_cond
|
||||||
m_slot = m_this->m_cvx32.atomic_op([](u64& cvx32)
|
m_slot = m_this->m_cvx32.atomic_op([](u64& cvx32)
|
||||||
{
|
{
|
||||||
// Combine used bits and invert to find least significant bit unused
|
// Combine used bits and invert to find least significant bit unused
|
||||||
const u32 slot = utils::cnttz64(~((cvx32 & 0xffffffff) | (cvx32 >> 32)), true);
|
const u32 slot = static_cast<u32>(utils::cnttz64(~((cvx32 & 0xffffffff) | (cvx32 >> 32)), true));
|
||||||
|
|
||||||
// Set lock bits (does nothing if all slots are used)
|
// Set lock bits (does nothing if all slots are used)
|
||||||
const u64 bit = (1ull << slot) & 0xffffffff;
|
const u64 bit = (1ull << slot) & 0xffffffff;
|
||||||
|
@ -259,7 +259,7 @@ public:
|
||||||
u32 count() const noexcept
|
u32 count() const noexcept
|
||||||
{
|
{
|
||||||
const u64 cvx32 = m_cvx32;
|
const u64 cvx32 = m_cvx32;
|
||||||
return utils::popcnt32(cvx32 | (cvx32 >> 32));
|
return utils::popcnt32(static_cast<u32>(cvx32 | (cvx32 >> 32)));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wait(shared_lock const& lock, u64 usec_timeout = -1) noexcept
|
bool wait(shared_lock const& lock, u64 usec_timeout = -1) noexcept
|
||||||
|
|
|
@ -167,8 +167,8 @@ bool mm_joystick_handler::bindPadToDevice(std::shared_ptr<Pad> pad, const std::s
|
||||||
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(p_profile->circle), CELL_PAD_CTRL_CIRCLE);
|
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(p_profile->circle), CELL_PAD_CTRL_CIRCLE);
|
||||||
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(p_profile->cross), CELL_PAD_CTRL_CROSS);
|
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(p_profile->cross), CELL_PAD_CTRL_CROSS);
|
||||||
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(p_profile->square), CELL_PAD_CTRL_SQUARE);
|
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(p_profile->square), CELL_PAD_CTRL_SQUARE);
|
||||||
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, joy_device->trigger_left, CELL_PAD_CTRL_L2);
|
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, (u32) joy_device->trigger_left, CELL_PAD_CTRL_L2);
|
||||||
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, joy_device->trigger_right, CELL_PAD_CTRL_R2);
|
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, (u32) joy_device->trigger_right, CELL_PAD_CTRL_R2);
|
||||||
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(p_profile->l1), CELL_PAD_CTRL_L1);
|
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(p_profile->l1), CELL_PAD_CTRL_L1);
|
||||||
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(p_profile->r1), CELL_PAD_CTRL_R1);
|
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(p_profile->r1), CELL_PAD_CTRL_R1);
|
||||||
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, find_key(p_profile->start), CELL_PAD_CTRL_START);
|
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, find_key(p_profile->start), CELL_PAD_CTRL_START);
|
||||||
|
|
|
@ -73,7 +73,7 @@ void save_data_info_dialog::UpdateData()
|
||||||
m_list->setItem(3, 1, new QTableWidgetItem(qstr(m_entry.details)));
|
m_list->setItem(3, 1, new QTableWidgetItem(qstr(m_entry.details)));
|
||||||
|
|
||||||
QImage img;
|
QImage img;
|
||||||
if (!m_entry.iconBuf.empty() && img.loadFromData((uchar*)&m_entry.iconBuf[0], m_entry.iconBuf.size(), "PNG"))
|
if (!m_entry.iconBuf.empty() && img.loadFromData((uchar*)&m_entry.iconBuf[0], static_cast<int>(m_entry.iconBuf.size()), "PNG"))
|
||||||
{
|
{
|
||||||
m_list->insertRow(0);
|
m_list->insertRow(0);
|
||||||
QTableWidgetItem* img_item = new QTableWidgetItem();
|
QTableWidgetItem* img_item = new QTableWidgetItem();
|
||||||
|
|
|
@ -655,7 +655,7 @@ void trophy_manager_dialog::PopulateGameTable()
|
||||||
m_game_table->setSortingEnabled(false); // Disable sorting before using setItem calls
|
m_game_table->setSortingEnabled(false); // Disable sorting before using setItem calls
|
||||||
|
|
||||||
m_game_table->clearContents();
|
m_game_table->clearContents();
|
||||||
m_game_table->setRowCount(m_trophies_db.size());
|
m_game_table->setRowCount(static_cast<int>(m_trophies_db.size()));
|
||||||
|
|
||||||
m_game_combo->clear();
|
m_game_combo->clear();
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ trophy_notification_frame::trophy_notification_frame(const std::vector<uchar>& i
|
||||||
trophyImgLabel->setPalette(black_background);
|
trophyImgLabel->setPalette(black_background);
|
||||||
|
|
||||||
QImage trophyImg;
|
QImage trophyImg;
|
||||||
if (!imgBuffer.empty() && trophyImg.loadFromData((uchar*)&imgBuffer[0], imgBuffer.size(), "PNG"))
|
if (!imgBuffer.empty() && trophyImg.loadFromData((uchar*)&imgBuffer[0], static_cast<int>(imgBuffer.size()), "PNG"))
|
||||||
{
|
{
|
||||||
trophyImg = trophyImg.scaledToHeight(height); // I might consider adding ability to change size since on hidpi this will be rather small.
|
trophyImg = trophyImg.scaledToHeight(height); // I might consider adding ability to change size since on hidpi this will be rather small.
|
||||||
trophyImgLabel->setPixmap(QPixmap::fromImage(trophyImg));
|
trophyImgLabel->setPixmap(QPixmap::fromImage(trophyImg));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue