Fix up code style adjustments

This commit is contained in:
Přemysl Eric Janouch 2024-12-26 12:26:19 +01:00
parent 8832ba2227
commit e53cddb030
Signed by: p
GPG Key ID: A0420B94F92B9493
2 changed files with 11 additions and 11 deletions

View File

@ -196,7 +196,7 @@ compress_value(unsigned value, struct str *encoded)
} }
static void static void
compress_pulses (const struct pulse *pulses, size_t len, struct str *encoded) compress_pulses(const struct pulse *pulses, size_t len, struct str *encoded)
{ {
unsigned counts[len]; unsigned counts[len];
memset(counts, 0, sizeof counts); memset(counts, 0, sizeof counts);
@ -527,15 +527,15 @@ send_identify(libusb_device_handle *device, struct error **e)
#if 0 #if 0
// The EKX4S does not respond to this request. // The EKX4S does not respond to this request.
static uint8_t c_serial[] = { -5, -5, -5, -5 }; static uint8_t c_serial[] = { -5, -5, -5, -5 };
if ((result = libusb_bulk_transfer (device, g.endpoint_out, if ((result = libusb_bulk_transfer(device, g.endpoint_out,
c_serial, sizeof c_serial, &len, 100))) c_serial, sizeof c_serial, &len, 100)))
return error_set (e, "serial/send: %s", libusb_strerror (result)); return error_set(e, "serial/send: %s", libusb_strerror(result));
if ((result = libusb_bulk_transfer (device, g.endpoint_in, if ((result = libusb_bulk_transfer(device, g.endpoint_in,
buffer, sizeof buffer, &len, 100))) buffer, sizeof buffer, &len, 100)))
return error_set (e, "serial/recv: %s", libusb_strerror (result)); return error_set(e, "serial/recv: %s", libusb_strerror(result));
if (len < (int) sizeof c_serial || if (len < (int) sizeof c_serial ||
memcmp (buffer, c_serial, sizeof c_serial)) memcmp(buffer, c_serial, sizeof c_serial))
return error_set (e, "serial retrieval failed"); return error_set(e, "serial retrieval failed");
#endif #endif
return true; return true;
} }

View File

@ -198,8 +198,8 @@ parse_options(int argc, char *argv[],
}; };
if (argc == 1) { if (argc == 1) {
show_usage (argv[0]); show_usage(argv[0]);
exit (EXIT_FAILURE); exit(EXIT_FAILURE);
} }
int c; int c;
@ -256,7 +256,7 @@ parse_options(int argc, char *argv[],
!strcasecmp(optarg, "on") || !strcasecmp(optarg, "on") ||
!strcasecmp(optarg, "yes")) { !strcasecmp(optarg, "yes")) {
new_config->gaming_mode = true; new_config->gaming_mode = true;
} else if (!strcasecmp (optarg, "false") || } else if (!strcasecmp(optarg, "false") ||
!strcasecmp(optarg, "off") || !strcasecmp(optarg, "off") ||
!strcasecmp(optarg, "no")) { !strcasecmp(optarg, "no")) {
new_config->gaming_mode = false; new_config->gaming_mode = false;
@ -362,7 +362,7 @@ main(int argc, char *argv[])
if ((result = apply_options(device, &options, &new_config))) if ((result = apply_options(device, &options, &new_config)))
FAIL(error_4, "operation failed: %s\n", FAIL(error_4, "operation failed: %s\n",
libusb_error_name (result)); libusb_error_name(result));
error_4: error_4:
if ((result = libusb_release_interface(device, BW_CTL_IFACE))) if ((result = libusb_release_interface(device, BW_CTL_IFACE)))
FAIL(error_3, "couldn't release interface: %s\n", FAIL(error_3, "couldn't release interface: %s\n",