Ozkan Sezer
2017-Jan-14 08:10 UTC
[flac-dev] unsigned int and FLAC__uint32 are used interchangeably
On 1/14/17, Erik de Castro Lopo <mle+la at mega-nerd.com> wrote:> Ozkan Sezer wrote: > >> > Ozkan Sezer wrote: >> > >> >> unsigned int and FLAC__uint32 are used interchangeably, leading to >> >> warnings with platforms (e.g. djgpp) where int32_t is long: >> > >> > Is `sizeof int == 4` though? >> >> Yes, obviously it is > > Well I've just pushed a patch that purges the code base of `unsigned`. > Please test and let us know how it goes.Well, the commit seems like overkill :) not all the unsigned needed converting. And build fails : format.c:53: error: conflicting types for 'FLAC__STREAM_SYNC' ../../include/FLAC/format.h:176: error: previous declaration of 'FLAC__STREAM_SYNC' was here [many others follow]
lvqcl
2017-Jan-14 22:14 UTC
[flac-dev] unsigned int and FLAC__uint32 are used interchangeably
Ozkan Sezer wrote:> Well, the commit seems like overkill :) not all the unsigned needed > converting. > > And build fails : > format.c:53: error: conflicting types for 'FLAC__STREAM_SYNC' > ../../include/FLAC/format.h:176: error: previous declaration of > 'FLAC__STREAM_SYNC' was here > [many others follow]Also MSVC fails because src/libFLAC/include/private/bitmath.h now contains "uint32_t long idx" instead of "unsigned long idx". According to MSDN _BitScanReverse*() functions have signatures: unsigned char _BitScanReverse(unsigned long *, unsigned long); unsigned char _BitScanReverse64(unsigned long *, unsigned __int64); Other than that, it compiles everything without errors.
Erik de Castro Lopo
2017-Jan-15 01:23 UTC
[flac-dev] unsigned int and FLAC__uint32 are used interchangeably
lvqcl wrote:> Also MSVC fails because src/libFLAC/include/private/bitmath.h now > contains "uint32_t long idx" instead of "unsigned long idx".Ah, missed that because it was MSVC code. They should be `uint64_t`.> According to MSDN _BitScanReverse*() functions have signatures: > unsigned char _BitScanReverse(unsigned long *, unsigned long); > unsigned char _BitScanReverse64(unsigned long *, unsigned __int64);The `unsigned long` type should be synonymous with `uint64_t` so using `uint64_t` should be safe. Furthermore if they aren't synonymous we *want* that to be a compile error!> Other than that, it compiles everything without errors.Thanks! Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
Erik de Castro Lopo
2017-Jan-15 01:26 UTC
[flac-dev] unsigned int and FLAC__uint32 are used interchangeably
Ozkan Sezer wrote:> Well, the commit seems like overkill :) not all the unsigned needed > converting.Not all of them *needed( converting, but afaiac this makes the code base better. I never liked the way the original C standard allowed the use of `unsigned` alone as type. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
lvqcl
2017-Jan-15 09:53 UTC
[flac-dev] unsigned int and FLAC__uint32 are used interchangeably
Erik de Castro Lopo wrote:> Not all of them *needed( converting, but afaiac this makes the code > base better. I never liked the way the original C standard allowed > the use of `unsigned` alone as type.These recent updates broke MSVC 2005 (and probably 2008) builds because they don't have <stdint.h> and all these [u]intNN_t types. A possible solution is to move their definition from share/compat.h into FLAC/ordinals.h. After all, this file already has this ifdef: #if defined(_MSC_VER) && _MSC_VER < 1600 ...and also to revert back src\share\getopt\getopt.c. After all, its coding style is EXTREMELY old and imho it won't benefit much from 'unsigned int' -> 'uint32_t' replacement.
Seemingly Similar Threads
- unsigned int and FLAC__uint32 are used interchangeably
- unsigned int and FLAC__uint32 are used interchangeably
- New routine: FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_16
- unsigned int and FLAC__uint32 are used interchangeably
- unsigned int and FLAC__uint32 are used interchangeably