Code review changes

This commit is contained in:
GPayne
2024-03-20 21:02:08 -06:00
parent 4b18b27b6e
commit 05231c705f
3 changed files with 5 additions and 6 deletions
@@ -26,8 +26,8 @@
#include "profile/line.h"
#include "profile/scriptlogdialog.h"
#include <ghoul/misc/stringhelper.h>
#include <openspace/scene/profile.h>
#include <ghoul/misc/stringhelper.h>
#include <QDialogButtonBox>
#include <QHBoxLayout>
#include <QLabel>
+3 -4
View File
@@ -412,8 +412,8 @@ bool SessionRecording::startPlayback(std::string& filename,
}
// throwaway newline character(s)
std::string lineEnd = readHeaderElement(_playbackFile, 1);
bool isDosLineEnding = (lineEnd == "\r");
if (isDosLineEnding) {
bool hasDosLineEnding = (lineEnd == "\r");
if (hasDosLineEnding) {
// throwaway the second newline character (\n) also
readHeaderElement(_playbackFile, 1);
}
@@ -424,8 +424,7 @@ bool SessionRecording::startPlayback(std::string& filename,
_playbackFile.close();
_playbackFile.open(_playbackFilename, std::ifstream::in | std::ios::binary);
size_t headerSize = FileHeaderTitle.length() + FileHeaderVersionLength
+ sizeof(DataFormatBinaryTag) + sizeof('\n')
+ ((isDosLineEnding) ? sizeof('\r') : 0);
+ sizeof(DataFormatBinaryTag) + sizeof('\n');
std::vector<char> hBuffer;
hBuffer.resize(headerSize);
_playbackFile.read(hBuffer.data(), headerSize);
+1 -1
View File
@@ -348,7 +348,7 @@ def check_for_std_getline(lines):
index = [i for i,s in enumerate(lines)
if 'std::getline' in s]
if len(index) > 0:
return 'File used wrong glm include. Use "#include <ghoul/glm.h>" instead'
return 'File used wrong std::getline function. Use ghoul::getline from "ghoul/misc/stringhelper.h" instead'
else:
return ''