mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 01:50:06 +00:00 
			
		
		
		
	General GCC compilation fixes
This commit is contained in:
		
							parent
							
								
									c7aba95233
								
							
						
					
					
						commit
						023688b746
					
				
					 19 changed files with 57 additions and 53 deletions
				
			
		|  | @ -29,7 +29,7 @@ static bool                                         initialized_ {false}; | |||
| static std::unordered_map<std::string, std::string> countyMap_; | ||||
| static std::shared_mutex                            countyMutex_; | ||||
| 
 | ||||
| void CountyDatabase::Initialize() | ||||
| void Initialize() | ||||
| { | ||||
|    if (initialized_) | ||||
|    { | ||||
|  |  | |||
|  | @ -255,8 +255,8 @@ void GeoLine::Impl::Update() | |||
|       const float ty = points_[1].longitude_; | ||||
| 
 | ||||
|       // Offset x/y in pixels
 | ||||
|       const float ox = width_ * 0.5f * std::cosf(angle_); | ||||
|       const float oy = width_ * 0.5f * std::sinf(angle_); | ||||
|       const float ox = width_ * 0.5f * cosf(angle_); | ||||
|       const float oy = width_ * 0.5f * sinf(angle_); | ||||
| 
 | ||||
|       // Texture coordinates
 | ||||
|       const float ls = texture_.sLeft_; | ||||
|  |  | |||
|  | @ -35,8 +35,8 @@ public: | |||
|        z_ {0.0f}, | ||||
|        width_ {0.0f}, | ||||
|        height_ {0.0f}, | ||||
|        borderColor_ {0, 0, 0, 0}, | ||||
|        borderWidth_ {0.0f}, | ||||
|        borderColor_ {0, 0, 0, 0}, | ||||
|        fillColor_ {std::nullopt}, | ||||
|        shaderProgram_ {nullptr}, | ||||
|        uMVPMatrixLocation_(GL_INVALID_INDEX), | ||||
|  |  | |||
|  | @ -362,7 +362,7 @@ RadarProductManager::coordinates(common::RadialSize radialSize) const | |||
|       return p->coordinates1Degree_; | ||||
|    } | ||||
| 
 | ||||
|    throw std::exception("Invalid radial size"); | ||||
|    throw std::invalid_argument("Invalid radial size"); | ||||
| } | ||||
| 
 | ||||
| float RadarProductManager::gate_size() const | ||||
|  |  | |||
|  | @ -26,12 +26,13 @@ static const auto        logger_    = scwx::util::Logger::Create(logPrefix_); | |||
| class ColorTableLayerImpl | ||||
| { | ||||
| public: | ||||
|    explicit ColorTableLayerImpl(std::shared_ptr<MapContext> context) : | ||||
|    explicit ColorTableLayerImpl() : | ||||
|        shaderProgram_(nullptr), | ||||
|        uMVPMatrixLocation_(GL_INVALID_INDEX), | ||||
|        vbo_ {GL_INVALID_INDEX}, | ||||
|        vao_ {GL_INVALID_INDEX}, | ||||
|        texture_ {GL_INVALID_INDEX}, | ||||
|        colorTable_ {}, | ||||
|        colorTableNeedsUpdate_ {true} | ||||
|    { | ||||
|    } | ||||
|  | @ -50,7 +51,7 @@ public: | |||
| }; | ||||
| 
 | ||||
| ColorTableLayer::ColorTableLayer(std::shared_ptr<MapContext> context) : | ||||
|     GenericLayer(context), p(std::make_unique<ColorTableLayerImpl>(context)) | ||||
|     GenericLayer(context), p(std::make_unique<ColorTableLayerImpl>()) | ||||
| { | ||||
| } | ||||
| ColorTableLayer::~ColorTableLayer() = default; | ||||
|  |  | |||
|  | @ -502,8 +502,8 @@ void MapWidget::SetMapLocation(double latitude, | |||
|                                double longitude, | ||||
|                                bool   updateRadarSite) | ||||
| { | ||||
|    if (p->map_ != nullptr && p->prevLatitude_ != latitude || | ||||
|        p->prevLongitude_ != longitude) | ||||
|    if (p->map_ != nullptr && | ||||
|        (p->prevLatitude_ != latitude || p->prevLongitude_ != longitude)) | ||||
|    { | ||||
|       // Update the map location
 | ||||
|       p->map_->setCoordinate({latitude, longitude}); | ||||
|  | @ -787,6 +787,9 @@ void MapWidget::mapChanged(QMapLibreGL::Map::MapChange mapChange) | |||
|    case QMapLibreGL::Map::MapChangeDidFinishLoadingStyle: | ||||
|       AddLayers(); | ||||
|       break; | ||||
| 
 | ||||
|    default: | ||||
|       break; | ||||
|    } | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -112,11 +112,6 @@ void OverlayLayer::Render( | |||
|       p->sweepTimeNeedsUpdate_ = false; | ||||
|    } | ||||
| 
 | ||||
|    glm::mat4 projection = glm::ortho(0.0f, | ||||
|                                      static_cast<float>(params.width), | ||||
|                                      0.0f, | ||||
|                                      static_cast<float>(params.height)); | ||||
| 
 | ||||
|    // Active Box
 | ||||
|    p->activeBoxOuter_->SetVisible(settings.isActive_); | ||||
|    p->activeBoxInner_->SetVisible(settings.isActive_); | ||||
|  | @ -139,7 +134,7 @@ void OverlayLayer::Render( | |||
|                       nullptr, | ||||
|                       ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | | ||||
|                          ImGuiWindowFlags_AlwaysAutoResize); | ||||
|          ImGui::Text(productName.c_str()); | ||||
|          ImGui::TextUnformatted(productName.c_str()); | ||||
|          ImGui::End(); | ||||
|       } | ||||
|    } | ||||
|  | @ -154,7 +149,7 @@ void OverlayLayer::Render( | |||
|                    nullptr, | ||||
|                    ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | | ||||
|                       ImGuiWindowFlags_AlwaysAutoResize); | ||||
|       ImGui::Text(p->sweepTimeString_.c_str()); | ||||
|       ImGui::TextUnformatted(p->sweepTimeString_.c_str()); | ||||
|       ImGui::End(); | ||||
|    } | ||||
| 
 | ||||
|  |  | |||
|  | @ -37,7 +37,7 @@ LatLongToScreenCoordinate(const QMapLibreGL::Coordinate& coordinate); | |||
| class RadarProductLayerImpl | ||||
| { | ||||
| public: | ||||
|    explicit RadarProductLayerImpl(std::shared_ptr<MapContext> context) : | ||||
|    explicit RadarProductLayerImpl() : | ||||
|        shaderProgram_(nullptr), | ||||
|        uMVPMatrixLocation_(GL_INVALID_INDEX), | ||||
|        uMapScreenCoordLocation_(GL_INVALID_INDEX), | ||||
|  | @ -75,7 +75,7 @@ public: | |||
| }; | ||||
| 
 | ||||
| RadarProductLayer::RadarProductLayer(std::shared_ptr<MapContext> context) : | ||||
|     GenericLayer(context), p(std::make_unique<RadarProductLayerImpl>(context)) | ||||
|     GenericLayer(context), p(std::make_unique<RadarProductLayerImpl>()) | ||||
| { | ||||
| } | ||||
| RadarProductLayer::~RadarProductLayer() = default; | ||||
|  |  | |||
|  | @ -45,7 +45,7 @@ QVariant ImGuiContextModel::data(const QModelIndex& index, int role) const | |||
|    } | ||||
| 
 | ||||
|    const int row = index.row(); | ||||
|    if (row >= p->contexts_.size() || row < 0) | ||||
|    if (row >= static_cast<int>(p->contexts_.size()) || row < 0) | ||||
|    { | ||||
|       return {}; | ||||
|    } | ||||
|  |  | |||
|  | @ -81,7 +81,7 @@ int TreeItem::column_count() const | |||
| 
 | ||||
| QVariant TreeItem::data(int column) const | ||||
| { | ||||
|    if (0 <= column && column < p->itemData_.size()) | ||||
|    if (0 <= column && column < static_cast<int>(p->itemData_.size())) | ||||
|    { | ||||
|       return p->itemData_[column]; | ||||
|    } | ||||
|  | @ -152,7 +152,7 @@ bool TreeItem::InsertChildren(int position, int count, int columns) | |||
| 
 | ||||
| bool TreeItem::SetData(int column, const QVariant& value) | ||||
| { | ||||
|    if (column < 0 || column >= p->itemData_.size()) | ||||
|    if (column < 0 || column >= static_cast<int>(p->itemData_.size())) | ||||
|    { | ||||
|       return false; | ||||
|    } | ||||
|  |  | |||
|  | @ -164,7 +164,7 @@ void SettingsInterface<T>::SetEditWidget(QWidget* widget) | |||
|                      { | ||||
|                         // Error value
 | ||||
|                         value.push_back( | ||||
|                            std::numeric_limits<T::value_type>::min()); | ||||
|                            std::numeric_limits<typename T::value_type>::min()); | ||||
|                      } | ||||
|                   } | ||||
|                } | ||||
|  |  | |||
|  | @ -235,6 +235,9 @@ void SettingsDialogImpl::ConnectSignals() | |||
|          case QDialogButtonBox::ButtonRole::ResetRole: // Restore Defaults
 | ||||
|             ResetToDefault(); | ||||
|             break; | ||||
| 
 | ||||
|          default: | ||||
|             break; | ||||
|          } | ||||
|       }); | ||||
| } | ||||
|  |  | |||
|  | @ -285,7 +285,7 @@ void FontImpl::CreateImGuiFont(QFile&                      fontFile, | |||
|       strncpy(fontConfig.Name, | ||||
|               fmt::format("{}:{}", fileInfo.fileName().toStdString(), fontSize) | ||||
|                  .c_str(), | ||||
|               sizeof(fontConfig.Name)); | ||||
|               sizeof(fontConfig.Name) - 1); | ||||
|       fontConfig.Name[sizeof(fontConfig.Name) - 1] = 0; | ||||
| 
 | ||||
|       // Add font to atlas
 | ||||
|  |  | |||
|  | @ -158,13 +158,15 @@ void AwsLevel3DataProvider::Impl::ListProducts() | |||
| 
 | ||||
|    logger_->debug("ListProducts()"); | ||||
| 
 | ||||
|    static const std::string delimiter {"_"}; | ||||
| 
 | ||||
|    // Prefix format: GGG_
 | ||||
|    const std::string prefix = fmt::format("{0}_", siteId_); | ||||
| 
 | ||||
|    Aws::S3::Model::ListObjectsV2Request request; | ||||
|    request.SetBucket(bucketName_); | ||||
|    request.SetPrefix(prefix); | ||||
|    request.SetDelimiter("_"); | ||||
|    request.SetDelimiter(delimiter); | ||||
| 
 | ||||
|    auto outcome = self_->client()->ListObjectsV2(request); | ||||
| 
 | ||||
|  |  | |||
|  | @ -33,35 +33,35 @@ class Ar2vFileImpl | |||
| { | ||||
| public: | ||||
|    explicit Ar2vFileImpl() : | ||||
|        tapeFilename_(), | ||||
|        extensionNumber_(), | ||||
|        tapeFilename_ {}, | ||||
|        extensionNumber_ {}, | ||||
|        julianDate_ {0}, | ||||
|        milliseconds_ {0}, | ||||
|        icao_(), | ||||
|        rawRecords_(), | ||||
|        icao_ {}, | ||||
|        vcpData_ {nullptr}, | ||||
|        radarData_ {}, | ||||
|        index_ {} {}; | ||||
|        index_ {}, | ||||
|        rawRecords_ {} {}; | ||||
|    ~Ar2vFileImpl() = default; | ||||
| 
 | ||||
|    size_t DecompressLDMRecords(std::istream& is); | ||||
|    void   HandleMessage(std::shared_ptr<rda::Level2Message>& message); | ||||
|    void   IndexFile(); | ||||
|    void   ParseLDMRecords(); | ||||
|    void   ParseLDMRecord(std::istream& is); | ||||
|    void   ProcessRadarData(std::shared_ptr<rda::DigitalRadarData> message); | ||||
|    std::size_t DecompressLDMRecords(std::istream& is); | ||||
|    void        HandleMessage(std::shared_ptr<rda::Level2Message>& message); | ||||
|    void        IndexFile(); | ||||
|    void        ParseLDMRecords(); | ||||
|    void        ParseLDMRecord(std::istream& is); | ||||
|    void        ProcessRadarData(std::shared_ptr<rda::DigitalRadarData> message); | ||||
| 
 | ||||
|    std::string tapeFilename_; | ||||
|    std::string extensionNumber_; | ||||
|    uint32_t    julianDate_; | ||||
|    uint32_t    milliseconds_; | ||||
|    std::string icao_; | ||||
|    std::string   tapeFilename_; | ||||
|    std::string   extensionNumber_; | ||||
|    std::uint32_t julianDate_; | ||||
|    std::uint32_t milliseconds_; | ||||
|    std::string   icao_; | ||||
| 
 | ||||
|    std::shared_ptr<rda::VolumeCoveragePatternData>         vcpData_; | ||||
|    std::map<uint16_t, std::shared_ptr<rda::ElevationScan>> radarData_; | ||||
|    std::shared_ptr<rda::VolumeCoveragePatternData>              vcpData_; | ||||
|    std::map<std::uint16_t, std::shared_ptr<rda::ElevationScan>> radarData_; | ||||
| 
 | ||||
|    std::map<rda::DataBlockType, | ||||
|             std::map<uint16_t, std::shared_ptr<rda::ElevationScan>>> | ||||
|             std::map<std::uint16_t, std::shared_ptr<rda::ElevationScan>>> | ||||
|       index_; | ||||
| 
 | ||||
|    std::list<std::stringstream> rawRecords_; | ||||
|  | @ -70,7 +70,7 @@ public: | |||
| Ar2vFile::Ar2vFile() : p(std::make_unique<Ar2vFileImpl>()) {} | ||||
| Ar2vFile::~Ar2vFile() = default; | ||||
| 
 | ||||
| Ar2vFile::Ar2vFile(Ar2vFile&&) noexcept = default; | ||||
| Ar2vFile::Ar2vFile(Ar2vFile&&) noexcept            = default; | ||||
| Ar2vFile& Ar2vFile::operator=(Ar2vFile&&) noexcept = default; | ||||
| 
 | ||||
| uint32_t Ar2vFile::julian_date() const | ||||
|  |  | |||
|  | @ -43,7 +43,7 @@ DataBlock::DataBlock(const std::string& dataBlockType, | |||
| } | ||||
| DataBlock::~DataBlock() = default; | ||||
| 
 | ||||
| DataBlock::DataBlock(DataBlock&&) noexcept = default; | ||||
| DataBlock::DataBlock(DataBlock&&) noexcept            = default; | ||||
| DataBlock& DataBlock::operator=(DataBlock&&) noexcept = default; | ||||
| 
 | ||||
| class MomentDataBlockImpl | ||||
|  | @ -198,7 +198,7 @@ bool MomentDataBlock::Parse(std::istream& is) | |||
|    p->scale_                         = awips::Message::SwapFloat(p->scale_); | ||||
|    p->offset_                        = awips::Message::SwapFloat(p->offset_); | ||||
| 
 | ||||
|    if (p->numberOfDataMomentGates_ >= 0 && p->numberOfDataMomentGates_ <= 1840) | ||||
|    if (p->numberOfDataMomentGates_ <= 1840) | ||||
|    { | ||||
|       if (p->dataWordSize_ == 8) | ||||
|       { | ||||
|  |  | |||
|  | @ -64,7 +64,7 @@ DigitalRadialDataArrayPacket::DigitalRadialDataArrayPacket() : | |||
| DigitalRadialDataArrayPacket::~DigitalRadialDataArrayPacket() = default; | ||||
| 
 | ||||
| DigitalRadialDataArrayPacket::DigitalRadialDataArrayPacket( | ||||
|    DigitalRadialDataArrayPacket&&) noexcept                         = default; | ||||
|    DigitalRadialDataArrayPacket&&) noexcept = default; | ||||
| DigitalRadialDataArrayPacket& DigitalRadialDataArrayPacket::operator=( | ||||
|    DigitalRadialDataArrayPacket&&) noexcept = default; | ||||
| 
 | ||||
|  | @ -158,13 +158,13 @@ bool DigitalRadialDataArrayPacket::Parse(std::istream& is) | |||
|          logger_->warn("Invalid packet code: {}", p->packetCode_); | ||||
|          blockValid = false; | ||||
|       } | ||||
|       if (p->indexOfFirstRangeBin_ < 0 || p->indexOfFirstRangeBin_ > 230) | ||||
|       if (p->indexOfFirstRangeBin_ > 230) | ||||
|       { | ||||
|          logger_->warn("Invalid index of first range bin: {}", | ||||
|                        p->indexOfFirstRangeBin_); | ||||
|          blockValid = false; | ||||
|       } | ||||
|       if (p->numberOfRangeBins_ < 0 || p->numberOfRangeBins_ > 1840) | ||||
|       if (p->numberOfRangeBins_ > 1840) | ||||
|       { | ||||
|          logger_->warn("Invalid number of range bins: {}", | ||||
|                        p->numberOfRangeBins_); | ||||
|  |  | |||
|  | @ -102,11 +102,11 @@ bool VectorArrowDataPacket::Parse(std::istream& is) | |||
| 
 | ||||
|    // The number of vectors is equal to the size divided by the number of bytes
 | ||||
|    // in a vector
 | ||||
|    size_t vectorCount = p->lengthOfBlock_ / 10; | ||||
|    std::size_t vectorCount = p->lengthOfBlock_ / 10; | ||||
| 
 | ||||
|    p->arrow_.resize(vectorCount); | ||||
| 
 | ||||
|    for (int v = 0; v < vectorCount && !is.eof(); v++) | ||||
|    for (std::size_t v = 0; v < vectorCount && !is.eof(); v++) | ||||
|    { | ||||
|       VectorArrow& arrow = p->arrow_[v]; | ||||
| 
 | ||||
|  |  | |||
|  | @ -101,11 +101,11 @@ bool WindBarbDataPacket::Parse(std::istream& is) | |||
| 
 | ||||
|    // The number of vectors is equal to the size divided by the number of bytes
 | ||||
|    // in a vector
 | ||||
|    size_t vectorCount = p->lengthOfBlock_ / 10; | ||||
|    std::size_t vectorCount = p->lengthOfBlock_ / 10; | ||||
| 
 | ||||
|    p->windBarb_.resize(vectorCount); | ||||
| 
 | ||||
|    for (int v = 0; v < vectorCount && !is.eof(); v++) | ||||
|    for (std::size_t v = 0; v < vectorCount && !is.eof(); v++) | ||||
|    { | ||||
|       WindBarb& windBarb = p->windBarb_[v]; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat