[vlc-devel] [PATCH] modules: cache: use the same type for reading and writing

Rémi Denis-Courmont remi at remlab.net
Tue Oct 11 23:12:35 CEST 2016


Le mardi 11 octobre 2016, 18:32:47 Steve Lhomme a écrit :
> On Tue, Oct 11, 2016 at 3:23 PM, Rémi Denis-Courmont <remi at remlab.net> 
wrote:
> > Le mardi 11 octobre 2016, 12:12:29 Steve Lhomme a écrit :
> >> sizeof() is used to know the size to read and write. On Windows the stat
> >> struct is not using the same types that are used for writing.
> > 
> > They are the same. module_cache_t specifically defines them to the same
> > underlying type as struct stat.
> 
> static_assert( sizeof( st.st_size ) == sizeof( cache->size ), "off_t
> mismatch" );
> fails for me with the Windows Kit SDK.

VLC has required 64-bits file offsets since before I even started using it. 
lseek() is the most obvious concern here. Sorry but deal with it.

The (de)merits of using operating system types rather than fixed size types for 
(de)serialization could be discussed. But in that respect, your patch seems to 
make things worse rather than better.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list