mirror of https://code.videolan.org/videolan/vlc
filesystem: constify vlc_readdir()
This commit is contained in:
parent
3244a74480
commit
4a9766d288
|
@ -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 ** ) );
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue