filesystem: constify vlc_readdir()

This commit is contained in:
Rémi Denis-Courmont 2015-08-24 18:10:20 +03:00
parent 3244a74480
commit 4a9766d288
5 changed files with 6 additions and 5 deletions

View File

@ -173,7 +173,7 @@ VLC_API DIR *vlc_opendir(const char *dirname) VLC_USED;
* If there are no more entries in the directory, NULL is returned.
* If an error occurs, errno is set and NULL is returned.
*/
VLC_API char *vlc_readdir(DIR *dir) VLC_USED;
VLC_API const char *vlc_readdir(DIR *dir) VLC_USED;
VLC_API int vlc_loaddir( DIR *dir, char ***namelist, int (*select)( const char * ), int (*compar)( const char **, const char ** ) );
VLC_API int vlc_scandir( const char *dirname, char ***namelist, int (*select)( const char * ), int (*compar)( const char **, const char ** ) );

View File

@ -439,7 +439,8 @@ static void AllocatePluginDir (module_bank_t *bank, unsigned maxdepth,
/* Parse the directory and try to load all files it contains. */
for (;;)
{
char *file = vlc_readdir (dh), *relpath = NULL, *abspath = NULL;
char *relpath = NULL, *abspath = NULL;
const char *file = vlc_readdir (dh);
if (file == NULL)
break;

View File

@ -109,7 +109,7 @@ DIR *vlc_opendir (const char *dirname)
return dir;
}
char *vlc_readdir( DIR *dir )
const char *vlc_readdir(DIR *dir)
{
/* Beware that readdir_r() assumes <buf> is large enough to hold the result
* dirent including the file name. A buffer overflow could occur otherwise.

View File

@ -107,7 +107,7 @@ DIR *vlc_opendir (const char *dirname)
return opendir (dirname);
}
char *vlc_readdir( DIR *dir )
const char *vlc_readdir(DIR *dir)
{
struct dirent *ent = readdir (dir);
return (ent != NULL) ? ent->d_name : NULL;

View File

@ -169,7 +169,7 @@ DIR *vlc_opendir (const char *dirname)
return (void *)p_dir;
}
char *vlc_readdir (DIR *dir)
const char *vlc_readdir (DIR *dir)
{
vlc_DIR *p_dir = (vlc_DIR *)dir;