diff --git a/include/share/compat.h b/include/share/compat.h index 7ef27550..1857c652 100644 --- a/include/share/compat.h +++ b/include/share/compat.h @@ -172,10 +172,10 @@ #endif #ifdef _WIN32 -#define _flac_stat _stat64 /* stat struct */ +#define flac_stat_s _stat64 /* stat struct */ #define flac_fstat _fstat64 #else -#define _flac_stat stat /* stat struct */ +#define flac_stat_s stat /* stat struct */ #define flac_fstat fstat #endif diff --git a/src/flac/encode.c b/src/flac/encode.c index 9e2cb77c..8769f604 100644 --- a/src/flac/encode.c +++ b/src/flac/encode.c @@ -2800,7 +2800,7 @@ FLAC__bool read_sane_extended(FILE *f, FLAC__uint32 *val, const char *fn) FLAC__bool fskip_ahead(FILE *f, FLAC__uint64 offset) { static unsigned char dump[8192]; - struct _flac_stat stb; + struct flac_stat_s stb; if(flac_fstat(fileno(f), &stb) == 0 && (stb.st_mode & S_IFMT) == S_IFREG) { diff --git a/src/libFLAC/metadata_iterators.c b/src/libFLAC/metadata_iterators.c index 5e1bf880..e7a5a5dc 100644 --- a/src/libFLAC/metadata_iterators.c +++ b/src/libFLAC/metadata_iterators.c @@ -118,8 +118,8 @@ static FLAC__bool open_tempfile_(const char *filename, const char *tempfile_path static FLAC__bool transport_tempfile_(const char *filename, FILE **tempfile, char **tempfilename, FLAC__Metadata_SimpleIteratorStatus *status); static void cleanup_tempfile_(FILE **tempfile, char **tempfilename); -static FLAC__bool get_file_stats_(const char *filename, struct _flac_stat *stats); -static void set_file_stats_(const char *filename, struct _flac_stat *stats); +static FLAC__bool get_file_stats_(const char *filename, struct flac_stat_s *stats); +static void set_file_stats_(const char *filename, struct flac_stat_s *stats); static int fseek_wrapper_(FLAC__IOHandle handle, FLAC__int64 offset, int whence); static FLAC__int64 ftell_wrapper_(FLAC__IOHandle handle); @@ -327,7 +327,7 @@ FLAC_API FLAC__bool FLAC__metadata_get_picture(const char *filename, FLAC__Strea struct FLAC__Metadata_SimpleIterator { FILE *file; char *filename, *tempfile_path_prefix; - struct _flac_stat stats; + struct flac_stat_s stats; FLAC__bool has_stats; FLAC__bool is_writable; FLAC__Metadata_SimpleIteratorStatus status; @@ -1630,7 +1630,7 @@ FLAC_API FLAC__bool FLAC__metadata_chain_check_if_tempfile_needed(FLAC__Metadata FLAC_API FLAC__bool FLAC__metadata_chain_write(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__bool preserve_file_stats) { - struct _flac_stat stats; + struct flac_stat_s stats; const char *tempfile_path_prefix = 0; FLAC__off_t current_length; @@ -3298,14 +3298,14 @@ void cleanup_tempfile_(FILE **tempfile, char **tempfilename) } } -FLAC__bool get_file_stats_(const char *filename, struct _flac_stat *stats) +FLAC__bool get_file_stats_(const char *filename, struct flac_stat_s *stats) { FLAC__ASSERT(0 != filename); FLAC__ASSERT(0 != stats); return (0 == flac_stat(filename, stats)); } -void set_file_stats_(const char *filename, struct _flac_stat *stats) +void set_file_stats_(const char *filename, struct flac_stat_s *stats) { struct utimbuf srctime; diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c index 753fd230..29e4469a 100644 --- a/src/libFLAC/stream_decoder.c +++ b/src/libFLAC/stream_decoder.c @@ -3342,7 +3342,7 @@ FLAC__StreamDecoderTellStatus file_tell_callback_(const FLAC__StreamDecoder *dec FLAC__StreamDecoderLengthStatus file_length_callback_(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data) { - struct _flac_stat filestats; + struct flac_stat_s filestats; (void)client_data; if(decoder->private_->file == stdin) diff --git a/src/share/grabbag/file.c b/src/share/grabbag/file.c index 601dba50..dd2880cb 100644 --- a/src/share/grabbag/file.c +++ b/src/share/grabbag/file.c @@ -50,7 +50,7 @@ void grabbag__file_copy_metadata(const char *srcpath, const char *destpath) { - struct _flac_stat srcstat; + struct flac_stat_s srcstat; struct utimbuf srctime; if(0 == flac_stat(srcpath, &srcstat)) { @@ -63,7 +63,7 @@ void grabbag__file_copy_metadata(const char *srcpath, const char *destpath) FLAC__off_t grabbag__file_get_filesize(const char *srcpath) { - struct _flac_stat srcstat; + struct flac_stat_s srcstat; if(0 == flac_stat(srcpath, &srcstat)) return srcstat.st_size; @@ -86,7 +86,7 @@ const char *grabbag__file_get_basename(const char *srcpath) FLAC__bool grabbag__file_change_stats(const char *filename, FLAC__bool read_only) { - struct _flac_stat stats; + struct flac_stat_s stats; if(0 == flac_stat(filename, &stats)) { #if !defined _MSC_VER && !defined __MINGW32__ @@ -145,7 +145,7 @@ FLAC__bool grabbag__file_are_same(const char *f1, const char *f2) CloseHandle(h2); return same; #else - struct _flac_stat s1, s2; + struct flac_stat_s s1, s2; return f1 && f2 && flac_stat(f1, &s1) == 0 && flac_stat(f2, &s2) == 0 && s1.st_ino == s2.st_ino && s1.st_dev == s2.st_dev; #endif } diff --git a/src/share/grabbag/replaygain.c b/src/share/grabbag/replaygain.c index ba6b98c9..43f1be0d 100644 --- a/src/share/grabbag/replaygain.c +++ b/src/share/grabbag/replaygain.c @@ -69,14 +69,14 @@ const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_ALBUM_GAIN = (const FLAC__byte const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_ALBUM_PEAK = (const FLAC__byte * const)"REPLAYGAIN_ALBUM_PEAK"; -static FLAC__bool get_file_stats_(const char *filename, struct _flac_stat *stats) +static FLAC__bool get_file_stats_(const char *filename, struct flac_stat_s *stats) { FLAC__ASSERT(0 != filename); FLAC__ASSERT(0 != stats); return (0 == flac_stat(filename, stats)); } -static void set_file_stats_(const char *filename, struct _flac_stat *stats) +static void set_file_stats_(const char *filename, struct flac_stat_s *stats) { FLAC__ASSERT(0 != filename); FLAC__ASSERT(0 != stats); @@ -478,7 +478,7 @@ static const char *store_to_file_pre_(const char *filename, FLAC__Metadata_Chain static const char *store_to_file_post_(const char *filename, FLAC__Metadata_Chain *chain, FLAC__bool preserve_modtime) { - struct _flac_stat stats; + struct flac_stat_s stats; const FLAC__bool have_stats = get_file_stats_(filename, &stats); (void)grabbag__file_change_stats(filename, /*read_only=*/false); diff --git a/src/test_libFLAC++/metadata_manip.cpp b/src/test_libFLAC++/metadata_manip.cpp index 54ed0997..8875dd04 100644 --- a/src/test_libFLAC++/metadata_manip.cpp +++ b/src/test_libFLAC++/metadata_manip.cpp @@ -258,14 +258,14 @@ bool transport_tempfile_(const char *filename, FILE **tempfile, char **tempfilen return true; } -bool get_file_stats_(const char *filename, struct _flac_stat *stats) +bool get_file_stats_(const char *filename, struct flac_stat_s *stats) { FLAC__ASSERT(0 != filename); FLAC__ASSERT(0 != stats); return (0 == flac_stat(filename, stats)); } -void set_file_stats_(const char *filename, struct _flac_stat *stats) +void set_file_stats_(const char *filename, struct flac_stat_s *stats) { struct utimbuf srctime; @@ -328,7 +328,7 @@ static bool write_chain_(FLAC::Metadata::Chain &chain, bool use_padding, bool pr callbacks.eof = chain_eof_cb_; if(chain.check_if_tempfile_needed(use_padding)) { - struct _flac_stat stats; + struct flac_stat_s stats; FILE *file, *tempfile; char *tempfilename; if(preserve_file_stats) { diff --git a/src/test_libFLAC/metadata_manip.c b/src/test_libFLAC/metadata_manip.c index a3e83e4b..f6fb73b5 100644 --- a/src/test_libFLAC/metadata_manip.c +++ b/src/test_libFLAC/metadata_manip.c @@ -243,14 +243,14 @@ static FLAC__bool transport_tempfile_(const char *filename, FILE **tempfile, cha return true; } -static FLAC__bool get_file_stats_(const char *filename, struct _flac_stat *stats) +static FLAC__bool get_file_stats_(const char *filename, struct flac_stat_s *stats) { FLAC__ASSERT(0 != filename); FLAC__ASSERT(0 != stats); return (0 == flac_stat(filename, stats)); } -static void set_file_stats_(const char *filename, struct _flac_stat *stats) +static void set_file_stats_(const char *filename, struct flac_stat_s *stats) { struct utimbuf srctime; @@ -313,7 +313,7 @@ static FLAC__bool write_chain_(FLAC__Metadata_Chain *chain, FLAC__bool use_paddi callbacks.eof = chain_eof_cb_; if(FLAC__metadata_chain_check_if_tempfile_needed(chain, use_padding)) { - struct _flac_stat stats; + struct flac_stat_s stats; FILE *file, *tempfile = 0; char *tempfilename; if(preserve_file_stats) { diff --git a/src/test_libs_common/file_utils_flac.c b/src/test_libs_common/file_utils_flac.c index af53f472..6642c83c 100644 --- a/src/test_libs_common/file_utils_flac.c +++ b/src/test_libs_common/file_utils_flac.c @@ -142,7 +142,7 @@ FLAC__bool file_utils__generate_flacfile(FLAC__bool is_ogg, const char *output_f FLAC__stream_encoder_delete(encoder); if(0 != output_filesize) { - struct _flac_stat filestats; + struct flac_stat_s filestats; if(flac_stat(output_filename, &filestats) != 0) return false; diff --git a/src/test_seeking/main.c b/src/test_seeking/main.c index 68935aa7..3dd707e4 100644 --- a/src/test_seeking/main.c +++ b/src/test_seeking/main.c @@ -93,7 +93,7 @@ static unsigned local_rand_(void) static FLAC__off_t get_filesize_(const char *srcpath) { - struct _flac_stat srcstat; + struct flac_stat_s srcstat; if(0 == flac_stat(srcpath, &srcstat)) return srcstat.st_size;