Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
26ec3a50
Commit
26ec3a50
authored
Aug 10, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Linux Release build compiler warning
parent
af8af613
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
MockMavlinkFileServer.cc
src/qgcunittest/MockMavlinkFileServer.cc
+1
-1
QGCUASFileManager.cc
src/uas/QGCUASFileManager.cc
+1
-2
QGCUASFileManager.h
src/uas/QGCUASFileManager.h
+10
-3
No files found.
src/qgcunittest/MockMavlinkFileServer.cc
View file @
26ec3a50
...
...
@@ -139,7 +139,7 @@ void MockMavlinkFileServer::_openCommand(QGCUASFileManager::Request* request, ui
// Data contains file length
response
.
hdr
.
size
=
sizeof
(
uint32_t
);
*
((
uint32_t
*
)
response
.
data
)
=
_readFileLength
;
response
.
openFileLength
=
_readFileLength
;
_emitResponse
(
&
response
,
outgoingSeqNumber
);
}
...
...
src/uas/QGCUASFileManager.cc
View file @
26ec3a50
...
...
@@ -107,8 +107,7 @@ void QGCUASFileManager::_openAckResponse(Request* openAck)
// File length comes back in data
Q_ASSERT
(
openAck
->
hdr
.
size
==
sizeof
(
uint32_t
));
uint32_t
fileLength
=
*
((
uint32_t
*
)
&
openAck
->
data
[
0
]);
emit
openFileLength
(
fileLength
);
emit
openFileLength
(
openAck
->
openFileLength
);
_readOffset
=
0
;
// Start reading at beginning of file
_readFileAccumulator
.
clear
();
// Start with an empty file
...
...
src/uas/QGCUASFileManager.h
View file @
26ec3a50
...
...
@@ -71,9 +71,16 @@ protected:
struct
Request
{
struct
RequestHeader
hdr
;
// The entire Request must fit into the data member of the mavlink_encapsulated_data_t structure. We use as many leftover bytes
// after we use up space for the RequestHeader for the data portion of the Request.
uint8_t
data
[
sizeof
(((
mavlink_encapsulated_data_t
*
)
0
)
->
data
)
-
sizeof
(
RequestHeader
)];
// We use a union here instead of just casting (uint32_t)&data[0] to not break strict aliasing rules
union
{
// The entire Request must fit into the data member of the mavlink_encapsulated_data_t structure. We use as many leftover bytes
// after we use up space for the RequestHeader for the data portion of the Request.
uint8_t
data
[
sizeof
(((
mavlink_encapsulated_data_t
*
)
0
)
->
data
)
-
sizeof
(
RequestHeader
)];
// File length returned by Open command
uint32_t
openFileLength
;
};
};
enum
Opcode
...
...
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