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

* 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 @@
# include <winsock.h>
#elif defined( WIN32 )
# include <winsock2.h>
# include <ws2tcpip.h>
#elif HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
......
......@@ -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
......
......@@ -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" ) )
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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 !
......
......@@ -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 */
......
......@@ -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);
......
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