Skip to content

Commit ccfb6c9

Browse files
Fix warnings in ValkyrieKeyboardController.cpp
1 parent 8aeab21 commit ccfb6c9

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

Controllers/ValkyrieKeyboardController/ValkyrieKeyboardController.cpp

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ int ValkyrieKeyboardController::GetInterfaceNum()
5757
return(interface_num);
5858
}
5959

60-
void ValkyrieKeyboardController::SendColors(unsigned char* color_data,unsigned int color_data_size)
60+
void ValkyrieKeyboardController::SendColors(unsigned char* color_data, unsigned int /*color_data_size*/)
6161
{
6262
unsigned char usb_buf_pro[392];
6363
unsigned char usb_buf_normal[408];
@@ -86,8 +86,8 @@ void ValkyrieKeyboardController::SendColors(unsigned char* color_data,unsigned
8686
}
8787
}
8888

89-
9089
SendInitializeColorPacket();
90+
9191
for(int i = 0; i <= 6; i++)
9292
{
9393
unsigned int usb_data_num = 16;
@@ -100,23 +100,24 @@ void ValkyrieKeyboardController::SendColors(unsigned char* color_data,unsigned
100100

101101
switch(interface_num)
102102
{
103-
case 3:
104-
for(int index = 0; index < usb_data_num; index++)
105-
{
106-
send_usb_buf[index * 4 + 1] = usb_buf_pro[index * 4 + i * 64 ];
107-
send_usb_buf[index * 4 + 2] = usb_buf_pro[index * 4 + i * 64 + 1];
108-
send_usb_buf[index * 4 + 3] = usb_buf_pro[index * 4 + i * 64 + 2];
109-
send_usb_buf[index * 4 + 4] = usb_buf_pro[index * 4 + i * 64 + 3];
110-
}
111-
break;
112-
default:
113-
for(int index = 0; index < usb_data_num; index++)
114-
{
115-
send_usb_buf[index * 4 + 1] = usb_buf_normal[index * 4 + i * 64 ];
116-
send_usb_buf[index * 4 + 2] = usb_buf_normal[index * 4 + i * 64 + 1];
117-
send_usb_buf[index * 4 + 3] = usb_buf_normal[index * 4 + i * 64 + 2];
118-
send_usb_buf[index * 4 + 4] = usb_buf_normal[index * 4 + i * 64 + 3];
119-
}
103+
case 3:
104+
for(unsigned int index = 0; index < usb_data_num; index++)
105+
{
106+
send_usb_buf[index * 4 + 1] = usb_buf_pro[index * 4 + i * 64 ];
107+
send_usb_buf[index * 4 + 2] = usb_buf_pro[index * 4 + i * 64 + 1];
108+
send_usb_buf[index * 4 + 3] = usb_buf_pro[index * 4 + i * 64 + 2];
109+
send_usb_buf[index * 4 + 4] = usb_buf_pro[index * 4 + i * 64 + 3];
110+
}
111+
break;
112+
default:
113+
for(unsigned int index = 0; index < usb_data_num; index++)
114+
{
115+
send_usb_buf[index * 4 + 1] = usb_buf_normal[index * 4 + i * 64 ];
116+
send_usb_buf[index * 4 + 2] = usb_buf_normal[index * 4 + i * 64 + 1];
117+
send_usb_buf[index * 4 + 3] = usb_buf_normal[index * 4 + i * 64 + 2];
118+
send_usb_buf[index * 4 + 4] = usb_buf_normal[index * 4 + i * 64 + 3];
119+
}
120+
break;
120121
}
121122

122123
/*-----------------------------------------------------*\

0 commit comments

Comments
 (0)