]> git.sesse.net Git - vlc/commitdiff
* all: compilation fix with vc7.1 compiler, and removed a bunch of warnings (there...
authorCyril Deguet <asmax@videolan.org>
Sun, 17 Jul 2005 21:21:04 +0000 (21:21 +0000)
committerCyril Deguet <asmax@videolan.org>
Sun, 17 Jul 2005 21:21:04 +0000 (21:21 +0000)
include/network.h
include/vlc_common.h
src/input/var.c
src/libvlc.c
src/misc/getaddrinfo.c
src/misc/net.c
src/stream_output/acl.c
src/stream_output/sap.c

index ed79473473487eb716bff07f2abfa4e8434f0b6f..2aeb2a3787321d90bc4ad69e862627ccc253b151 100644 (file)
@@ -30,6 +30,7 @@
 #   include <winsock.h>
 #elif defined( WIN32 )
 #   include <winsock2.h>
+#   include <ws2tcpip.h>
 #elif HAVE_SYS_SOCKET_H
 #   include <sys/socket.h>
 #endif
index 539cb1072d4fa6fe23ec575212ecbdaf17c5dde8..158122b282d98c316d5351f9a80dcd5a67bbb28b 100644 (file)
@@ -536,7 +536,7 @@ static int64_t GCD( int64_t a, int64_t b )
 }
 
 /* Dynamic array handling: realloc array, move data, increment position */
-#if defined( _MSC_VER )
+#if defined( _MSC_VER ) && _MSC_VER < 1300
 #   define VLCCVP (void**) /* Work-around for broken compiler */
 #else
 #   define VLCCVP
index f2fcd15c51f0abc8bc9ba991e22c7c5eb73e3c0e..4b61f4447263088cf246dc93b432f7232efad09a 100644 (file)
@@ -475,8 +475,6 @@ static int RateCallback( vlc_object_t *p_this, char const *psz_cmd,
                          vlc_value_t oldval, vlc_value_t newval, void *p_data )
 {
     input_thread_t *p_input = (input_thread_t*)p_this;
-    vlc_value_t val;
-    int i_rate;
 
     /* Problem with this way: the "rate" variable is update after the input thread do the change */
     if( !strcmp( psz_cmd, "rate-slower" ) )
index 97906f6eb6fd4a8715cd01c9e9ab220243da7fc9..31932deb0bc7f64fe96fd4fbb07384210f3e84cb 100644 (file)
@@ -247,12 +247,14 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
     char *       psz_modules;
     char *       psz_parser;
     char *       psz_control;
-    char *       psz_language;
     vlc_bool_t   b_exit = VLC_FALSE;
     vlc_t *      p_vlc = vlc_current_object( i_object );
     module_t    *p_help_module;
     playlist_t  *p_playlist;
     vlc_value_t  val;
+#ifndef WIN32
+    char *       psz_language;
+#endif
 
     if( !p_vlc )
     {
@@ -2034,7 +2036,7 @@ static void Usage( vlc_t *p_this, char const *psz_module_name )
             char *psz_text, *psz_spaces = psz_spaces_text;
             char *psz_bra = NULL, *psz_type = NULL, *psz_ket = NULL;
             char *psz_suf = "", *psz_prefix = NULL;
-            int i;
+            size_t i;
 
             /* Skip deprecated options */
             if( p_item->psz_current )
@@ -2167,10 +2169,10 @@ static void Usage( vlc_t *p_this, char const *psz_module_name )
             while( *psz_text )
             {
                 char *psz_parser, *psz_word;
-                int i_end = strlen( psz_text );
+                size_t i_end = strlen( psz_text );
 
                 /* If the remaining text fits in a line, print it. */
-                if( i_end <= i_width )
+                if( i_end <= (size_t)i_width )
                 {
                     fprintf( stdout, "%s\n", psz_text );
                     break;
index 157a292754b6554446aeb237bfa20b629a1c07de..6002a4ec5961ce9b60f76c662d5939087d3be5e8 100644 (file)
@@ -500,6 +500,16 @@ int vlc_getnameinfo( const struct sockaddr *sa, int salen,
 {
     char psz_servbuf[6], *psz_serv;
     int i_servlen, i_val;
+#ifdef WIN32
+    /*
+     * Here is the kind of kludge you need to keep binary compatibility among
+     * varying OS versions...
+     */
+    typedef int (CALLBACK * GETNAMEINFO) ( const struct sockaddr*, socklen_t,
+                                           char*, DWORD, char*, DWORD, int );
+    HINSTANCE wship6_module;
+    GETNAMEINFO ws2_getnameinfo;
+#endif
 
     flags |= NI_NUMERICSERV;
     if( portnum != NULL )
@@ -512,16 +522,7 @@ int vlc_getnameinfo( const struct sockaddr *sa, int salen,
         psz_serv = NULL;
         i_servlen = 0;
     }
-#ifdef WIN32
-    /*
-     * Here is the kind of kludge you need to keep binary compatibility among
-     * varying OS versions...
-     */
-    typedef int (CALLBACK * GETNAMEINFO) ( const struct sockaddr*, socklen_t,
-                                           char*, DWORD, char*, DWORD, int );
-    HINSTANCE wship6_module;
-    GETNAMEINFO ws2_getnameinfo;
-     
+#ifdef WIN32    
     wship6_module = LoadLibrary( "wship6.dll" );
     if( wship6_module != NULL )
     {
@@ -554,7 +555,7 @@ int vlc_getnameinfo( const struct sockaddr *sa, int salen,
          * gethostbyaddr and the likes */
         vlc_mutex_lock( lock.p_address );
 #else
-# warning FIXME : This is not thread-safe!
+//# warning FIXME : This is not thread-safe!
 #endif
         i_val = __getnameinfo( sa, salen, host, hostlen, psz_serv, i_servlen,
                                flags );
index 774e52bdaa6509a0a23720f449a128f5025a7c3b..ddd7086c25106fe75e60dcc8e7eecb0ed602afb0 100644 (file)
@@ -42,6 +42,7 @@
 #   if defined(UNDER_CE) && defined(sockaddr_storage)
 #       undef sockaddr_storage
 #   endif
+#   include <io.h>
 #   include <winsock2.h>
 #   include <ws2tcpip.h>
 #else
@@ -128,8 +129,8 @@ static int net_Socket( vlc_object_t *p_this, int i_family, int i_socktype,
     if( i_family == AF_INET6 )
     {
         i_val = PROTECTION_LEVEL_UNRESTRICTED;
-        setsockopt( fd, IPPROTO_IPV6, IPV6_PROTECTION_LEVEL, &i_val,
-                    sizeof( i_val ) );
+        setsockopt( fd, IPPROTO_IPV6, IPV6_PROTECTION_LEVEL,
+                   (const char*)&i_val, sizeof( i_val ) );
     }
 # else
 # warning You are using outdated headers for Winsock !
index edb29cc0928a0111442d7056f543b4422e552f57..a58e111847ceaf4c69d570c4e059ab72b1a268b3 100644 (file)
@@ -66,7 +66,7 @@ struct vlc_acl_t
 static int ACL_Resolve( vlc_object_t *p_this, uint8_t *p_bytes,
                         const char *psz_ip )
 {
-    struct addrinfo hints = { }, *res;
+    struct addrinfo hints, *res;
     int i_family;
 
     hints.ai_socktype = SOCK_STREAM; /* doesn't matter */
index 279821fbaca3c3243e601d514177ac93e1ece136..22ad07fe8b399d235b943228013808c5325af44e 100644 (file)
@@ -352,7 +352,7 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
         p_method->psz_address = strdup( psz_addr );
     }
     else
-        b_ipv6 == (strchr( p_method->psz_address, ':' ) != NULL);
+        b_ipv6 = (strchr( p_method->psz_address, ':' ) != NULL);
 
     msg_Dbg( p_sap, "using SAP address: %s", p_method->psz_address);