mirror of
https://github.com/opencv/opencv.git
synced 2025-06-17 15:20:51 +08:00
Merge pull request #8107 from reunanen:fix8093
This commit is contained in:
commit
48f7cbec75
@ -1592,7 +1592,10 @@ Size_<_Tp>& Size_<_Tp>::operator = (const Size_<_Tp>& sz)
|
|||||||
template<typename _Tp> inline
|
template<typename _Tp> inline
|
||||||
_Tp Size_<_Tp>::area() const
|
_Tp Size_<_Tp>::area() const
|
||||||
{
|
{
|
||||||
return width * height;
|
const _Tp result = width * height;
|
||||||
|
CV_DbgAssert(!std::numeric_limits<_Tp>::is_integer
|
||||||
|
|| width == 0 || result / width == height); // make sure the result fits in the return value
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename _Tp> static inline
|
template<typename _Tp> static inline
|
||||||
@ -1731,7 +1734,10 @@ Size_<_Tp> Rect_<_Tp>::size() const
|
|||||||
template<typename _Tp> inline
|
template<typename _Tp> inline
|
||||||
_Tp Rect_<_Tp>::area() const
|
_Tp Rect_<_Tp>::area() const
|
||||||
{
|
{
|
||||||
return width * height;
|
const _Tp result = width * height;
|
||||||
|
CV_DbgAssert(!std::numeric_limits<_Tp>::is_integer
|
||||||
|
|| width == 0 || result / width == height); // make sure the result fits in the return value
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename _Tp> template<typename _Tp2> inline
|
template<typename _Tp> template<typename _Tp2> inline
|
||||||
|
Loading…
Reference in New Issue
Block a user