[vlc-commits] network: privatize net_SetPort()

Rémi Denis-Courmont git at videolan.org
Sun Nov 11 16:33:32 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Nov 10 11:32:47 2018 +0200| [a68ea2192463881007f8644c135abd2b289c7834] | committer: Rémi Denis-Courmont

network: privatize net_SetPort()

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a68ea2192463881007f8644c135abd2b289c7834
---

 include/vlc_network.h            | 15 ---------------
 modules/services_discovery/sap.c | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/include/vlc_network.h b/include/vlc_network.h
index 4e601fd75d..ab53b42dba 100644
--- a/include/vlc_network.h
+++ b/include/vlc_network.h
@@ -287,21 +287,6 @@ static inline int net_GetPeerAddress( int fd, char *address, int *port )
         ? VLC_EGENERIC : 0;
 }
 
-static inline void net_SetPort (struct sockaddr *addr, uint16_t port)
-{
-    switch (addr->sa_family)
-    {
-#ifdef AF_INET6
-        case AF_INET6:
-            ((struct sockaddr_in6 *)addr)->sin6_port = port;
-        break;
-#endif
-        case AF_INET:
-            ((struct sockaddr_in *)addr)->sin_port = port;
-        break;
-    }
-}
-
 VLC_API char *vlc_getProxyUrl(const char *);
 
 # ifdef __cplusplus
diff --git a/modules/services_discovery/sap.c b/modules/services_discovery/sap.c
index d33fa3e2bd..bd599b9e8e 100644
--- a/modules/services_discovery/sap.c
+++ b/modules/services_discovery/sap.c
@@ -1152,6 +1152,20 @@ static int ParseSDPConnection (const char *str, struct sockaddr_storage *addr,
     return 0;
 }
 
+static void net_SetPort(struct sockaddr *addr, uint16_t port)
+{
+    switch (addr->sa_family)
+    {
+#ifdef AF_INET6
+        case AF_INET6:
+            ((struct sockaddr_in6 *)addr)->sin6_port = port;
+        break;
+#endif
+        case AF_INET:
+            ((struct sockaddr_in *)addr)->sin_port = port;
+        break;
+    }
+}
 
 /***********************************************************************
  * ParseSDP : SDP parsing



More information about the vlc-commits mailing list