nuttx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerpe...@apache.org
Subject [incubator-nuttx-apps] 01/02: usrsock: Fix warning: the incompatible pointer type
Date Mon, 27 Apr 2020 13:29:44 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit f55c5b67ee7d8c77b029958620e9bc51f6f8fb8b
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
AuthorDate: Mon Apr 27 12:36:06 2020 +0800

    usrsock: Fix warning: the incompatible pointer type
    
    Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
---
 system/usrsock_rpmsg/usrsock_rpmsg_client.c | 13 ++++++-----
 system/usrsock_rpmsg/usrsock_rpmsg_server.c | 35 +++++++++++++++++------------
 2 files changed, 28 insertions(+), 20 deletions(-)

diff --git a/system/usrsock_rpmsg/usrsock_rpmsg_client.c b/system/usrsock_rpmsg/usrsock_rpmsg_client.c
index cc00dfb..29c742d 100644
--- a/system/usrsock_rpmsg/usrsock_rpmsg_client.c
+++ b/system/usrsock_rpmsg/usrsock_rpmsg_client.c
@@ -71,8 +71,9 @@ struct usrsock_rpmsg_s
 
 static int usrsock_rpmsg_dns_handler(struct rpmsg_endpoint *ept, void *data,
                                      size_t len, uint32_t src, void *priv);
-static int usrsock_rpmsg_default_handler(struct rpmsg_endpoint *ept, void *data,
-                                         size_t len, uint32_t src, void *priv_);
+static int usrsock_rpmsg_default_handler(struct rpmsg_endpoint *ept,
+                                         void *data, size_t len,
+                                         uint32_t src, void *priv_);
 
 static void usrsock_rpmsg_device_created(struct rpmsg_device *rdev,
                                          void *priv_);
@@ -130,8 +131,9 @@ static int usrsock_rpmsg_dns_handler(struct rpmsg_endpoint *ept, void
*data,
   return ret;
 }
 
-static int usrsock_rpmsg_default_handler(struct rpmsg_endpoint *ept, void *data,
-                                         size_t len, uint32_t src, void *priv_)
+static int usrsock_rpmsg_default_handler(struct rpmsg_endpoint *ept,
+                                         void *data, size_t len,
+                                         uint32_t src, void *priv_)
 {
   struct usrsock_rpmsg_s *priv = priv_;
 
@@ -237,7 +239,7 @@ int main(int argc, char *argv[])
         {
           struct pollfd pfd;
           void  *buf;
-          size_t len;
+          uint32_t len;
 
           /* Wait the packet ready */
 
@@ -284,7 +286,6 @@ int main(int argc, char *argv[])
         }
 
       /* The remote side crash, loop to wait it restore */
-
     }
 
 destroy_ept:
diff --git a/system/usrsock_rpmsg/usrsock_rpmsg_server.c b/system/usrsock_rpmsg/usrsock_rpmsg_server.c
index 52c75bd..a789e1e 100644
--- a/system/usrsock_rpmsg/usrsock_rpmsg_server.c
+++ b/system/usrsock_rpmsg/usrsock_rpmsg_server.c
@@ -70,9 +70,10 @@ struct usrsock_rpmsg_s
 static int usrsock_rpmsg_send_ack(struct rpmsg_endpoint *ept,
                                   uint8_t xid, int32_t result);
 static int usrsock_rpmsg_send_data_ack(struct rpmsg_endpoint *ept,
-                                       struct usrsock_message_datareq_ack_s *ack,
-                                       uint8_t xid, int32_t result,
-                                       uint16_t valuelen, uint16_t valuelen_nontrunc);
+                                  struct usrsock_message_datareq_ack_s *ack,
+                                  uint8_t xid, int32_t result,
+                                  uint16_t valuelen,
+                                  uint16_t valuelen_nontrunc);
 static int usrsock_rpmsg_send_event(struct rpmsg_endpoint *ept,
                                     int16_t usockid, uint16_t events);
 
@@ -167,10 +168,10 @@ static int usrsock_rpmsg_send_ack(struct rpmsg_endpoint *ept,
 }
 
 static int usrsock_rpmsg_send_data_ack(struct rpmsg_endpoint *ept,
-                                       struct usrsock_message_datareq_ack_s *ack,
-                                       uint8_t xid, int32_t result,
-                                       uint16_t valuelen,
-                                       uint16_t valuelen_nontrunc)
+                                  struct usrsock_message_datareq_ack_s *ack,
+                                  uint8_t xid, int32_t result,
+                                  uint16_t valuelen,
+                                  uint16_t valuelen_nontrunc)
 {
   ack->reqack.head.msgid = USRSOCK_MESSAGE_RESPONSE_DATA_ACK;
   ack->reqack.head.flags = 0;
@@ -372,7 +373,7 @@ static int usrsock_rpmsg_sendto_handler(struct rpmsg_endpoint *ept,
 }
 
 static int usrsock_rpmsg_recvfrom_handler(struct rpmsg_endpoint *ept,
-                                          void *data, size_t len,
+                                          void *data, size_t len_,
                                           uint32_t src, void *priv_)
 {
   struct usrsock_request_recvfrom_s *req = data;
@@ -382,6 +383,7 @@ static int usrsock_rpmsg_recvfrom_handler(struct rpmsg_endpoint *ept,
   socklen_t inaddrlen = req->max_addrlen;
   size_t buflen = req->max_buflen;
   ssize_t ret = -EBADF;
+  uint32_t len;
   int retr;
 
   ack = rpmsg_get_tx_payload_buffer(ept, &len, true);
@@ -434,7 +436,7 @@ static int usrsock_rpmsg_setsockopt_handler(struct rpmsg_endpoint *ept,
 }
 
 static int usrsock_rpmsg_getsockopt_handler(struct rpmsg_endpoint *ept,
-                                            void *data, size_t len,
+                                            void *data, size_t len_,
                                             uint32_t src, void *priv_)
 {
   struct usrsock_request_getsockopt_s *req = data;
@@ -442,6 +444,7 @@ static int usrsock_rpmsg_getsockopt_handler(struct rpmsg_endpoint *ept,
   struct usrsock_rpmsg_s *priv = priv_;
   socklen_t optlen = req->max_valuelen;
   int ret = -EBADF;
+  uint32_t len;
 
   ack = rpmsg_get_tx_payload_buffer(ept, &len, true);
   if (req->usockid >= 0 && req->usockid < CONFIG_NSOCKET_DESCRIPTORS)
@@ -455,7 +458,7 @@ static int usrsock_rpmsg_getsockopt_handler(struct rpmsg_endpoint *ept,
 }
 
 static int usrsock_rpmsg_getsockname_handler(struct rpmsg_endpoint *ept,
-                                             void *data, size_t len,
+                                             void *data, size_t len_,
                                              uint32_t src, void *priv_)
 {
   struct usrsock_request_getsockname_s *req = data;
@@ -464,6 +467,7 @@ static int usrsock_rpmsg_getsockname_handler(struct rpmsg_endpoint *ept,
   socklen_t outaddrlen = req->max_addrlen;
   socklen_t inaddrlen = req->max_addrlen;
   int ret = -EBADF;
+  uint32_t len;
 
   ack = rpmsg_get_tx_payload_buffer(ept, &len, true);
   if (req->usockid >= 0 && req->usockid < CONFIG_NSOCKET_DESCRIPTORS)
@@ -477,7 +481,7 @@ static int usrsock_rpmsg_getsockname_handler(struct rpmsg_endpoint *ept,
 }
 
 static int usrsock_rpmsg_getpeername_handler(struct rpmsg_endpoint *ept,
-                                             void *data, size_t len,
+                                             void *data, size_t len_,
                                              uint32_t src, void *priv_)
 {
   struct usrsock_request_getpeername_s *req = data;
@@ -486,6 +490,7 @@ static int usrsock_rpmsg_getpeername_handler(struct rpmsg_endpoint *ept,
   socklen_t outaddrlen = req->max_addrlen;
   socklen_t inaddrlen = req->max_addrlen;
   int ret = -EBADF;
+  uint32_t len;
 
   ack = rpmsg_get_tx_payload_buffer(ept, &len, true);
   if (req->usockid >= 0 && req->usockid < CONFIG_NSOCKET_DESCRIPTORS)
@@ -543,7 +548,7 @@ static int usrsock_rpmsg_listen_handler(struct rpmsg_endpoint *ept,
 }
 
 static int usrsock_rpmsg_accept_handler(struct rpmsg_endpoint *ept,
-                                        void *data, size_t len,
+                                        void *data, size_t len_,
                                         uint32_t src, void *priv_)
 {
   struct usrsock_request_accept_s *req = data;
@@ -551,9 +556,10 @@ static int usrsock_rpmsg_accept_handler(struct rpmsg_endpoint *ept,
   struct usrsock_rpmsg_s *priv = priv_;
   socklen_t outaddrlen = req->max_addrlen;
   socklen_t inaddrlen = req->max_addrlen;
+  int ret = -EBADF;
+  uint32_t len;
   int i = 0;
   int retr;
-  int ret = -EBADF;
 
   ack = rpmsg_get_tx_payload_buffer(ept, &len, true);
   if (req->usockid >= 0 && req->usockid < CONFIG_NSOCKET_DESCRIPTORS)
@@ -618,13 +624,14 @@ static int usrsock_rpmsg_accept_handler(struct rpmsg_endpoint *ept,
 }
 
 static int usrsock_rpmsg_ioctl_handler(struct rpmsg_endpoint *ept,
-                                       void *data, size_t len,
+                                       void *data, size_t len_,
                                        uint32_t src, void *priv_)
 {
   struct usrsock_request_ioctl_s *req = data;
   struct usrsock_message_datareq_ack_s *ack;
   struct usrsock_rpmsg_s *priv = priv_;
   int ret = -EBADF;
+  uint32_t len;
 
   ack = rpmsg_get_tx_payload_buffer(ept, &len, true);
   if (req->usockid >= 0 && req->usockid < CONFIG_NSOCKET_DESCRIPTORS)


Mime
View raw message