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
6ab10fc3
Commit
6ab10fc3
authored
Apr 01, 2017
by
Tomoaki Teshima
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
suppress warnings on GCC 4.9 series
- check boundary strictly - initialize the variable before using it
parent
b67382cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
24 deletions
+21
-24
contours.cpp
modules/imgproc/src/contours.cpp
+20
-16
imgwarp.cpp
modules/imgproc/src/imgwarp.cpp
+1
-8
No files found.
modules/imgproc/src/contours.cpp
View file @
6ab10fc3
...
...
@@ -528,6 +528,7 @@ cvSubstituteContour( CvContourScanner scanner, CvSeq * new_contour )
}
}
static
const
int
MAX_SIZE
=
16
;
/*
marks domain border with +/-<constant> and stores the contour into CvSeq.
...
...
@@ -544,7 +545,7 @@ icvFetchContour( schar *ptr,
int
_method
)
{
const
schar
nbd
=
2
;
int
deltas
[
16
];
int
deltas
[
MAX_SIZE
];
CvSeqWriter
writer
;
schar
*
i0
=
ptr
,
*
i1
,
*
i3
,
*
i4
=
0
;
int
prev_s
=
-
1
,
s
,
s_end
;
...
...
@@ -588,8 +589,9 @@ icvFetchContour( schar *ptr,
for
(
;;
)
{
s_end
=
s
;
s
=
std
::
min
(
s
,
MAX_SIZE
-
1
);
for
(
;;
)
while
(
s
<
MAX_SIZE
-
1
)
{
i4
=
i3
+
deltas
[
++
s
];
if
(
*
i4
!=
0
)
...
...
@@ -654,8 +656,8 @@ icvFetchContour( schar *ptr,
static
int
icvTraceContour
(
schar
*
ptr
,
int
step
,
schar
*
stop_ptr
,
int
is_hole
)
{
int
deltas
[
16
];
schar
*
i0
=
ptr
,
*
i1
,
*
i3
,
*
i4
;
int
deltas
[
MAX_SIZE
];
schar
*
i0
=
ptr
,
*
i1
,
*
i3
,
*
i4
=
NULL
;
int
s
,
s_end
;
/* initialize local state */
...
...
@@ -682,7 +684,8 @@ icvTraceContour( schar *ptr, int step, schar *stop_ptr, int is_hole )
for
(
;;
)
{
for
(
;;
)
s
=
std
::
min
(
s
,
MAX_SIZE
-
1
);
while
(
s
<
MAX_SIZE
-
1
)
{
i4
=
i3
+
deltas
[
++
s
];
if
(
*
i4
!=
0
)
...
...
@@ -709,9 +712,9 @@ icvFetchContourEx( schar* ptr,
int
nbd
,
CvRect
*
_rect
)
{
int
deltas
[
16
];
int
deltas
[
MAX_SIZE
];
CvSeqWriter
writer
;
schar
*
i0
=
ptr
,
*
i1
,
*
i3
,
*
i4
;
schar
*
i0
=
ptr
,
*
i1
,
*
i3
,
*
i4
=
NULL
;
CvRect
rect
;
int
prev_s
=
-
1
,
s
,
s_end
;
int
method
=
_method
-
1
;
...
...
@@ -759,8 +762,9 @@ icvFetchContourEx( schar* ptr,
for
(
;;
)
{
s_end
=
s
;
s
=
std
::
min
(
s
,
MAX_SIZE
-
1
);
for
(
;;
)
while
(
s
<
MAX_SIZE
-
1
)
{
i4
=
i3
+
deltas
[
++
s
];
if
(
*
i4
!=
0
)
...
...
@@ -833,8 +837,8 @@ icvFetchContourEx( schar* ptr,
static
int
icvTraceContour_32s
(
int
*
ptr
,
int
step
,
int
*
stop_ptr
,
int
is_hole
)
{
int
deltas
[
16
];
int
*
i0
=
ptr
,
*
i1
,
*
i3
,
*
i4
;
int
deltas
[
MAX_SIZE
];
int
*
i0
=
ptr
,
*
i1
,
*
i3
,
*
i4
=
NULL
;
int
s
,
s_end
;
const
int
right_flag
=
INT_MIN
;
const
int
new_flag
=
(
int
)((
unsigned
)
INT_MIN
>>
1
);
...
...
@@ -863,8 +867,9 @@ icvTraceContour_32s( int *ptr, int step, int *stop_ptr, int is_hole )
for
(
;;
)
{
s_end
=
s
;
s
=
std
::
min
(
s
,
MAX_SIZE
-
1
);
for
(
;;
)
while
(
s
<
MAX_SIZE
-
1
)
{
i4
=
i3
+
deltas
[
++
s
];
if
(
(
*
i4
&
value_mask
)
==
ccomp_val
)
...
...
@@ -890,7 +895,7 @@ icvFetchContourEx_32s( int* ptr,
int
_method
,
CvRect
*
_rect
)
{
int
deltas
[
16
];
int
deltas
[
MAX_SIZE
];
CvSeqWriter
writer
;
int
*
i0
=
ptr
,
*
i1
,
*
i3
,
*
i4
;
CvRect
rect
;
...
...
@@ -925,7 +930,7 @@ icvFetchContourEx_32s( int* ptr,
s
=
(
s
-
1
)
&
7
;
i1
=
i0
+
deltas
[
s
];
}
while
(
(
*
i1
&
value_mask
)
!=
ccomp_val
&&
s
!=
s_end
);
while
(
(
*
i1
&
value_mask
)
!=
ccomp_val
&&
s
!=
s_end
&&
(
s
<
MAX_SIZE
-
1
)
);
if
(
s
==
s_end
)
/* single pixel domain */
{
...
...
@@ -945,12 +950,11 @@ icvFetchContourEx_32s( int* ptr,
{
s_end
=
s
;
for
(
;;
)
do
{
i4
=
i3
+
deltas
[
++
s
];
if
(
(
*
i4
&
value_mask
)
==
ccomp_val
)
break
;
}
while
(
(
*
i4
&
value_mask
)
!=
ccomp_val
&&
(
s
<
MAX_SIZE
-
1
)
);
s
&=
7
;
/* check "right" bound */
...
...
modules/imgproc/src/imgwarp.cpp
View file @
6ab10fc3
...
...
@@ -1704,10 +1704,6 @@ public:
CV_Assert
(
ksize
<=
MAX_ESIZE
);
}
#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 8)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Warray-bounds"
#endif
virtual
void
operator
()
(
const
Range
&
range
)
const
{
int
dy
,
cn
=
src
.
channels
();
...
...
@@ -1737,7 +1733,7 @@ public:
int
sy
=
clip
(
sy0
-
ksize2
+
1
+
k
,
0
,
ssize
.
height
);
for
(
k1
=
std
::
max
(
k1
,
k
);
k1
<
ksize
;
k1
++
)
{
if
(
sy
==
prev_sy
[
k1
]
)
// if the sy-th row has been computed already, reuse it.
if
(
k1
<
MAX_ESIZE
&&
sy
==
prev_sy
[
k1
]
)
// if the sy-th row has been computed already, reuse it.
{
if
(
k1
>
k
)
memcpy
(
rows
[
k
],
rows
[
k1
],
bufstep
*
sizeof
(
rows
[
0
][
0
])
);
...
...
@@ -1756,9 +1752,6 @@ public:
vresize
(
(
const
WT
**
)
rows
,
(
T
*
)(
dst
.
data
+
dst
.
step
*
dy
),
beta
,
dsize
.
width
);
}
}
#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 8)
# pragma GCC diagnostic pop
#endif
private
:
Mat
src
;
...
...
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