X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Ftest_libFLAC%2B%2B%2Fencoders.cpp;h=daa12f36d8a52df33f52ae0142e3cafbe0a19300;hb=f25b2602dce3c09098e3092bfad983e3ec7fdb4f;hp=32cf513f6a5155105081cd3742e22b4b7ccb5118;hpb=6497ce19770ec48d565f3a043cc74c9c389c7829;p=platform%2Fupstream%2Fflac.git diff --git a/src/test_libFLAC++/encoders.cpp b/src/test_libFLAC++/encoders.cpp index 32cf513..daa12f3 100644 --- a/src/test_libFLAC++/encoders.cpp +++ b/src/test_libFLAC++/encoders.cpp @@ -28,6 +28,7 @@ extern "C" { #include #include #include +#include "share/compat.h" typedef enum { LAYER_STREAM = 0, /* FLAC__stream_encoder_init_stream() without seeking */ @@ -131,7 +132,7 @@ public: { if(layer_==LAYER_STREAM) return ::FLAC__STREAM_ENCODER_SEEK_STATUS_UNSUPPORTED; - else if(fseek(file_, (long)absolute_byte_offset, SEEK_SET) < 0) + else if(fseeko(file_, (FLAC__off_t)absolute_byte_offset, SEEK_SET) < 0) return FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR; else return FLAC__STREAM_ENCODER_SEEK_STATUS_OK; @@ -139,10 +140,10 @@ public: ::FLAC__StreamEncoderTellStatus StreamEncoder::tell_callback(FLAC__uint64 *absolute_byte_offset) { - long pos; + FLAC__off_t pos; if(layer_==LAYER_STREAM) return ::FLAC__STREAM_ENCODER_TELL_STATUS_UNSUPPORTED; - else if((pos = ftell(file_)) < 0) + else if((pos = ftello(file_)) < 0) return FLAC__STREAM_ENCODER_TELL_STATUS_ERROR; else { *absolute_byte_offset = (FLAC__uint64)pos; @@ -478,11 +479,7 @@ static bool test_stream_encoder(Layer layer, bool is_ogg) printf("testing get_total_samples_estimate()... "); if(encoder->get_total_samples_estimate() != streaminfo_.data.stream_info.total_samples) { -#ifdef _MSC_VER - printf("FAILED, expected %I64u, got %I64u\n", streaminfo_.data.stream_info.total_samples, encoder->get_total_samples_estimate()); -#else - printf("FAILED, expected %llu, got %llu\n", (unsigned long long)streaminfo_.data.stream_info.total_samples, (unsigned long long)encoder->get_total_samples_estimate()); -#endif + printf("FAILED, expected %" PRIu64 ", got %" PRIu64 "\n", streaminfo_.data.stream_info.total_samples, encoder->get_total_samples_estimate()); return false; } printf("OK\n");