From cba6201b673ee3dbbd3b03a83cb76cbe797b0a38 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 7 Nov 2018 13:49:33 -0500 Subject: [PATCH] Minor coding style changes --- ext/ghoul | 2 +- .../rendering/renderableplanescloud.cpp | 2 +- modules/globebrowsing/src/rawtiledatareader.cpp | 7 ++----- modules/globebrowsing/src/renderableglobe.cpp | 3 +-- modules/globebrowsing/src/renderableglobe.h | 2 +- modules/globebrowsing/src/skirtedgrid.cpp | 4 +--- modules/globebrowsing/src/tileloadjob.cpp | 2 +- modules/globebrowsing/src/tileprovider.cpp | 16 ---------------- modules/server/src/topics/versiontopic.cpp | 4 ---- src/interaction/sessionrecording.cpp | 3 +-- src/scene/scenegraphnode.cpp | 2 +- src/scripting/scriptengine_lua.inl | 4 +--- 12 files changed, 11 insertions(+), 40 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index a6bb81f5b5..29829ac11a 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit a6bb81f5b544966d27020696340aedddc6974824 +Subproject commit 29829ac11a99df218ece3c8501269afce84f8e3f diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.cpp b/modules/digitaluniverse/rendering/renderableplanescloud.cpp index 6fae1481e9..a7b7fde7d2 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.cpp +++ b/modules/digitaluniverse/rendering/renderableplanescloud.cpp @@ -591,7 +591,7 @@ void RenderablePlanesCloud::renderPlanes(const RenderData&, _program->setUniform(_uniformCache.galaxyTexture, unit); int currentTextureIndex = -1; - for (const std::unordered_map::reference pAMapItem : _planesMap) + for (std::unordered_map::reference pAMapItem : _planesMap) { // For planes with undefined textures references if (pAMapItem.first == 30) { diff --git a/modules/globebrowsing/src/rawtiledatareader.cpp b/modules/globebrowsing/src/rawtiledatareader.cpp index 66e59abe99..c9f4e9b864 100644 --- a/modules/globebrowsing/src/rawtiledatareader.cpp +++ b/modules/globebrowsing/src/rawtiledatareader.cpp @@ -244,9 +244,6 @@ bool isInside(const PixelRegion& lhs, const PixelRegion& rhs) { } IODescription cutIODescription(IODescription& io, Side side, int pos) { - const PixelRegion readPreCut = io.read.region; - const PixelRegion writePreCut = io.write.region; - glm::dvec2 ratio = { io.write.region.numPixels.x / static_cast(io.read.region.numPixels.x), io.write.region.numPixels.y / static_cast(io.read.region.numPixels.y) @@ -368,9 +365,9 @@ RawTile::ReadError postProcessErrorCheck(const RawTile& rawTile, size_t nRasters RawTileDataReader::RawTileDataReader(std::string filePath, TileTextureInitData initData, PerformPreprocessing preprocess) - : _initData(std::move(initData)) + : _datasetFilePath(std::move(filePath)) + , _initData(std::move(initData)) , _preprocess(preprocess) - , _datasetFilePath(std::move(filePath)) { initialize(); } diff --git a/modules/globebrowsing/src/renderableglobe.cpp b/modules/globebrowsing/src/renderableglobe.cpp index 34db102e75..8f4e65a342 100644 --- a/modules/globebrowsing/src/renderableglobe.cpp +++ b/modules/globebrowsing/src/renderableglobe.cpp @@ -399,9 +399,9 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary) FloatProperty(OrenNayarRoughnessInfo, 0.f, 0.f, 1.f) }) , _debugPropertyOwner({ "Debug" }) + , _grid(DefaultSkirtedGridSegments, DefaultSkirtedGridSegments) , _leftRoot(Chunk(LeftHemisphereIndex)) , _rightRoot(Chunk(RightHemisphereIndex)) - , _grid(DefaultSkirtedGridSegments, DefaultSkirtedGridSegments) { // Read the radii in to its own dictionary if (dictionary.hasKeyAndValue(KeyRadii)) { @@ -1229,7 +1229,6 @@ void RenderableGlobe::recompileShaders() { // Different layer types can be height layers or color layers for example. // These are used differently within the shaders. - preprocessingData.layeredTextureInfo; for (size_t i = 0; i < preprocessingData.layeredTextureInfo.size(); i++) { // lastLayerIndex must be at least 0 for the shader to compile, diff --git a/modules/globebrowsing/src/renderableglobe.h b/modules/globebrowsing/src/renderableglobe.h index 2e4182f9ea..ebac79fcbf 100644 --- a/modules/globebrowsing/src/renderableglobe.h +++ b/modules/globebrowsing/src/renderableglobe.h @@ -86,7 +86,7 @@ public: void update(const UpdateData& data) override; SurfacePositionHandle calculateSurfacePositionHandle( - const glm::dvec3& targetModelSpace) const; + const glm::dvec3& targetModelSpace) const override; const Ellipsoid& ellipsoid() const; const LayerManager& layerManager() const; diff --git a/modules/globebrowsing/src/skirtedgrid.cpp b/modules/globebrowsing/src/skirtedgrid.cpp index d3426116aa..1c35d2c283 100644 --- a/modules/globebrowsing/src/skirtedgrid.cpp +++ b/modules/globebrowsing/src/skirtedgrid.cpp @@ -28,8 +28,6 @@ #include namespace { - constexpr const char* _loggerCat = "SkirtedGrid"; - size_t numElements(int xSegments, int ySegments) { return 3 * 2 * xSegments * ySegments; } @@ -162,7 +160,7 @@ void SkirtedGrid::initializeGL() { glBindVertexArray(0); ghoul_assert( - elementData.size() == _elementSize, + static_cast(elementData.size()) == _elementSize, "Wrong element size. The correct number is assumed in the render method" ); } diff --git a/modules/globebrowsing/src/tileloadjob.cpp b/modules/globebrowsing/src/tileloadjob.cpp index 52ee6751db..8bbbd3a1df 100644 --- a/modules/globebrowsing/src/tileloadjob.cpp +++ b/modules/globebrowsing/src/tileloadjob.cpp @@ -40,7 +40,7 @@ TileLoadJob::~TileLoadJob() { } void TileLoadJob::execute() { - _rawTile = std::move(_rawTileDataReader.readTileData(_chunkIndex)); + _rawTile = _rawTileDataReader.readTileData(_chunkIndex); _hasTile = true; } diff --git a/modules/globebrowsing/src/tileprovider.cpp b/modules/globebrowsing/src/tileprovider.cpp index dabf25bfa6..ffcce43c7d 100644 --- a/modules/globebrowsing/src/tileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider.cpp @@ -131,8 +131,6 @@ namespace bylevelprovider { namespace temporal { constexpr const char* KeyBasePath = "BasePath"; - constexpr const char* KeyPreCacheStartTime = "PreCacheStartTime"; - constexpr const char* KeyPreCacheEndTime = "PreCacheEndTime"; constexpr const char* UrlTimePlaceholder = "${OpenSpaceTimeId}"; constexpr const char* TimeStart = "OpenSpaceTimeStart"; @@ -148,20 +146,6 @@ namespace temporal { }; } // namespace temporal -Type toType(const layergroupid::TypeID& id) { - using T = layergroupid::TypeID; - switch (id) { - case T::Unknown: throw ghoul::MissingCaseException(); - case T::DefaultTileLayer: return Type::DefaultTileProvider; - case T::SingleImageTileLayer: return Type::SingleImageTileProvider; - case T::SizeReferenceTileLayer: return Type::SizeReferenceTileProvider; - case T::TemporalTileLayer: return Type::TemporalTileProvider; - case T::TileIndexTileLayer: return Type::TileIndexTileProvider; - case T::ByIndexTileLayer: return Type::ByIndexTileProvider; - case T::ByLevelTileLayer: return Type::ByLevelTileProvider; - default: throw ghoul::MissingCaseException(); - } -} // // DefaultTileProvider diff --git a/modules/server/src/topics/versiontopic.cpp b/modules/server/src/topics/versiontopic.cpp index c1c59fe400..ad7d64f86b 100644 --- a/modules/server/src/topics/versiontopic.cpp +++ b/modules/server/src/topics/versiontopic.cpp @@ -28,10 +28,6 @@ #include #include -namespace { - constexpr const char* _loggerCat = "VersionTopic"; -} // namespace - namespace openspace { bool VersionTopic::isDone() const { diff --git a/src/interaction/sessionrecording.cpp b/src/interaction/sessionrecording.cpp index 69320979fc..41b1c46188 100644 --- a/src/interaction/sessionrecording.cpp +++ b/src/interaction/sessionrecording.cpp @@ -360,7 +360,7 @@ void SessionRecording::saveStringToFile(const std::string s) { _bufferIndex = 0; unsigned char const *p = reinterpret_cast(&strLen); memcpy((_keyframeBuffer + _bufferIndex), p, writeSize_bytes); - _bufferIndex += (unsigned int)writeSize_bytes; + _bufferIndex += static_cast(writeSize_bytes); saveKeyframeToFileBinary(_keyframeBuffer, _bufferIndex); _recordFile.write(s.c_str(), s.size()); @@ -1065,7 +1065,6 @@ bool SessionRecording::findNextFutureCameraIndex(double currTime) { { _idxTimeline_cameraPtrPrev = _idxTimeline_cameraPtrNext; return false; - break; } if (seekAheadIndex == (_timeline.size() - 1)) { diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index 0353e5baa1..21e41b7a59 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -226,9 +226,9 @@ std::unique_ptr SceneGraphNode::createFromDictionary( SceneGraphNode::SceneGraphNode() : properties::PropertyOwner({ "" }) + , _guiHidden(GuiHiddenInfo) , _guiPath(GuiPathInfo) , _guiDisplayName(GuiNameInfo) - , _guiHidden(GuiHiddenInfo) , _transform { std::make_unique(), std::make_unique(), diff --git a/src/scripting/scriptengine_lua.inl b/src/scripting/scriptengine_lua.inl index 5a3ec004dd..1d2b7873b1 100644 --- a/src/scripting/scriptengine_lua.inl +++ b/src/scripting/scriptengine_lua.inl @@ -365,9 +365,7 @@ int unzipFile(lua_State* L) { deleteSource = ghoul::lua::value(L, 3, ghoul::lua::PopValue::No); } - auto onExtractEntry = [](const char *filename, void *arg) { - return 0; - }; + auto onExtractEntry = [](const char*, void*) { return 0; }; int arg = 2; zip_extract(source.c_str(), dest.c_str(), onExtractEntry, &arg);