seek_barrage() has variable n of type long int (which is 32bit usually). Then we see something like n = (long int)total_samples; So, why n has type long int, and not FLAC__int64 or some other 64-bit type?
Erik de Castro Lopo
2016-Feb-01 00:09 UTC
[flac-dev] question about src/test_seeking.c - seek_barrage()
lvqcl wrote:> seek_barrage() has variable n of type long int (which is 32bit usually).Thats true on Windows, but on both 32 and 64 bit linux sizeof (long int) is 8.> Then we see something like > > n = (long int)total_samples; > > So, why n has type long int, and not FLAC__int64 or some other 64-bit type?If I was writing FLAC from scratch now, I would not define any of these FLAC_intXX types and just use the standard <stdint.h> types. Since this `n` variable is not part of the public API, I would use int64_t. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
Brian Willoughby
2016-Feb-01 01:46 UTC
[flac-dev] question about src/test_seeking.c - seek_barrage()
Agreed. Although there wasn't a universal standard when FLAC was started, it sure seems like int64_t and related types are available on all systems these days. Either FLAC__intXX or intXX_t are better than the old types, like byte, word, dword, quadword, or whatever. Brian On Jan 31, 2016, at 4:09 PM, Erik de Castro Lopo <mle+la at mega-nerd.com> wrote:> If I was writing FLAC from scratch now, I would not define any of these > FLAC_intXX types and just use the standard <stdint.h> types. > > Since this `n` variable is not part of the public API, I would use int64_t. > > Erik