From: Cyril Deguet Date: Sun, 17 Jul 2005 21:21:04 +0000 (+0000) Subject: * all: compilation fix with vc7.1 compiler, and removed a bunch of warnings (there... X-Git-Tag: 0.8.4~1217 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=2c1edcf1f486e4f968e8fa499508c4b7b620e12e;p=vlc * all: compilation fix with vc7.1 compiler, and removed a bunch of warnings (there are still many warnings about size_t/int mismatch though...) --- diff --git a/include/network.h b/include/network.h index ed79473473..2aeb2a3787 100644 --- a/include/network.h +++ b/include/network.h @@ -30,6 +30,7 @@ # include #elif defined( WIN32 ) # include +# include #elif HAVE_SYS_SOCKET_H # include #endif diff --git a/include/vlc_common.h b/include/vlc_common.h index 539cb1072d..158122b282 100644 --- a/include/vlc_common.h +++ b/include/vlc_common.h @@ -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 diff --git a/src/input/var.c b/src/input/var.c index f2fcd15c51..4b61f44472 100644 --- a/src/input/var.c +++ b/src/input/var.c @@ -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" ) ) diff --git a/src/libvlc.c b/src/libvlc.c index 97906f6eb6..31932deb0b 100644 --- a/src/libvlc.c +++ b/src/libvlc.c @@ -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; diff --git a/src/misc/getaddrinfo.c b/src/misc/getaddrinfo.c index 157a292754..6002a4ec59 100644 --- a/src/misc/getaddrinfo.c +++ b/src/misc/getaddrinfo.c @@ -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 ); diff --git a/src/misc/net.c b/src/misc/net.c index 774e52bdaa..ddd7086c25 100644 --- a/src/misc/net.c +++ b/src/misc/net.c @@ -42,6 +42,7 @@ # if defined(UNDER_CE) && defined(sockaddr_storage) # undef sockaddr_storage # endif +# include # include # include #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 ! diff --git a/src/stream_output/acl.c b/src/stream_output/acl.c index edb29cc092..a58e111847 100644 --- a/src/stream_output/acl.c +++ b/src/stream_output/acl.c @@ -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 */ diff --git a/src/stream_output/sap.c b/src/stream_output/sap.c index 279821fbac..22ad07fe8b 100644 --- a/src/stream_output/sap.c +++ b/src/stream_output/sap.c @@ -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);