@@ -68,15 +68,15 @@ namespace ams::mitm {
6868 *out = atoi (value);
6969 }
7070
71- void ParsePollingRate (const char *value, int32_t *out){
71+ void ParsePollingRate (const char *value, uint32_t *out){
7272 int32_t temp=8 ;
7373 ParseInt (value, &temp);
7474 if (temp >= 0 && temp <= 16 )
7575 *out = temp;
7676 else *out = 8 ;
7777 }
7878
79- void ParseBrightness (const char *value, int32_t *out){
79+ void ParseBrightness (const char *value, uint32_t *out) {
8080 int32_t temp=8 ;
8181 ParseInt (value, &temp);
8282 if (temp >= 0 && temp <= 63 )
@@ -117,7 +117,7 @@ namespace ams::mitm {
117117 else *out = 0 .0f ;
118118 }
119119
120- void ParseRGBstring (const char * value, controller::RGBColour *out){
120+ void ParseRGBstring (const char * value, controller::RGBColour *out) {
121121 uint8_t temp[3 ];
122122 if (std::strncmp (value, " rgb(" , 4 ) == 0 ) {
123123 value+=4 ;
@@ -126,28 +126,28 @@ namespace ams::mitm {
126126 temp[0 ] = 0 ;
127127 temp[1 ] = 0 ;
128128 temp[2 ] = 0 ;
129- while (i< str_len && value[i] !=' )' && k <= 2 ){
130- if (value[i] >= ' 0' && value[i] <= ' 9' ) {
129+ while (i < str_len && value[i] !=' )' && k <= 2 ){
130+ if (value[i] >= ' 0' && value[i] <= ' 9' ) {
131131 temp[k] *= 10 ;
132132 temp[k] += value[i] - ' 0' ;
133133
134134 }
135- else if (value[i] == ' ,' ){
135+ else if (value[i] == ' ,' ){
136136 k++;
137137 }
138- else if (value[i] != ' ' ) // Ignore spaces if found
138+ else if (value[i] != ' ' ) // Ignore spaces if found
139139 return ;
140140 i++;
141141 }
142- if (k== 2 ){
142+ if (k == 2 ){
143143 out->r = temp[0 ];
144144 out->g = temp[1 ];
145145 out->b = temp[2 ];
146146 }
147147 }
148148 else if (value[0 ] == ' #' ) {
149149 char buf[2 + 1 ];
150- if (strlen (value)>= 7 ) {
150+ if (strlen (value) >= 7 ) {
151151 std::memcpy (buf, value + 1 , 2 );
152152 temp[0 ] = static_cast <uint8_t >(std::strtoul (buf, nullptr , 16 ));
153153 std::memcpy (buf, value + 3 , 2 );
@@ -164,7 +164,7 @@ namespace ams::mitm {
164164 }
165165
166166 Result StringifyBluetoothAddress (const bluetooth::Address *address, char *out, size_t out_size) {
167- if (out_size < 2 *sizeof (bluetooth::Address) + 1 )
167+ if (out_size < 2 *sizeof (bluetooth::Address) + 1 )
168168 return -1 ;
169169
170170 char ch;
0 commit comments