mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
Merge pull request #21107 from take1014:remove_assert_21038
resolves #21038 * remove C assert * revert C header * fix several points in review * fix test_ds.cpp
This commit is contained in:
@@ -212,7 +212,7 @@ int CvCaptureCAM_CMU::getDepth()
|
||||
|
||||
// TODO
|
||||
if( format==7 ) {
|
||||
assert(0);
|
||||
CV_Assert(0);
|
||||
return 1;
|
||||
}
|
||||
// irrelvant to depth
|
||||
@@ -233,7 +233,7 @@ int CvCaptureCAM_CMU::getNChannels()
|
||||
int mode = cmucam->GetVideoMode();
|
||||
|
||||
if( format==7 ){
|
||||
assert(0);
|
||||
CV_Assert(0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -272,7 +272,7 @@ static CvCaptureCAM_DC1394 * icvCaptureFromCAM_DC1394 (int index)
|
||||
format_idx = preferred_modes[i] - FORMAT_MIN;
|
||||
continue;
|
||||
}
|
||||
assert(format_idx != -1);
|
||||
CV_Assert(format_idx != -1);
|
||||
if ( ! icvFormatSupportedCAM_DC1394(pcap->format, formats) )
|
||||
continue;
|
||||
if ( icvModeSupportedCAM_DC1394(pcap->format, preferred_modes[i], modes[format_idx]) ){
|
||||
|
||||
@@ -64,7 +64,6 @@ static uint32_t getControlRegister(dc1394camera_t *camera, uint64_t offset)
|
||||
uint32_t value = 0;
|
||||
dc1394error_t err = dc1394_get_control_register(camera, offset, &value);
|
||||
|
||||
assert(err == DC1394_SUCCESS);
|
||||
return err == DC1394_SUCCESS ? value : 0xffffffff;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
#if !(defined(_WIN32) || defined(WINCE))
|
||||
# include <pthread.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
|
||||
@@ -405,7 +404,7 @@ static
|
||||
inline int _opencv_ffmpeg_interrupt_callback(void *ptr)
|
||||
{
|
||||
AVInterruptCallbackMetadata* metadata = (AVInterruptCallbackMetadata*)ptr;
|
||||
assert(metadata);
|
||||
CV_Assert(metadata);
|
||||
|
||||
if (metadata->timeout_after_ms == 0)
|
||||
{
|
||||
@@ -2113,7 +2112,7 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int
|
||||
}
|
||||
}
|
||||
else {
|
||||
assert(false);
|
||||
CV_Assert(false);
|
||||
}
|
||||
|
||||
if( (width & -2) != frame_width || (height & -2) != frame_height || !data )
|
||||
@@ -2165,7 +2164,7 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int
|
||||
}
|
||||
|
||||
if ( c->pix_fmt != input_pix_fmt ) {
|
||||
assert( input_picture );
|
||||
CV_Assert( input_picture );
|
||||
// let input_picture point to the raw data buffer of 'image'
|
||||
_opencv_ffmpeg_av_image_fill_arrays(input_picture, (uint8_t *) data,
|
||||
(AVPixelFormat)input_pix_fmt, width, height);
|
||||
@@ -2441,7 +2440,7 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc,
|
||||
#else
|
||||
oc = av_alloc_format_context();
|
||||
#endif
|
||||
assert (oc);
|
||||
CV_Assert (oc);
|
||||
|
||||
/* set file name */
|
||||
oc->oformat = fmt;
|
||||
|
||||
@@ -441,7 +441,7 @@ CvCaptureCAM_Giganetix::grabImage ()
|
||||
{
|
||||
gige::IImageInfo imageInfo;
|
||||
m_device->GetImageInfo (&imageInfo);
|
||||
assert(imageInfo.IsValid());
|
||||
CV_Assert(imageInfo.IsValid());
|
||||
|
||||
if (m_device->GetPendingImagesCount() == 1)
|
||||
{
|
||||
|
||||
@@ -249,7 +249,6 @@ make & enjoy!
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <asm/types.h> /* for videodev2.h */
|
||||
#include <assert.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
@@ -1125,7 +1124,7 @@ static int read_frame_v4l2(CvCaptureCAM_V4L* capture) {
|
||||
}
|
||||
}
|
||||
|
||||
assert(buf.index < capture->req.count);
|
||||
CV_Assert(buf.index < capture->req.count);
|
||||
|
||||
#ifdef USE_TEMP_BUFFER
|
||||
memcpy(capture->buffers[MAX_V4L_BUFFERS].start,
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
|
||||
// standard includes
|
||||
#include <cstdio>
|
||||
#include <cassert>
|
||||
|
||||
// Mac OS includes
|
||||
#include <Carbon/Carbon.h>
|
||||
@@ -608,14 +607,14 @@ static CvCapture_QT_Cam * icvCaptureFromCam_QT (const int index)
|
||||
/// capture properties currently unimplemented for QuickTime camera interface
|
||||
static double icvGetProperty_QT_Cam (CvCapture_QT_Cam * capture, int property_id)
|
||||
{
|
||||
assert (0);
|
||||
CV_Assert (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// capture properties currently unimplemented for QuickTime camera interface
|
||||
static int icvSetProperty_QT_Cam (CvCapture_QT_Cam * capture, int property_id, double value)
|
||||
{
|
||||
assert (0);
|
||||
CV_Assert (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -220,7 +220,6 @@ make & enjoy!
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <limits>
|
||||
@@ -929,8 +928,8 @@ bool CvCaptureCAM_V4L::read_frame_v4l2()
|
||||
return false;
|
||||
}
|
||||
|
||||
assert(buf.index < req.count);
|
||||
assert(buffers[buf.index].length == buf.length);
|
||||
CV_Assert(buf.index < req.count);
|
||||
CV_Assert(buffers[buf.index].length == buf.length);
|
||||
|
||||
//We shouldn't use this buffer in the queue while not retrieve frame from it.
|
||||
buffers[buf.index].buffer = buf;
|
||||
|
||||
@@ -68,7 +68,6 @@
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h> // FIXIT remove this
|
||||
|
||||
#if defined _WIN32 || defined WINCE
|
||||
#if !defined _WIN32_WINNT
|
||||
|
||||
Reference in New Issue
Block a user