mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 23:30:05 +00:00 
			
		
		
		
	Fixing warnings in scwx-qt
This commit is contained in:
		
							parent
							
								
									3339a40780
								
							
						
					
					
						commit
						ff58f5bcf6
					
				
					 15 changed files with 36 additions and 21 deletions
				
			
		|  | @ -215,6 +215,15 @@ target_include_directories(scwx-qt PUBLIC ${scwx-qt_SOURCE_DIR}/source | ||||||
| 
 | 
 | ||||||
| target_include_directories(supercell-wx PUBLIC ${scwx-qt_SOURCE_DIR}/source) | target_include_directories(supercell-wx PUBLIC ${scwx-qt_SOURCE_DIR}/source) | ||||||
| 
 | 
 | ||||||
|  | target_compile_options(scwx-qt PRIVATE | ||||||
|  |     $<$<CXX_COMPILER_ID:MSVC>:/W4 /WX> | ||||||
|  |     $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Wextra -Wpedantic -Werror> | ||||||
|  | ) | ||||||
|  | target_compile_options(supercell-wx PRIVATE | ||||||
|  |     $<$<CXX_COMPILER_ID:MSVC>:/W4 /WX> | ||||||
|  |     $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Wextra -Wpedantic -Werror> | ||||||
|  | ) | ||||||
|  | 
 | ||||||
| target_link_libraries(scwx-qt PUBLIC Qt${QT_VERSION_MAJOR}::Widgets | target_link_libraries(scwx-qt PUBLIC Qt${QT_VERSION_MAJOR}::Widgets | ||||||
|                                      Qt${QT_VERSION_MAJOR}::OpenGLWidgets |                                      Qt${QT_VERSION_MAJOR}::OpenGLWidgets | ||||||
|                                      Boost::json |                                      Boost::json | ||||||
|  |  | ||||||
|  | @ -1,7 +1,9 @@ | ||||||
| #include <scwx/qt/gl/text_shader.hpp> | #include <scwx/qt/gl/text_shader.hpp> | ||||||
| #include <scwx/util/logger.hpp> | #include <scwx/util/logger.hpp> | ||||||
| 
 | 
 | ||||||
|  | #pragma warning(push, 0) | ||||||
| #include <glm/gtc/type_ptr.hpp> | #include <glm/gtc/type_ptr.hpp> | ||||||
|  | #pragma warning(pop) | ||||||
| 
 | 
 | ||||||
| namespace scwx | namespace scwx | ||||||
| { | { | ||||||
|  |  | ||||||
|  | @ -154,7 +154,7 @@ MainWindow::MainWindow(QWidget* parent) : | ||||||
|    connect(qApp, |    connect(qApp, | ||||||
|            &QApplication::focusChanged, |            &QApplication::focusChanged, | ||||||
|            this, |            this, | ||||||
|            [=](QWidget* old, QWidget* now) { p->HandleFocusChange(now); }); |            [=](QWidget* /*old*/, QWidget* now) { p->HandleFocusChange(now); }); | ||||||
|    connect(p->level2ProductsWidget_, |    connect(p->level2ProductsWidget_, | ||||||
|            &ui::Level2ProductsWidget::RadarProductSelected, |            &ui::Level2ProductsWidget::RadarProductSelected, | ||||||
|            this, |            this, | ||||||
|  | @ -277,7 +277,7 @@ void MainWindowImpl::ConfigureMapLayout() | ||||||
| 
 | 
 | ||||||
|    maps_.resize(mapCount); |    maps_.resize(mapCount); | ||||||
| 
 | 
 | ||||||
|    auto MoveSplitter = [=](int pos, int index) |    auto MoveSplitter = [=](int /*pos*/, int /*index*/) | ||||||
|    { |    { | ||||||
|       QSplitter* s = dynamic_cast<QSplitter*>(sender()); |       QSplitter* s = dynamic_cast<QSplitter*>(sender()); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -2,8 +2,10 @@ | ||||||
| #include <scwx/qt/gl/shader_program.hpp> | #include <scwx/qt/gl/shader_program.hpp> | ||||||
| #include <scwx/util/logger.hpp> | #include <scwx/util/logger.hpp> | ||||||
| 
 | 
 | ||||||
|  | #pragma warning(push, 0) | ||||||
| #include <glm/glm.hpp> | #include <glm/glm.hpp> | ||||||
| #include <glm/gtc/type_ptr.hpp> | #include <glm/gtc/type_ptr.hpp> | ||||||
|  | #pragma warning(pop) | ||||||
| 
 | 
 | ||||||
| namespace scwx | namespace scwx | ||||||
| { | { | ||||||
|  |  | ||||||
|  | @ -2,9 +2,11 @@ | ||||||
| #include <scwx/qt/gl/shader_program.hpp> | #include <scwx/qt/gl/shader_program.hpp> | ||||||
| #include <scwx/util/logger.hpp> | #include <scwx/util/logger.hpp> | ||||||
| 
 | 
 | ||||||
|  | #pragma warning(push, 0) | ||||||
| #include <glm/glm.hpp> | #include <glm/glm.hpp> | ||||||
| #include <glm/gtc/matrix_transform.hpp> | #include <glm/gtc/matrix_transform.hpp> | ||||||
| #include <glm/gtc/type_ptr.hpp> | #include <glm/gtc/type_ptr.hpp> | ||||||
|  | #pragma warning(pop) | ||||||
| 
 | 
 | ||||||
| namespace scwx | namespace scwx | ||||||
| { | { | ||||||
|  |  | ||||||
|  | @ -172,7 +172,7 @@ MapWidgetImpl::GetLevel2ProductOrDefault(const std::string& productName) const | ||||||
|    { |    { | ||||||
|       if (context_->radarProductView_ != nullptr) |       if (context_->radarProductView_ != nullptr) | ||||||
|       { |       { | ||||||
|          common::Level2Product level2Product = common::GetLevel2Product( |          level2Product = common::GetLevel2Product( | ||||||
|             context_->radarProductView_->GetRadarProductName()); |             context_->radarProductView_->GetRadarProductName()); | ||||||
|       } |       } | ||||||
|    } |    } | ||||||
|  |  | ||||||
|  | @ -9,6 +9,7 @@ | ||||||
| #include <chrono> | #include <chrono> | ||||||
| #include <execution> | #include <execution> | ||||||
| 
 | 
 | ||||||
|  | #pragma warning(push, 0) | ||||||
| #include <boost/date_time.hpp> | #include <boost/date_time.hpp> | ||||||
| #include <boost/date_time/local_time/local_time.hpp> | #include <boost/date_time/local_time/local_time.hpp> | ||||||
| #include <boost/timer/timer.hpp> | #include <boost/timer/timer.hpp> | ||||||
|  | @ -17,6 +18,7 @@ | ||||||
| #include <glm/gtc/matrix_transform.hpp> | #include <glm/gtc/matrix_transform.hpp> | ||||||
| #include <glm/gtc/type_ptr.hpp> | #include <glm/gtc/type_ptr.hpp> | ||||||
| #include <mbgl/util/constants.hpp> | #include <mbgl/util/constants.hpp> | ||||||
|  | #pragma warning(pop) | ||||||
| 
 | 
 | ||||||
| namespace scwx | namespace scwx | ||||||
| { | { | ||||||
|  |  | ||||||
|  | @ -4,12 +4,14 @@ | ||||||
| 
 | 
 | ||||||
| #include <execution> | #include <execution> | ||||||
| 
 | 
 | ||||||
|  | #pragma warning(push, 0) | ||||||
| #include <boost/timer/timer.hpp> | #include <boost/timer/timer.hpp> | ||||||
| #include <GeographicLib/Geodesic.hpp> | #include <GeographicLib/Geodesic.hpp> | ||||||
| #include <glm/glm.hpp> | #include <glm/glm.hpp> | ||||||
| #include <glm/gtc/matrix_transform.hpp> | #include <glm/gtc/matrix_transform.hpp> | ||||||
| #include <glm/gtc/type_ptr.hpp> | #include <glm/gtc/type_ptr.hpp> | ||||||
| #include <mbgl/util/constants.hpp> | #include <mbgl/util/constants.hpp> | ||||||
|  | #pragma warning(pop) | ||||||
| 
 | 
 | ||||||
| namespace scwx | namespace scwx | ||||||
| { | { | ||||||
|  |  | ||||||
|  | @ -44,7 +44,7 @@ RadarProductRecord::RadarProductRecord( | ||||||
|    std::shared_ptr<wsr88d::Ar2vFile>   level2File = level2_file(); |    std::shared_ptr<wsr88d::Ar2vFile>   level2File = level2_file(); | ||||||
|    std::shared_ptr<wsr88d::Level3File> level3File = level3_file(); |    std::shared_ptr<wsr88d::Level3File> level3File = level3_file(); | ||||||
| 
 | 
 | ||||||
|    uint16_t julianDate   = 0; |    uint32_t julianDate   = 0; | ||||||
|    uint32_t milliseconds = 0; |    uint32_t milliseconds = 0; | ||||||
| 
 | 
 | ||||||
|    if (level2File != nullptr) |    if (level2File != nullptr) | ||||||
|  |  | ||||||
|  | @ -35,7 +35,7 @@ public: | ||||||
|       layout_->setContentsMargins(0, 0, 0, 0); |       layout_->setContentsMargins(0, 0, 0, 0); | ||||||
| 
 | 
 | ||||||
|       elevationGroupBox_ = new QGroupBox(tr("Elevation"), self); |       elevationGroupBox_ = new QGroupBox(tr("Elevation"), self); | ||||||
|       QLayout* elevationLayout = new ui::FlowLayout(elevationGroupBox_); |       new ui::FlowLayout(elevationGroupBox_); | ||||||
|       layout_->addWidget(elevationGroupBox_); |       layout_->addWidget(elevationGroupBox_); | ||||||
| 
 | 
 | ||||||
|       settingsGroupBox_       = new QGroupBox(tr("Settings"), self); |       settingsGroupBox_       = new QGroupBox(tr("Settings"), self); | ||||||
|  |  | ||||||
|  | @ -16,6 +16,7 @@ | ||||||
| #include FT_SFNT_NAMES_H | #include FT_SFNT_NAMES_H | ||||||
| #include FT_TRUETYPE_IDS_H | #include FT_TRUETYPE_IDS_H | ||||||
| 
 | 
 | ||||||
|  | #pragma warning(push, 0) | ||||||
| // #include <freetype-gl.h> (exclude opengl.h)
 | // #include <freetype-gl.h> (exclude opengl.h)
 | ||||||
| #include <platform.h> | #include <platform.h> | ||||||
| #include <vec234.h> | #include <vec234.h> | ||||||
|  | @ -23,6 +24,7 @@ | ||||||
| #include <texture-atlas.h> | #include <texture-atlas.h> | ||||||
| #include <texture-font.h> | #include <texture-font.h> | ||||||
| #include <ftgl-utils.h> | #include <ftgl-utils.h> | ||||||
|  | #pragma warning(pop) | ||||||
| 
 | 
 | ||||||
| #ifdef WIN32 | #ifdef WIN32 | ||||||
| #   include <WinSock2.h> | #   include <WinSock2.h> | ||||||
|  | @ -179,7 +181,7 @@ float Font::BufferText(std::shared_ptr<FontBuffer> buffer, | ||||||
|    return x; |    return x; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| float Font::Kerning(char c1, char c2) const | float Font::Kerning(char /*c1*/, char /*c2*/) const | ||||||
| { | { | ||||||
|    // TODO
 |    // TODO
 | ||||||
|    return 0.0f; |    return 0.0f; | ||||||
|  |  | ||||||
|  | @ -225,27 +225,27 @@ void Level3ProductView::UpdateColorTable() | ||||||
|             uint16_t th = descriptionBlock->data_level_threshold(i); |             uint16_t th = descriptionBlock->data_level_threshold(i); | ||||||
|             if ((th & 0x8000u) == 0) |             if ((th & 0x8000u) == 0) | ||||||
|             { |             { | ||||||
|                float scale = 1.0f; |                float scaleFactor = 1.0f; | ||||||
| 
 | 
 | ||||||
|                if (th & 0x4000u) |                if (th & 0x4000u) | ||||||
|                { |                { | ||||||
|                   scale *= 0.01f; |                   scaleFactor *= 0.01f; | ||||||
|                } |                } | ||||||
|                if (th & 0x2000u) |                if (th & 0x2000u) | ||||||
|                { |                { | ||||||
|                   scale *= 0.05f; |                   scaleFactor *= 0.05f; | ||||||
|                } |                } | ||||||
|                if (th & 0x1000u) |                if (th & 0x1000u) | ||||||
|                { |                { | ||||||
|                   scale *= 0.1f; |                   scaleFactor *= 0.1f; | ||||||
|                } |                } | ||||||
|                if (th & 0x0100u) |                if (th & 0x0100u) | ||||||
|                { |                { | ||||||
|                   scale *= -1.0f; |                   scaleFactor *= -1.0f; | ||||||
|                } |                } | ||||||
| 
 | 
 | ||||||
|                // If bit 0 is zero, then the LSB is numeric
 |                // If bit 0 is zero, then the LSB is numeric
 | ||||||
|                f = static_cast<float>(th & 0x00ffu) * scale; |                f = static_cast<float>(th & 0x00ffu) * scaleFactor; | ||||||
| 
 | 
 | ||||||
|                lut[lutIndex] = p->colorTable_->Color(f); |                lut[lutIndex] = p->colorTable_->Color(f); | ||||||
|             } |             } | ||||||
|  |  | ||||||
|  | @ -254,8 +254,6 @@ void Level3RadialView::ComputeSweep() | ||||||
|    dataMoments8.resize(radials * gates * VERTICES_PER_BIN); |    dataMoments8.resize(radials * gates * VERTICES_PER_BIN); | ||||||
| 
 | 
 | ||||||
|    // Compute threshold at which to display an individual bin
 |    // Compute threshold at which to display an individual bin
 | ||||||
|    const float    scale        = descriptionBlock->scale(); |  | ||||||
|    const float    offset       = descriptionBlock->offset(); |  | ||||||
|    const uint16_t snrThreshold = descriptionBlock->threshold(); |    const uint16_t snrThreshold = descriptionBlock->threshold(); | ||||||
| 
 | 
 | ||||||
|    // Determine which radial to start at
 |    // Determine which radial to start at
 | ||||||
|  | @ -269,8 +267,6 @@ void Level3RadialView::ComputeSweep() | ||||||
| 
 | 
 | ||||||
|       // Compute gate interval
 |       // Compute gate interval
 | ||||||
|       const uint16_t dataMomentInterval = descriptionBlock->x_resolution_raw(); |       const uint16_t dataMomentInterval = descriptionBlock->x_resolution_raw(); | ||||||
|       const uint16_t dataMomentIntervalH = dataMomentInterval / 2; |  | ||||||
|       const uint16_t dataMomentRange     = dataMomentIntervalH; |  | ||||||
| 
 | 
 | ||||||
|       // Compute gate size (number of base gates per bin)
 |       // Compute gate size (number of base gates per bin)
 | ||||||
|       const uint16_t gateSize = std::max<uint16_t>( |       const uint16_t gateSize = std::max<uint16_t>( | ||||||
|  |  | ||||||
|  | @ -278,8 +278,6 @@ void Level3RasterView::ComputeSweep() | ||||||
|    dataMoments8.resize(rows * maxColumns * VERTICES_PER_BIN); |    dataMoments8.resize(rows * maxColumns * VERTICES_PER_BIN); | ||||||
| 
 | 
 | ||||||
|    // Compute threshold at which to display an individual bin
 |    // Compute threshold at which to display an individual bin
 | ||||||
|    const float    scale        = descriptionBlock->scale(); |  | ||||||
|    const float    offset       = descriptionBlock->offset(); |  | ||||||
|    const uint16_t snrThreshold = descriptionBlock->threshold(); |    const uint16_t snrThreshold = descriptionBlock->threshold(); | ||||||
| 
 | 
 | ||||||
|    for (size_t row = 0; row < rasterData->number_of_rows(); ++row) |    for (size_t row = 0; row < rasterData->number_of_rows(); ++row) | ||||||
|  |  | ||||||
|  | @ -79,7 +79,7 @@ void RadarProductView::Initialize() | ||||||
|    p->initialized_ = true; |    p->initialized_ = true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void RadarProductView::SelectElevation(float elevation) {} | void RadarProductView::SelectElevation(float /*elevation*/) {} | ||||||
| 
 | 
 | ||||||
| bool RadarProductView::IsInitialized() const | bool RadarProductView::IsInitialized() const | ||||||
| { | { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat