Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
2f095050
Commit
2f095050
authored
Nov 12, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use void * for utf8_(l)?stat() as it hinders bug detection
parent
65b7318b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
15 deletions
+22
-15
include/charset.h
include/charset.h
+12
-2
include/vlc_symbols.h
include/vlc_symbols.h
+2
-2
modules/access/file.c
modules/access/file.c
+2
-5
src/misc/unicode.c
src/misc/unicode.c
+6
-6
No files found.
include/charset.h
View file @
2f095050
...
...
@@ -28,6 +28,11 @@
#include <stdarg.h>
#include <sys/types.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#else
struct
stat
{
};
#endif
# ifdef __cplusplus
extern
"C"
{
...
...
@@ -44,8 +49,13 @@ VLC_EXPORT( FILE *, utf8_fopen, ( const char *filename, const char *mode ) );
VLC_EXPORT
(
void
*
,
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
**
)
)
);
VLC_EXPORT
(
int
,
utf8_stat
,
(
const
char
*
filename
,
void
*
buf
)
);
VLC_EXPORT
(
int
,
utf8_lstat
,
(
const
char
*
filename
,
void
*
buf
)
);
#ifdef WIN32
# define stat _stati64
#endif
VLC_EXPORT
(
int
,
utf8_stat
,
(
const
char
*
filename
,
struct
stat
*
buf
)
);
VLC_EXPORT
(
int
,
utf8_lstat
,
(
const
char
*
filename
,
struct
stat
*
buf
)
);
VLC_EXPORT
(
int
,
utf8_mkdir
,
(
const
char
*
filename
)
);
VLC_EXPORT
(
int
,
utf8_vfprintf
,
(
FILE
*
stream
,
const
char
*
fmt
,
va_list
ap
)
);
...
...
include/vlc_symbols.h
View file @
2f095050
...
...
@@ -469,8 +469,8 @@ struct module_symbols_t
void
*
(
*
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
,
void
*
buf
);
int
(
*
utf8_lstat_inner
)
(
const
char
*
filename
,
void
*
buf
);
int
(
*
utf8_stat_inner
)
(
const
char
*
filename
,
struct
stat
*
buf
);
int
(
*
utf8_lstat_inner
)
(
const
char
*
filename
,
struct
stat
*
buf
);
char
*
(
*
FromLocaleDup_inner
)
(
const
char
*
);
int
(
*
utf8_mkdir_inner
)
(
const
char
*
filename
);
vlm_media_t
*
(
*
vlm_MediaSearch_inner
)
(
vlm_t
*
,
const
char
*
);
...
...
modules/access/file.c
View file @
2f095050
...
...
@@ -53,7 +53,6 @@
#if defined( WIN32 ) && !defined( UNDER_CE )
/* fstat() support for large files on win32 */
# define fstat(a,b) _fstati64(a,b)
# define FILESTAT _stati64
# ifdef lseek
# undef lseek
# endif
...
...
@@ -68,8 +67,6 @@
# undef lseek
# endif
# define lseek fseek
#else
# define FILESTAT stat
#endif
#include "charset.h"
...
...
@@ -169,7 +166,7 @@ static int Open( vlc_object_t *p_this )
fd
=
open_file
(
p_access
,
p_access
->
psz_path
);
#ifdef HAVE_SYS_STAT_H
struct
FILESTAT
st
;
struct
stat
st
;
while
(
fd
!=
-
1
)
{
...
...
@@ -302,7 +299,7 @@ static int Read( access_t *p_access, uint8_t *p_buffer, int i_len )
if
(
p_access
->
info
.
i_size
!=
0
&&
(
p_sys
->
i_nb_reads
%
INPUT_FSTAT_NB_READS
)
==
0
)
{
struct
FILESTAT
st
;
struct
stat
st
;
if
((
fstat
(
fd
,
&
st
)
==
0
)
&&
(
p_access
->
info
.
i_size
!=
st
.
st_size
))
...
...
src/misc/unicode.c
View file @
2f095050
...
...
@@ -518,7 +518,7 @@ int utf8_scandir( const char *dirname, char ***namelist,
}
static
int
utf8_statEx
(
const
char
*
filename
,
void
*
buf
,
static
int
utf8_statEx
(
const
char
*
filename
,
struct
stat
*
buf
,
vlc_bool_t
deref
)
{
#if defined (WIN32) || defined (UNDER_CE)
...
...
@@ -535,7 +535,7 @@ static int utf8_statEx( const char *filename, void *buf,
}
wpath
[
MAX_PATH
]
=
L'\0'
;
return
_wstati64
(
wpath
,
(
struct
_stati64
*
)
buf
);
return
_wstati64
(
wpath
,
buf
);
}
#endif
#ifdef HAVE_SYS_STAT_H
...
...
@@ -543,8 +543,8 @@ static int utf8_statEx( const char *filename, void *buf,
if
(
local_name
!=
NULL
)
{
int
res
=
deref
?
stat
(
local_name
,
(
struct
stat
*
)
buf
)
:
lstat
(
local_name
,
(
struct
stat
*
)
buf
);
int
res
=
deref
?
stat
(
local_name
,
buf
)
:
lstat
(
local_name
,
buf
);
LocaleFree
(
local_name
);
return
res
;
}
...
...
@@ -554,12 +554,12 @@ static int utf8_statEx( const char *filename, void *buf,
}
int
utf8_stat
(
const
char
*
filename
,
void
*
buf
)
int
utf8_stat
(
const
char
*
filename
,
struct
stat
*
buf
)
{
return
utf8_statEx
(
filename
,
buf
,
VLC_TRUE
);
}
int
utf8_lstat
(
const
char
*
filename
,
void
*
buf
)
int
utf8_lstat
(
const
char
*
filename
,
struct
stat
*
buf
)
{
return
utf8_statEx
(
filename
,
buf
,
VLC_FALSE
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment