mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-13 08:58:54 -05:00
More coding style fixes
This commit is contained in:
@@ -61,12 +61,18 @@ void writeToBuffer(std::vector<char>& buffer, size_t& currentWriteLocation, T va
|
||||
if ((currentWriteLocation + sizeof(T)) > buffer.size())
|
||||
buffer.resize(2 * buffer.size());
|
||||
|
||||
std::memmove(buffer.data() + currentWriteLocation, reinterpret_cast<const void*>(&value), sizeof(T));
|
||||
std::memmove(
|
||||
buffer.data() + currentWriteLocation,
|
||||
reinterpret_cast<const void*>(&value),
|
||||
sizeof(T)
|
||||
);
|
||||
currentWriteLocation += sizeof(T);
|
||||
}
|
||||
|
||||
template <>
|
||||
void writeToBuffer<std::string>(std::vector<char>& buffer, size_t& currentWriteLocation, std::string value) {
|
||||
void writeToBuffer<std::string>(std::vector<char>& buffer, size_t& currentWriteLocation,
|
||||
std::string value)
|
||||
{
|
||||
if ((currentWriteLocation + sizeof(uint8_t) + value.size()) > buffer.size())
|
||||
buffer.resize(2 * buffer.size());
|
||||
|
||||
@@ -92,7 +98,8 @@ void SequenceParser::sendPlaybookInformation(const std::string& name) {
|
||||
// 1 byte : Number of Instruments (i)
|
||||
// i times: 1 byte (id), 1 byte (length j of name), j bytes (name)
|
||||
// 4 byte: Number (n) of images
|
||||
// n times: 8 byte (beginning time), 8 byte (ending time), 1 byte (target id), 2 byte (instrument id)
|
||||
// n times: 8 byte (beginning time), 8 byte (ending time), 1 byte (target id),
|
||||
// 2 byte (instrument id)
|
||||
|
||||
std::map<std::string, uint8_t> targetMap;
|
||||
uint8_t currentTargetId = 0;
|
||||
@@ -136,8 +143,12 @@ void SequenceParser::sendPlaybookInformation(const std::string& name) {
|
||||
writeToBuffer(buffer, currentWriteLocation, image.timeRange.start);
|
||||
writeToBuffer(buffer, currentWriteLocation, image.timeRange.end);
|
||||
|
||||
std::string timeBegin = SpiceManager::ref().dateFromEphemerisTime(image.timeRange.start);
|
||||
std::string timeEnd = SpiceManager::ref().dateFromEphemerisTime(image.timeRange.end);
|
||||
std::string timeBegin = SpiceManager::ref().dateFromEphemerisTime(
|
||||
image.timeRange.start
|
||||
);
|
||||
std::string timeEnd = SpiceManager::ref().dateFromEphemerisTime(
|
||||
image.timeRange.end
|
||||
);
|
||||
|
||||
writeToBuffer(buffer, currentWriteLocation, timeBegin);
|
||||
writeToBuffer(buffer, currentWriteLocation, timeEnd);
|
||||
|
||||
Reference in New Issue
Block a user