Address Visual Studio analyzer warnings

This commit is contained in:
Alexander Bock
2022-04-12 00:58:11 +02:00
parent f1667a7f43
commit d360f2ae59
17 changed files with 38 additions and 41 deletions

View File

@@ -9,7 +9,3 @@ charset = utf-8
indent_style = space
indent_size = 4
insert_final_newline = true
# overwrite default settings here, for instance like this:
# [*.cpp]
# indent_style = tabs

View File

@@ -61,10 +61,10 @@ public:
};
struct MemoryFile {
char* buffer;
size_t size;
char* buffer = nullptr;
size_t size = 0;
std::string format;
bool corrupted;
bool corrupted = false;
};
BooleanType(UseMultipleThreads);

View File

@@ -49,7 +49,7 @@ private:
// Input from mouse
std::vector<MouseButton> _mouseButtonsDown;
glm::dvec2 _mousePosition = glm::dvec2(0.0);
double _mouseScrollDelta;
double _mouseScrollDelta = 0.0;
};
} // namespace openspace::interaction

View File

@@ -125,7 +125,7 @@ private:
std::atomic<bool> _timeTimelineChanged;
std::mutex _latencyMutex;
std::deque<double> _latencyDiffs;
double _initialTimeDiff;
double _initialTimeDiff = 0.0;
std::unique_ptr<std::thread> _receiveThread = nullptr;
std::shared_ptr<ghoul::Event<>> _connectionEvent;

View File

@@ -135,12 +135,12 @@ private:
UniformCache(downscaledRenderedVolume, downscaledRenderedVolumeDepth, viewport,
resolution) _writeDownscaledVolumeUniformCache;
GLint _defaultFBO;
GLuint _screenQuad;
GLuint _vertexPositionBuffer;
GLuint _exitColorTexture;
GLuint _exitDepthTexture;
GLuint _exitFramebuffer;
GLint _defaultFBO = 0;
GLuint _screenQuad = 0;
GLuint _vertexPositionBuffer = 0;
GLuint _exitColorTexture = 0;
GLuint _exitDepthTexture = 0;
GLuint _exitFramebuffer = 0;
struct {
GLuint colorTexture;

View File

@@ -72,20 +72,20 @@ struct Shaders {
struct VertexObjects {
struct {
GLuint vao;
GLuint vbo;
GLuint vao = 0;
GLuint vbo = 0;
} square;
struct {
GLuint vao;
GLuint vbo;
GLuint ibo;
GLuint vao = 0;
GLuint vbo = 0;
GLuint ibo = 0;
int nElements = 64;
} sphere;
struct {
GLuint vao;
GLuint vao = 0;
} empty;
};

View File

@@ -86,7 +86,7 @@ public:
std::string documentation;
std::string name;
std::string guiPath;
bool isLocal;
bool isLocal = false;
std::string script;
};
@@ -101,7 +101,7 @@ public:
Relative
};
Type type;
Type type = Type::Absolute;
std::string value;
};
@@ -111,7 +111,7 @@ public:
std::string anchor;
std::optional<std::string> aim;
std::string referenceFrame;
glm::dvec3 position;
glm::dvec3 position = glm::dvec3(0.0);
std::optional<glm::dvec3> up;
std::optional<double> yaw;
std::optional<double> pitch;
@@ -121,8 +121,8 @@ public:
static constexpr const char* Type = "goToGeo";
std::string anchor;
double latitude;
double longitude;
double latitude = 0.0;
double longitude = 0.0;
std::optional<double> altitude;
};

View File

@@ -46,7 +46,7 @@ struct LuaLibrary {
/// The name of the function
std::string name;
/// The function pointer that is executed if the function is called
lua_CFunction function;
lua_CFunction function = nullptr;
struct Argument {
/// The name of the arguments
std::string name;

View File

@@ -856,7 +856,7 @@ public:
};
/// The shape of the returned field of view
Shape shape;
Shape shape = Shape::Rectangle;
/// The name of the reference frame in which the #bounds are defined
std::string frameName;

View File

@@ -198,7 +198,8 @@ constexpr double convertTime(double t, TimeUnit sourceUnit, TimeUnit destination
case TimeUnit::Year:
seconds = t * SecondsPerYear;
break;
default: ;
default:
break;
}
switch (destinationUnit) {

View File

@@ -167,7 +167,7 @@ private:
bool _shouldSetTime = false;
Time _timeNextFrame;
bool _timelineChanged;
bool _timelineChanged = false;
double _latestConsumedTimestamp = -std::numeric_limits<double>::max();
int _nextCallbackHandle = 0;

View File

@@ -97,7 +97,7 @@ bool ScreenSpaceFramebuffer::deinitializeGL() {
_framebuffer->activate();
_framebuffer->detachAll();
_framebuffer->deactivate();
ghoul::opengl::FramebufferObject::deactivate();
removeAllRenderFunctions();
return true;
@@ -122,7 +122,7 @@ void ScreenSpaceFramebuffer::render() {
);
global::renderEngine->openglStateCache().setViewportState(viewport);
GLint defaultFBO = _framebuffer->getActiveObject();
GLint defaultFBO = ghoul::opengl::FramebufferObject::getActiveObject();
_framebuffer->activate();
glClearColor(0.f, 0.f, 0.f, 0.f);
@@ -130,7 +130,7 @@ void ScreenSpaceFramebuffer::render() {
for (const RenderFunction& renderFunction : _renderFunctions) {
renderFunction();
}
_framebuffer->deactivate();
ghoul::opengl::FramebufferObject::deactivate();
glBindFramebuffer(GL_FRAMEBUFFER, defaultFBO);
glViewport(viewport[0], viewport[1], viewport[2], viewport[3]);
@@ -185,7 +185,7 @@ void ScreenSpaceFramebuffer::createFramebuffer() {
_texture->setFilter(ghoul::opengl::Texture::FilterMode::LinearMipMap);
_texture->purgeFromRAM();
_framebuffer->attachTexture(_texture.get(), GL_COLOR_ATTACHMENT0);
_framebuffer->deactivate();
ghoul::opengl::FramebufferObject::deactivate();
}
int ScreenSpaceFramebuffer::id() {

View File

@@ -170,7 +170,7 @@ void OpenSpaceEngine::registerPathTokens() {
using Override = ghoul::filesystem::FileSystem::Override;
FileSys.registerPathToken(
std::move(fullKey),
std::move(path.second),
path.second,
Override(overrideBase || overrideTemporary)
);
}

View File

@@ -101,9 +101,9 @@ glm::dmat3 TransformationManager::kameleonTransformationMatrix(
ccmc::Position out1;
ccmc::Position out2;
_kameleon->_cxform(from.c_str(), to.c_str(), ephemerisTime, &in0, &out0);
_kameleon->_cxform(from.c_str(), to.c_str(), ephemerisTime, &in1, &out1);
_kameleon->_cxform(from.c_str(), to.c_str(), ephemerisTime, &in2, &out2);
ccmc::Kameleon::_cxform(from.c_str(), to.c_str(), ephemerisTime, &in0, &out0);
ccmc::Kameleon::_cxform(from.c_str(), to.c_str(), ephemerisTime, &in1, &out1);
ccmc::Kameleon::_cxform(from.c_str(), to.c_str(), ephemerisTime, &in2, &out2);
return glm::dmat3(
out0.c0, out0.c1, out0.c2,