You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ra...@apache.org on 2024/10/02 08:40:11 UTC

(nuttx-apps) branch master updated (6c88a1ad7 -> 4f09da79c)

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

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


    from 6c88a1ad7 examples/elf/sotest: enable and run them simultaneously
     new 161c99607 apps: use sizeof array in snprintf
     new 1dabdfa0b lte: add missing FAR
     new 4f09da79c system/uniqueid: remove FAR from int variables

The 3 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/ws2812esp32rmt/ws2812esp32rmt_main.c | 8 ++++----
 graphics/nxwm/src/cnxterm.cxx                 | 4 ++--
 graphics/twm4nx/apps/cnxterm.cxx              | 4 ++--
 lte/alt1250/alt1250_devevent.c                | 3 ++-
 system/uniqueid/uniqueid_main.c               | 4 ++--
 testing/sensortest/sensortest.c               | 2 +-
 6 files changed, 13 insertions(+), 12 deletions(-)


(nuttx-apps) 01/03: apps: use sizeof array in snprintf

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

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

commit 161c996079e75cdf7c39bba35b2b2586b4f00dc1
Author: Petro Karashchenko <pe...@gmail.com>
AuthorDate: Tue Oct 1 22:23:10 2024 +0200

    apps: use sizeof array in snprintf
    
    Signed-off-by: Petro Karashchenko <pe...@gmail.com>
---
 examples/ws2812esp32rmt/ws2812esp32rmt_main.c | 8 ++++----
 graphics/nxwm/src/cnxterm.cxx                 | 4 ++--
 graphics/twm4nx/apps/cnxterm.cxx              | 4 ++--
 testing/sensortest/sensortest.c               | 2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/examples/ws2812esp32rmt/ws2812esp32rmt_main.c b/examples/ws2812esp32rmt/ws2812esp32rmt_main.c
index 4f1c7f986..892c135c8 100644
--- a/examples/ws2812esp32rmt/ws2812esp32rmt_main.c
+++ b/examples/ws2812esp32rmt/ws2812esp32rmt_main.c
@@ -157,15 +157,15 @@ int main(int argc, FAR char *argv[])
 
   uint32_t n_leds = atoi(argv[2]);
 
-  char dev_name[50];
-  snprintf(dev_name, 50, "/dev/rmt%d", ch_idx);
-  fd = open(dev_name, O_WRONLY);
+  char devname[50];
+  snprintf(devname, sizeof(devname), "/dev/rmt%d", ch_idx);
+  fd = open(devname, O_WRONLY);
   if (fd < 0)
     {
       fprintf(stderr,
               "%s: open %s failed: %d\n",
               argv[0],
-              dev_name,
+              devname,
               errno);
       goto errout_with_dev;
     }
diff --git a/graphics/nxwm/src/cnxterm.cxx b/graphics/nxwm/src/cnxterm.cxx
index d84fd1b03..2df27c36e 100644
--- a/graphics/nxwm/src/cnxterm.cxx
+++ b/graphics/nxwm/src/cnxterm.cxx
@@ -331,7 +331,7 @@ void CNxTerm::stop(void)
       // Construct the driver name using this minor number
 
       char devname[32];
-      snprintf(devname, 32, "/dev/nxterm%d", m_minor);
+      snprintf(devname, sizeof(devname), "/dev/nxterm%d", m_minor);
 
       unlink(devname);
       m_nxterm = 0;
@@ -460,7 +460,7 @@ int CNxTerm::nxterm(int argc, char *argv[])
   // Construct the driver name using this minor number
 
   char devname[32];
-  snprintf(devname, 32, "/dev/nxterm%d", g_nxtermvars.minor);
+  snprintf(devname, sizeof(devname), "/dev/nxterm%d", g_nxtermvars.minor);
 
   // Increment the minor number while it is protect by the semaphore
 
diff --git a/graphics/twm4nx/apps/cnxterm.cxx b/graphics/twm4nx/apps/cnxterm.cxx
index d3cbd99d0..67a964c43 100644
--- a/graphics/twm4nx/apps/cnxterm.cxx
+++ b/graphics/twm4nx/apps/cnxterm.cxx
@@ -330,7 +330,7 @@ void CNxTerm::stop(void)
       // Construct the driver name using this minor number
 
       char devname[32];
-      snprintf(devname, 32, "/dev/nxterm%d", m_minor);
+      snprintf(devname, sizeof(devname), "/dev/nxterm%d", m_minor);
 
       unlink(devname);
       m_NxTerm = 0;
@@ -373,7 +373,7 @@ int CNxTerm::nxterm(int argc, char *argv[])
   // Construct the driver name using this minor number
 
   char devname[32];
-  snprintf(devname, 32, "/dev/nxterm%d", GNxTermVars.minor);
+  snprintf(devname, sizeof(devname), "/dev/nxterm%d", GNxTermVars.minor);
 
   // Increment the minor number while it is protect by the semaphore
 
diff --git a/testing/sensortest/sensortest.c b/testing/sensortest/sensortest.c
index 8544d67f0..ca309aa19 100644
--- a/testing/sensortest/sensortest.c
+++ b/testing/sensortest/sensortest.c
@@ -350,7 +350,7 @@ int main(int argc, FAR char *argv[])
       goto name_err;
     }
 
-  snprintf(devname, PATH_MAX, DEVNAME_FMT, name);
+  snprintf(devname, sizeof(devname), DEVNAME_FMT, name);
   fd = open(devname, O_RDONLY | O_NONBLOCK);
   if (fd < 0)
     {


(nuttx-apps) 02/03: lte: add missing FAR

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

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

commit 1dabdfa0bab3f28a9e6cdf4b373b302ada8918a8
Author: Petro Karashchenko <pe...@gmail.com>
AuthorDate: Tue Oct 1 22:23:39 2024 +0200

    lte: add missing FAR
    
    Signed-off-by: Petro Karashchenko <pe...@gmail.com>
---
 lte/alt1250/alt1250_devevent.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lte/alt1250/alt1250_devevent.c b/lte/alt1250/alt1250_devevent.c
index 118f31254..f58fe7170 100644
--- a/lte/alt1250/alt1250_devevent.c
+++ b/lte/alt1250/alt1250_devevent.c
@@ -59,7 +59,8 @@
 
 static int handle_replypkt(FAR struct alt1250_s *dev,
                            FAR struct alt_container_s *reply,
-                           FAR int32_t *usock_result, uint32_t *usock_xid,
+                           FAR int32_t *usock_result,
+                           FAR uint32_t *usock_xid,
                            FAR struct usock_ackinfo_s *ackinfo)
 {
   int ret;


(nuttx-apps) 03/03: system/uniqueid: remove FAR from int variables

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

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

commit 4f09da79cf276873deabadeb6c52c6a5710d8643
Author: Petro Karashchenko <pe...@gmail.com>
AuthorDate: Tue Oct 1 22:24:03 2024 +0200

    system/uniqueid: remove FAR from int variables
    
    Signed-off-by: Petro Karashchenko <pe...@gmail.com>
---
 system/uniqueid/uniqueid_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/system/uniqueid/uniqueid_main.c b/system/uniqueid/uniqueid_main.c
index ab7e1c8e1..1568d4a9c 100644
--- a/system/uniqueid/uniqueid_main.c
+++ b/system/uniqueid/uniqueid_main.c
@@ -56,8 +56,8 @@ static int parse_positions(FAR char *arg, FAR uint8_t *positions,
   FAR char *range_save;
   FAR char *range_item;
   FAR char *endptr;
-  FAR int pos;
-  FAR int pos2;
+  int pos;
+  int pos2;
 
 #define APPEND_POSITION(pos) \
   do \