1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge pull request #23055 from seanm:sprintf2

* Replaced most remaining sprintf with snprintf
* Deprecated encodeFormat and introduced new method that takes the buffer length
* Also increased buffer size at call sites to be a little bigger, in case int is 64 bit
This commit is contained in:
Sean McBride
2023-04-18 02:22:59 -04:00
committed by GitHub
parent 8512deb3cc
commit 47bea69322
32 changed files with 82 additions and 71 deletions
+2 -2
View File
@@ -633,7 +633,7 @@ static bool ocl_reduce(InputArray _src, OutputArray _dst,
static const size_t maxItemInGroupCount = 16;
tileHeight = min(tileHeight, defDev.localMemSize() / buf_cols / CV_ELEM_SIZE(CV_MAKETYPE(wdepth, cn)) / maxItemInGroupCount);
}
char cvt[3][40];
char cvt[3][50];
cv::String build_opt = format("-D OP_REDUCE_PRE -D BUF_COLS=%d -D TILE_HEIGHT=%zu -D %s -D dim=1"
" -D cn=%d -D ddepth=%d"
" -D srcT=%s -D bufT=%s -D dstT=%s"
@@ -667,7 +667,7 @@ static bool ocl_reduce(InputArray _src, OutputArray _dst,
}
else
{
char cvt[2][40];
char cvt[2][50];
cv::String build_opt = format("-D %s -D dim=%d -D cn=%d -D ddepth=%d"
" -D srcT=%s -D dstT=%s -D dstT0=%s -D convertToWT=%s"
" -D convertToDT=%s -D convertToDT0=%s%s",