Merge "vpx_internal_error -> fix -Wunused-function issues"

This commit is contained in:
Jim Bankoski 2014-08-13 10:54:33 -07:00 committed by Gerrit Code Review
commit 02b2c16775
2 changed files with 27 additions and 22 deletions

View File

@ -431,28 +431,10 @@ struct vpx_internal_error_info {
jmp_buf jmp;
};
static void vpx_internal_error(struct vpx_internal_error_info *info,
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);
}
...);
#ifdef __cplusplus
} // extern "C"

View File

@ -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);
}