From 7068f9900d136312318ff430aef588b14e0c87ad Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Thu, 26 Oct 2017 15:23:08 +0100 Subject: COMPMID-631: Merge branches/gles_compute branch Last commit: commit b25c5f68042b0c81bf611d59a1bb8535e1c42497 Author: Xinghang Zhou Date: Wed Oct 25 18:48:10 2017 +0800 Synced validation's tolerances of GCSoftmax from cl side Change-Id: Ibe72054205c1c8721845d679a31af7ed0a7c5cf6 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/93283 Reviewed-by: Anthony Barbier Tested-by: Kaizen --- src/core/Error.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/core/Error.cpp') diff --git a/src/core/Error.cpp b/src/core/Error.cpp index 2e699feeb9..3b0a012f5f 100644 --- a/src/core/Error.cpp +++ b/src/core/Error.cpp @@ -30,23 +30,29 @@ using namespace arm_compute; +Error arm_compute::create_error_va_list(ErrorCode error_code, const char *function, const char *file, const int line, const char *msg, va_list args) +{ + char out[512]; + int offset = snprintf(out, sizeof(out), "in %s %s:%d: ", function, file, line); + vsnprintf(out + offset, sizeof(out) - offset, msg, args); + + return Error(error_code, std::string(out)); +} + Error arm_compute::create_error(ErrorCode error_code, const char *function, const char *file, const int line, const char *msg, ...) { - char out[512]; va_list args; va_start(args, msg); - int offset = snprintf(out, sizeof(out), "in %s %s:%d: ", function, file, line); - vsnprintf(out + offset, sizeof(out) - offset, msg, args); + auto err = create_error_va_list(error_code, function, file, line, msg, args); va_end(args); - - return Error(error_code, std::string(out)); + return err; } void arm_compute::error(const char *function, const char *file, const int line, const char *msg, ...) { va_list args; va_start(args, msg); - auto err = create_error(ErrorCode::RUNTIME_ERROR, function, file, line, msg, args); + auto err = create_error_va_list(ErrorCode::RUNTIME_ERROR, function, file, line, msg, args); va_end(args); throw std::runtime_error(err.description()); } -- cgit v1.2.1