Feature/warnings (#1885)

Remove many warnings from MSVC, Clang, and GCC
This commit is contained in:
Alexander Bock
2022-02-16 18:33:12 +01:00
committed by GitHub
parent 40ed640bc8
commit e8072495ec
47 changed files with 92 additions and 195 deletions
@@ -365,7 +365,7 @@ bool GlobeLabelsComponent::readLabelsFile(const std::filesystem::path& file) {
// atlas)
// Once this limitation is fixed, we can remove the next piece of code
// Removing non ASCII characters:
strncpy(lEntry.feature, token.c_str(), 256);
strncpy(lEntry.feature, token.c_str(), 255);
int tokenChar = 0;
while (tokenChar < 256) {
if (lEntry.feature[tokenChar] < 0 && lEntry.feature[tokenChar] != '\0') {
@@ -112,7 +112,7 @@ TileDepthTransform ImageSequenceTileProvider::depthTransform() {
void ImageSequenceTileProvider::update() {
if (_isImageDirty && !_imagePaths.empty() &&
_index >= 0 && _index < _imagePaths.size())
_index >= 0 && _index < static_cast<int>(_imagePaths.size()))
{
if (_currentTileProvider) {
_currentTileProvider->deinitialize();
@@ -104,7 +104,7 @@ Tile SizeReferenceTileProvider::tile(const TileIndex& tileIndex) {
return TextTileProvider::renderTile(tileIndex, text, textPosition, glm::vec4(1.f));
}
Tile::Status SizeReferenceTileProvider::tileStatus(const TileIndex& index) {
Tile::Status SizeReferenceTileProvider::tileStatus(const TileIndex&) {
return Tile::Status::OK;
}
@@ -44,17 +44,8 @@
#include <sstream>
namespace {
constexpr const char* KeyBasePath = "BasePath";
constexpr const char* TimePlaceholder = "${OpenSpaceTimeId}";
constexpr openspace::properties::Property::PropertyInfo FilePathInfo = {
"FilePath",
"File Path",
"This is the path to the XML configuration file that describes the temporal tile "
"information."
};
constexpr openspace::properties::Property::PropertyInfo UseFixedTimeInfo = {
"UseFixedTime",
"Use Fixed Time",
@@ -450,8 +441,8 @@ DefaultTileProvider* TemporalTileProvider::retrieveTileProvider(const Time& t) {
_folder.files.cbegin(),
_folder.files.cend(),
time,
[](const std::pair<double, std::string>& p, double time) {
return p.first < time;
[](const std::pair<double, std::string>& p, double sec) {
return p.first < sec;
}
);
return std::string_view(it->second);
@@ -721,9 +712,10 @@ Tile TemporalTileProvider::InterpolateTileProvider::tile(const TileIndex& tileIn
Tile prev = t1->tile(tileIndex);
Tile next = t2->tile(tileIndex);
// the tile before and the tile after the interpolation interval are loaded so the
// interpolation goes smoother
Tile prevprev = before->tile(tileIndex);
Tile nextnext = future->tile(tileIndex);
// interpolation goes smoother. It is on purpose that we are not actually storing the
// return tile here, we just want to trigger the load already
before->tile(tileIndex);
future->tile(tileIndex);
cache::ProviderTileKey key = { tileIndex, uniqueIdentifier };
if (!prev.texture || !next.texture) {
@@ -65,8 +65,6 @@ namespace {
std::unique_ptr<ghoul::opengl::Texture> DefaultTileTexture;
Tile DefaultTile = Tile { nullptr, std::nullopt, Tile::Status::Unavailable };
constexpr const char* KeyFilePath = "FilePath";
} // namespace
unsigned int TileProvider::NumTileProviders = 0;
@@ -27,23 +27,32 @@
#include <openspace/documentation/documentation.h>
namespace {
constexpr const char* KeyDefaultProvider = "DefaultProvider";
constexpr const char* KeyProviders = "IndexTileProviders";
constexpr const char* KeyTileIndex = "TileIndex";
constexpr const char* KeyTileProvider = "TileProvider";
struct [[codegen::Dictionary(TileProviderByIndex)]] Parameters {
ghoul::Dictionary defaultProvider;
struct IndexProvider {
struct Index {
// The x coordinate for this index. This specifies the horizontal
// direction (longitude) component
int x [[codegen::greaterequal(0)]];
// The y coordinate for this index. This specifies the vertical direction
// (latitude) component
int y [[codegen::greaterequal(0)]];
// The z-level which corresponds to the depth of the tile pyramid, which
// directly impacts the applied resolution of the tileprovider shown here
int level [[codegen::inrange(0, 255)]];
};
// The index for which the provided tile provider is used
Index tileIndex;
// The dictionary that described the tileprovider to be used by the provided
// index
ghoul::Dictionary tileProvider;
};
// The list of all tileprovides and the indices at which they are used
std::vector<IndexProvider> indexTileProviders;
};
#include "tileproviderbyindex_codegen.cpp"
+1 -2
View File
@@ -630,9 +630,8 @@ std::vector<std::string> TimeQuantizer::quantized(Time& start, Time& end) {
const double startSeconds = s.J2000();
const double endSeconds = e.J2000();
const double delta = endSeconds - startSeconds;
ghoul_assert(
static_cast<int>(delta) % static_cast<int>(_resolution) == 0,
static_cast<int>(endSeconds - startSeconds) % static_cast<int>(_resolution) == 0,
"Quantization error"
);