Conversation
|
@alalek on this line: I can't understand this warning correctly. May I remove this assert on this line? |
| dc1394error_t err = dc1394_get_control_register(camera, offset, &value); | ||
|
|
||
| assert(err == DC1394_SUCCESS); | ||
| CV_Assert(err == DC1394_SUCCESS); |
There was a problem hiding this comment.
Perhaps this line should be removed.
modules/ts/src/ts_func.cpp
Outdated
| { | ||
| static const int scharr[8] = { 3, 10, 3, -1, 0, 1, 0, 0 }; // extra elements to eliminate "-Warray-bounds" bogus warning | ||
| assert( size == 3 ); | ||
| CV_DbgAssert( size == 3 ); |
There was a problem hiding this comment.
It is OK to use CV_Assert() even for per-pixel processing in tests code.
modules/calib3d/src/calibration.cpp
Outdated
| CV_Assert(fabs(matR[2][1]) < FLT_EPSILON); | ||
| matR[2][1] = 0; |
There was a problem hiding this comment.
Please use CV_DbgAssert() here (and 2 cases below) to keep code compatible with previous version.
Code itself should be updated to properly handle computation / accuracy issues in a right way (not a part of this patch).
Next line resets checked value to zero anyway.
| { | ||
| CvSetElem* _elem = (CvSetElem*)elem; | ||
| assert( _elem->flags >= 0 /*&& (elem->flags & CV_SET_ELEM_IDX_MASK) < set_header->total*/ ); | ||
| CV_Assert( _elem->flags >= 0 /*&& (elem->flags & CV_SET_ELEM_IDX_MASK) < set_header->total*/ ); |
There was a problem hiding this comment.
This is a C header.
Probably we should left it "as is" as there is no exceptions in C (at last for 3.4 branch).
| CvMat m; | ||
|
|
||
| assert( (unsigned)CV_MAT_DEPTH(type) <= CV_64F ); | ||
| CV_Assert( (unsigned)CV_MAT_DEPTH(type) <= CV_64F ); |
modules/core/test/test_ds.cpp
Outdated
| if( from_idx == to_idx ) | ||
| return; | ||
| assert( (from_idx > to_idx && !elem) || (from_idx < to_idx && elem) ); | ||
| CV_Assert( (from_idx > to_idx && !elem) || (from_idx < to_idx && elem) ); |
There was a problem hiding this comment.
test_ds.cpp:53:58: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]
Please use this workaround:
if (elem)
CV_Assert(from_idx < to_idx);
else
CV_Assert(from_idx > to_idx);
There was a problem hiding this comment.
@alalek
Thanks for your review. I fixed them.
resolves #21038
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.