MSVC: fix compiler warnings

This commit is contained in:
wmayer
2024-02-23 15:32:38 +01:00
committed by wwmayer
parent 78ffa29629
commit 64a91968a3
8 changed files with 12 additions and 9 deletions

View File

@@ -303,7 +303,7 @@ QWidget* setupMainWindow()
try {
Gui::initGuiAppPostMainWindow(true, *qApp, *mw, nullptr);
}
catch (const Base::Exception& e) {
catch (const Base::Exception&) {
return nullptr;
}

View File

@@ -3067,7 +3067,7 @@ App::Color CDxfRead::ObjectColor(ColorIndex_t index)
result = App::Color(brightness, brightness, brightness);
}
else {
static const std::array<float, 5> fades = {1.00, 0.74, 0.50, 0.40, 0.30};
static const std::array<float, 5> fades = {1.00F, 0.74F, 0.50F, 0.40F, 0.30F};
return wheel(index / 10 - 1, (index & 1) != 0 ? 0.69 : 0, fades[(index / 2) % 5]);
}
// TODO: These colors are modified to contrast with the background. In the original program

View File

@@ -476,7 +476,7 @@ void ModelSelect::onSelectModel(const QItemSelection& selected, const QItemSelec
ui->standardButtons->button(QDialogButtonBox::Ok)->setEnabled(true);
ui->buttonFavorite->setEnabled(true);
}
catch (const std::exception& e) {
catch (const std::exception&) {
_selected = QString::fromStdString("");
clearMaterialModel();
ui->standardButtons->button(QDialogButtonBox::Ok)->setEnabled(false);

View File

@@ -135,9 +135,6 @@
<property name="text">
<string>In x-direction:</string>
</property>
<property name="buddy">
<cstring>labelOffset</cstring>
</property>
</widget>
</item>
<item row="1" column="1">

View File

@@ -71,7 +71,7 @@ App::DocumentObjectExecReturn* Feature::recompute()
return StdReturn;
}
}
catch (Base::Exception& e) {
catch (Base::Exception&) {
//invalid BaseShape
Suppressed.setValue(false);
}

View File

@@ -27,6 +27,10 @@
#include <boost/math/constants/constants.hpp>
#include "../../SketcherGlobal.h"
#ifdef _MSC_VER
#pragma warning(disable : 4251)
#endif
namespace GCS
{
class SketcherExport Point

View File

@@ -241,6 +241,8 @@ public:
return isEndPointSelected;
case Sketcher::PointPos::mid:
return isMidPointSelected;
default:
return false;
}
}

View File

@@ -1099,7 +1099,7 @@ QGraphicsItem *QGIViewPart::getQGISubItemByName(const std::string &subName) cons
scanType = QGIFace::Type;
}
}
catch (Base::ValueError& e) {
catch (Base::ValueError&) {
// No action
}
if (!scanType) {
@@ -1110,7 +1110,7 @@ QGraphicsItem *QGIViewPart::getQGISubItemByName(const std::string &subName) cons
try {
scanIndex = TechDraw::DrawUtil::getIndexFromName(subName);
}
catch (Base::ValueError& e) {
catch (Base::ValueError&) {
// No action
}
if (scanIndex < 0) {