You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/05/06 13:31:21 UTC

[incubator-nuttx-apps] branch master updated (005ef92 -> 7a99d62)

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

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


    from 005ef92  Restore Git Credentials on NuttX repo
     new 8a1f5ee  debug: Reduce CONFIG_CPP_HAVE_VARARGS usage
     new 7a99d62  Fix nxstyle warning

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 examples/elf/elf_main.c            |  29 ++----
 examples/ft80x/ft80x.h             |  62 +++++--------
 examples/nxflat/nxflat_main.c      |  32 +++----
 examples/posix_spawn/spawn_main.c  |  20 ++---
 fsutils/inifile/inifile.c          |  46 ++++------
 graphics/ft80x/ft80x.h             |  62 +++++--------
 graphics/nxwm/src/cmediaplayer.cxx |  14 ---
 graphics/nxwm/src/ctouchscreen.cxx |  19 ----
 netutils/thttpd/fdwatch.c          |  53 +++++------
 system/cle/cle.c                   |  38 +++-----
 system/i2c/i2ctool.h               |   4 -
 system/spi/spitool.h               |   4 -
 system/vi/vi.c                     | 178 ++++++++++++++-----------------------
 system/zmodem/zm.h                 |  29 +++---
 14 files changed, 207 insertions(+), 383 deletions(-)


[incubator-nuttx-apps] 02/02: Fix nxstyle warning

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 7a99d62ca17da413e9e9715b5d453e4a902abdc4
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Wed May 6 03:03:56 2020 +0800

    Fix nxstyle warning
    
    Signed-off-by: Xiang Xiao <xiaox
    iang@xiaomi.com>
---
 examples/nxflat/nxflat_main.c |   3 +-
 fsutils/inifile/inifile.c     |   6 +--
 netutils/thttpd/fdwatch.c     |  35 +++++++-------
 system/vi/vi.c                | 106 ++++++++++++++++++++++--------------------
 system/zmodem/zm.h            |  16 +++++--
 5 files changed, 90 insertions(+), 76 deletions(-)

diff --git a/examples/nxflat/nxflat_main.c b/examples/nxflat/nxflat_main.c
index 2d1620a..8c68029 100644
--- a/examples/nxflat/nxflat_main.c
+++ b/examples/nxflat/nxflat_main.c
@@ -112,7 +112,8 @@
  ****************************************************************************/
 
 static const char delimiter[] =
-  "****************************************************************************";
+  "**************************************"
+  "**************************************";
 
 #ifndef CONFIG_LIB_ENVPATH
 static char fullpath[128];
diff --git a/fsutils/inifile/inifile.c b/fsutils/inifile/inifile.c
index 75098f6..a6b1ce8 100644
--- a/fsutils/inifile/inifile.c
+++ b/fsutils/inifile/inifile.c
@@ -90,7 +90,7 @@ struct inifile_var_s
   FAR char *value;
 };
 
-/* This structure describes the state of one instance of the INI file parser */
+/* A structure describes the state of one instance of the INI file parser */
 
 struct inifile_state_s
 {
@@ -136,7 +136,7 @@ static FAR char *
 
 static bool inifile_next_line(FAR struct inifile_state_s *priv)
 {
-  /* Search ahead for the end of line mark (or possibly the end of file mark) */
+  /* Search ahead for the end of line mark (possibly the end of file mark) */
 
   while ((priv->nextch != '\n') && (priv->nextch != EOF))
     {
@@ -305,7 +305,7 @@ static bool inifile_seek_to_section(FAR struct inifile_state_s *priv,
                   *sectend = '\0';
                 }
 
-              /* Then compare the section name to the one we are looking for */
+              /* Then compare the section name to what we are looking for */
 
               if (strcasecmp(&priv->line[1], section) == 0)
                 {
diff --git a/netutils/thttpd/fdwatch.c b/netutils/thttpd/fdwatch.c
index ed1880d..7890587 100644
--- a/netutils/thttpd/fdwatch.c
+++ b/netutils/thttpd/fdwatch.c
@@ -92,16 +92,17 @@ static void fdwatch_dump(const char *msg, FAR struct fdwatch_s *fw)
   fwinfo("%s\n", msg);
   fwinfo("nwatched: %d nfds: %d\n", fw->nwatched, fw->nfds);
   for (i = 0; i < fw->nwatched; i++)
-  {
-    fwinfo("%2d. pollfds: {fd: %d events: %02x revents: %02x} client: %p\n",
-           i+1, fw->pollfds[i].fd, fw->pollfds[i].events,
-           fw->pollfds[i].revents, fw->client[i]);
-  }
+    {
+      fwinfo("%2d.pollfds: {fd: %d events: %02x revents: %02x} client: %p\n",
+             i + 1, fw->pollfds[i].fd, fw->pollfds[i].events,
+             fw->pollfds[i].revents, fw->client[i]);
+    }
+
   fwinfo("nactive: %d next: %d\n", fw->nactive, fw->next);
   for (i = 0; i < fw->nactive; i++)
-  {
-    fwinfo("%2d. %d active\n", i, fw->ready[i]);
-  }
+    {
+      fwinfo("%2d. %d active\n", i, fw->ready[i]);
+    }
 }
 #else
 #  define fdwatch_dump(m,f)
@@ -138,7 +139,7 @@ struct fdwatch_s *fdwatch_initialize(int nfds)
 
   /* Allocate the fdwatch data structure */
 
-  fw = (struct fdwatch_s*)zalloc(sizeof(struct fdwatch_s));
+  fw = (struct fdwatch_s *)zalloc(sizeof(struct fdwatch_s));
   if (!fw)
     {
       fwerr("ERROR: Failed to allocate fdwatch\n");
@@ -149,19 +150,19 @@ struct fdwatch_s *fdwatch_initialize(int nfds)
 
   fw->nfds = nfds;
 
-  fw->client = (void**)httpd_malloc(sizeof(void*) * nfds);
+  fw->client = (void **)httpd_malloc(sizeof(void *) * nfds);
   if (!fw->client)
     {
       goto errout_with_allocations;
     }
 
-  fw->pollfds = (struct pollfd*)httpd_malloc(sizeof(struct pollfd) * nfds);
+  fw->pollfds = (struct pollfd *)httpd_malloc(sizeof(struct pollfd) * nfds);
   if (!fw->pollfds)
     {
       goto errout_with_allocations;
     }
 
-  fw->ready = (uint8_t*)httpd_malloc(sizeof(uint8_t) * nfds);
+  fw->ready = (uint8_t *)httpd_malloc(sizeof(uint8_t) * nfds);
   if (!fw->ready)
     {
       goto errout_with_allocations;
@@ -201,7 +202,7 @@ void fdwatch_uninitialize(struct fdwatch_s *fw)
     }
 }
 
-/* Add a descriptor to the watch list.  rw is either FDW_READ or FDW_WRITE.  */
+/* Add a descriptor to the watch list. rw is either FDW_READ or FDW_WRITE. */
 
 void fdwatch_add_fd(struct fdwatch_s *fw, int fd, void *client_data)
 {
@@ -254,7 +255,8 @@ void fdwatch_del_fd(struct fdwatch_s *fw, int fd)
           fw->client[pollndx]  = fw->client[fw->nwatched];
         }
     }
-   fdwatch_dump("After deleting:", fw);
+
+  fdwatch_dump("After deleting:", fw);
 }
 
 /* Do the watch.  Return value is the number of descriptors that are ready,
@@ -289,7 +291,8 @@ int fdwatch(struct fdwatch_s *fw, long timeout_msecs)
         {
           /* Is there activity on this descriptor? */
 
-          if (fw->pollfds[i].revents & (POLLIN | POLLERR | POLLHUP | POLLNVAL))
+          if (fw->pollfds[i].revents &
+              (POLLIN | POLLERR | POLLHUP | POLLNVAL))
             {
               /* Yes... save it in a shorter list */
 
@@ -341,7 +344,7 @@ void *fdwatch_get_next_client_data(struct fdwatch_s *fw)
   if (fw->next >= fw->nwatched)
     {
       fwinfo("All client data returned: %d\n", fw->next);
-      return (void*)-1;
+      return (void *)-1;
     }
 
   fwinfo("client_data[%d]: %p\n", fw->next, fw->client[fw->next]);
diff --git a/system/vi/vi.c b/system/vi/vi.c
index 272a7f3..ea509be 100644
--- a/system/vi/vi.c
+++ b/system/vi/vi.c
@@ -549,7 +549,8 @@ static const char g_fmtallocfail[]  = "Failed to allocate memory";
 static const char g_fmtcmdfail[]    = "%s failed: %d";
 static const char g_fmtnotfile[]    = "%s is not a regular file";
 static const char g_fmtfileexists[] = "File exists (add ! to override)";
-static const char g_fmtmodified[]   = "No write since last change (add ! to override)";
+static const char g_fmtmodified[]   =
+                            "No write since last change (add ! to override)";
 static const char g_fmtnotvalid[]   = "Command not valid";
 static const char g_fmtnotcmd[]     = "Not an editor command: %s";
 static const char g_fmtsrcbot[]     = "search hit BOTTOM, continuing at TOP";
@@ -700,7 +701,7 @@ static int vi_getch(FAR struct vi_s *vi)
 
 static void vi_clearbottomline(FAR struct vi_s *vi)
 {
-  vi_setcursor(vi, vi->display.row-1, 0);
+  vi_setcursor(vi, vi->display.row - 1, 0);
   vi_clrtoeol(vi);
 }
 
@@ -842,7 +843,7 @@ static void vi_scrollup(FAR struct vi_s *vi, uint16_t nlines)
 
   /* Ensure bottom line is cleared */
 
-  vi_setcursor(vi, vi->display.row-1, 0);
+  vi_setcursor(vi, vi->display.row - 1, 0);
   vi_clrtoeol(vi);
 }
 
@@ -860,7 +861,7 @@ static void vi_scrolldown(FAR struct vi_s *vi, uint16_t nlines)
 
   /* Ensure the bottom line is cleared after the scroll */
 
-  vi_setcursor(vi, vi->display.row-2, 0);
+  vi_setcursor(vi, vi->display.row - 2, 0);
   vi_clrtoeol(vi);
 
   /* Scroll for the specified number of lines */
@@ -1616,7 +1617,8 @@ static void vi_scrollcheck(FAR struct vi_s *vi)
   while (curline < vi->winpos)
     {
       /* Yes.. move the window position up to the beginning of the previous
-       * line line and check again */
+       * line line and check again
+       */
 
       vi->winpos = vi_prevline(vi, vi->winpos);
       vi->vscroll--;
@@ -1635,7 +1637,7 @@ static void vi_scrollcheck(FAR struct vi_s *vi)
 
   /* Check if the cursor row position is below the bottom of the display */
 
-  for (; vi->cursor.row >= vi->display.row-1; vi->cursor.row--)
+  for (; vi->cursor.row >= vi->display.row - 1; vi->cursor.row--)
     {
       /* Yes.. move the window position down by one line and check again */
 
@@ -1693,7 +1695,7 @@ static void vi_scrollcheck(FAR struct vi_s *vi)
        */
 
       for (nlines = 0, pos = vi->prevpos;
-           pos != vi->winpos && nlines < vi->display.row-1;
+           pos != vi->winpos && nlines < vi->display.row - 1;
            nlines++)
         {
           pos = vi_nextline(vi, pos);
@@ -1701,7 +1703,7 @@ static void vi_scrollcheck(FAR struct vi_s *vi)
 
       /* Then scroll up that number of lines */
 
-      if (nlines < vi->display.row-1)
+      if (nlines < vi->display.row - 1)
         {
           vi_scrollup(vi, nlines);
           vi->fullredraw = true;
@@ -1724,7 +1726,7 @@ static void vi_scrollcheck(FAR struct vi_s *vi)
 
       /* Then scroll down that number of lines */
 
-      if (nlines < vi->display.row-1)
+      if (nlines < vi->display.row - 1)
         {
           vi_scrolldown(vi, nlines);
           vi->fullredraw = true;
@@ -1778,7 +1780,7 @@ static void vi_showtext(FAR struct vi_s *vi)
    * do not update the last line.
    */
 
-  endrow = vi->display.row-1;
+  endrow = vi->display.row - 1;
 
   /* Make sure that all character attributes are disabled; Turn off the
    * cursor during the update.
@@ -1831,7 +1833,7 @@ static void vi_showtext(FAR struct vi_s *vi)
         {
           redraw_line = false;
         }
-      else if (row+1 < vi->cursor.row && !vi->fullredraw)
+      else if (row + 1 < vi->cursor.row && !vi->fullredraw)
         {
           redraw_line = false;
         }
@@ -1892,7 +1894,7 @@ static void vi_showtext(FAR struct vi_s *vi)
 
                   if (writefrom != pos)
                     {
-                      vi_write(vi, &vi->text[writefrom], pos-writefrom);
+                      vi_write(vi, &vi->text[writefrom], pos - writefrom);
                     }
 
                   tabcol = NEXT_TAB(column);
@@ -1907,8 +1909,8 @@ static void vi_showtext(FAR struct vi_s *vi)
                     }
                   else
                     {
-                      /* Break out of the loop... there is nothing left on the
-                       * line but whitespace.
+                      /* Break out of the loop... there is nothing left on
+                       * the line but whitespace.
                        */
 
                       writefrom = pos;
@@ -1928,7 +1930,7 @@ static void vi_showtext(FAR struct vi_s *vi)
 
           if (writefrom != pos)
             {
-              vi_write(vi, &vi->text[writefrom], pos-writefrom);
+              vi_write(vi, &vi->text[writefrom], pos - writefrom);
             }
 
           vi_clrtoeol(vi);
@@ -1939,7 +1941,7 @@ static void vi_showtext(FAR struct vi_s *vi)
       pos = vi_nextline(vi, pos);
     }
 
-  if (pos == vi->textsize && vi->text[pos-1] == '\n')
+  if (pos == vi->textsize && vi->text[pos - 1] == '\n')
     {
       vi_setcursor(vi, row, 0);
       vi_clrtoeol(vi);
@@ -1966,6 +1968,7 @@ static void vi_showtext(FAR struct vi_s *vi)
             {
               vi_putch(vi, '~');
             }
+
           vi_clrtoeol(vi);
         }
     }
@@ -1993,7 +1996,7 @@ static void vi_showlinecol(FAR struct vi_s *vi)
   /* Move to bototm line for display */
 
   vi_cursoroff(vi);
-  vi_setcursor(vi, vi->display.row-1, vi->display.column-15);
+  vi_setcursor(vi, vi->display.row - 1, vi->display.column - 15);
 
   len = snprintf(vi->scratch, SCRATCH_BUFSIZE, "%d,%d",
                  vi->cursor.row + vi->vscroll + 1,
@@ -2281,7 +2284,7 @@ static void vi_delforward(FAR struct vi_s *vi)
 
   start = vi->curpos;
 
-  vi_yanktext(vi, start, end-1, true, true);
+  vi_yanktext(vi, start, end - 1, true, true);
   vi->curpos = start;
   if (at_end)
     {
@@ -2310,7 +2313,7 @@ static void vi_delbackward(FAR struct vi_s *vi)
   /* Test if we are at beginning of line */
 
   if (vi->curpos == 0 || vi->text[vi->curpos] == '\n' ||
-      vi->text[vi->curpos-1] == '\n')
+      vi->text[vi->curpos - 1] == '\n')
     {
       return;
     }
@@ -2438,7 +2441,7 @@ static void vi_deltoeol(FAR struct vi_s *vi)
   vi_yanktext(vi, start, end, true, true);
   if (start > 0 && start != vi->textsize && vi->text[start - 1] != '\n')
     {
-      vi->curpos = start-1;
+      vi->curpos = start - 1;
     }
   else
     {
@@ -2591,8 +2594,8 @@ static void vi_yank(FAR struct vi_s *vi, bool del_after_yank)
   /* Test if deleting last line with empty line above it */
 
   if ((end > 0 && start == end && end == vi->textsize -1 &&
-      vi->text[end-1] == '\n') || (start > 1 && end + 1 ==
-      vi->textsize && vi->text[start-2] == '\n'))
+      vi->text[end - 1] == '\n') || (start > 1 && end + 1 ==
+      vi->textsize && vi->text[start - 2] == '\n'))
     {
       empty_last_line = true;
     }
@@ -2605,7 +2608,7 @@ static void vi_yank(FAR struct vi_s *vi, bool del_after_yank)
 
   if (end + 1 == textsize && start != end && del_after_yank)
     {
-      vi_shrinktext(vi, vi->textsize-1, 1);
+      vi_shrinktext(vi, vi->textsize - 1, 1);
     }
 
   /* Place cursor at beginning of the line */
@@ -2712,8 +2715,8 @@ static void vi_paste(FAR struct vi_s *vi, bool paste_before)
           /* Test if pasting at end of file */
 
           new_curpos = start;
-          if ((start >= vi->textsize && vi->text[vi->textsize-1] != '\n') ||
-              vi->curpos == vi->textsize)
+          if ((start >= vi->textsize && vi->text[vi->textsize - 1] != '\n')
+              || vi->curpos == vi->textsize)
             {
               off_t textsize = vi->textsize;
               bool at_end = vi->curpos == vi->textsize;
@@ -2725,7 +2728,7 @@ static void vi_paste(FAR struct vi_s *vi, bool paste_before)
 
               /* Don't append the \n' in the yank buffer */
 
-              if (vi->text[textsize-1] != '\n' || at_end)
+              if (vi->text[textsize - 1] != '\n' || at_end)
                 {
                   size--;
                 }
@@ -2790,7 +2793,7 @@ static void vi_join(FAR struct vi_s *vi)
 
   /* Ensure the line ends with '\n' */
 
-  if (vi->text[start+1] != '\n')
+  if (vi->text[start + 1] != '\n')
     {
       return;
     }
@@ -2808,9 +2811,9 @@ static void vi_join(FAR struct vi_s *vi)
       end++;
     }
 
-  if (start+1 != end)
+  if (start + 1 != end)
     {
-      vi_shrinktext(vi, start+1, end - (start+1));
+      vi_shrinktext(vi, start + 1, end - (start + 1));
     }
 
   vi->curpos    = start;
@@ -2969,7 +2972,7 @@ static off_t vi_findnextword(FAR struct vi_s *vi)
           break;
         }
 
-      /* Test for alpha search followed by space.  Then switch the search type
+      /* Test for alpha search followed by space. Then switch the search type
        * to space so we find whatever is next.
        */
 
@@ -3028,8 +3031,8 @@ static void vi_gotonextword(FAR struct vi_s *vi)
       pos     = vi->curpos;
       crfound = false;
 
-      while ((vi->text[pos-1] == ' ' || vi->text[pos-1] == '\t' ||
-             vi->text[pos-1] == '\n') && pos > start)
+      while ((vi->text[pos - 1] == ' ' || vi->text[pos - 1] == '\t' ||
+             vi->text[pos - 1] == '\n') && pos > start)
         {
           /* We rewind only if '\n' found before non-space */
 
@@ -3038,7 +3041,6 @@ static void vi_gotonextword(FAR struct vi_s *vi)
             {
               crfound = true;
             }
-
         }
 
       if (crfound)
@@ -3162,7 +3164,7 @@ static off_t vi_findprevword(FAR struct vi_s *vi)
 
       while (pos > 0)
         {
-          pos_type = vi_chartype(vi->text[pos-1]);
+          pos_type = vi_chartype(vi->text[pos - 1]);
 
           if (pos_type != srch_type && pos_type != VI_CHAR_CRLF)
             {
@@ -3200,7 +3202,7 @@ static off_t vi_findprevword(FAR struct vi_s *vi)
   /* Now find beginning of this new type */
 
   srch_type = vi_chartype(vi->text[pos]);
-  while (pos > 0 && vi_chartype(vi->text[pos-1]) == srch_type)
+  while (pos > 0 && vi_chartype(vi->text[pos - 1]) == srch_type)
     {
       pos--;
     }
@@ -3456,7 +3458,6 @@ static void vi_cmd_mode(FAR struct vi_s *vi)
 
       if (vi->cmdrepeat && vi->cmdindex == vi->cmdcount)
         {
-
           /* Terminate the command repeat */
 
           vi->cmdrepeat = false;
@@ -3594,7 +3595,7 @@ static void vi_cmd_mode(FAR struct vi_s *vi)
         case KEY_RIGHT:         /* Move the cursor right one character */
           {
             if (vi->text[vi->curpos] != '\n' &&
-                vi->text[vi->curpos+1] != '\n')
+                vi->text[vi->curpos + 1] != '\n')
               {
                 vi->curpos = vi_cursorright(vi, vi->curpos, vi->value);
                 if (vi->curpos >= vi->textsize)
@@ -3988,7 +3989,7 @@ static void vi_cmd_mode(FAR struct vi_s *vi)
 
                 break;
               }
-            else if (pos+1 != vi->textsize && vi->text[pos+1] == '\n')
+            else if (pos + 1 != vi->textsize && vi->text[pos + 1] == '\n')
               {
                 if (pos > 0)
                   {
@@ -4361,7 +4362,9 @@ static void vi_parsecolon(FAR struct vi_s *vi)
                 }
               else
                 {
-                  /* Anything else, including a forced quit is a syntax error */
+                  /* Anything else,
+                   * including a forced quit is a syntax error
+                   */
 
                   goto errout_bad_command;
                 }
@@ -5214,7 +5217,7 @@ static void vi_findinline_mode(FAR struct vi_s *vi)
   pos = vi->curpos + 1;
   count = vi->value > 0 ? vi->value : 1;
 
-  while (count > 0 && pos < vi->textsize-1 && vi->text[pos] != '\n')
+  while (count > 0 && pos < vi->textsize - 1 && vi->text[pos] != '\n')
     {
       /* Increment to next character */
 
@@ -5408,8 +5411,8 @@ static void vi_insert_mode(FAR struct vi_s *vi)
            */
 
           if (vi->cursor.column + 1 < vi->display.column && ch != '\t' &&
-              (vi->curpos+1 == vi->textsize ||
-               vi->text[vi->curpos+1] == '\n'))
+              (vi->curpos + 1 == vi->textsize ||
+               vi->text[vi->curpos + 1] == '\n'))
             {
               vi_putch(vi, ch);
             }
@@ -5464,12 +5467,12 @@ static void vi_insert_mode(FAR struct vi_s *vi)
 
                   if (vi->curpos > 0)
                     {
-                      if (vi->text[vi->curpos-1] == '\n')
+                      if (vi->text[vi->curpos - 1] == '\n')
                         {
                           vi->drawtoeos = true;
                         }
 
-                      vi_shrinktext(vi, vi->curpos-1, 1);
+                      vi_shrinktext(vi, vi->curpos - 1, 1);
                     }
                 }
               else
@@ -5491,7 +5494,7 @@ static void vi_insert_mode(FAR struct vi_s *vi)
 
               /* Move cursor 1 space to the left when exiting insert mode */
 
-              if (vi->curpos > 0 && vi->text[vi->curpos-1] != '\n')
+              if (vi->curpos > 0 && vi->text[vi->curpos - 1] != '\n')
                 {
                   --vi->curpos;
                 }
@@ -5688,10 +5691,12 @@ static void vi_showusage(FAR struct vi_s *vi, FAR const char *progname,
   fprintf(stderr, "\t<filename>:\n");
   fprintf(stderr, "\t\tOptional name of the file to open\n");
   fprintf(stderr, "\t-c <columns>:\n");
-  fprintf(stderr, "\t\tOptional width of the display in columns.  Default: %d\n",
+  fprintf(stderr,
+          "\t\tOptional width of the display in columns.  Default: %d\n",
           CONFIG_SYSTEM_VI_COLS);
   fprintf(stderr, "\t-r <rows>:\n");
-  fprintf(stderr, "\t\tOptional height of the display in rows.  Default: %d\n",
+  fprintf(stderr,
+          "\t\tOptional height of the display in rows.  Default: %d\n",
           CONFIG_SYSTEM_VI_ROWS);
   fprintf(stderr, "\t-h:\n");
   fprintf(stderr, "\t\tShows this message and exits.\n");
@@ -5810,7 +5815,7 @@ int main(int argc, FAR char *argv[])
         }
     }
 
-  /* There may be one additional argument on the command line:  The filename */
+  /* There maybe one additional argument on the command line: The filename */
 
   if (optind < argc)
     {
@@ -5824,12 +5829,12 @@ int main(int argc, FAR char *argv[])
         {
           /* Make file relative to current working directory */
 
-          getcwd(vi->filename, MAX_STRING-1);
+          getcwd(vi->filename, MAX_STRING - 1);
           strncat(vi->filename, "/", MAX_STRING - 1);
           strncat(vi->filename, argv[optind], MAX_STRING - 1);
         }
 
-      /* Make sure that the (possibly truncated) file name is NUL terminated */
+      /* Make sure the (possibly truncated) file name is NUL terminated */
 
       vi->filename[MAX_STRING - 1] = '\0';
 
@@ -5895,7 +5900,6 @@ int main(int argc, FAR char *argv[])
           case MODE_FINDINLINE:       /* Insert mode */
             vi_findinline_mode(vi);
             break;
-
         }
     }
 
diff --git a/system/zmodem/zm.h b/system/zmodem/zm.h
index 822f9e9..b7e212f 100644
--- a/system/zmodem/zm.h
+++ b/system/zmodem/zm.h
@@ -59,8 +59,10 @@
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
+
 /* ZModem *******************************************************************/
-/* Zmodem ZRINIT flags.  These bits describe the cababilities of the receiver.
+
+/* Zmodem ZRINIT flags. These bits describe the cababilities of the receiver.
  * Reference: Paragraph 11.2:
  */
 
@@ -79,6 +81,7 @@
 #define TESC8         (1 << 7)       /* Sender needs 8th bit escaped. */
 
 /* ZFILE transfer flags */
+
 /* F0 */
 
 #define ZCBIN         1              /* Binary transfer */
@@ -162,6 +165,7 @@
 #define ZRUB1         'm'           /* Translate to 0xff */
 
 /* Implementation ***********************************************************/
+
 /* Zmodem Events (same as frame type + data received and error events) */
 
 #define ZME_RQINIT    ZRQINIT        /* Request receive init */
@@ -241,6 +245,7 @@
 /****************************************************************************
  * Public Types
  ****************************************************************************/
+
 /* The state of the parser */
 
 enum parser_state_e
@@ -283,9 +288,9 @@ enum pdata_substate_e
 struct zm_state_s;
 typedef int (*action_t)(FAR struct zm_state_s *pzm);
 
-/* State transition table entry.  There is one row of the table per possible state.
- * Each row is a row of all reasonable events for this state and long the
- * appropriate state transition and transition action.
+/* State transition table entry.  There is one row of the table per possible
+ * state. Each row is a row of all reasonable events for this state and long
+ * the appropriate state transition and transition action.
  */
 
 struct zm_transition_s
@@ -562,7 +567,8 @@ ssize_t zm_remwrite(int fd, FAR const uint8_t *buffer, size_t buflen);
  *
  ****************************************************************************/
 
-int zm_writefile(int fd, FAR const uint8_t *buffer, size_t buflen, bool zcnl);
+int zm_writefile(int fd, FAR const uint8_t *buffer,
+                 size_t buflen, bool zcnl);
 
 /****************************************************************************
  * Name: zm_filecrc


[incubator-nuttx-apps] 01/02: debug: Reduce CONFIG_CPP_HAVE_VARARGS usage

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8a1f5ee34c782dc585a339007878fb4a7407e3d2
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon May 4 18:52:59 2020 +0800

    debug: Reduce CONFIG_CPP_HAVE_VARARGS usage
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 examples/elf/elf_main.c            | 29 +++++----------
 examples/ft80x/ft80x.h             | 62 +++++++++++++-------------------
 examples/nxflat/nxflat_main.c      | 29 +++++----------
 examples/posix_spawn/spawn_main.c  | 20 +++--------
 fsutils/inifile/inifile.c          | 40 ++++++++-------------
 graphics/ft80x/ft80x.h             | 62 +++++++++++++-------------------
 graphics/nxwm/src/cmediaplayer.cxx | 14 --------
 graphics/nxwm/src/ctouchscreen.cxx | 19 ----------
 netutils/thttpd/fdwatch.c          | 18 +++-------
 system/cle/cle.c                   | 38 ++++++--------------
 system/i2c/i2ctool.h               |  4 ---
 system/spi/spitool.h               |  4 ---
 system/vi/vi.c                     | 72 ++++++++------------------------------
 system/zmodem/zm.h                 | 13 +++----
 14 files changed, 117 insertions(+), 307 deletions(-)

diff --git a/examples/elf/elf_main.c b/examples/elf/elf_main.c
index 8c15935..5ddf81b 100644
--- a/examples/elf/elf_main.c
+++ b/examples/elf/elf_main.c
@@ -105,28 +105,15 @@
  * that the output will be synchronous with the debug output.
  */
 
-#ifdef CONFIG_CPP_HAVE_VARARGS
-#  ifdef CONFIG_DEBUG_INFO
-#    define message(format, ...)  syslog(LOG_INFO, format, ##__VA_ARGS__)
-#  else
-#    define message(format, ...)  printf(format, ##__VA_ARGS__)
-#  endif
-#  ifdef CONFIG_DEBUG_ERROR
-#    define errmsg(format, ...)   syslog(LOG_ERR, format, ##__VA_ARGS__)
-#  else
-#    define errmsg(format, ...)   fprintf(stderr, format, ##__VA_ARGS__)
-#  endif
+#ifdef CONFIG_DEBUG_INFO
+#  define message               _info
 #else
-#  ifdef CONFIG_DEBUG_INFO
-#    define message               _info
-#  else
-#    define message               printf
-#  endif
-#  ifdef CONFIG_DEBUG_ERROR
-#    define errmsg                _err
-#  else
-#    define errmsg                printf
-#  endif
+#  define message               printf
+#endif
+#ifdef CONFIG_DEBUG_ERROR
+#  define errmsg                _err
+#else
+#  define errmsg                printf
 #endif
 
 /****************************************************************************
diff --git a/examples/ft80x/ft80x.h b/examples/ft80x/ft80x.h
index ca9438d..110b80e 100644
--- a/examples/ft80x/ft80x.h
+++ b/examples/ft80x/ft80x.h
@@ -56,45 +56,31 @@
  * Could be a porting issue.
  */
 
-#ifdef CONFIG_CPP_HAVE_VARARGS
-#  ifdef GRAPHICS_FT80X_DEBUG_ERROR
-#    define  ft80x_err(format, ...) \
-       fprintf(stderr, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
-#  else
-#    define  ft80x_err(format, ...)
-#  endif
-
-#  ifdef GRAPHICS_FT80X_DEBUG_WARN
-#    define  ft80x_warn(format, ...) \
-       fprintf(stderr, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
-#  else
-#    define  ft80x_warn(format, ...)
-#  endif
-
-#  ifdef GRAPHICS_FT80X_DEBUG_INFO
-#    define  ft80x_info(format, ...) \
-       printf(EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
-#  else
-#    define  ft80x_info(format, ...)
-#  endif
+#if !defined(GRAPHICS_FT80X_DEBUG_ERROR)
+#  define ft80x_err _none
+#elif defined(CONFIG_CPP_HAVE_VARARGS)
+#  define ft80x_err(format, ...) \
+     fprintf(stderr, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
 #else
-#  ifdef GRAPHICS_FT80X_DEBUG_ERROR
-#    define  ft80x_err printf
-#  else
-#    define  ft80x_err (void)
-#  endif
-
-#  ifdef GRAPHICS_FT80X_DEBUG_WARN
-#    define  ft80x_warn printf
-#  else
-#    define  ft80x_warn (void)
-#  endif
-
-#  ifdef GRAPHICS_FT80X_DEBUG_INFO
-#    define  ft80x_info printf
-#  else
-#    define  ft80x_info (void)
-#  endif
+#  define ft80x_err printf
+#endif
+
+#if !defined(GRAPHICS_FT80X_DEBUG_WARN)
+#  define ft80x_warn _none
+#elif defined(CONFIG_CPP_HAVE_VARARGS)
+#  define ft80x_warn(format, ...) \
+     fprintf(stderr, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
+#else
+#  define ft80x_warn printf
+#endif
+
+#if !defined(GRAPHICS_FT80X_DEBUG_INFO)
+#  define ft80x_info _none
+#elif defined(CONFIG_CPP_HAVE_VARARGS)
+#  define ft80x_info(format, ...) \
+     printf(EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
+#else
+#  define ft80x_info printf
 #endif
 
 /****************************************************************************
diff --git a/examples/nxflat/nxflat_main.c b/examples/nxflat/nxflat_main.c
index 5001f3a..2d1620a 100644
--- a/examples/nxflat/nxflat_main.c
+++ b/examples/nxflat/nxflat_main.c
@@ -96,28 +96,15 @@
  * that the output will be synchronous with the debug output.
  */
 
-#ifdef CONFIG_CPP_HAVE_VARARGS
-#  ifdef CONFIG_DEBUG_INFO
-#    define message(format, ...)    syslog(LOG_INFO, format, ##__VA_ARGS__)
-#  else
-#    define message(format, ...)    printf(format, ##__VA_ARGS__)
-#  endif
-#  ifdef CONFIG_DEBUG_ERROR
-#    define errmsg(format, ...)     syslog(LOG_ERR, format, ##__VA_ARGS__)
-#  else
-#    define errmsg(format, ...)     fprintf(stderr, format, ##__VA_ARGS__)
-#  endif
+#ifdef CONFIG_DEBUG_INFO
+#  define message                 _info
 #else
-#  ifdef CONFIG_DEBUG_INFO
-#    define message                 _info
-#  else
-#    define message                 printf
-#  endif
-#  ifdef CONFIG_DEBUG_ERROR
-#    define errmsg                  _err
-#  else
-#    define errmsg                  printf
-#  endif
+#  define message                 printf
+#endif
+#ifdef CONFIG_DEBUG_ERROR
+#  define errmsg                  _err
+#else
+#  define errmsg                  printf
 #endif
 
 /****************************************************************************
diff --git a/examples/posix_spawn/spawn_main.c b/examples/posix_spawn/spawn_main.c
index 6316f58..add4d2d 100644
--- a/examples/posix_spawn/spawn_main.c
+++ b/examples/posix_spawn/spawn_main.c
@@ -96,22 +96,12 @@
  * that the output will be synchronous with the debug output.
  */
 
-#ifdef CONFIG_CPP_HAVE_VARARGS
-#  ifdef CONFIG_DEBUG_FEATURES
-#    define message(format, ...)    _info(format, ##__VA_ARGS__)
-#    define errmsg(format, ...)     _err(format, ##__VA_ARGS__)
-#  else
-#    define message(format, ...)    printf(format, ##__VA_ARGS__)
-#    define errmsg(format, ...)     fprintf(stderr, format, ##__VA_ARGS__)
-#  endif
+#ifdef CONFIG_DEBUG_FEATURES
+#  define message                 _info
+#  define errmsg                  _err
 #else
-#  ifdef CONFIG_DEBUG_FEATURES
-#    define message                 _info
-#    define errmsg                  _err
-#  else
-#    define message                 printf
-#    define errmsg                  printf
-#  endif
+#  define message                 printf
+#  define errmsg                  printf
 #endif
 
 /****************************************************************************
diff --git a/fsutils/inifile/inifile.c b/fsutils/inifile/inifile.c
index 6707abf..75098f6 100644
--- a/fsutils/inifile/inifile.c
+++ b/fsutils/inifile/inifile.c
@@ -60,32 +60,22 @@
 #  define CONFIG_FSUTILS_INIFILE_DEBUGLEVEL 0
 #endif
 
-#ifdef CONFIG_CPP_HAVE_VARARGS
-#  if CONFIG_FSUTILS_INIFILE_DEBUGLEVEL > 0
-#    define inidbg(format, ...) \
-       printf(EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
-#  else
-#    define inidbg(x...)
-#  endif
-
-#  if CONFIG_FSUTILS_INIFILE_DEBUGLEVEL > 1
-#    define iniinfo(format, ...) \
-       printf(EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
-#  else
-#    define iniinfo(x...)
-#  endif
+#if CONFIG_FSUTILS_INIFILE_DEBUGLEVEL < 1
+#  define inidbg _none
+#elif defined(CONFIG_CPP_HAVE_VARARGS)
+#  define inidbg(format, ...) \
+     printf(EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
 #else
-#  if CONFIG_FSUTILS_INIFILE_DEBUGLEVEL > 0
-#    define inidbg printf
-#  else
-#    define inidbg (void)
-#  endif
-
-#  if CONFIG_FSUTILS_INIFILE_DEBUGLEVEL > 1
-#    define iniinfo printf
-#  else
-#    define iniinfo (void)
-#  endif
+#  define inidbg printf
+#endif
+
+#if CONFIG_FSUTILS_INIFILE_DEBUGLEVEL < 2
+#  define iniinfo _none
+#elif defined(CONFIG_CPP_HAVE_VARARGS)
+#  define iniinfo(format, ...) \
+     printf(EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
+#else
+#  define iniinfo printf
 #endif
 
 /****************************************************************************
diff --git a/graphics/ft80x/ft80x.h b/graphics/ft80x/ft80x.h
index fa2224c..cbfcb88 100644
--- a/graphics/ft80x/ft80x.h
+++ b/graphics/ft80x/ft80x.h
@@ -57,45 +57,31 @@
  * Could be a porting issue.
  */
 
-#ifdef CONFIG_CPP_HAVE_VARARGS
-#  ifdef CONFIG_GRAPHICS_FT80X_DEBUG_ERROR
-#    define  ft80x_err(format, ...) \
-       fprintf(stderr, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
-#  else
-#    define  ft80x_err(format, ...)
-#  endif
-
-#  ifdef CONFIG_GRAPHICS_FT80X_DEBUG_WARN
-#    define  ft80x_warn(format, ...) \
-       fprintf(stderr, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
-#  else
-#    define  ft80x_warn(format, ...)
-#  endif
-
-#  ifdef CONFIG_GRAPHICS_FT80X_DEBUG_INFO
-#    define  ft80x_info(format, ...) \
-       printf(EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
-#  else
-#    define  ft80x_info(format, ...)
-#  endif
+#if !defined(CONFIG_GRAPHICS_FT80X_DEBUG_ERROR)
+#  define ft80x_err _none
+#elif defined(CONFIG_CPP_HAVE_VARARGS)
+#  define ft80x_err(format, ...) \
+     fprintf(stderr, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
 #else
-#  ifdef CONFIG_GRAPHICS_FT80X_DEBUG_ERROR
-#    define  ft80x_err printf
-#  else
-#    define  ft80x_err (void)
-#  endif
-
-#  ifdef CONFIG_GRAPHICS_FT80X_DEBUG_WARN
-#    define  ft80x_warn printf
-#  else
-#    define  ft80x_warn (void)
-#  endif
-
-#  ifdef CONFIG_GRAPHICS_FT80X_DEBUG_INFO
-#    define  ft80x_info printf
-#  else
-#    define  ft80x_info (void)
-#  endif
+#  define ft80x_err printf
+#endif
+
+#if !defined(CONFIG_GRAPHICS_FT80X_DEBUG_WARN)
+#  define ft80x_warn _none
+#elif defined(CONFIG_CPP_HAVE_VARARGS)
+#  define ft80x_warn(format, ...) \
+     fprintf(stderr, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
+#else
+#  define ft80x_warn printf
+#endif
+
+#if !defined(CONFIG_GRAPHICS_FT80X_DEBUG_INFO)
+#  define ft80x_info _none
+#elif defined(CONFIG_CPP_HAVE_VARARGS)
+#  define ft80x_info(format, ...) \
+     printf(EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
+#else
+#  define ft80x_info printf
 #endif
 
 #define FT80X_CMDFIFO_MASK  (FT80X_CMDFIFO_SIZE - 1)
diff --git a/graphics/nxwm/src/cmediaplayer.cxx b/graphics/nxwm/src/cmediaplayer.cxx
index 1e5d367..4c32f99 100644
--- a/graphics/nxwm/src/cmediaplayer.cxx
+++ b/graphics/nxwm/src/cmediaplayer.cxx
@@ -63,20 +63,6 @@
  * Pre-Processor Definitions
  ********************************************************************************************/
 
-/* We want debug output from this file if either audio or graphics debug is enabled. */
-
-#if !defined(CONFIG_DEBUG_AUDIO) && !defined(CONFIG_DEBUG_GRAPHICS)
-#  undef gerr
-#  undef _info
-#  ifdef CONFIG_CPP_HAVE_VARARGS
-#    define gerr(x...)
-#    define _info(x...)
-#  else
-#    define gerr  (void)
-#    define _info (void)
-#  endif
-#endif
-
 #define AUDIO_NSUBSAMPLES 4
 
 /********************************************************************************************
diff --git a/graphics/nxwm/src/ctouchscreen.cxx b/graphics/nxwm/src/ctouchscreen.cxx
index 19253b2..b7e279c 100644
--- a/graphics/nxwm/src/ctouchscreen.cxx
+++ b/graphics/nxwm/src/ctouchscreen.cxx
@@ -61,25 +61,6 @@
 #include "graphics/nxwm/ctouchscreen.hxx"
 
 /********************************************************************************************
- * Pre-Processor Definitions
- ********************************************************************************************/
-/* We want debug output from this file if either input/touchscreen or graphics debug is
- * enabled.
- */
-
-#if !defined(CONFIG_DEBUG_INPUT) && !defined(CONFIG_DEBUG_GRAPHICS)
-#  undef gerr
-#  undef _info
-#  ifdef CONFIG_CPP_HAVE_VARARGS
-#    define gerr(x...)
-#    define _info(x...)
-#  else
-#    define gerr  (void)
-#    define _info (void)
-#  endif
-#endif
-
-/********************************************************************************************
  * CTouchscreen Method Implementations
  ********************************************************************************************/
 
diff --git a/netutils/thttpd/fdwatch.c b/netutils/thttpd/fdwatch.c
index 0706aaf..ed1880d 100644
--- a/netutils/thttpd/fdwatch.c
+++ b/netutils/thttpd/fdwatch.c
@@ -61,21 +61,11 @@
  */
 
 #ifdef CONFIG_THTTPD_FDWATCH_DEBUG
-#  ifdef CONFIG_CPP_HAVE_VARARGS
-#    define fwerr(format, ...)    nerr(format, ##__VA_ARGS__)
-#    define fwinfo(format, ...)   ninfo(format, ##__VA_ARGS__)
-#  else
-#    define fwerr    nerr
-#    define fwinfo   ninfo
-#  endif
+#  define fwerr    nerr
+#  define fwinfo   ninfo
 #else
-#  ifdef CONFIG_CPP_HAVE_VARARGS
-#    define fwerr(x...)
-#    define fwinfo(x...)
-#  else
-#    define fwerr    (void)
-#    define fwinfo  (void)
-#  endif
+#  define fwerr    _none
+#  define fwinfo   _none
 #endif
 
 #ifndef MIN
diff --git a/system/cle/cle.c b/system/cle/cle.c
index bb39371..f2e0cfd 100644
--- a/system/cle/cle.c
+++ b/system/cle/cle.c
@@ -106,32 +106,16 @@
 #  define CONFIG_SYSTEM_CLE_DEBUGLEVEL 0
 #endif
 
-#ifdef CONFIG_CPP_HAVE_VARARGS
-#  if CONFIG_SYSTEM_CLE_DEBUGLEVEL > 0
-#    define cledbg(format, ...) \
-       syslog(LOG_DEBUG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
-#  else
-#    define cledbg(x...)
-#  endif
-
-#  if CONFIG_SYSTEM_CLE_DEBUGLEVEL > 1
-#    define cleinfo(format, ...) \
-       syslog(LOG_DEBUG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
-#  else
-#    define cleinfo(x...)
-#  endif
+#if CONFIG_SYSTEM_CLE_DEBUGLEVEL > 0
+#  define cledbg  cle_debug
 #else
-#  if CONFIG_SYSTEM_CLE_DEBUGLEVEL > 0
-#    define cledbg  cle_debug
-#  else
-#    define cledbg  (void)
-#  endif
-
-#  if CONFIG_SYSTEM_CLE_DEBUGLEVEL > 1
-#    define cleinfo cle_debug
-#  else
-#    define cleinfo (void)
-#  endif
+#  define cledbg  _none
+#endif
+
+#if CONFIG_SYSTEM_CLE_DEBUGLEVEL > 1
+#  define cleinfo cle_debug
+#else
+#  define cleinfo _none
 #endif
 
 #ifdef CONFIG_SYSTEM_COLOR_CLE
@@ -182,7 +166,7 @@ struct cle_s
  * Private Function Prototypes
  ****************************************************************************/
 
-#if !defined(CONFIG_CPP_HAVE_VARARGS) && CONFIG_SYSTEM_CLE_DEBUGLEVEL > 0
+#if CONFIG_SYSTEM_CLE_DEBUGLEVEL > 0
 static int      cle_debug(FAR const char *fmt, ...);
 #endif
 
@@ -262,7 +246,7 @@ static const char g_setcolor[]     = VT100_FMT_FORE_COLOR;
  *
  ****************************************************************************/
 
-#if !defined(CONFIG_CPP_HAVE_VARARGS) && CONFIG_SYSTEM_CLE_DEBUGLEVEL > 0
+#if CONFIG_SYSTEM_CLE_DEBUGLEVEL > 0
 static int cle_debug(FAR const char *fmt, ...)
 {
   va_list ap;
diff --git a/system/i2c/i2ctool.h b/system/i2c/i2ctool.h
index 3cf7cce..b901135 100644
--- a/system/i2c/i2ctool.h
+++ b/system/i2c/i2ctool.h
@@ -127,11 +127,7 @@
 
 /* Output is via printf but can be changed using this macro */
 
-#ifdef CONFIG_CPP_HAVE_VARARGS
-# define i2c_output(v, ...) printf(v, ##__VA_ARGS__)
-#else
 # define i2c_output         printf
-#endif
 
 /****************************************************************************
  * Public Types
diff --git a/system/spi/spitool.h b/system/spi/spitool.h
index 211f4ff..e545cb6 100644
--- a/system/spi/spitool.h
+++ b/system/spi/spitool.h
@@ -131,11 +131,7 @@
 
 /* Output is via printf but can be changed using this macro */
 
-#ifdef CONFIG_CPP_HAVE_VARARGS
-# define spi_output(v, ...) printf(v, ##__VA_ARGS__)
-#else
 # define spi_output         printf
-#endif
 
 /****************************************************************************
  * Public Types
diff --git a/system/vi/vi.c b/system/vi/vi.c
index d6e2927..272a7f3 100644
--- a/system/vi/vi.c
+++ b/system/vi/vi.c
@@ -170,37 +170,21 @@
 #  define CONFIG_SYSTEM_VI_DEBUGLEVEL 0
 #endif
 
-#ifdef CONFIG_CPP_HAVE_VARARGS
-#  if CONFIG_SYSTEM_VI_DEBUGLEVEL > 0
-#    define vidbg(format, ...) \
-       syslog(LOG_DEBUG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
-#    define vvidbg(format, ap) \
-       vsyslog(LOG_DEBUG, format, ap)
-#  else
-#    define vidbg(x...)
-#    define vvidbg(x...)
-#  endif
-
-#  if CONFIG_SYSTEM_VI_DEBUGLEVEL > 1
-#    define viinfo(format, ...) \
-       syslog(LOG_DEBUG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
-#  else
-#    define viinfo(x...)
-#  endif
+#if CONFIG_SYSTEM_VI_DEBUGLEVEL > 0
+#  define vidbg(format, ...) \
+     syslog(LOG_DEBUG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
+#  define vvidbg(format, ap) \
+     vsyslog(LOG_DEBUG, format, ap)
 #else
-#  if CONFIG_SYSTEM_VI_DEBUGLEVEL > 0
-#    define vidbg  vi_debug
-#    define vvidbg vi_vdebug
-#  else
-#    define vidbg  (void)
-#    define vvidbg (void)
-#  endif
-
-#  if CONFIG_SYSTEM_VI_DEBUGLEVEL > 1
-#    define viinfo vi_debug
-#  else
-#    define viinfo (void)
-#  endif
+#  define vidbg(x...)
+#  define vvidbg(x...)
+#endif
+
+#if CONFIG_SYSTEM_VI_DEBUGLEVEL > 1
+#  define viinfo(format, ...) \
+     syslog(LOG_DEBUG, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
+#else
+#  define viinfo(x...)
 #endif
 
 /* Uncomment to enable bottom line debug printing.  Useful during yank /
@@ -577,34 +561,6 @@ static const char g_fmtinsert[]     = "--INSERT--";
  ****************************************************************************/
 
 /****************************************************************************
- * Name: vi_vdebug and vi_debug
- *
- * Description:
- *   Print a debug message to the syslog
- *
- ****************************************************************************/
-
-#if !defined(CONFIG_CPP_HAVE_VARARGS) && CONFIG_SYSTEM_VI_DEBUGLEVEL > 0
-static inline int vi_vdebug(FAR const char *fmt, va_list ap)
-{
-  return vsyslog(LOG_DEBUG, fmt, ap);
-}
-
-static int vi_debug(FAR const char *fmt, ...)
-{
-  va_list ap;
-  int ret;
-
-  /* Let vsyslog do the real work */
-
-  va_start(ap, fmt);
-  ret = vsyslog(LOG_DEBUG, fmt, ap);
-  va_end(ap);
-  return ret;
-}
-#endif
-
-/****************************************************************************
  * Low-level display and data entry functions
  ****************************************************************************/
 
diff --git a/system/zmodem/zm.h b/system/zmodem/zm.h
index d99a281..822f9e9 100644
--- a/system/zmodem/zm.h
+++ b/system/zmodem/zm.h
@@ -230,17 +230,12 @@
  */
 
 #ifdef CONFIG_DEBUG_ZMODEM
-#  define zmprintf(format, ...) syslog(LOG_INFO, format, ##__VA_ARGS__)
-#  define zmdbg(format, ...)    syslog(LOG_INFO, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
+#  define zmprintf(format, ...) _info
+#  define zmdbg(format, ...)    _info
 #else
 #  undef CONFIG_SYSTEM_ZMODEM_DUMPBUFFER
-#  ifdef CONFIG_CPP_HAVE_VARARGS
-#     define zmprintf(x...)
-#     define zmdbg(x...)
-#  else
-#     define zmprintf           (void)
-#     define zmdbg              (void)
-#  endif
+#  define zmprintf              _none
+#  define zmdbg                 _none
 #endif
 
 /****************************************************************************