mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 02:40:05 +00:00 
			
		
		
		
	Fixing warnings in wxdata
This commit is contained in:
		
							parent
							
								
									05d795d18f
								
							
						
					
					
						commit
						3339a40780
					
				
					 17 changed files with 36 additions and 43 deletions
				
			
		|  | @ -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); | ||||
|  |  | |||
|  | @ -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; | ||||
|  |  | |||
|  | @ -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); | ||||
| 
 | ||||
|  |  | |||
|  | @ -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}, | ||||
|  |  | |||
|  | @ -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); | ||||
|  |  | |||
|  | @ -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; | ||||
|  |  | |||
|  | @ -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); }); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat