]> git.sesse.net Git - vlc/blobdiff - src/network/udp.c
Avoid ?: GCC-ism
[vlc] / src / network / udp.c
index f063e2ffbbfd5a39b395117e87216ed9b0c24d15..f3e60981ab1f2d4e39babb83fd9e4ca1bc55d5bd 100644 (file)
@@ -151,7 +151,8 @@ static int net_ListenSingle (vlc_object_t *obj, const char *host, int port,
     if (host && !*host)
         host = NULL;
 
-    msg_Dbg (obj, "net: opening %s datagram port %d", host ?: "any", port);
+    msg_Dbg (obj, "net: opening %s datagram port %d",
+             host ? host : "any", port);
 
     int val = vlc_getaddrinfo (obj, host, port, &hints, &res);
     if (val)
@@ -166,7 +167,7 @@ static int net_ListenSingle (vlc_object_t *obj, const char *host, int port,
     for (const struct addrinfo *ptr = res; ptr != NULL; ptr = ptr->ai_next)
     {
         int fd = net_Socket (obj, ptr->ai_family, ptr->ai_socktype,
-                             protocol ?: ptr->ai_protocol);
+                             protocol ? protocol : ptr->ai_protocol);
         if (fd == -1)
         {
             msg_Dbg (obj, "socket error: %m");
@@ -662,7 +663,7 @@ int __net_ConnectDgram( vlc_object_t *p_this, const char *psz_host, int i_port,
     {
         char *str;
         int fd = net_Socket (p_this, ptr->ai_family, ptr->ai_socktype,
-                             proto ?: ptr->ai_protocol);
+                             proto ? proto : ptr->ai_protocol);
         if (fd == -1)
             continue;
 
@@ -773,7 +774,7 @@ int __net_OpenDgram( vlc_object_t *obj, const char *psz_bind, int i_bind,
     for (struct addrinfo *ptr = loc; ptr != NULL; ptr = ptr->ai_next)
     {
         int fd = net_Socket (obj, ptr->ai_family, ptr->ai_socktype,
-                             protocol ?: ptr->ai_protocol);
+                             protocol ? protocol : ptr->ai_protocol);
         if (fd == -1)
             continue; // usually, address family not supported