You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/10/31 05:28:23 UTC

[incubator-nuttx-apps] branch master updated (d52a8298c -> 165f30d3a)

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

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


    from d52a8298c Fix Error: ftpd.c:1773:9: error: variable 'pos' set but not used [-Werror,-Wunused-but-set-variable]
     new 1c23a095e Fix Error: keyboard_main.c:420:15: error: result of comparison of constant -1 with expression of type 'char' is always true [-Werror,-Wtautological-constant-out-of-range-compare]       if (key != EOF)           ~~~ ^  ~~~
     new 757552e75 Fix nsh_fscmds.c:92:19: error: unused function 'ls_specialdir' [-Werror,-Wunused-function]
     new 76fece26a Fix Error: shift_main.c:763:7: error: variable 'score' set but not used [-Werror,-Wunused-but-set-variable]
     new 165f30d3a Fix Error: ascii/mbascii.c:118:25: error: unused variable 'ucLRC' [-Werror,-Wunused-variable]

The 4 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/fmsynth/keyboard_main.c  |  4 ++--
 examples/fmsynth/mmlplayer_main.c |  4 ++--
 games/shift/shift_main.c          |  3 ---
 modbus/ascii/mbascii.c            | 20 +++++++++++---------
 nshlib/nsh_fscmds.c               |  2 ++
 5 files changed, 17 insertions(+), 16 deletions(-)


[incubator-nuttx-apps] 04/04: Fix Error: ascii/mbascii.c:118:25: error: unused variable 'ucLRC' [-Werror,-Wunused-variable]

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

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

commit 165f30d3acefa128c819b15e0b85431cd1e6e72d
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Oct 30 01:12:17 2022 +0800

    Fix Error: ascii/mbascii.c:118:25: error: unused variable 'ucLRC' [-Werror,-Wunused-variable]
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 modbus/ascii/mbascii.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/modbus/ascii/mbascii.c b/modbus/ascii/mbascii.c
index 2fdc6d5a0..a4bf5a186 100644
--- a/modbus/ascii/mbascii.c
+++ b/modbus/ascii/mbascii.c
@@ -115,7 +115,6 @@ static volatile eMBBytePos eBytePos;
 static volatile uint8_t *pucSndBufferCur;
 static volatile uint16_t usSndBufferCount;
 
-static volatile uint8_t ucLRC;
 static volatile uint8_t ucMBLFCharacter;
 
 /****************************************************************************
@@ -130,11 +129,11 @@ static uint8_t prvucMBint8_t2BIN(uint8_t ucCharacter)
     }
   else if ((ucCharacter >= 'A') && (ucCharacter <= 'F'))
     {
-      return (uint8_t)(ucCharacter - 'A' + 0x0A);
+      return (uint8_t)(ucCharacter - 'A' + 0x0a);
     }
     else
     {
-      return 0xFF;
+      return 0xff;
     }
 }
 
@@ -144,9 +143,9 @@ static uint8_t prvucMBBIN2int8_t(uint8_t ucByte)
     {
       return (uint8_t)('0' + ucByte);
     }
-  else if ((ucByte >= 0x0A) && (ucByte <= 0x0F))
+  else if ((ucByte >= 0x0a) && (ucByte <= 0x0f))
     {
-      return (uint8_t)(ucByte - 0x0A + 'A');
+      return (uint8_t)(ucByte - 0x0a + 'A');
     }
   else
     {
@@ -241,7 +240,7 @@ eMBErrorCode eMBASCIIReceive(uint8_t *pucRcvAddress, uint8_t **pucFrame,
        * size of address field and CRC checksum.
        */
 
-      *pusLength = (uint16_t)(usRcvBufferPos - MB_SER_PDU_PDU_OFF - MB_SER_PDU_SIZE_LRC);
+      *pusLength = usRcvBufferPos - MB_SER_PDU_PDU_OFF - MB_SER_PDU_SIZE_LRC;
 
       /* Return the start of the Modbus PDU to the caller. */
 
@@ -318,6 +317,7 @@ bool xMBASCIIReceiveFSM(void)
      */
 
     case STATE_RX_RCV:
+
       /* Enable timer for character timeout. */
 
       vMBPortTimersEnable();
@@ -356,7 +356,7 @@ bool xMBASCIIReceiveFSM(void)
 
                 eRcvState = STATE_RX_IDLE;
 
-                /* Disable previously activated timer because of error state. */
+                /* Disable previously activated timer due to error state. */
 
                 vMBPortTimersDisable();
               }
@@ -466,7 +466,7 @@ bool xMBASCIITransmitFSM(void)
           break;
 
         case BYTE_LOW_NIBBLE:
-          ucByte = prvucMBBIN2int8_t((uint8_t)(*pucSndBufferCur & 0x0F));
+          ucByte = prvucMBBIN2int8_t((uint8_t)(*pucSndBufferCur & 0x0f));
           xMBPortSerialPutByte((int8_t)ucByte);
           pucSndBufferCur++;
           eBytePos = BYTE_HIGH_NIBBLE;
@@ -514,6 +514,7 @@ bool xMBASCIITransmitFSM(void)
      */
 
     case STATE_TX_IDLE:
+
       /* enable receiver/disable transmitter. */
 
       vMBPortSerialEnable(true, false);
@@ -530,13 +531,14 @@ bool xMBASCIITimerT1SExpired(void)
   /* If we have a timeout we go back to the idle state and wait for
    * the next frame.
    */
+
   case STATE_RX_RCV:
   case STATE_RX_WAIT_EOF:
     eRcvState = STATE_RX_IDLE;
     break;
 
   default:
-    DEBUGASSERT((eRcvState == STATE_RX_RCV) || (eRcvState == STATE_RX_WAIT_EOF));
+    DEBUGASSERT(eRcvState == STATE_RX_RCV || eRcvState == STATE_RX_WAIT_EOF);
     break;
   }
 


[incubator-nuttx-apps] 02/04: Fix nsh_fscmds.c:92:19: error: unused function 'ls_specialdir' [-Werror,-Wunused-function]

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

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

commit 757552e7597788b3aefa2cd57c6efe3d8a550b43
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Oct 30 00:56:32 2022 +0800

    Fix nsh_fscmds.c:92:19: error: unused function 'ls_specialdir' [-Werror,-Wunused-function]
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 nshlib/nsh_fscmds.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/nshlib/nsh_fscmds.c b/nshlib/nsh_fscmds.c
index ec800e0f9..4f161a37b 100644
--- a/nshlib/nsh_fscmds.c
+++ b/nshlib/nsh_fscmds.c
@@ -89,12 +89,14 @@
  * Name: ls_specialdir
  ****************************************************************************/
 
+#if !defined(CONFIG_NSH_DISABLE_LS)
 static inline int ls_specialdir(FAR const char *dir)
 {
   /* '.' and '..' directories are not listed like normal directories */
 
   return (strcmp(dir, ".")  == 0 || strcmp(dir, "..") == 0);
 }
+#endif
 
 /****************************************************************************
  * Name: ls_handler


[incubator-nuttx-apps] 01/04: Fix Error: keyboard_main.c:420:15: error: result of comparison of constant -1 with expression of type 'char' is always true [-Werror,-Wtautological-constant-out-of-range-compare] if (key != EOF) ~~~ ^ ~~~

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

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

commit 1c23a095eaac23262869b28751216a214cfc54c5
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sat Oct 29 18:49:34 2022 +0800

    Fix Error: keyboard_main.c:420:15: error: result of comparison of constant -1 with expression of type 'char' is always true [-Werror,-Wtautological-constant-out-of-range-compare]
          if (key != EOF)
              ~~~ ^  ~~~
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 examples/fmsynth/keyboard_main.c  | 4 ++--
 examples/fmsynth/mmlplayer_main.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/examples/fmsynth/keyboard_main.c b/examples/fmsynth/keyboard_main.c
index d3f0c9bc4..0cf434a6a 100644
--- a/examples/fmsynth/keyboard_main.c
+++ b/examples/fmsynth/keyboard_main.c
@@ -372,7 +372,7 @@ int main(int argc, FAR char *argv[])
 {
   int i;
   int ret;
-  char key;
+  int key;
   bool running = true;
   pthread_t pid;
   struct app_options appopt;
@@ -416,7 +416,7 @@ int main(int argc, FAR char *argv[])
 
   while (running)
     {
-      key = (char)getchar();
+      key = getchar();
       if (key != EOF)
         {
           switch (key)
diff --git a/examples/fmsynth/mmlplayer_main.c b/examples/fmsynth/mmlplayer_main.c
index edab3cb9a..c5e11f5a0 100644
--- a/examples/fmsynth/mmlplayer_main.c
+++ b/examples/fmsynth/mmlplayer_main.c
@@ -502,7 +502,7 @@ int main(int argc, FAR char *argv[])
 {
   int i;
   int ret;
-  char key;
+  int key;
   bool running = true;
   pthread_t pid;
   struct app_options appopt;
@@ -542,7 +542,7 @@ int main(int argc, FAR char *argv[])
 
   while (running)
     {
-      key = (char)getchar();
+      key = getchar();
       if (key != EOF)
         {
           switch (key)


[incubator-nuttx-apps] 03/04: Fix Error: shift_main.c:763:7: error: variable 'score' set but not used [-Werror,-Wunused-but-set-variable]

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

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

commit 76fece26a26acfb91fd258456d9d2194c2d8a57f
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Oct 30 01:11:19 2022 +0800

    Fix Error: shift_main.c:763:7: error: variable 'score' set but not used [-Werror,-Wunused-but-set-variable]
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 games/shift/shift_main.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/games/shift/shift_main.c b/games/shift/shift_main.c
index d0906bf58..0e60f56a1 100644
--- a/games/shift/shift_main.c
+++ b/games/shift/shift_main.c
@@ -760,7 +760,6 @@ int main(int argc, FAR char *argv[])
   struct input_state_s input;
   struct screen_state_s state;
   struct fb_area_s area;
-  int score = 0;
   int ret;
 
   /* Open the framebuffer driver */
@@ -906,8 +905,6 @@ int main(int argc, FAR char *argv[])
             }
 
           usleep(500000);
-
-          score += 100;
         }
 
 #ifdef DEBUG_SHIFT_GAME