Fix some Windows build warnings

This commit is contained in:
Adam Honse 2022-07-18 20:46:13 -05:00
parent c0851f3b1e
commit bf6ae63ae6
5 changed files with 20 additions and 18 deletions

View file

@ -98,7 +98,7 @@ unsigned char ENESMBusInterface_SpectrixS40G::ENERegisterRead(ene_dev_id dev, en
DWORD bytesreturned = 0;
while(bytesreturned != sizeof(buffer))
{
bool result = DeviceIoControl(nvme_fd, IOCTL_STORAGE_PROTOCOL_COMMAND, buffer, sizeof(buffer), buffer, sizeof(buffer), &bytesreturned, (LPOVERLAPPED)0x0);
DeviceIoControl(nvme_fd, IOCTL_STORAGE_PROTOCOL_COMMAND, buffer, sizeof(buffer), buffer, sizeof(buffer), &bytesreturned, (LPOVERLAPPED)0x0);
}
/*-----------------------------------------------------------------------------*\
@ -107,7 +107,7 @@ unsigned char ENESMBusInterface_SpectrixS40G::ENERegisterRead(ene_dev_id dev, en
\*-----------------------------------------------------------------------------*/
memcpy(ExtraValue, &command->Command + sizeof(NVME_COMMAND), sizeof(ExtraValue));
return(ExtraValue[16]);
return((unsigned char)ExtraValue[16]);
}
}

View file

@ -67,7 +67,7 @@ bool DetectNVIDIAIllumGPUs()
NV_U32 revision_id;
NV_U32 sub_system_id;
NV_STATUS initialize = NvAPI_Initialize();
NvAPI_Initialize();
NvAPI_EnumPhysicalGPUs(gpu_handles, &gpu_count);

View file

@ -163,6 +163,13 @@ void RGBController_NVIDIAIlluminationV1::SetupZones()
}
void RGBController_NVIDIAIlluminationV1::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_NVIDIAIlluminationV1::DeviceUpdateLEDs()
{
NVIDIAIllumination_Config nv_zone_config;
@ -203,8 +210,3 @@ void RGBController_NVIDIAIlluminationV1::DeviceUpdateMode()
{
DeviceUpdateLEDs();
}
void RGBController_NVIDIAIlluminationV1::ResizeZone(int zone, int new_size)
{
}

View file

@ -92,10 +92,10 @@ OpenRGBDevicePage::OpenRGBDevicePage(RGBController *dev, QWidget *parent) :
ui->ModeBox->blockSignals(true);
ui->ModeBox->clear();
for (std::size_t i = 0; i < device->modes.size(); i++)
for(std::size_t i = 0; i < device->modes.size(); i++)
{
ui->ModeBox->addItem(device->modes[i].name.c_str());
ui->ModeBox->setItemData(i, ModeDescription(device->modes[i]), Qt::ToolTipRole);
ui->ModeBox->setItemData((int)i, ModeDescription(device->modes[i]), Qt::ToolTipRole);
}
ui->ModeBox->setCurrentIndex(device->GetMode());
@ -179,7 +179,7 @@ void Ui::OpenRGBDevicePage::on_ZoneBox_currentIndexChanged(int /*index*/)
if(MultipleSelected) // Preserve the multiple() option
{
ui->LEDBox->addItem(msLine);
ui->LEDBox->setCurrentIndex(device->leds.size());
ui->LEDBox->setCurrentIndex((int)device->leds.size());
}
ui->ResizeButton->setEnabled(false);
@ -276,7 +276,7 @@ void Ui::OpenRGBDevicePage::on_LEDBox_currentIndexChanged(int index)
{
if(MultipleSelected)
{
ui->LEDBox->removeItem(device->leds.size() + 1);
ui->LEDBox->removeItem((int)(device->leds.size() + 1));
}
MultipleSelected = 0;
color = device->GetLED(index); // One LED, proceed
@ -1038,11 +1038,11 @@ void Ui::OpenRGBDevicePage::on_DeviceViewBox_selectionChanged(QVector<int> indic
{
if(MultipleSelected)
{
ui->LEDBox->removeItem(device->leds.size() + 1);
ui->LEDBox->removeItem((int)(device->leds.size() + 1));
}
// TODO: translate
ui->LEDBox->addItem("Multiple (" + QVariant(indices.size()).toString() + ")");
ui->LEDBox->setCurrentIndex(device->leds.size() + 1);
ui->LEDBox->setCurrentIndex((int)(device->leds.size() + 1));
MultipleSelected = 1;
}
}
@ -1106,7 +1106,7 @@ void Ui::OpenRGBDevicePage::on_ResizeButton_clicked()
{
OpenRGBZoneResizeDialog dlg(device->modes[device->active_mode].colors_min,
device->modes[device->active_mode].colors_max,
device->modes[device->active_mode].colors.size());
(int)device->modes[device->active_mode].colors.size());
int new_size = dlg.show();

View file

@ -1325,9 +1325,9 @@ void OpenRGBDialog2::UpdateDevicesList()
| Remove all remaining device tabs |
\*-----------------------------------------------------*/
unsigned int tab_count = ui->DevicesTabBar->count();
unsigned int base_tab = controllers.size();
unsigned int base_tab = (unsigned int)controllers.size();
for(unsigned int tab_idx = controllers.size(); tab_idx < tab_count; tab_idx++)
for(std::size_t tab_idx = controllers.size(); tab_idx < tab_count; tab_idx++)
{
QWidget* tab_widget = ui->DevicesTabBar->widget(base_tab);
@ -1348,7 +1348,7 @@ void OpenRGBDialog2::UpdateDevicesList()
| Remove all remaining device information tabs, leaving |
| other information tabs alone |
\*-----------------------------------------------------*/
for(int tab_idx = controllers.size(); tab_idx < ui->InformationTabBar->count(); tab_idx++)
for(std::size_t tab_idx = controllers.size(); tab_idx < ui->InformationTabBar->count(); tab_idx++)
{
std::string type_str = ui->InformationTabBar->widget(base_tab)->metaObject()->className();
if(type_str == "Ui::OpenRGBDeviceInfoPage")