Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
be524792
Commit
be524792
authored
Jan 09, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imgcodecs: remove assert() usage
parent
f34a0a87
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
17 deletions
+18
-17
bitstrm.cpp
modules/imgcodecs/src/bitstrm.cpp
+7
-7
grfmt_pam.cpp
modules/imgcodecs/src/grfmt_pam.cpp
+6
-4
grfmt_sunras.cpp
modules/imgcodecs/src/grfmt_sunras.cpp
+4
-4
precomp.hpp
modules/imgcodecs/src/precomp.hpp
+0
-1
utils.cpp
modules/imgcodecs/src/utils.cpp
+1
-1
No files found.
modules/imgcodecs/src/bitstrm.cpp
View file @
be524792
...
...
@@ -165,7 +165,7 @@ void RBaseStream::release()
void
RBaseStream
::
setPos
(
int
pos
)
{
assert
(
isOpened
()
&&
pos
>=
0
);
CV_Assert
(
isOpened
()
&&
pos
>=
0
);
if
(
!
m_file
)
{
...
...
@@ -182,13 +182,13 @@ void RBaseStream::setPos( int pos )
int
RBaseStream
::
getPos
()
{
assert
(
isOpened
()
);
CV_Assert
(
isOpened
()
);
return
m_block_pos
+
(
int
)(
m_current
-
m_start
);
}
void
RBaseStream
::
skip
(
int
bytes
)
{
assert
(
bytes
>=
0
);
CV_Assert
(
bytes
>=
0
);
m_current
+=
bytes
;
}
...
...
@@ -221,7 +221,7 @@ int RLByteStream::getBytes( void* buffer, int count )
{
uchar
*
data
=
(
uchar
*
)
buffer
;
int
readed
=
0
;
assert
(
count
>=
0
);
CV_Assert
(
count
>=
0
);
while
(
count
>
0
)
{
...
...
@@ -373,7 +373,7 @@ void WBaseStream::writeBlock()
{
int
size
=
(
int
)(
m_current
-
m_start
);
assert
(
isOpened
()
);
CV_Assert
(
isOpened
()
);
if
(
size
==
0
)
return
;
...
...
@@ -444,7 +444,7 @@ void WBaseStream::release()
int
WBaseStream
::
getPos
()
{
assert
(
isOpened
()
);
CV_Assert
(
isOpened
()
);
return
m_block_pos
+
(
int
)(
m_current
-
m_start
);
}
...
...
@@ -467,7 +467,7 @@ void WLByteStream::putBytes( const void* buffer, int count )
{
uchar
*
data
=
(
uchar
*
)
buffer
;
assert
(
data
&&
m_current
&&
count
>=
0
);
CV_Assert
(
data
&&
m_current
&&
count
>=
0
);
while
(
count
)
{
...
...
modules/imgcodecs/src/grfmt_pam.cpp
View file @
be524792
...
...
@@ -53,6 +53,8 @@
#include "utils.hpp"
#include "grfmt_pam.hpp"
using
namespace
cv
;
/* the PAM related fields */
#define MAX_PAM_HEADER_IDENITFIER_LENGTH 8
#define MAX_PAM_HEADER_VALUE_LENGTH 255
...
...
@@ -184,7 +186,7 @@ basic_conversion (void *src, const struct channel_layout *layout, int src_sampe_
}
break
;
default:
assert
(
0
);
CV_Error
(
Error
::
StsInternal
,
""
);
}
break
;
}
...
...
@@ -205,12 +207,12 @@ basic_conversion (void *src, const struct channel_layout *layout, int src_sampe_
}
break
;
default:
assert
(
0
);
CV_Error
(
Error
::
StsInternal
,
""
);
}
break
;
}
default:
assert
(
0
);
CV_Error
(
Error
::
StsInternal
,
""
);
}
}
...
...
@@ -711,7 +713,7 @@ bool PAMEncoder::write( const Mat& img, const std::vector<int>& params )
}
else
strm
.
putBytes
(
data
,
stride
*
height
);
}
else
assert
(
0
);
CV_Error
(
Error
::
StsInternal
,
""
);
strm
.
close
();
return
true
;
...
...
modules/imgcodecs/src/grfmt_sunras.cpp
View file @
be524792
...
...
@@ -124,7 +124,7 @@ bool SunRasterDecoder::readHeader()
m_type
=
IsColorPalette
(
m_palette
,
m_bpp
)
?
CV_8UC3
:
CV_8UC1
;
m_offset
=
m_strm
.
getPos
();
assert
(
m_offset
==
32
+
m_maplength
);
CV_Assert
(
m_offset
==
32
+
m_maplength
);
result
=
true
;
}
}
...
...
@@ -137,7 +137,7 @@ bool SunRasterDecoder::readHeader()
m_offset
=
m_strm
.
getPos
();
assert
(
m_offset
==
32
+
m_maplength
);
CV_Assert
(
m_offset
==
32
+
m_maplength
);
result
=
true
;
}
}
...
...
@@ -230,7 +230,7 @@ bool SunRasterDecoder::readData( Mat& img )
code
=
m_strm
.
getByte
();
if
(
len
>
line_end
-
tsrc
)
{
assert
(
0
);
CV_Error
(
Error
::
StsInternal
,
""
);
goto
bad_decoding_1bpp
;
}
...
...
@@ -371,7 +371,7 @@ bad_decoding_end:
result
=
true
;
break
;
default
:
assert
(
0
);
CV_Error
(
Error
::
StsInternal
,
""
);
}
}
CV_CATCH_ALL
...
...
modules/imgcodecs/src/precomp.hpp
View file @
be524792
...
...
@@ -56,7 +56,6 @@
#include <string.h>
#include <limits.h>
#include <ctype.h>
#include <assert.h>
#if defined _WIN32 || defined WINCE
#include <windows.h>
...
...
modules/imgcodecs/src/utils.cpp
View file @
be524792
...
...
@@ -670,7 +670,7 @@ cvConvertImage( const CvArr* srcarr, CvArr* dstarr, int flags )
icvCvt_BGR2Gray_8u_C3C1R
(
s
,
s_step
,
d
,
d_step
,
size
,
swap_rb
);
break
;
case
33
:
assert
(
swap_rb
);
CV_Assert
(
swap_rb
);
icvCvt_RGB2BGR_8u_C3R
(
s
,
s_step
,
d
,
d_step
,
size
);
break
;
case
41
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment