From 28f919d9d24a9f2405d86d3f17a1ff544a52e6c5 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Thu, 1 Apr 2021 10:26:22 +0000 Subject: [PATCH] apps(model_diagnostics): fix invalid callback --- apps/model-diagnostics/model_diagnostics.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/model-diagnostics/model_diagnostics.cpp b/apps/model-diagnostics/model_diagnostics.cpp index ed20ec07b1..2ffeaa1ea5 100644 --- a/apps/model-diagnostics/model_diagnostics.cpp +++ b/apps/model-diagnostics/model_diagnostics.cpp @@ -12,11 +12,14 @@ using namespace cv; using namespace dnn; -static void diagnosticsErrorCallback(const Exception& exc) +static +int diagnosticsErrorCallback(int /*status*/, const char* /*func_name*/, + const char* /*err_msg*/, const char* /*file_name*/, + int /*line*/, void* /*userdata*/) { - CV_UNUSED(exc); fflush(stdout); fflush(stderr); + return 0; } static std::string checkFileExists(const std::string& fileName) @@ -54,7 +57,7 @@ int main( int argc, const char** argv ) CV_Assert(!model.empty()); enableModelDiagnostics(true); - redirectError((ErrorCallback)diagnosticsErrorCallback, NULL); + redirectError(diagnosticsErrorCallback, NULL); Net ocvNet = readNet(model, config, frameworkId);