Fixing warnings in wxdata

This commit is contained in:
Dan Paulat 2022-06-11 06:35:53 -05:00
parent 05d795d18f
commit 3339a40780
17 changed files with 36 additions and 43 deletions

View file

@ -112,9 +112,9 @@ std::shared_ptr<const rda::VolumeCoveragePatternData> Ar2vFile::vcp_data() const
}
std::tuple<std::shared_ptr<rda::ElevationScan>, float, std::vector<float>>
Ar2vFile::GetElevationScan(rda::DataBlockType dataBlockType,
float elevation,
std::chrono::system_clock::time_point time) const
Ar2vFile::GetElevationScan(rda::DataBlockType dataBlockType,
float elevation,
std::chrono::system_clock::time_point /*time*/) const
{
logger_->debug("GetElevationScan: {} degrees", elevation);
@ -148,10 +148,10 @@ Ar2vFile::GetElevationScan(rda::DataBlockType dataBlockType,
elevationCuts.push_back(scan.first / scaleFactor);
}
uint16_t lowerDelta = std::abs(static_cast<int32_t>(codedElevation) -
static_cast<int32_t>(lowerBound));
uint16_t upperDelta = std::abs(static_cast<int32_t>(codedElevation) -
static_cast<int32_t>(upperBound));
int32_t lowerDelta = std::abs(static_cast<int32_t>(codedElevation) -
static_cast<int32_t>(lowerBound));
int32_t upperDelta = std::abs(static_cast<int32_t>(codedElevation) -
static_cast<int32_t>(upperBound));
if (lowerDelta < upperDelta)
{
@ -278,8 +278,8 @@ size_t Ar2vFileImpl::DecompressLDMRecords(std::istream& is)
}
catch (const boost::iostreams::bzip2_error& ex)
{
int error = ex.error();
logger_->warn("Error decompressing record {}", numRecords);
logger_->warn(
"Error decompressing record {}: {}", numRecords, ex.what());
is.seekg(startPosition + std::streampos(recordSize),
std::ios_base::beg);

View file

@ -139,8 +139,6 @@ bool Level3FileImpl::DecompressFile(std::istream& is, std::stringstream& ss)
}
catch (const boost::iostreams::zlib_error& ex)
{
int error = ex.error();
logger_->warn("Error decompressing data: {}", ex.what());
dataValid = false;

View file

@ -28,7 +28,7 @@ typedef std::function<std::shared_ptr<Level2Message>(Level2MessageHeader&&,
std::istream&)>
CreateLevel2MessageFunction;
static const std::unordered_map<uint8_t, CreateLevel2MessageFunction> create_ {
static const std::unordered_map<unsigned int, CreateLevel2MessageFunction> create_ {
{2, RdaStatusData::Create},
{3, PerformanceMaintenanceData::Create},
{5, VolumeCoveragePatternData::Create},

View file

@ -120,8 +120,6 @@ bool DigitalPrecipitationDataArrayPacket::Parse(std::istream& is)
for (uint16_t r = 0; r < p->numberOfRows_; r++)
{
size_t rowBytesRead = 0;
auto& row = p->row_[r];
is.read(reinterpret_cast<char*>(&row.numberOfBytes_), 2);

View file

@ -109,7 +109,6 @@ bool GraphicProductMessage::Parse(std::istream& is)
}
catch (const boost::iostreams::bzip2_error& ex)
{
int error = ex.error();
logger_->warn("Error decompressing data: {}", ex.what());
dataValid = false;

View file

@ -25,7 +25,7 @@ typedef std::function<std::shared_ptr<Level3Message>(Level3MessageHeader&&,
std::istream&)>
CreateLevel3MessageFunction;
static const std::unordered_map<int16_t, CreateLevel3MessageFunction> //
static const std::unordered_map<int, CreateLevel3MessageFunction> //
create_ {{2, GeneralStatusMessage::Create},
{19, GraphicProductMessage::Create},
{20, GraphicProductMessage::Create},
@ -140,7 +140,6 @@ std::shared_ptr<Level3Message> Level3MessageFactory::Create(std::istream& is)
if (messageValid)
{
int16_t messageCode = header.message_code();
size_t dataSize = header.length_of_message() - Level3MessageHeader::SIZE;
logger_->debug("Found Message {}", messageCode);

View file

@ -40,7 +40,7 @@ static const auto logger_ = util::Logger::Create(logPrefix_);
typedef std::function<std::shared_ptr<Packet>(std::istream&)>
CreateMessageFunction;
static const std::unordered_map<uint16_t, CreateMessageFunction> create_ {
static const std::unordered_map<unsigned int, CreateMessageFunction> create_ {
{1, TextAndSpecialSymbolPacket::Create},
{2, TextAndSpecialSymbolPacket::Create},
{3, MesocycloneSymbolPacket::Create},

View file

@ -117,8 +117,6 @@ bool PrecipitationRateDataArrayPacket::Parse(std::istream& is)
for (uint16_t r = 0; r < p->numberOfRows_; r++)
{
size_t rowBytesRead = 0;
auto& row = p->row_[r];
is.read(reinterpret_cast<char*>(&row.numberOfBytes_), 2);

View file

@ -18,12 +18,12 @@ static const std::string logPrefix_ =
"scwx::wsr88d::rpg::product_description_block";
static const auto logger_ = util::Logger::Create(logPrefix_);
static const std::set<int16_t> compressedProducts_ = {
static const std::set<int> compressedProducts_ = {
32, 94, 99, 134, 135, 138, 149, 152, 153, 154, 155,
159, 161, 163, 165, 167, 168, 170, 172, 173, 174, 175,
176, 177, 178, 179, 180, 182, 186, 193, 195, 202};
static const std::unordered_map<int16_t, uint16_t> rangeMap_ {
static const std::unordered_map<int, unsigned int> rangeMap_ {
{19, 230}, {20, 460}, {27, 230}, {30, 230}, {31, 230}, {32, 230},
{37, 230}, {38, 460}, {41, 230}, {50, 230}, {51, 230}, {56, 230},
{57, 230}, {58, 460}, {59, 230}, {61, 230}, {62, 460}, {65, 230},
@ -38,7 +38,7 @@ static const std::unordered_map<int16_t, uint16_t> rangeMap_ {
{176, 230}, {177, 230}, {178, 300}, {179, 300}, {180, 89}, {181, 89},
{182, 89}, {184, 89}, {186, 412}, {193, 460}, {195, 460}, {196, 50}};
static const std::unordered_map<int16_t, uint16_t> xResolutionMap_ {
static const std::unordered_map<int, unsigned int> xResolutionMap_ {
{19, 1000}, {20, 2000}, {27, 1000}, {30, 1000}, {31, 2000}, {32, 1000},
{33, 1000}, {34, 1000}, {37, 1000}, {38, 4000}, {41, 4000}, {50, 1000},
{51, 1000}, {56, 1000}, {57, 4000}, {65, 4000}, {66, 4000}, {67, 4000},
@ -52,7 +52,7 @@ static const std::unordered_map<int16_t, uint16_t> xResolutionMap_ {
{178, 1000}, {179, 1000}, {180, 150}, {181, 150}, {182, 150}, {184, 150},
{186, 300}, {193, 250}, {195, 1000}};
static const std::unordered_map<int16_t, uint16_t> yResolutionMap_ {{37, 1000},
static const std::unordered_map<int, unsigned int> yResolutionMap_ {{37, 1000},
{38, 4000},
{41, 4000},
{50, 500},
@ -255,7 +255,7 @@ uint16_t ProductDescriptionBlock::range_raw() const
auto it = rangeMap_.find(p->productCode_);
if (it != rangeMap_.cend())
{
range = it->second;
range = static_cast<uint16_t>(it->second);
}
return range;
@ -273,7 +273,7 @@ uint16_t ProductDescriptionBlock::x_resolution_raw() const
auto it = xResolutionMap_.find(p->productCode_);
if (it != xResolutionMap_.cend())
{
xResolution = it->second;
xResolution = static_cast<uint16_t>(it->second);
}
return xResolution;
@ -291,7 +291,7 @@ uint16_t ProductDescriptionBlock::y_resolution_raw() const
auto it = yResolutionMap_.find(p->productCode_);
if (it != yResolutionMap_.cend())
{
yResolution = it->second;
yResolution = static_cast<uint16_t>(it->second);
}
return yResolution;

View file

@ -184,8 +184,6 @@ bool RasterDataPacket::Parse(std::istream& is)
for (uint16_t r = 0; r < p->numberOfRows_; r++)
{
size_t rowBytesRead = 0;
auto& row = p->row_[r];
is.read(reinterpret_cast<char*>(&row.numberOfBytes_), 2);
@ -219,7 +217,7 @@ bool RasterDataPacket::Parse(std::istream& is)
uint16_t binCount =
std::accumulate(row.data_.cbegin(),
row.data_.cend(),
0,
static_cast<uint16_t>(0u),
[](const uint16_t& a, const uint8_t& b) -> uint16_t
{ return a + (b >> 4); });