1
0
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:
Sean McBride
2022-12-26 19:00:03 -05:00
parent e3e1f704a4
commit 58e4a880a2
25 changed files with 92 additions and 85 deletions
+6 -6
View File
@@ -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);