tcp: Explicitly convert a pointer to a boolean integer
authorMartin Storsjö <martin@martin.st>
Mon, 9 Sep 2013 08:28:14 +0000 (11:28 +0300)
committerMartin Storsjö <martin@martin.st>
Mon, 9 Sep 2013 20:57:04 +0000 (23:57 +0300)
This fixes warnings about making integers from pointers without
a cast, and avoids the theoretical case where the lower 32 bits of
the pointer would all be zero where the implicit cast wouldn't give
the right result.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/tcp.c

index 39065aa..cbd5142 100644 (file)
@@ -100,7 +100,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
         }
     } else {
         if ((ret = ff_listen_connect(fd, cur_ai->ai_addr, cur_ai->ai_addrlen,
-                                     timeout * 100, h, cur_ai->ai_next)) < 0) {
+                                     timeout * 100, h, !!cur_ai->ai_next)) < 0) {
 
             if (ret == AVERROR_EXIT)
                 goto fail1;