浏览代码

remove warnings

Nicolas Winkler 5 年之前
父节点
当前提交
fff5644669

+ 2 - 2
Almond.pro

@@ -77,9 +77,9 @@ win32:LIBS += -lopengl32
 else:LIBS += -lOpenGL
 
 win32:QMAKE_CXXFLAGS += -openmp
-else:unix:QMAKE_CXXFLAGS +=
+else:unix:QMAKE_CXXFLAGS += -fopenmp
 win32:QMAKE_LFLAGS +=  -openmp
-else:unix:QMAKE_LFLAGS+= -fopenmp -flto
+else:unix:QMAKE_LFLAGS+= -fopenmp
 LIBS += -fopenmp
 unix:LIBS += -lm -latomic
 

+ 2 - 2
BackgroundTask.cpp

@@ -1,8 +1,8 @@
 #include "BackgroundTask.h"
 
-BackgroundTask::BackgroundTask(QRunnable* q)
+BackgroundTask::BackgroundTask(QRunnable* q) :
+    task{ q }
 {
-
 }
 
 

+ 1 - 0
BackgroundTask.h

@@ -5,6 +5,7 @@
 
 class BackgroundTask
 {
+    QRunnable* task;
 public:
     BackgroundTask(QRunnable* task);
 

+ 3 - 3
MandelVideoGenerator.cpp

@@ -118,7 +118,7 @@ inline RGBColor nearest(const Bitmap<RGBColor>& img, double x, double y)
 
 
 Bitmap<RGBColor> MandelVideoGenerator::overlay(const Bitmap<RGBColor>& outer,
-                         const Bitmap<RGBColor>& inner, double scale)
+                         const Bitmap<RGBColor>& /* inner */, double scale)
 {
     printf("%lf\n", scale);
     Bitmap<RGBColor> ret{ outer.width / 2, outer.height / 2 };
@@ -127,7 +127,7 @@ Bitmap<RGBColor> MandelVideoGenerator::overlay(const Bitmap<RGBColor>& outer,
     double newX = outer.width * (1 - scale) / 2;
     double newY = outer.height * (1 - scale) / 2;
 
-    auto before = std::chrono::high_resolution_clock::now();
+    //auto before = std::chrono::high_resolution_clock::now();
 #pragma omp parallel for
     for (int i = 0; i < ret.height; i++) {
         for (int j = 0; j < ret.width; j++) {
@@ -137,7 +137,7 @@ Bitmap<RGBColor> MandelVideoGenerator::overlay(const Bitmap<RGBColor>& outer,
             ret.get(j, i) = a;
         }
     }
-    auto after = std::chrono::high_resolution_clock::now();
+    //auto after = std::chrono::high_resolution_clock::now();
     //printf("gradient applied in: %lld microseconds\n", std::chrono::duration_cast<std::chrono::microseconds>(after - before).count());
     fflush(stdout);
     /*for (int i = 0; i < ret.height * ret.width; i++) {

+ 1 - 1
MandelWidget.cpp

@@ -385,7 +385,7 @@ void MandelView::clearCells(void)
 }
 
 
-void MandelView::garbageCollect(int level, GridIndex i, GridIndex j)
+void MandelView::garbageCollect(int level, GridIndex /*i*/, GridIndex /*j*/)
 {
     for(auto& [l, grid] : levels) {
         int dist = ::abs(l - level);

+ 1 - 1
VideoStream.cpp

@@ -128,7 +128,7 @@ void VideoStream::encode(AVFrame* frame)
             exit(1);
         }
 
-        printf("encoded frame %3d\"PRId64\" (size=%5d)\n", pkt->pts, pkt->size);
+        printf("encoded frame %3ld\"PRId64\" (size=%5d)\n", long(pkt->pts), pkt->size);
         //fwrite(pkt->data, 1, pkt->size, outfile);
         //av_interleaved_write_frame(formatContext, pkt);
 

+ 4 - 4
choosegenerators.cpp

@@ -191,7 +191,7 @@ ChooseGenerators::ChooseGenerators(mnd::MandelContext& mndCtxt, mnd::AdaptiveGen
         }
     }*/
 
-    initializeTables(allGenerators);
+    initializeTables();
 
     //ui->addRow->setIcon(ui->addRow->style()->standardIcon(QStyle::SP_));
     //ui->moveRowUp->setIcon(ui->moveRowUp->style()->standardIcon(QStyle::SP_ArrowUp));
@@ -245,7 +245,7 @@ ChooseGenerators::ChooseGenerators(mnd::MandelContext& mndCtxt, mnd::GeneratorCo
         allGenerators.push_back(gen.get());
     }*/
 
-    initializeTables(allGenerators);
+    initializeTables();
 }
 
 
@@ -255,7 +255,7 @@ ChooseGenerators::~ChooseGenerators()
 
 
 
-void ChooseGenerators::initializeTables(const std::vector<mnd::MandelGenerator*>& allGenerators)
+void ChooseGenerators::initializeTables(void)
 {
     for (auto it = generator.getGenerators().rbegin(); it != generator.getGenerators().rend(); it++) {
         auto& [prec, gen] = *it;
@@ -388,7 +388,7 @@ void ChooseGenerators::on_buttonBox_accepted()
             if (generator)
                 chosenGenerator->addGenerator(precision, *generator);
         }*/
-        for (size_t i = 0; i < ui->table->rowCount(); i++) {
+        for (int i = 0; i < ui->table->rowCount(); i++) {
             QLineEdit* precItem = dynamic_cast<QLineEdit*>(ui->table->cellWidget(i, 0));
             QWidget* genWidget = ui->table->cellWidget(i, 1);
             QComboBox* genItem = dynamic_cast<QComboBox*>(genWidget);

+ 1 - 1
choosegenerators.h

@@ -94,7 +94,7 @@ public:
 
 private:
 
-    void initializeTables(const std::vector<mnd::MandelGenerator *> &allGenerators);
+    void initializeTables(void);
 
     QComboBox* createComboBox(void);
     QLineEdit* createFloatText(void);

+ 4 - 4
choosegenerators.ui

@@ -107,14 +107,14 @@
               <bool>true</bool>
              </property>
              <attribute name="horizontalHeaderVisible">
-              <bool>false</bool>
-             </attribute>
-             <attribute name="horizontalHeaderDefaultSectionSize">
-              <number>180</number>
+              <bool>true</bool>
              </attribute>
              <attribute name="horizontalHeaderMinimumSectionSize">
               <number>100</number>
              </attribute>
+             <attribute name="horizontalHeaderDefaultSectionSize">
+              <number>180</number>
+             </attribute>
              <attribute name="verticalHeaderVisible">
               <bool>false</bool>
              </attribute>

+ 1 - 1
exportdialogs.cpp

@@ -7,7 +7,7 @@
 #include "Mandel.h"
 #include "VideoStream.h"
 
-static bool exportVideo(const ExportVideoInfo& evi);
+//static bool exportVideo(const ExportVideoInfo& evi);
 
 ExportImageDialog::ExportImageDialog(QWidget* parent) :
     QDialog{ parent }

+ 1 - 2
gradientchoosedialog.cpp

@@ -26,9 +26,8 @@ void GradientChooseDialog::on_buttonBox_accepted()
 }
 
 
-void GradientChooseDialog::on_buttonBox_clicked(QAbstractButton *button)
+void GradientChooseDialog::on_buttonBox_clicked(QAbstractButton*)
 {
-
 }
 
 void GradientChooseDialog::on_presets_currentIndexChanged(const QString& index)

+ 3 - 3
libmandel/include/Generators.h

@@ -117,22 +117,22 @@ protected:
 public:
     MandelGenerator();
     inline MandelGenerator(Precision type) :
-        type{ type },
         precision{ mnd::getPrecision(type) },
+        type{ type },
         extension{ mnd::CpuExtension::NONE }
     {
     }
 
     inline MandelGenerator(Precision type, CpuExtension extension) :
-        type{ type },
         precision{ mnd::getPrecision(type) },
+        type{ type },
         extension{ extension }
     {
     }
 
     inline MandelGenerator(Precision type, CpuExtension extension, const Real& precision) :
-        type{ type },
         precision{ precision },
+        type{ type },
         extension{ extension }
     {
     }