You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2020/09/27 21:18:27 UTC

[incubator-nuttx-apps] 02/03: fixed some coding styles issues

This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit d2463021a940212f4f8fae944195a6b6b90d32dc
Author: saramonteiro <sa...@gmail.com>
AuthorDate: Sun Sep 27 17:41:42 2020 -0300

    fixed some coding styles issues
---
 examples/timer/timer_main.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/examples/timer/timer_main.c b/examples/timer/timer_main.c
index ee4a23e..8dd8244 100644
--- a/examples/timer/timer_main.c
+++ b/examples/timer/timer_main.c
@@ -151,24 +151,23 @@ int main(int argc, FAR char *argv[])
   int opt;
   char devname[DEVNAME_SIZE];
   strcpy(devname, CONFIG_EXAMPLES_TIMER_DEVNAME);
-  
-  while ((opt = getopt(argc, argv, ":d:")) != -1) 
-  {
-    switch (opt) 
+
+  while ((opt = getopt(argc, argv, ":d:")) != -1)
     {
-      case 'd':
-          strcpy(devname, optarg);
-          break;
-      case ':':
-          fprintf(stderr, "ERROR: Option needs a value\n");
-          exit(EXIT_FAILURE);
-      default: /* '?' */
-          fprintf(stderr, "Usage: %s [-d /dev/timerx]\n",
-                  argv[0]);
-          exit(EXIT_FAILURE);
+      switch (opt)
+      {
+        case 'd':
+            strcpy(devname, optarg);
+            break;
+        case ':':
+            fprintf(stderr, "ERROR: Option needs a value\n");
+            exit(EXIT_FAILURE);
+        default: /* '?' */
+            fprintf(stderr, "Usage: %s [-d /dev/timerx]\n",
+                    argv[0]);
+            exit(EXIT_FAILURE);
+      }
     }
-  }
-
 
   /* Open the timer device */
 
@@ -194,7 +193,8 @@ int main(int argc, FAR char *argv[])
   ret = ioctl(fd, TCIOC_SETTIMEOUT, CONFIG_EXAMPLES_TIMER_INTERVAL);
   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);
       return EXIT_FAILURE;
     }