Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
9f3b5b78
Commit
9f3b5b78
authored
Mar 04, 2017
by
Gus Grubba
Browse files
Uninitialized variable used in fmin/fmax.
parent
45cb473c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/MissionManager/MissionController.cc
View file @
9f3b5b78
...
...
@@ -1392,26 +1392,28 @@ void MissionController::_addPlannedHomePosition(Vehicle* vehicle, QmlObjectListM
visualItems
->
insert
(
0
,
homeItem
);
if
(
visualItems
->
count
()
>
1
&&
addToCenter
)
{
double
north
,
south
,
east
,
west
;
double
north
=
0.0
;
double
south
=
0.0
;
double
east
=
0.0
;
double
west
=
0.0
;
bool
firstCoordSet
=
false
;
for
(
int
i
=
1
;
i
<
visualItems
->
count
();
i
++
)
{
VisualMissionItem
*
item
=
qobject_cast
<
VisualMissionItem
*>
(
visualItems
->
get
(
i
));
if
(
item
->
specifiesCoordinate
())
{
if
(
firstCoordSet
)
{
double
lat
=
_normalizeLat
(
item
->
coordinate
().
latitude
());
double
lon
=
_normalizeLon
(
item
->
coordinate
().
longitude
());
north
=
fmax
(
north
,
lat
);
south
=
fmin
(
south
,
lat
);
east
=
fmax
(
east
,
lon
);
west
=
fmin
(
west
,
lon
);
east
=
fmax
(
east
,
lon
);
west
=
fmin
(
west
,
lon
);
}
else
{
firstCoordSet
=
true
;
north
=
_normalizeLat
(
item
->
coordinate
().
latitude
());
south
=
north
;
east
=
_normalizeLon
(
item
->
coordinate
().
longitude
());
west
=
east
;
east
=
_normalizeLon
(
item
->
coordinate
().
longitude
());
west
=
east
;
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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