From 380a26112c82adad1abb1449f50de1155e6d2139 Mon Sep 17 00:00:00 2001 From: Jerome Jiang Date: Tue, 20 Dec 2016 16:49:42 -0800 Subject: [PATCH] Fix compile warnings for target=armv7-android-gcc Fix compile warnings about implicit type conversion for target=armv7-android-gcc in vpxenc.c. BUG=webm:1348 Change-Id: I9fbabd843512f2a1a09f4bb934cd091e834eed9c --- tools_common.h | 19 +++++++++++-------- vpxenc.c | 4 ++-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/tools_common.h b/tools_common.h index 73ba1bc03..c4a48b24d 100644 --- a/tools_common.h +++ b/tools_common.h @@ -26,11 +26,21 @@ /* MSVS uses _f{seek,tell}i64. */ #define fseeko _fseeki64 #define ftello _ftelli64 +typedef int64_t FileOffset; #elif defined(_WIN32) /* MinGW uses f{seek,tell}o64 for large files. */ #define fseeko fseeko64 #define ftello ftello64 -#endif /* _WIN32 */ +typedef off64_t FileOffset; +#elif CONFIG_OS_SUPPORT +typedef off_t FileOffset; +/* Use 32-bit file operations in WebM file format when building ARM + * executables (.axf) with RVCT. */ +#else +#define fseeko fseek +#define ftello ftell +typedef long FileOffset /* NOLINT */ +#endif /* CONFIG_OS_SUPPORT */ #if CONFIG_OS_SUPPORT #if defined(_MSC_VER) @@ -42,13 +52,6 @@ #endif /* _MSC_VER */ #endif /* CONFIG_OS_SUPPORT */ -/* Use 32-bit file operations in WebM file format when building ARM - * executables (.axf) with RVCT. */ -#if !CONFIG_OS_SUPPORT -#define fseeko fseek -#define ftello ftell -#endif /* CONFIG_OS_SUPPORT */ - #define LITERALU64(hi, lo) ((((uint64_t)hi) << 32) | lo) #ifndef PATH_MAX diff --git a/vpxenc.c b/vpxenc.c index a0f760574..9cd10ab2e 100644 --- a/vpxenc.c +++ b/vpxenc.c @@ -1657,7 +1657,7 @@ static void get_cx_data(struct stream_state *stream, *got_data = 0; while ((pkt = vpx_codec_get_cx_data(&stream->encoder, &iter))) { static size_t fsize = 0; - static int64_t ivf_header_pos = 0; + static FileOffset ivf_header_pos = 0; switch (pkt->kind) { case VPX_CODEC_CX_FRAME_PKT: @@ -1683,7 +1683,7 @@ static void get_cx_data(struct stream_state *stream, fsize += pkt->data.frame.sz; if (!(pkt->data.frame.flags & VPX_FRAME_IS_FRAGMENT)) { - const int64_t currpos = ftello(stream->file); + const FileOffset currpos = ftello(stream->file); fseeko(stream->file, ivf_header_pos, SEEK_SET); ivf_write_frame_size(stream->file, fsize); fseeko(stream->file, currpos, SEEK_SET); -- 2.40.0