From a6a997d2296566a95421acffb6133cb99b2985db Mon Sep 17 00:00:00 2001 From: Jim Bankoski Date: Wed, 13 Aug 2014 07:58:01 -0700 Subject: [PATCH] vpx_internal_error -> fix -Wunused-function issues Moved to global function to avoid unused function warnings... Change-Id: I4e9002dcb20748f6d8d84cbbe6ef2de0bd9a8018 --- vpx/internal/vpx_codec_internal.h | 26 ++++---------------------- vpx/src/vpx_codec.c | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/vpx/internal/vpx_codec_internal.h b/vpx/internal/vpx_codec_internal.h index f84bfedcf..3ca650475 100644 --- a/vpx/internal/vpx_codec_internal.h +++ b/vpx/internal/vpx_codec_internal.h @@ -431,28 +431,10 @@ struct vpx_internal_error_info { jmp_buf jmp; }; -static void vpx_internal_error(struct vpx_internal_error_info *info, - vpx_codec_err_t error, - const char *fmt, - ...) { - va_list ap; - - info->error_code = error; - info->has_detail = 0; - - if (fmt) { - size_t sz = sizeof(info->detail); - - info->has_detail = 1; - va_start(ap, fmt); - vsnprintf(info->detail, sz - 1, fmt, ap); - va_end(ap); - info->detail[sz - 1] = '\0'; - } - - if (info->setjmp) - longjmp(info->jmp, info->error_code); -} +void vpx_internal_error(struct vpx_internal_error_info *info, + vpx_codec_err_t error, + const char *fmt, + ...); #ifdef __cplusplus } // extern "C" diff --git a/vpx/src/vpx_codec.c b/vpx/src/vpx_codec.c index 9f7af9f83..d175eae64 100644 --- a/vpx/src/vpx_codec.c +++ b/vpx/src/vpx_codec.c @@ -134,3 +134,26 @@ vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx, return SAVE_STATUS(ctx, res); } + +void vpx_internal_error(struct vpx_internal_error_info *info, + vpx_codec_err_t error, + const char *fmt, + ...) { + va_list ap; + + info->error_code = error; + info->has_detail = 0; + + if (fmt) { + size_t sz = sizeof(info->detail); + + info->has_detail = 1; + va_start(ap, fmt); + vsnprintf(info->detail, sz - 1, fmt, ap); + va_end(ap); + info->detail[sz - 1] = '\0'; + } + + if (info->setjmp) + longjmp(info->jmp, info->error_code); +}