Commit ff7206fa authored by Gildas Bazin's avatar Gildas Bazin

* ALL: portability fixes.

parent 5130db5c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* directory.c: expands a directory (directory: access plug-in) * directory.c: expands a directory (directory: access plug-in)
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: directory.c,v 1.5 2004/02/16 17:16:24 zorglub Exp $ * $Id: directory.c,v 1.6 2004/02/17 13:13:31 gbazin Exp $
* *
* Authors: Derk-Jan Hartman <thedj@users.sourceforge.net> * Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
* *
...@@ -101,7 +101,7 @@ vlc_module_begin(); ...@@ -101,7 +101,7 @@ vlc_module_begin();
add_shortcut( "dir" ); add_shortcut( "dir" );
add_string( "recursive", "expand" , NULL, RECURSIVE_TEXT, add_string( "recursive", "expand" , NULL, RECURSIVE_TEXT,
RECURSIVE_LONGTEXT, VLC_FALSE ); RECURSIVE_LONGTEXT, VLC_FALSE );
//change_string_list( psz_recursive_list, psz_recursive_list_text, 0 ); change_string_list( psz_recursive_list, psz_recursive_list_text, 0 );
set_callbacks( Open, Close ); set_callbacks( Open, Close );
vlc_module_end(); vlc_module_end();
...@@ -293,7 +293,15 @@ int ReadDir( input_thread_t *p_input, char *psz_name , int i_mode ) ...@@ -293,7 +293,15 @@ int ReadDir( input_thread_t *p_input, char *psz_name , int i_mode )
strcmp( p_dir_content->d_name, ".." ) && strcmp( p_dir_content->d_name, ".." ) &&
p_access_data->i_pos + i_size_entry < MAX_DIR_SIZE ) p_access_data->i_pos + i_size_entry < MAX_DIR_SIZE )
{ {
#if defined( DT_DIR )
if( p_dir_content->d_type == DT_DIR ) if( p_dir_content->d_type == DT_DIR )
#elif defined( S_ISDIR )
struct stat stat_data;
stat( psz_entry, &stat_data );
if( S_ISDIR(stat_data.st_mode) )
#else
if( 0 )
#endif
{ {
if( i_mode == MODE_NONE ) if( i_mode == MODE_NONE )
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* a52.c : raw A/52 stream input module for vlc * a52.c : raw A/52 stream input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: a52.c,v 1.4 2004/02/13 22:37:35 gbazin Exp $ * $Id: a52.c,v 1.5 2004/02/17 13:13:32 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -70,7 +70,7 @@ vlc_module_end(); ...@@ -70,7 +70,7 @@ vlc_module_end();
/***************************************************************************** /*****************************************************************************
* CheckSync: Check if buffer starts with an A52 sync code * CheckSync: Check if buffer starts with an A52 sync code
*****************************************************************************/ *****************************************************************************/
int CheckSync( uint8_t *p_peek, vlc_bool_t *p_big_endian ) static int CheckSync( uint8_t *p_peek, vlc_bool_t *p_big_endian )
{ {
/* Little endian version of the bitstream */ /* Little endian version of the bitstream */
if( p_peek[0] == 0x77 && p_peek[1] == 0x0b && if( p_peek[0] == 0x77 && p_peek[1] == 0x0b &&
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* dts.c : raw DTS stream input module for vlc * dts.c : raw DTS stream input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: dts.c,v 1.7 2004/02/08 16:48:11 gbazin Exp $ * $Id: dts.c,v 1.8 2004/02/17 13:13:32 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -64,7 +64,7 @@ vlc_module_end(); ...@@ -64,7 +64,7 @@ vlc_module_end();
/***************************************************************************** /*****************************************************************************
* CheckSync: Check if buffer starts with a DTS sync code * CheckSync: Check if buffer starts with a DTS sync code
*****************************************************************************/ *****************************************************************************/
int CheckSync( uint8_t *p_peek ) static int CheckSync( uint8_t *p_peek )
{ {
/* 14 bits, little endian version of the bitstream */ /* 14 bits, little endian version of the bitstream */
if( p_peek[0] == 0xff && p_peek[1] == 0x1f && if( p_peek[0] == 0xff && p_peek[1] == 0x1f &&
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* drms.c: DRMS * drms.c: DRMS
***************************************************************************** *****************************************************************************
* Copyright (C) 2004 VideoLAN * Copyright (C) 2004 VideoLAN
* $Id: drms.c,v 1.12 2004/01/26 17:15:40 jlj Exp $ * $Id: drms.c,v 1.13 2004/02/17 13:13:31 gbazin Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Sam Hocevar <sam@zoy.org> * Sam Hocevar <sam@zoy.org>
...@@ -145,7 +145,7 @@ static int GetUserKey ( void *, uint32_t * ); ...@@ -145,7 +145,7 @@ static int GetUserKey ( void *, uint32_t * );
static int GetSCIData ( char *, uint32_t **, uint32_t * ); static int GetSCIData ( char *, uint32_t **, uint32_t * );
static int HashSystemInfo ( uint32_t * ); static int HashSystemInfo ( uint32_t * );
static int GetiPodID ( long long * ); static int GetiPodID ( int64_t * );
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
/***************************************************************************** /*****************************************************************************
...@@ -756,7 +756,7 @@ static int GetSystemKey( uint32_t *p_sys_key, vlc_bool_t b_ipod ) ...@@ -756,7 +756,7 @@ static int GetSystemKey( uint32_t *p_sys_key, vlc_bool_t b_ipod )
static char const p_secret1[ 8 ] = "YuaFlafu"; static char const p_secret1[ 8 ] = "YuaFlafu";
static char const p_secret2[ 8 ] = "zPif98ga"; static char const p_secret2[ 8 ] = "zPif98ga";
struct md5_s md5; struct md5_s md5;
long long i_ipod_id; int64_t i_ipod_id;
uint32_t p_system_hash[ 4 ]; uint32_t p_system_hash[ 4 ];
/* Compute the MD5 hash of our system info */ /* Compute the MD5 hash of our system info */
...@@ -1116,8 +1116,6 @@ static int HashSystemInfo( uint32_t *p_system_hash ) ...@@ -1116,8 +1116,6 @@ static int HashSystemInfo( uint32_t *p_system_hash )
struct md5_s md5; struct md5_s md5;
int i_ret = 0; int i_ret = 0;
InitMD5( &md5 );
#ifdef WIN32 #ifdef WIN32
HKEY i_key; HKEY i_key;
unsigned int i; unsigned int i;
...@@ -1143,6 +1141,8 @@ static int HashSystemInfo( uint32_t *p_system_hash ) ...@@ -1143,6 +1141,8 @@ static int HashSystemInfo( uint32_t *p_system_hash )
} }
}; };
InitMD5( &md5 );
AddMD5( &md5, "cache-control", 13 ); AddMD5( &md5, "cache-control", 13 );
AddMD5( &md5, "Ethernet", 8 ); AddMD5( &md5, "Ethernet", 8 );
...@@ -1183,6 +1183,7 @@ static int HashSystemInfo( uint32_t *p_system_hash ) ...@@ -1183,6 +1183,7 @@ static int HashSystemInfo( uint32_t *p_system_hash )
} }
#else #else
InitMD5( &md5 );
i_ret = -1; i_ret = -1;
#endif #endif
...@@ -1197,7 +1198,7 @@ static int HashSystemInfo( uint32_t *p_system_hash ) ...@@ -1197,7 +1198,7 @@ static int HashSystemInfo( uint32_t *p_system_hash )
***************************************************************************** *****************************************************************************
* This function gets the iPod ID. * This function gets the iPod ID.
*****************************************************************************/ *****************************************************************************/
static int GetiPodID( long long *p_ipod_id ) static int GetiPodID( int64_t *p_ipod_id )
{ {
int i_ret = -1; int i_ret = -1;
...@@ -1241,7 +1242,7 @@ static int GetiPodID( long long *p_ipod_id ) ...@@ -1241,7 +1242,7 @@ static int GetiPodID( long long *p_ipod_id )
{ {
if( CFGetTypeID( value ) == CFNumberGetTypeID() ) if( CFGetTypeID( value ) == CFNumberGetTypeID() )
{ {
long long i_ipod_id; int64_t i_ipod_id;
CFNumberGetValue( (CFNumberRef)value, CFNumberGetValue( (CFNumberRef)value,
kCFNumberLongLongType, kCFNumberLongLongType,
&i_ipod_id ); &i_ipod_id );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ts.c: MPEG-II TS Muxer * ts.c: MPEG-II TS Muxer
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: ts.c,v 1.43 2004/01/30 17:53:05 fenrir Exp $ * $Id: ts.c,v 1.44 2004/02/17 13:13:31 gbazin Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org> * Eric Petit <titer@videolan.org>
...@@ -389,9 +389,16 @@ static int Open( vlc_object_t *p_this ) ...@@ -389,9 +389,16 @@ static int Open( vlc_object_t *p_this )
} }
else else
{ {
uint64_t i_ck = strtoll( val, NULL, 16 ); /* Avoid using strtoll */
uint8_t ck[8]; uint64_t i_ck;
int i; uint8_t ck[8];
int i;
ck[0] = val[8];
val[8] = 0;
i_ck = strtol( val, NULL, 16 ) << 32;
val[8] = ck[0];
i_ck += strtol( &val[8], NULL, 16 );
for( i = 0; i < 8; i++ ) for( i = 0; i < 8; i++ )
{ {
ck[i] = ( i_ck >> ( 56 - 8*i) )&0xff; ck[i] = ( i_ck >> ( 56 - 8*i) )&0xff;
......
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