Skip to content

Commit c92ea25

Browse files
committed
Clangd fix
1 parent 819a9e6 commit c92ea25

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

src/device.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ bool device_has_capability(struct device* device, enum capabilities cap)
6363
if (device == NULL)
6464
return false;
6565
return (device->capabilities & B(cap)) == B(cap);
66-
}
66+
}

src/device.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -401,4 +401,4 @@ typedef struct DeviceListNode {
401401
struct DeviceListNode* next;
402402
} DeviceListNode;
403403

404-
bool device_has_capability(struct device* device, enum capabilities cap);
404+
bool device_has_capability(struct device* device, enum capabilities cap);

src/main.c

+22-22
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ static FeatureResult handle_feature(struct device* device_found, hid_device** de
271271

272272
switch (cap) {
273273
case CAP_SIDETONE:
274-
ret = device_found->send_sidetone(*device_handle, (uint8_t)*(int*)param);
274+
ret = device_found->send_sidetone(*device_handle, (uint8_t) * (int*)param);
275275
break;
276276

277277
case CAP_BATTERY_STATUS: {
@@ -307,15 +307,15 @@ static FeatureResult handle_feature(struct device* device_found, hid_device** de
307307
}
308308

309309
case CAP_NOTIFICATION_SOUND:
310-
ret = device_found->notifcation_sound(*device_handle, (uint8_t)*(int*)param);
310+
ret = device_found->notifcation_sound(*device_handle, (uint8_t) * (int*)param);
311311
break;
312312

313313
case CAP_LIGHTS:
314-
ret = device_found->switch_lights(*device_handle, (uint8_t)*(int*)param);
314+
ret = device_found->switch_lights(*device_handle, (uint8_t) * (int*)param);
315315
break;
316316

317317
case CAP_INACTIVE_TIME:
318-
ret = device_found->send_inactive_time(*device_handle, (uint8_t)*(int*)param);
318+
ret = device_found->send_inactive_time(*device_handle, (uint8_t) * (int*)param);
319319
break;
320320

321321
case CAP_CHATMIX_STATUS:
@@ -334,39 +334,39 @@ static FeatureResult handle_feature(struct device* device_found, hid_device** de
334334
return result;
335335

336336
case CAP_VOICE_PROMPTS:
337-
ret = device_found->switch_voice_prompts(*device_handle, (uint8_t)*(int*)param);
337+
ret = device_found->switch_voice_prompts(*device_handle, (uint8_t) * (int*)param);
338338
break;
339339

340340
case CAP_ROTATE_TO_MUTE:
341-
ret = device_found->switch_rotate_to_mute(*device_handle, (uint8_t)*(int*)param);
341+
ret = device_found->switch_rotate_to_mute(*device_handle, (uint8_t) * (int*)param);
342342
break;
343343

344344
case CAP_EQUALIZER_PRESET:
345-
ret = device_found->send_equalizer_preset(*device_handle, (uint8_t)*(int*)param);
345+
ret = device_found->send_equalizer_preset(*device_handle, (uint8_t) * (int*)param);
346346
break;
347347

348348
case CAP_EQUALIZER:
349349
ret = device_found->send_equalizer(*device_handle, (struct equalizer_settings*)param);
350350
break;
351351

352352
case CAP_MICROPHONE_MUTE_LED_BRIGHTNESS:
353-
ret = device_found->send_microphone_mute_led_brightness(*device_handle, (uint8_t)*(int*)param);
353+
ret = device_found->send_microphone_mute_led_brightness(*device_handle, (uint8_t) * (int*)param);
354354
break;
355355

356356
case CAP_MICROPHONE_VOLUME:
357-
ret = device_found->send_microphone_volume(*device_handle, (uint8_t)*(int*)param);
357+
ret = device_found->send_microphone_volume(*device_handle, (uint8_t) * (int*)param);
358358
break;
359359

360360
case CAP_VOLUME_LIMITER:
361-
ret = device_found->send_volume_limiter(*device_handle, (uint8_t)*(int*)param);
361+
ret = device_found->send_volume_limiter(*device_handle, (uint8_t) * (int*)param);
362362
break;
363363

364364
case CAP_BT_WHEN_POWERED_ON:
365-
ret = device_found->send_bluetooth_when_powered_on(*device_handle, (uint8_t)*(int*)param);
365+
ret = device_found->send_bluetooth_when_powered_on(*device_handle, (uint8_t) * (int*)param);
366366
break;
367367

368368
case CAP_BT_CALL_VOLUME:
369-
ret = device_found->send_bluetooth_call_volume(*device_handle, (uint8_t)*(int*)param);
369+
ret = device_found->send_bluetooth_call_volume(*device_handle, (uint8_t) * (int*)param);
370370
break;
371371

372372
case NUM_CAPABILITIES:
@@ -579,7 +579,7 @@ int main(int argc, char* argv[])
579579
{
580580
int c;
581581

582-
int selected_vendor_id = 0;
582+
int selected_vendor_id = 0;
583583
int selected_product_id = 0;
584584

585585
int should_print_help = 0;
@@ -962,19 +962,19 @@ int main(int argc, char* argv[])
962962

963963
FeatureRequest* feature_requests[headset_available];
964964
for (int i = 0; i < headset_available; i++) {
965-
feature_requests[i] = memcpy(malloc(sizeof(featureRequests)), featureRequests, sizeof(featureRequests));
965+
feature_requests[i] = memcpy(malloc(sizeof(featureRequests)), featureRequests, sizeof(featureRequests));
966966
devices_found[i].featureRequests = feature_requests[i];
967-
devices_found[i].size = numFeatures;
967+
devices_found[i].size = numFeatures;
968968
}
969969

970970
// For specific output types, like YAML, we will do all actions - even when not specified - to aggreate all information
971971
if (output_format == OUTPUT_YAML || output_format == OUTPUT_JSON || output_format == OUTPUT_ENV) {
972-
for(int i=0; i<headset_available; i++) {
973-
for(int j=0; j<numFeatures; j++){
972+
for (int i = 0; i < headset_available; i++) {
973+
for (int j = 0; j < numFeatures; j++) {
974974
if (feature_requests[i][j].type == CAPABILITYTYPE_INFO && !feature_requests[i][j].should_process) {
975975
if ((devices_found[i].device->capabilities & B(feature_requests[i][j].cap)) == B(feature_requests[i][j].cap)) {
976976
feature_requests[i][j].should_process = true;
977-
feature_requests[i][j].result = handle_feature(devices_found[i].device, &device_handle, &hid_path, feature_requests[i][j].cap, feature_requests[i][j].param);
977+
feature_requests[i][j].result = handle_feature(devices_found[i].device, &device_handle, &hid_path, feature_requests[i][j].cap, feature_requests[i][j].param);
978978
}
979979
}
980980
}
@@ -983,12 +983,12 @@ int main(int argc, char* argv[])
983983
}
984984

985985
if (request_connected) {
986-
if(device_selected == NULL) {
986+
if (device_selected == NULL) {
987987
fprintf(stderr, "Error: No device has been selected.\n");
988988
return 1;
989989
}
990990
struct device* device = device_selected->device;
991-
int is_test_device = test_device && device->idVendor == VENDOR_TESTDEVICE && device->idProduct == PRODUCT_TESTDEVICE;
991+
int is_test_device = test_device && device->idVendor == VENDOR_TESTDEVICE && device->idProduct == PRODUCT_TESTDEVICE;
992992
// Check if battery status can be read
993993
// If it isn't supported, the device is
994994
// probably wired meaning it is connected
@@ -1018,7 +1018,7 @@ int main(int argc, char* argv[])
10181018
} else {
10191019
printf("true\n");
10201020
}
1021-
} else{
1021+
} else {
10221022
do {
10231023
if (device_selected != NULL) {
10241024
FeatureRequest* deviceFeatureRequests = device_selected->featureRequests;
@@ -1049,7 +1049,7 @@ int main(int argc, char* argv[])
10491049
free(equalizer);
10501050

10511051
for (int i = 0; i < headset_available; i++) {
1052-
if (output_format != OUTPUT_STANDARD){
1052+
if (output_format != OUTPUT_STANDARD) {
10531053
// Free memory from features
10541054
for (int j = 0; j < numFeatures; j++) {
10551055
free(devices_found[i].featureRequests[j].result.message);

src/utility.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ int get_two_ids(char* input, int* id1, int* id2)
145145
char* str = (char*)malloc(sz + 1);
146146
strcpy(str, input);
147147

148-
int v1,v2;
148+
int v1, v2;
149149

150150
char* token = strtok(input, delim);
151151
int i = 0;

0 commit comments

Comments
 (0)