mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Deprecated convertTypeStr and made new variant that also takes the buffer size
This allows removing the unsafe sprintf.
This commit is contained in:
@@ -642,9 +642,9 @@ static bool ocl_reduce(InputArray _src, OutputArray _dst,
|
||||
ocl::typeToStr(sdepth),
|
||||
ocl::typeToStr(ddepth),
|
||||
ocl::typeToStr(ddepth0),
|
||||
ocl::convertTypeStr(ddepth, wdepth, 1, cvt[0]),
|
||||
ocl::convertTypeStr(sdepth, ddepth, 1, cvt[1]),
|
||||
ocl::convertTypeStr(wdepth, ddepth0, 1, cvt[2]),
|
||||
ocl::convertTypeStr(ddepth, wdepth, 1, cvt[0], sizeof(cvt[0])),
|
||||
ocl::convertTypeStr(sdepth, ddepth, 1, cvt[1], sizeof(cvt[1])),
|
||||
ocl::convertTypeStr(wdepth, ddepth0, 1, cvt[2], sizeof(cvt[2])),
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : "");
|
||||
ocl::Kernel k("reduce_horz_opt", ocl::core::reduce2_oclsrc, build_opt);
|
||||
if (k.empty())
|
||||
@@ -673,9 +673,9 @@ static bool ocl_reduce(InputArray _src, OutputArray _dst,
|
||||
" -D convertToDT=%s -D convertToDT0=%s%s",
|
||||
ops[op], dim, cn, ddepth, ocl::typeToStr(useOptimized ? ddepth : sdepth),
|
||||
ocl::typeToStr(ddepth), ocl::typeToStr(ddepth0),
|
||||
ocl::convertTypeStr(ddepth, wdepth, 1, cvt[0]),
|
||||
ocl::convertTypeStr(sdepth, ddepth, 1, cvt[0]),
|
||||
ocl::convertTypeStr(wdepth, ddepth0, 1, cvt[1]),
|
||||
ocl::convertTypeStr(ddepth, wdepth, 1, cvt[0], sizeof(cvt[0])),
|
||||
ocl::convertTypeStr(sdepth, ddepth, 1, cvt[0], sizeof(cvt[0])),
|
||||
ocl::convertTypeStr(wdepth, ddepth0, 1, cvt[1], sizeof(cvt[1])),
|
||||
doubleSupport ? " -D DOUBLE_SUPPORT" : "");
|
||||
|
||||
ocl::Kernel k("reduce", ocl::core::reduce2_oclsrc, build_opt);
|
||||
|
||||
Reference in New Issue
Block a user