x52test: Clean up compiler warnings

pull/22/head
nirenjan 2020-06-11 23:11:25 -07:00
parent 37162510ac
commit 09eb7d31e8
2 changed files with 12 additions and 11 deletions

View File

@ -162,7 +162,7 @@ static int run_tests(int test_set)
return 0; return 0;
} }
void underline(const char *msg) { static void underline(const char *msg) {
size_t i; size_t i;
puts(msg); puts(msg);
for (i = 0; i < strlen(msg); i++) { for (i = 0; i < strlen(msg); i++) {
@ -171,7 +171,7 @@ void underline(const char *msg) {
putchar('\n'); putchar('\n');
} }
void usage(void) static void usage(void)
{ {
puts(_("These are the available tests with a description and\n" puts(_("These are the available tests with a description and\n"
"approximate runtime. Not specifying any tests will run\n" "approximate runtime. Not specifying any tests will run\n"
@ -187,7 +187,7 @@ void usage(void)
} }
struct test_map { struct test_map {
char *cmd; const char *cmd;
int test_bitmap; int test_bitmap;
}; };
const struct test_map tests[] = { const struct test_map tests[] = {

View File

@ -39,10 +39,10 @@
int test_leds(void) int test_leds(void)
{ {
int rc;
print_banner(_("LEDs")); print_banner(_("LEDs"));
/* Check if the connected device supports individual LED control */ { /* Check if the connected device supports individual LED control */
int rc;
rc = libx52_check_feature(dev, LIBX52_FEATURE_LED); rc = libx52_check_feature(dev, LIBX52_FEATURE_LED);
if (rc == LIBX52_ERROR_NOT_SUPPORTED) { if (rc == LIBX52_ERROR_NOT_SUPPORTED) {
puts(_("Skipping LED tests since the device does not support LED control")); puts(_("Skipping LED tests since the device does not support LED control"));
@ -50,6 +50,7 @@ int test_leds(void)
} else if (rc != LIBX52_SUCCESS) { } else if (rc != LIBX52_SUCCESS) {
return rc; return rc;
} }
}
puts(_("This cycles the LEDs through all possible states")); puts(_("This cycles the LEDs through all possible states"));