[Asterisk-code-review] netsock2: compile fixes. (asterisk[13])

Joshua Colp asteriskteam at digium.com
Thu Mar 26 07:39:08 CDT 2020


Joshua Colp has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/13957 )

Change subject: netsock2: compile fixes.
......................................................................

netsock2: compile fixes.

This fixes ast_addressfamily_to_sockaddrsize to reference the
provided argument, and ast_sockaddr_from_sockaddr to not use the name of
a structure as argument.

Change-Id: Ibf5db469c47c3b4214edf8456326086174e8edd7
---
M include/asterisk/netsock2.h
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, approved; Approved for Submit
  Kevin Harwell: Looks good to me, but someone else must approve



diff --git a/include/asterisk/netsock2.h b/include/asterisk/netsock2.h
index 9e3c2fb..da1b799 100644
--- a/include/asterisk/netsock2.h
+++ b/include/asterisk/netsock2.h
@@ -754,7 +754,7 @@
  * \param family The AF_XXX value to determine the size of
  * \return Size of the applicable struct sockaddr.
  */
-#define ast_addressfamily_to_sockaddrsize(family) _ast_addressfamily_to_sockaddrsize(addr, __FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define ast_addressfamily_to_sockaddrsize(family) _ast_addressfamily_to_sockaddrsize(family, __FILE__, __LINE__, __PRETTY_FUNCTION__)
 static inline int _ast_addressfamily_to_sockaddrsize(int af, const char *file, int line, const char *func)
 {
 	switch (af) {
@@ -780,10 +780,10 @@
  * You can check for failure with ast_sockaddr_isnull.
  *
  * \param[out] addr The address of the ast_sockaddr to store into
- * \param sockaddr The sockaddr structure (sockaddr_in or sockaddr_in6) to convert
+ * \param sa The sockaddr structure (sockaddr_in or sockaddr_in6) to convert
  * \return Nothing
  */
-#define ast_sockaddr_from_sockaddr(addr,sockaddr)	ast_sockaddr_copy_sockaddr(addr, sockaddr, ast_addressfamily_to_sockaddrsize(((const struct sockaddr*)(sockaddr))->sa_family))
+#define ast_sockaddr_from_sockaddr(addr,sa)	ast_sockaddr_copy_sockaddr(addr, sa, ast_addressfamily_to_sockaddrsize(((const struct sockaddr*)(sa))->sa_family))
 
 /*@}*/
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13957
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: Ibf5db469c47c3b4214edf8456326086174e8edd7
Gerrit-Change-Number: 13957
Gerrit-PatchSet: 2
Gerrit-Owner: Jaco Kroon <jaco at uls.co.za>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200326/a3f6941b/attachment.html>


More information about the asterisk-code-review mailing list