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

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

commit c69df55cd043c1621e4c0fa3207ffd6ab7c71e18
Author: hongfengchen <[email protected]>
AuthorDate: Tue Jun 10 15:00:26 2025 +0800

    rexecd: fix type change
    
    Fix cast from pointer to integer of different size to ensure
    proper type conversion and avoid compilation warnings.
    
    Signed-off-by: hongfengchen <[email protected]>
---
 netutils/ftpd/ftpd.c                     | 34 ++++++++++++++++----------------
 netutils/rexecd/rexecd.c                 |  2 +-
 testing/mm/memstress/memorystress_main.c |  4 ++--
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/netutils/ftpd/ftpd.c b/netutils/ftpd/ftpd.c
index 4f5cc4667..73b8fc9b9 100644
--- a/netutils/ftpd/ftpd.c
+++ b/netutils/ftpd/ftpd.c
@@ -140,11 +140,11 @@ static uint8_t ftpd_listoption(FAR char **param);
 static int ftpd_listbuffer(FAR struct ftpd_session_s *session,
                            FAR char *path, FAR struct stat *st,
                            FAR char *buffer, size_t buflen,
-                           unsigned int opton);
+                           unsigned int option);
 static int fptd_listscan(FAR struct ftpd_session_s *session,
-                         FAR char *path, unsigned int opton);
+                         FAR char *path, unsigned int option);
 static int ftpd_list(FAR struct ftpd_session_s *session,
-                     unsigned int opton);
+                     unsigned int option);
 
 /* Command handlers */
 
@@ -2145,7 +2145,7 @@ static uint8_t ftpd_listoption(FAR char **param)
 static int ftpd_listbuffer(FAR struct ftpd_session_s *session,
                            FAR char *path,
                            FAR struct stat *st, FAR char *buffer,
-                           size_t buflen, unsigned int opton)
+                           size_t buflen, unsigned int option)
 {
   UNUSED(session);
 
@@ -2154,7 +2154,7 @@ static int ftpd_listbuffer(FAR struct ftpd_session_s 
*session,
 
   name = basename(path);
 
-  if ((opton & FTPD_LISTOPTION_L) != 0)
+  if ((option & FTPD_LISTOPTION_L) != 0)
     {
       FAR const char *str;
       struct tm tm;
@@ -2367,7 +2367,7 @@ static int ftpd_listbuffer(FAR struct ftpd_session_s 
*session,
  ****************************************************************************/
 
 static int fptd_listscan(FAR struct ftpd_session_s *session, FAR char *path,
-                         unsigned int opton)
+                         unsigned int option)
 {
   FAR char *temp;
   DIR *dir;
@@ -2384,7 +2384,7 @@ static int fptd_listscan(FAR struct ftpd_session_s 
*session, FAR char *path,
   if (!S_ISDIR(st.st_mode))
     {
       ret = ftpd_listbuffer(session, path, &st, session->data.buffer,
-                            session->data.buflen, opton);
+                            session->data.buflen, option);
       if (ret == 0)
         {
           ret = ftpd_response(session->data.sd, session->txtimeout,
@@ -2412,7 +2412,7 @@ static int fptd_listscan(FAR struct ftpd_session_s 
*session, FAR char *path,
 
       if (entry->d_name[0] == '.')
         {
-          if ((opton & FTPD_LISTOPTION_A) == 0)
+          if ((option & FTPD_LISTOPTION_A) == 0)
             {
               continue;
             }
@@ -2432,7 +2432,7 @@ static int fptd_listscan(FAR struct ftpd_session_s 
*session, FAR char *path,
         }
 
       ret = ftpd_listbuffer(session, temp, &st, session->data.buffer,
-                            session->data.buflen, opton);
+                            session->data.buflen, option);
       if (ret >= 0)
         {
           ret = ftpd_response(session->data.sd, session->txtimeout,
@@ -2454,7 +2454,7 @@ static int fptd_listscan(FAR struct ftpd_session_s 
*session, FAR char *path,
  * Name: ftpd_list
  ****************************************************************************/
 
-static int ftpd_list(FAR struct ftpd_session_s *session, unsigned int opton)
+static int ftpd_list(FAR struct ftpd_session_s *session, unsigned int option)
 {
   FAR char *abspath;
   int ret;
@@ -2462,7 +2462,7 @@ static int ftpd_list(FAR struct ftpd_session_s *session, 
unsigned int opton)
   ret = ftpd_getpath(session, session->param, &abspath, NULL);
   if (ret >= 0)
     {
-      ret = fptd_listscan(session, abspath, opton);
+      ret = fptd_listscan(session, abspath, option);
       free(abspath);
     }
 
@@ -3417,7 +3417,7 @@ static int ftpd_command_epsv(FAR struct ftpd_session_s 
*session)
 
 static int ftpd_command_list(FAR struct ftpd_session_s *session)
 {
-  uint8_t opton = FTPD_LISTOPTION_L;
+  uint8_t option = FTPD_LISTOPTION_L;
   int ret;
 
   ret = ftpd_dataopen(session);
@@ -3435,8 +3435,8 @@ static int ftpd_command_list(FAR struct ftpd_session_s 
*session)
       return ret;
     }
 
-  opton |= ftpd_listoption((char **)(&session->param));
-  ftpd_list(session, opton);
+  option |= ftpd_listoption((char **)(&session->param));
+  ftpd_list(session, option);
 
   ret = ftpd_response(session->cmd.sd, session->txtimeout,
                       g_respfmt1, 226, ' ', "Transfer complete");
@@ -3451,7 +3451,7 @@ static int ftpd_command_list(FAR struct ftpd_session_s 
*session)
 
 static int ftpd_command_nlst(FAR struct ftpd_session_s *session)
 {
-  uint8_t opton = 0;
+  uint8_t option = 0;
   int ret;
 
   ret = ftpd_dataopen(session);
@@ -3469,8 +3469,8 @@ static int ftpd_command_nlst(FAR struct ftpd_session_s 
*session)
       return ret;
     }
 
-  opton |= ftpd_listoption((char **)(&session->param));
-  ftpd_list(session, opton);
+  option |= ftpd_listoption((char **)(&session->param));
+  ftpd_list(session, option);
 
   ret = ftpd_response(session->cmd.sd, session->txtimeout,
                       g_respfmt1, 226, ' ', "Transfer complete");
diff --git a/netutils/rexecd/rexecd.c b/netutils/rexecd/rexecd.c
index 5c301c62a..2e462083c 100644
--- a/netutils/rexecd/rexecd.c
+++ b/netutils/rexecd/rexecd.c
@@ -85,7 +85,7 @@ static FAR void *doit(pthread_addr_t pvarg)
   char buf[REXECD_BUFSIZE];
   struct pollfd fds[2];
   FAR FILE *fp;
-  int sock = (int)pvarg;
+  int sock = (long)pvarg;
   int ret;
 
   /* we need to read err_sock, user and passwd, but ignore them */
diff --git a/testing/mm/memstress/memorystress_main.c 
b/testing/mm/memstress/memorystress_main.c
index ab1ff8630..eca7b7735 100644
--- a/testing/mm/memstress/memorystress_main.c
+++ b/testing/mm/memstress/memorystress_main.c
@@ -122,7 +122,7 @@ static void show_usage(FAR const char *progname)
 {
   printf("\nUsage: %s -m [max allocsize Default:8192] "
          "-n [node length Default:1024] -t [sleep us Default:100]"
-         " -x [nthreads Default:1] -d [debuger mode]\n",
+         " -x [nthreads Default:1] -d [debugger mode]\n",
         progname);
   printf("\nWhere:\n");
   printf("  -m [max-allocsize] max alloc size.\n");
@@ -217,7 +217,7 @@ static void checknode(FAR struct 
memorystress_thread_context_s *context,
           context->error.rwerror = rwerror;
 
           error_result(context->error);
-          lib_dumpbuffer("debuger", node->buf, size);
+          lib_dumpbuffer("debugger", node->buf, size);
 
           /* Trigger the ASSET once it occurs, retaining the error site */
 

Reply via email to