Return DIR from utf8_open to avoid casting bugs

This commit is contained in:
Rémi Denis-Courmont 2006-11-21 20:42:33 +00:00
parent a46cc88f28
commit b8ddca0134
3 changed files with 4 additions and 3 deletions

View File

@ -27,6 +27,7 @@
#include <stdarg.h>
#include <sys/types.h>
#include <dirent.h>
VLC_EXPORT( void, LocaleFree, ( const char * ) );
VLC_EXPORT( char *, FromLocale, ( const char * ) );
@ -35,7 +36,7 @@ VLC_EXPORT( char *, ToLocale, ( const char * ) );
VLC_EXPORT( int, utf8_open, ( const char *filename, int flags, mode_t mode ) );
VLC_EXPORT( FILE *, utf8_fopen, ( const char *filename, const char *mode ) );
VLC_EXPORT( void *, utf8_opendir, ( const char *dirname ) );
VLC_EXPORT( DIR *, utf8_opendir, ( const char *dirname ) );
VLC_EXPORT( char *, utf8_readdir, ( void *dir ) );
VLC_EXPORT( int, utf8_scandir, ( const char *dirname, char ***namelist, int (*select)( const char * ), int (*compar)( const char **, const char ** ) ) );

View File

@ -466,7 +466,7 @@ struct module_symbols_t
void *vlc_HashInsert_deprecated;
void *vlc_HashLookup_deprecated;
void *vlc_HashRetrieve_deprecated;
void * (*utf8_opendir_inner) (const char *dirname);
DIR * (*utf8_opendir_inner) (const char *dirname);
FILE * (*utf8_fopen_inner) (const char *filename, const char *mode);
char * (*utf8_readdir_inner) (void *dir);
int (*utf8_stat_inner) (const char *filename, struct stat *buf);

View File

@ -427,7 +427,7 @@ int utf8_mkdir( const char *dirname )
}
void *utf8_opendir( const char *dirname )
DIR *utf8_opendir( const char *dirname )
{
/* TODO: support for WinNT non-ACP filenames */
const char *local_name = ToLocale( dirname );