Commit 2c1edcf1 authored by Cyril Deguet's avatar Cyril Deguet
Browse files

* all: compilation fix with vc7.1 compiler, and removed a bunch of warnings...

* all: compilation fix with vc7.1 compiler, and removed a bunch of warnings (there are still many warnings about size_t/int mismatch though...)
parent 80ee9c71
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
# include <winsock.h> # include <winsock.h>
#elif defined( WIN32 ) #elif defined( WIN32 )
# include <winsock2.h> # include <winsock2.h>
# include <ws2tcpip.h>
#elif HAVE_SYS_SOCKET_H #elif HAVE_SYS_SOCKET_H
# include <sys/socket.h> # include <sys/socket.h>
#endif #endif
......
...@@ -536,7 +536,7 @@ static int64_t GCD( int64_t a, int64_t b ) ...@@ -536,7 +536,7 @@ static int64_t GCD( int64_t a, int64_t b )
} }
/* Dynamic array handling: realloc array, move data, increment position */ /* 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 */ # define VLCCVP (void**) /* Work-around for broken compiler */
#else #else
# define VLCCVP # define VLCCVP
......
...@@ -475,8 +475,6 @@ static int RateCallback( vlc_object_t *p_this, char const *psz_cmd, ...@@ -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 ) vlc_value_t oldval, vlc_value_t newval, void *p_data )
{ {
input_thread_t *p_input = (input_thread_t*)p_this; 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 */ /* Problem with this way: the "rate" variable is update after the input thread do the change */
if( !strcmp( psz_cmd, "rate-slower" ) ) if( !strcmp( psz_cmd, "rate-slower" ) )
......
...@@ -247,12 +247,14 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] ) ...@@ -247,12 +247,14 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
char * psz_modules; char * psz_modules;
char * psz_parser; char * psz_parser;
char * psz_control; char * psz_control;
char * psz_language;
vlc_bool_t b_exit = VLC_FALSE; vlc_bool_t b_exit = VLC_FALSE;
vlc_t * p_vlc = vlc_current_object( i_object ); vlc_t * p_vlc = vlc_current_object( i_object );
module_t *p_help_module; module_t *p_help_module;
playlist_t *p_playlist; playlist_t *p_playlist;
vlc_value_t val; vlc_value_t val;
#ifndef WIN32
char * psz_language;
#endif
if( !p_vlc ) if( !p_vlc )
{ {
...@@ -2034,7 +2036,7 @@ static void Usage( vlc_t *p_this, char const *psz_module_name ) ...@@ -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_text, *psz_spaces = psz_spaces_text;
char *psz_bra = NULL, *psz_type = NULL, *psz_ket = NULL; char *psz_bra = NULL, *psz_type = NULL, *psz_ket = NULL;
char *psz_suf = "", *psz_prefix = NULL; char *psz_suf = "", *psz_prefix = NULL;
int i; size_t i;
/* Skip deprecated options */ /* Skip deprecated options */
if( p_item->psz_current ) if( p_item->psz_current )
...@@ -2167,10 +2169,10 @@ static void Usage( vlc_t *p_this, char const *psz_module_name ) ...@@ -2167,10 +2169,10 @@ static void Usage( vlc_t *p_this, char const *psz_module_name )
while( *psz_text ) while( *psz_text )
{ {
char *psz_parser, *psz_word; 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 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 ); fprintf( stdout, "%s\n", psz_text );
break; break;
......
...@@ -500,6 +500,16 @@ int vlc_getnameinfo( const struct sockaddr *sa, int salen, ...@@ -500,6 +500,16 @@ int vlc_getnameinfo( const struct sockaddr *sa, int salen,
{ {
char psz_servbuf[6], *psz_serv; char psz_servbuf[6], *psz_serv;
int i_servlen, i_val; 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; flags |= NI_NUMERICSERV;
if( portnum != NULL ) if( portnum != NULL )
...@@ -513,15 +523,6 @@ int vlc_getnameinfo( const struct sockaddr *sa, int salen, ...@@ -513,15 +523,6 @@ int vlc_getnameinfo( const struct sockaddr *sa, int salen,
i_servlen = 0; i_servlen = 0;
} }
#ifdef WIN32 #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;
wship6_module = LoadLibrary( "wship6.dll" ); wship6_module = LoadLibrary( "wship6.dll" );
if( wship6_module != NULL ) if( wship6_module != NULL )
{ {
...@@ -554,7 +555,7 @@ int vlc_getnameinfo( const struct sockaddr *sa, int salen, ...@@ -554,7 +555,7 @@ int vlc_getnameinfo( const struct sockaddr *sa, int salen,
* gethostbyaddr and the likes */ * gethostbyaddr and the likes */
vlc_mutex_lock( lock.p_address ); vlc_mutex_lock( lock.p_address );
#else #else
# warning FIXME : This is not thread-safe! //# warning FIXME : This is not thread-safe!
#endif #endif
i_val = __getnameinfo( sa, salen, host, hostlen, psz_serv, i_servlen, i_val = __getnameinfo( sa, salen, host, hostlen, psz_serv, i_servlen,
flags ); flags );
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
# if defined(UNDER_CE) && defined(sockaddr_storage) # if defined(UNDER_CE) && defined(sockaddr_storage)
# undef sockaddr_storage # undef sockaddr_storage
# endif # endif
# include <io.h>
# include <winsock2.h> # include <winsock2.h>
# include <ws2tcpip.h> # include <ws2tcpip.h>
#else #else
...@@ -128,8 +129,8 @@ static int net_Socket( vlc_object_t *p_this, int i_family, int i_socktype, ...@@ -128,8 +129,8 @@ static int net_Socket( vlc_object_t *p_this, int i_family, int i_socktype,
if( i_family == AF_INET6 ) if( i_family == AF_INET6 )
{ {
i_val = PROTECTION_LEVEL_UNRESTRICTED; i_val = PROTECTION_LEVEL_UNRESTRICTED;
setsockopt( fd, IPPROTO_IPV6, IPV6_PROTECTION_LEVEL, &i_val, setsockopt( fd, IPPROTO_IPV6, IPV6_PROTECTION_LEVEL,
sizeof( i_val ) ); (const char*)&i_val, sizeof( i_val ) );
} }
# else # else
# warning You are using outdated headers for Winsock ! # warning You are using outdated headers for Winsock !
......
...@@ -66,7 +66,7 @@ struct vlc_acl_t ...@@ -66,7 +66,7 @@ struct vlc_acl_t
static int ACL_Resolve( vlc_object_t *p_this, uint8_t *p_bytes, static int ACL_Resolve( vlc_object_t *p_this, uint8_t *p_bytes,
const char *psz_ip ) const char *psz_ip )
{ {
struct addrinfo hints = { }, *res; struct addrinfo hints, *res;
int i_family; int i_family;
hints.ai_socktype = SOCK_STREAM; /* doesn't matter */ hints.ai_socktype = SOCK_STREAM; /* doesn't matter */
......
...@@ -352,7 +352,7 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap, ...@@ -352,7 +352,7 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
p_method->psz_address = strdup( psz_addr ); p_method->psz_address = strdup( psz_addr );
} }
else 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); msg_Dbg( p_sap, "using SAP address: %s", p_method->psz_address);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment