From c1e58d9416c79af92ca2a9f0ae3f419710a01c86 Mon Sep 17 00:00:00 2001 From: Michael Behrisch Date: Thu, 13 Feb 2025 13:39:20 +0100 Subject: [PATCH] fixing warnings and typos #22 #3 --- src/gui/GUIApplicationWindow.cpp | 2 +- src/gui/dialogs/GUIDialog_Breakpoints.cpp | 9 ++++++++- src/gui/dialogs/GUIDialog_Breakpoints.h | 1 + src/netedit/GNEViewNet.cpp | 14 ++++++++++++++ src/osgview/GUIOSGView.cpp | 3 ++- src/osgview/GUIOSGView.h | 1 + src/utils/gui/div/GUIDialog_GLChosenEditor.cpp | 2 +- .../gui/windows/GUIDanielPerspectiveChanger.h | 1 + .../gui/windows/GUIDialog_ChooserAbstract.cpp | 2 +- src/utils/gui/windows/GUIDialog_ChooserAbstract.h | 1 + src/utils/gui/windows/GUIDialog_EditViewport.cpp | 2 +- src/utils/gui/windows/GUIDialog_EditViewport.h | 1 + src/utils/gui/windows/GUIDialog_ViewSettings.h | 1 + src/utils/traction_wire/Circuit.h | 2 +- 14 files changed, 35 insertions(+), 7 deletions(-) diff --git a/src/gui/GUIApplicationWindow.cpp b/src/gui/GUIApplicationWindow.cpp index fb530e5b2f19..c19e48f0089e 100644 --- a/src/gui/GUIApplicationWindow.cpp +++ b/src/gui/GUIApplicationWindow.cpp @@ -243,7 +243,7 @@ std::mt19937 GUIApplicationWindow::myGamingRNG; // =========================================================================== #ifdef _MSC_VER #pragma warning(push) -#pragma warning(disable: 4355) // mask warning about "this" in intializers +#pragma warning(disable: 4355) // mask warning about "this" in initializers #endif GUIApplicationWindow::GUIApplicationWindow(FXApp* a, const std::string& configPattern) : GUIMainWindow(a), diff --git a/src/gui/dialogs/GUIDialog_Breakpoints.cpp b/src/gui/dialogs/GUIDialog_Breakpoints.cpp index a4e2ac109466..059e6c5f39d4 100644 --- a/src/gui/dialogs/GUIDialog_Breakpoints.cpp +++ b/src/gui/dialogs/GUIDialog_Breakpoints.cpp @@ -61,10 +61,14 @@ FXDEFMAP(GUIDialog_Breakpoints) GUIDialog_BreakpointsMap[] = { FXIMPLEMENT(GUIDialog_Breakpoints, FXMainWindow, GUIDialog_BreakpointsMap, ARRAYNUMBER(GUIDialog_BreakpointsMap)) + // =========================================================================== // method definitions // =========================================================================== - +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 4355) // mask warning about "this" in initializers +#endif GUIDialog_Breakpoints::GUIDialog_Breakpoints(GUIApplicationWindow* parent, std::vector& breakpoints, FXMutex& breakpointLock, const SUMOTime simBegin) : FXMainWindow(parent->getApp(), TL("Breakpoints Editor"), GUIIconSubSys::getIcon(GUIIcon::APP_BREAKPOINTS), nullptr, GUIDesignChooserDialog), GUIPersistentWindowPos(this, "DIALOG_BREAKPOINTS", true, 20, 40, 300, 350), @@ -104,6 +108,9 @@ GUIDialog_Breakpoints::GUIDialog_Breakpoints(GUIApplicationWindow* parent, std:: create(); show(); } +#ifdef _MSC_VER +#pragma warning(pop) +#endif GUIDialog_Breakpoints::~GUIDialog_Breakpoints() { diff --git a/src/gui/dialogs/GUIDialog_Breakpoints.h b/src/gui/dialogs/GUIDialog_Breakpoints.h index a74ce4e08332..d1f4a6e36c5e 100644 --- a/src/gui/dialogs/GUIDialog_Breakpoints.h +++ b/src/gui/dialogs/GUIDialog_Breakpoints.h @@ -53,6 +53,7 @@ class GUIDialog_Breakpoints : public FXMainWindow, public GUIPersistentWindowPos /// @brief sets the focus after the window is created void show(); + using FXMainWindow::show; // to silence the warning C4266 about a hidden function /// @name FOX-callbacks /// @{ diff --git a/src/netedit/GNEViewNet.cpp b/src/netedit/GNEViewNet.cpp index 5e0690a9d26e..0f27eec04db7 100644 --- a/src/netedit/GNEViewNet.cpp +++ b/src/netedit/GNEViewNet.cpp @@ -251,6 +251,10 @@ FXIMPLEMENT(GNEViewNet, GUISUMOAbstractView, GNEViewNetMap, ARRAYNUMBER(GNEViewN // =========================================================================== // member method definitions // =========================================================================== +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 4355) // mask warning about "this" in initializers +#endif GNEViewNet::GNEViewNet(FXComposite* tmpParent, FXComposite* actualParent, GUIMainWindow& app, GNEViewParent* viewParent, GNENet* net, GNEUndoList* undoList, FXGLVisual* glVis, FXGLCanvas* share) : @@ -299,6 +303,9 @@ GNEViewNet::GNEViewNet(FXComposite* tmpParent, FXComposite* actualParent, GUIMai myDemandViewOptions.menuCheckToggleDrawJunctionShape->setChecked(hide); myDataViewOptions.menuCheckToggleDrawJunctionShape->setChecked(hide); } +#ifdef _MSC_VER +#pragma warning(pop) +#endif GNEViewNet::~GNEViewNet() { @@ -1188,6 +1195,10 @@ GNEViewNet::removeRestrictedLane(GNELane* lane, SUMOVehicleClass vclass) { } +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 4355) // mask warning about "this" in initializers +#endif GNEViewNet::GNEViewNet() : myViewObjectsSelector(this), myEditModes(this), @@ -1210,6 +1221,9 @@ GNEViewNet::GNEViewNet() : myEditNetworkElementShapes(this), myLockManager(this) { } +#ifdef _MSC_VER +#pragma warning(pop) +#endif std::vector diff --git a/src/osgview/GUIOSGView.cpp b/src/osgview/GUIOSGView.cpp index c9a39e6859f8..55e8586fdf2d 100644 --- a/src/osgview/GUIOSGView.cpp +++ b/src/osgview/GUIOSGView.cpp @@ -138,7 +138,7 @@ GUIOSGView::GUIOSGView( GUINet& net, FXGLVisual* glVis, FXGLCanvas* share) : GUISUMOAbstractView(p, app, parent, net.getVisualisationSpeedUp(), glVis, share), - myTracked(0), myCameraManipulator(new GUIOSGManipulator(this)), myLastUpdate(-1), + myTracked(0), myLastUpdate(-1), myOSGNormalizedCursorX(0.), myOSGNormalizedCursorY(0.) { if (myChanger != nullptr) { delete (myChanger); @@ -147,6 +147,7 @@ GUIOSGView::GUIOSGView( int h = getHeight(); myAdapter = new FXOSGAdapter(this, new FXCursor(parent->getApp(), CURSOR_CROSS)); myViewer = new osgViewer::Viewer(); + myCameraManipulator = new GUIOSGManipulator(this); myChanger = new GUIOSGPerspectiveChanger(*this, *myGrid); const char* sumoPath = getenv("SUMO_HOME"); if (sumoPath != 0) { diff --git a/src/osgview/GUIOSGView.h b/src/osgview/GUIOSGView.h index e45627594005..ded857c1362d 100644 --- a/src/osgview/GUIOSGView.h +++ b/src/osgview/GUIOSGView.h @@ -337,6 +337,7 @@ class GUIOSGView : public GUISUMOAbstractView { public: PickHandler(GUIOSGView* parent) : myParent(parent), myDrag(false) {}; bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa); + using osgGA::GUIEventHandler::handle; // to silence the warning C4266 about a hidden function protected: ~PickHandler() {}; private: diff --git a/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp b/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp index 8a9d0caa6464..e77a2a43c072 100644 --- a/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp +++ b/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp @@ -57,7 +57,7 @@ FXIMPLEMENT(GUIDialog_GLChosenEditor, FXMainWindow, GUIDialog_GLChosenEditorMap, // =========================================================================== #ifdef _MSC_VER #pragma warning(push) -#pragma warning(disable: 4355) // mask warning about "this" in intializers +#pragma warning(disable: 4355) // mask warning about "this" in initializers #endif GUIDialog_GLChosenEditor::GUIDialog_GLChosenEditor(GUIMainWindow* parent, GUISelectedStorage* str) : FXMainWindow(parent->getApp(), "List of Selected Items", GUIIconSubSys::getIcon(GUIIcon::APP_SELECTOR), nullptr, GUIDesignChooserDialog), diff --git a/src/utils/gui/windows/GUIDanielPerspectiveChanger.h b/src/utils/gui/windows/GUIDanielPerspectiveChanger.h index 0bf20ac3ee47..a5b87a94550a 100644 --- a/src/utils/gui/windows/GUIDanielPerspectiveChanger.h +++ b/src/utils/gui/windows/GUIDanielPerspectiveChanger.h @@ -91,6 +91,7 @@ class GUIDanielPerspectiveChanger : public GUIPerspectiveChanger { /** @brief Sets the viewport */ void setViewport(double zoom, double xPos, double yPos); + using GUIPerspectiveChanger::setViewport; // to silence the warning C4266 about a hidden function /// @brief Alternative method for setting the viewport void setViewportFrom(double xPos, double yPos, double zPos); diff --git a/src/utils/gui/windows/GUIDialog_ChooserAbstract.cpp b/src/utils/gui/windows/GUIDialog_ChooserAbstract.cpp index 9bcff845549c..7756f916c8ba 100644 --- a/src/utils/gui/windows/GUIDialog_ChooserAbstract.cpp +++ b/src/utils/gui/windows/GUIDialog_ChooserAbstract.cpp @@ -67,7 +67,7 @@ FXIMPLEMENT(GUIDialog_ChooserAbstract, FXMainWindow, GUIDialog_ChooserAbstractMa // =========================================================================== #ifdef _MSC_VER #pragma warning(push) -#pragma warning(disable: 4355) // mask warning about "this" in intializers +#pragma warning(disable: 4355) // mask warning about "this" in initializers #endif GUIDialog_ChooserAbstract::GUIDialog_ChooserAbstract(GUIGlChildWindow* windowsParent, int messageId, FXIcon* icon, const FXString& title, const std::vector& ids, GUIGlObjectStorage& /*glStorage*/) : diff --git a/src/utils/gui/windows/GUIDialog_ChooserAbstract.h b/src/utils/gui/windows/GUIDialog_ChooserAbstract.h index e934b73ba296..bf48265ecdbb 100644 --- a/src/utils/gui/windows/GUIDialog_ChooserAbstract.h +++ b/src/utils/gui/windows/GUIDialog_ChooserAbstract.h @@ -119,6 +119,7 @@ class GUIDialog_ChooserAbstract : public FXMainWindow, public GUIPersistentWindo /// @brief sets the focus after the window is created to work-around bug in libfox void show(); + using FXMainWindow::show; // to silence the warning C4266 about a hidden function int getMessageId() const { return myMessageId; diff --git a/src/utils/gui/windows/GUIDialog_EditViewport.cpp b/src/utils/gui/windows/GUIDialog_EditViewport.cpp index e225f47ed0f4..e223c32e31fb 100644 --- a/src/utils/gui/windows/GUIDialog_EditViewport.cpp +++ b/src/utils/gui/windows/GUIDialog_EditViewport.cpp @@ -56,7 +56,7 @@ FXIMPLEMENT(GUIDialog_EditViewport, FXDialogBox, GUIDialog_EditViewportMap, ARRA #ifdef _MSC_VER #pragma warning(push) -#pragma warning(disable: 4355) // mask warning about "this" in intializers +#pragma warning(disable: 4355) // mask warning about "this" in initializers #endif GUIDialog_EditViewport::GUIDialog_EditViewport(GUISUMOAbstractView* parent, const char* name) : FXDialogBox(parent, name, GUIDesignDialogBox, 0, 0, 0, 0, 0, 0, 0, 0), diff --git a/src/utils/gui/windows/GUIDialog_EditViewport.h b/src/utils/gui/windows/GUIDialog_EditViewport.h index 28fa1fb5bfac..501249d02768 100644 --- a/src/utils/gui/windows/GUIDialog_EditViewport.h +++ b/src/utils/gui/windows/GUIDialog_EditViewport.h @@ -63,6 +63,7 @@ class GUIDialog_EditViewport : public FXDialogBox, public GUIPersistentWindowPos /// @brief overload show function to focus always in OK Button void show(); + using FXDialogBox::show; // to silence the warning C4266 about a hidden function /// @name FOX-callbacks /// @{ diff --git a/src/utils/gui/windows/GUIDialog_ViewSettings.h b/src/utils/gui/windows/GUIDialog_ViewSettings.h index f4694b19ea81..b3934caa3f1f 100644 --- a/src/utils/gui/windows/GUIDialog_ViewSettings.h +++ b/src/utils/gui/windows/GUIDialog_ViewSettings.h @@ -186,6 +186,7 @@ class GUIDialog_ViewSettings : public FXDialogBox, public GUIPersistentWindowPos /// @brief show view settings dialog void show(); + using FXDialogBox::show; // to silence the warning C4266 about a hidden function /// @brief get GUISUMOAbstractView parent GUISUMOAbstractView* getSUMOAbstractView(); diff --git a/src/utils/traction_wire/Circuit.h b/src/utils/traction_wire/Circuit.h index 89a45ab648bf..1b629fffdb0f 100644 --- a/src/utils/traction_wire/Circuit.h +++ b/src/utils/traction_wire/Circuit.h @@ -30,7 +30,7 @@ #ifdef HAVE_EIGEN #ifdef _MSC_VER #pragma warning(push) -#pragma warning(disable: 4464 5031) +#pragma warning(disable: 4127 4464 5031) #endif // avoid warnings in clang #ifdef __clang__