Skip to content

Commit f568253

Browse files
Clean up more warnings
1 parent 2251feb commit f568253

7 files changed

Lines changed: 17 additions & 17 deletions

File tree

NetworkClient.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ void NetworkClient::ListenThreadFunction()
381381
}
382382
bytes_read += tmp_bytes_read;
383383

384-
} while (bytes_read < header.pkt_size);
384+
} while ((unsigned int)bytes_read < header.pkt_size);
385385
}
386386

387387
//Entire request received, select functionality based on request ID
@@ -448,7 +448,7 @@ void NetworkClient::ProcessReply_ControllerCount(unsigned int data_size, char *
448448
}
449449
}
450450

451-
void NetworkClient::ProcessReply_ControllerData(unsigned int data_size, char * data, unsigned int dev_idx)
451+
void NetworkClient::ProcessReply_ControllerData(unsigned int /*data_size*/, char * data, unsigned int dev_idx)
452452
{
453453
RGBController_Network * new_controller = new RGBController_Network(this, dev_idx);
454454

NetworkProtocol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ typedef struct NetPacketHeader
2020
unsigned int pkt_dev_idx; /* Device index */
2121
unsigned int pkt_id; /* Packet ID */
2222
unsigned int pkt_size; /* Packet size */
23-
};
23+
} NetPacketHeader;
2424

2525
enum
2626
{

NetworkServer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
446446
}
447447
bytes_read += tmp_bytes_read;
448448

449-
} while (bytes_read < header.pkt_size);
449+
} while ((unsigned int)bytes_read < header.pkt_size);
450450
}
451451

452452
//Entire request received, select functionality based on request ID
@@ -584,7 +584,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
584584
ClientInfoChanged();
585585
}
586586

587-
void NetworkServer::ProcessRequest_ClientString(SOCKET client_sock, unsigned int data_size, char * data)
587+
void NetworkServer::ProcessRequest_ClientString(SOCKET client_sock, unsigned int /*data_size*/, char * data)
588588
{
589589
ServerClientsMutex.lock();
590590
for(unsigned int this_idx = 0; this_idx < ServerClients.size(); this_idx++)

ResourceManager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,15 @@ void ResourceManager::DetectDevicesThreadFunction()
161161
/*-------------------------------------------------*\
162162
| Detect i2c busses |
163163
\*-------------------------------------------------*/
164-
for(int i2c_bus_detector_idx = 0; i2c_bus_detector_idx < i2c_bus_detectors.size(); i2c_bus_detector_idx++)
164+
for(unsigned int i2c_bus_detector_idx = 0; i2c_bus_detector_idx < i2c_bus_detectors.size(); i2c_bus_detector_idx++)
165165
{
166166
i2c_bus_detectors[i2c_bus_detector_idx](busses);
167167
}
168168

169169
/*-------------------------------------------------*\
170170
| Detect i2c devices |
171171
\*-------------------------------------------------*/
172-
for(int i2c_detector_idx = 0; i2c_detector_idx < i2c_device_detectors.size(); i2c_detector_idx++)
172+
for(unsigned int i2c_detector_idx = 0; i2c_detector_idx < i2c_device_detectors.size(); i2c_detector_idx++)
173173
{
174174
detection_string = i2c_device_detector_strings[i2c_detector_idx];
175175
DeviceListChanged();
@@ -207,7 +207,7 @@ void ResourceManager::DetectDevicesThreadFunction()
207207
/*-------------------------------------------------*\
208208
| Detect other devices |
209209
\*-------------------------------------------------*/
210-
for(int detector_idx = 0; detector_idx < device_detectors.size(); detector_idx++)
210+
for(unsigned int detector_idx = 0; detector_idx < device_detectors.size(); detector_idx++)
211211
{
212212
detection_string = device_detector_strings[detector_idx];
213213
DeviceListChanged();

cli.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ bool OptionDevice(int *current_device, std::string argument, Options *options, s
532532
}
533533
}
534534

535-
bool OptionZone(int *current_device, int *current_zone, std::string argument, Options *options, std::vector<RGBController *> &rgb_controllers)
535+
bool OptionZone(int *current_device, int *current_zone, std::string argument, Options */*options*/, std::vector<RGBController *> &rgb_controllers)
536536
{
537537
ResourceManager::get()->WaitForDeviceDetection();
538538

@@ -557,7 +557,7 @@ bool OptionZone(int *current_device, int *current_zone, std::string argument, Op
557557
}
558558
}
559559

560-
bool OptionColor(int *currentDev, int *current_zone, std::string argument, Options *options)
560+
bool OptionColor(int *currentDev, int */*current_zone*/, std::string argument, Options *options)
561561
{
562562
DeviceOptions* currentDevOpts = GetDeviceOptionsForDevID(options, *currentDev);
563563

@@ -587,7 +587,7 @@ bool OptionMode(int *currentDev, std::string argument, Options *options)
587587
return true;
588588
}
589589

590-
bool OptionSize(int *current_device, int *current_zone, std::string argument, Options *options, std::vector<RGBController *> &rgb_controllers)
590+
bool OptionSize(int *current_device, int *current_zone, std::string argument, Options */*options*/, std::vector<RGBController *> &rgb_controllers)
591591
{
592592
const unsigned int new_size = std::stoi(argument);
593593

@@ -1024,7 +1024,7 @@ void ApplyOptions(DeviceOptions& options, std::vector<RGBController *> &rgb_cont
10241024

10251025
void WaitWhileServerOnline(NetworkServer* srv)
10261026
{
1027-
while (network_server->GetOnline())
1027+
while (srv->GetOnline())
10281028
{
10291029
std::this_thread::sleep_for(1s);
10301030
};

qt/DeviceView.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ void DeviceView::setController(RGBController * controller_ptr)
216216
{
217217
matrix_map_type * map = controller->zones[zone_idx].matrix_map;
218218

219-
for(int led_x = 0; led_x < map->width; led_x++)
219+
for(unsigned int led_x = 0; led_x < map->width; led_x++)
220220
{
221-
for(int led_y = 0; led_y < map->height; led_y++)
221+
for(unsigned int led_y = 0; led_y < map->height; led_y++)
222222
{
223223
unsigned int map_idx = led_y * map->width + led_x;
224224
unsigned int color_idx = map->map[map_idx] + controller->zones[zone_idx].start_idx;
@@ -281,7 +281,7 @@ void DeviceView::setController(RGBController * controller_ptr)
281281
led_pos[color_idx].matrix_x -= atom;
282282
led_pos[color_idx].matrix_w += atom;
283283
}
284-
for(int map_idx2 = map_idx + 1; map_idx2 < (led_y + 1) * map->width && map->map[map_idx2] == 0xFFFFFFFF; ++map_idx2)
284+
for(unsigned int map_idx2 = map_idx + 1; map_idx2 < (led_y + 1) * map->width && map->map[map_idx2] == 0xFFFFFFFF; ++map_idx2)
285285
{
286286
led_pos[color_idx].matrix_w += atom;
287287
}
@@ -294,7 +294,7 @@ void DeviceView::setController(RGBController * controller_ptr)
294294
}
295295
else
296296
{
297-
for(int i = 0; i < controller->zones[zone_idx].leds_count; i++)
297+
for(unsigned int i = 0; i < controller->zones[zone_idx].leds_count; i++)
298298
{
299299
led_pos[i + controller->zones[zone_idx].start_idx].matrix_x = zone_pos[zone_idx].matrix_x + (i % maxCols + ledPadding) * atom;
300300
led_pos[i + controller->zones[zone_idx].start_idx].matrix_y = current_y + (i / maxCols + ledPadding) * atom;

qt/OpenRGBDevicePage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ void Ui::OpenRGBDevicePage::UpdateModeUi()
640640
for (std::size_t i = 0; i < device->modes[selected_mode].colors.size(); i++)
641641
{
642642
char id_buf[32];
643-
snprintf(id_buf, 16, "Mode Color %lu", i);
643+
snprintf(id_buf, 16, "Mode Color %u", i);
644644
ui->LEDBox->addItem(id_buf);
645645
}
646646

0 commit comments

Comments
 (0)