fixed some coding styles issues

This commit is contained in:
saramonteiro 2020-09-27 17:41:42 -03:00 committed by Alan Carvalho de Assis
parent 32f193a7e2
commit d2463021a9

View File

@ -153,22 +153,21 @@ int main(int argc, FAR char *argv[])
strcpy(devname, CONFIG_EXAMPLES_TIMER_DEVNAME); strcpy(devname, CONFIG_EXAMPLES_TIMER_DEVNAME);
while ((opt = getopt(argc, argv, ":d:")) != -1) while ((opt = getopt(argc, argv, ":d:")) != -1)
{
switch (opt)
{ {
case 'd': switch (opt)
strcpy(devname, optarg); {
break; case 'd':
case ':': strcpy(devname, optarg);
fprintf(stderr, "ERROR: Option needs a value\n"); break;
exit(EXIT_FAILURE); case ':':
default: /* '?' */ fprintf(stderr, "ERROR: Option needs a value\n");
fprintf(stderr, "Usage: %s [-d /dev/timerx]\n", exit(EXIT_FAILURE);
argv[0]); default: /* '?' */
exit(EXIT_FAILURE); fprintf(stderr, "Usage: %s [-d /dev/timerx]\n",
argv[0]);
exit(EXIT_FAILURE);
}
} }
}
/* Open the timer device */ /* Open the timer device */
@ -194,7 +193,8 @@ int main(int argc, FAR char *argv[])
ret = ioctl(fd, TCIOC_SETTIMEOUT, CONFIG_EXAMPLES_TIMER_INTERVAL); ret = ioctl(fd, TCIOC_SETTIMEOUT, CONFIG_EXAMPLES_TIMER_INTERVAL);
if (ret < 0) if (ret < 0)
{ {
fprintf(stderr, "ERROR: Failed to set the timer interval: %d\n", errno); fprintf(stderr, "ERROR: Failed to set the timer interval: %d\n",
errno);
close(fd); close(fd);
return EXIT_FAILURE; return EXIT_FAILURE;
} }