From 3b942d827c474eb3b602d2e71d31cd6fdc2d7970 Mon Sep 17 00:00:00 2001 From: Viktor Uzlov Date: Mon, 17 Aug 2020 16:12:15 +0300 Subject: [PATCH] fix warning "mismatch signed unsigned", "conversion variables", add commit struct "GUI_UNUSED(var)" part2 --- src/GraphicsView/GraphicsView_Object.cxx | 1 + src/GraphicsView/GraphicsView_Object.h | 6 +++--- src/GraphicsView/GraphicsView_Scene.cxx | 8 ++++---- src/GraphicsView/GraphicsView_Selector.cxx | 1 + src/GraphicsView/GraphicsView_Viewer.cxx | 3 ++- src/LightApp/LightApp_Driver.cxx | 10 +++++----- src/LightApp/LightApp_Study.cxx | 4 ++-- src/OCCViewer/OCCViewer_ClippingDlg.cxx | 2 +- src/OCCViewer/OCCViewer_EnvTextureDlg.cxx | 2 +- src/OCCViewer/OCCViewer_ViewFrame.h | 6 +++--- src/OCCViewer/OCCViewer_ViewModel.cxx | 2 +- src/OCCViewer/OCCViewer_ViewSketcher.cxx | 2 +- src/OCCViewer/OCCViewer_ViewWindow.cxx | 2 +- src/PVViewer/PVViewer_Behaviors.cxx | 1 + src/PVViewer/PVViewer_Core.cxx | 1 + src/Plot2d/Plot2d_PlotItems.cxx | 8 ++++---- src/Plot2d/Plot2d_ViewFrame.cxx | 2 +- src/QxScene/QxScene_ViewModel.cxx | 1 + src/QxScene/QxScene_ViewWindow.cxx | 2 ++ src/SALOME_PY/SalomePy.cxx | 2 +- .../SALOME_PYQT_BorrowedDataObjectLight.cxx | 1 + .../SALOME_PYQT_DataModelLight.cxx | 3 +++ .../SALOME_PYQT_DataObjectLight.cxx | 1 + .../SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx | 1 + .../SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx | 1 + src/SOCC/SOCC_ViewModel.cxx | 2 ++ src/SOCC/SOCC_ViewWindow.cxx | 2 +- src/SPlot2d/SPlot2d_ViewModel.cxx | 2 +- src/SPlot2d/SPlot2d_ViewModel.h | 2 +- src/SalomeApp/SalomeApp_Application.cxx | 2 ++ src/SalomeApp/SalomeApp_DataModel.cxx | 1 + src/SalomeApp/SalomeApp_Engine_i.cxx | 5 +++-- src/SalomeApp/SalomeApp_ListView.cxx | 6 +++--- src/SalomeApp/SalomeApp_Module.cxx | 2 ++ src/SalomeApp/SalomeApp_Study.cxx | 9 +++++---- src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx | 2 +- src/TOOLSGUI/ToolsGUI.cxx | 6 +++--- src/TOOLSGUI/ToolsGUI_RegWidget.cxx | 6 +++--- src/TreeData/DockWidgets.cxx | 3 ++- tools/PyInterp/src/PyInterp_Interp.cxx | 2 +- 40 files changed, 75 insertions(+), 50 deletions(-) diff --git a/src/GraphicsView/GraphicsView_Object.cxx b/src/GraphicsView/GraphicsView_Object.cxx index 159f79571..ed3dbbb81 100644 --- a/src/GraphicsView/GraphicsView_Object.cxx +++ b/src/GraphicsView/GraphicsView_Object.cxx @@ -101,6 +101,7 @@ QRectF GraphicsView_Object::getRect() const //================================================================ bool GraphicsView_Object::checkHighlight( double theX, double theY, QCursor& theCursor ) const { + /*GUI_UNUSED(theCursor);*/ return !getRect().isNull() && getRect().contains( theX, theY ); } diff --git a/src/GraphicsView/GraphicsView_Object.h b/src/GraphicsView/GraphicsView_Object.h index dd976fe6f..4c5796186 100644 --- a/src/GraphicsView/GraphicsView_Object.h +++ b/src/GraphicsView/GraphicsView_Object.h @@ -74,10 +74,10 @@ public: virtual void move( double theDX, double theDY, bool theIsAtOnce = false ); virtual bool finishMove( bool theStatus ); virtual bool isMoving() const { return myIsMoving; } - virtual bool isMovingByXAllowed( double theDX ) { return true; } - virtual bool isMovingByYAllowed( double theDY ) { return true; } + virtual bool isMovingByXAllowed( double theDX ) {/*GUI_UNUSED(theDX);*/ return true; } + virtual bool isMovingByYAllowed( double theDY ) {/*GUI_UNUSED(theDY);*/ return true; } - virtual bool updateScale( bool theIsScaleUp, bool theIsCtrl ) { return false; } + virtual bool updateScale( bool theIsScaleUp, bool theIsCtrl ) {/*GUI_UNUSED(theIsScaleUp);GUI_UNUSED(theIsCtrl);*/ return false; } virtual QRectF getPullingRect() const { return getRect(); } virtual bool portContains( const QPointF& ) { return false; } diff --git a/src/GraphicsView/GraphicsView_Scene.cxx b/src/GraphicsView/GraphicsView_Scene.cxx index 621fe0934..33f5905d3 100644 --- a/src/GraphicsView/GraphicsView_Scene.cxx +++ b/src/GraphicsView/GraphicsView_Scene.cxx @@ -170,7 +170,7 @@ void GraphicsView_Scene::contextMenuEvent( QGraphicsSceneContextMenuEvent* e ) // Function : dragEnterEvent // Purpose : //================================================================ -void GraphicsView_Scene::dragEnterEvent( QGraphicsSceneDragDropEvent* e ) +void GraphicsView_Scene::dragEnterEvent( QGraphicsSceneDragDropEvent* /*e*/ ) //!< TODO: unused variable { //QGraphicsScene::dragEnterEvent( e ); // don't uncomment } @@ -179,7 +179,7 @@ void GraphicsView_Scene::dragEnterEvent( QGraphicsSceneDragDropEvent* e ) // Function : dragLeaveEvent // Purpose : //================================================================ -void GraphicsView_Scene::dragLeaveEvent( QGraphicsSceneDragDropEvent* e ) +void GraphicsView_Scene::dragLeaveEvent( QGraphicsSceneDragDropEvent* /*e*/ ) //!< TODO: unused variable { //QGraphicsScene::dragLeaveEvent( e ); // don't uncomment } @@ -188,7 +188,7 @@ void GraphicsView_Scene::dragLeaveEvent( QGraphicsSceneDragDropEvent* e ) // Function : dragMoveEvent // Purpose : //================================================================ -void GraphicsView_Scene::dragMoveEvent( QGraphicsSceneDragDropEvent* e ) +void GraphicsView_Scene::dragMoveEvent( QGraphicsSceneDragDropEvent* /*e*/ ) //!< TODO: unused variable { //QGraphicsScene::dragMoveEvent( e ); // don't uncomment } @@ -197,7 +197,7 @@ void GraphicsView_Scene::dragMoveEvent( QGraphicsSceneDragDropEvent* e ) // Function : dropEvent // Purpose : //================================================================ -void GraphicsView_Scene::dropEvent( QGraphicsSceneDragDropEvent* e ) +void GraphicsView_Scene::dropEvent( QGraphicsSceneDragDropEvent* /*e*/ ) //!< TODO: unused variable { //QGraphicsScene::dropEvent( e ); // don't uncomment } diff --git a/src/GraphicsView/GraphicsView_Selector.cxx b/src/GraphicsView/GraphicsView_Selector.cxx index fa8c60a3e..8bc9ae194 100644 --- a/src/GraphicsView/GraphicsView_Selector.cxx +++ b/src/GraphicsView/GraphicsView_Selector.cxx @@ -105,6 +105,7 @@ void GraphicsView_Selector::unselectAll() //================================================================ void GraphicsView_Selector::checkSelection( int selBefore, bool append, int theStatus ) { + //GUI_UNUSED(append); int selAfter = numSelected(); if ( selBefore > 0 && selAfter < 1 ) emit selSelectionCancel(); diff --git a/src/GraphicsView/GraphicsView_Viewer.cxx b/src/GraphicsView/GraphicsView_Viewer.cxx index c57049b4f..d701baa9c 100644 --- a/src/GraphicsView/GraphicsView_Viewer.cxx +++ b/src/GraphicsView/GraphicsView_Viewer.cxx @@ -57,6 +57,7 @@ GraphicsView_Viewer::GraphicsView_Viewer( const QString& title, QWidget* widget myWidget( widget ), myIsInitialized( false ) { + //GUI_UNUSED(title); } //======================================================================= @@ -364,7 +365,7 @@ void GraphicsView_Viewer::handleKeyPress( QKeyEvent* e ) // Function : handleKeyRelease // Purpose : //================================================================ -void GraphicsView_Viewer::handleKeyRelease( QKeyEvent* e ) +void GraphicsView_Viewer::handleKeyRelease( QKeyEvent* /*e*/ ) //!< TODO: unused variable { } diff --git a/src/LightApp/LightApp_Driver.cxx b/src/LightApp/LightApp_Driver.cxx index ea9ba5952..8b95a36f6 100644 --- a/src/LightApp/LightApp_Driver.cxx +++ b/src/LightApp/LightApp_Driver.cxx @@ -74,7 +74,7 @@ bool LightApp_Driver::SaveDatasInFile( const char* theFileName, bool isMultiFile for (it = myMap.begin(); it != myMap.end(); ++it) { aModuleName[i] = const_cast(it->first.c_str());//(it->first); aFileBufferSize += 4; //Add 4 bytes: a length of the module name - aFileBufferSize += strlen(aModuleName[i])+1; + aFileBufferSize += (int)strlen(aModuleName[i])+1; //!< TODO: conversion from size_t to int std::string aName(aModuleName[i]); PutFilesToStream(aName, aBuffer[i], aBufferSize[i], isMultiFile); aFileBufferSize += 8; //Add 8 bytes: a length of the buffer @@ -99,7 +99,7 @@ bool LightApp_Driver::SaveDatasInFile( const char* theFileName, bool isMultiFile int aBufferNameSize = 0; for (i = 0; i < n; i++) { - aBufferNameSize = strlen(aModuleName[i])+1; + aBufferNameSize = (int)strlen(aModuleName[i])+1; //!< TODO: conversion from size_t to int //Initialize 4 bytes of the buffer by 0 memset((aFileBuffer + aCurrentPos), 0, 4); //Copy the length of the module name to the buffer @@ -238,7 +238,7 @@ void LightApp_Driver::PutFilesToStream( const std::string& theModuleName, unsign // aFiles must contain temporary directory name in its first item // and names of files (relatively the temporary directory) in the others - int i, aLength = aFiles.size() - 1; + int i, aLength = (int)aFiles.size() - 1; //!< TODO: conversion size_t to int if(aLength <= 0) { theBufferSize = 0; theBuffer = new unsigned char[theBufferSize]; @@ -273,7 +273,7 @@ void LightApp_Driver::PutFilesToStream( const std::string& theModuleName, unsign aFileSize[i] = aFile.tellg(); aBufferSize += aFileSize[i]; //Add a space to store the file } - aFileNameSize[i] = strlen(aFName) + 1; + aFileNameSize[i] = (int)strlen(aFName) + 1; //!< TODO: conversion from size_t to int aBufferSize += aFileNameSize[i]; //Add a space to store the file name aBufferSize += (theNamesOnly)?4:12; //Add 4 bytes: a length of the file name, // 8 bytes: length of the file itself @@ -409,7 +409,7 @@ LightApp_Driver::ListOfFiles LightApp_Driver::PutStreamToFiles( const unsigned c */ void LightApp_Driver::RemoveFiles( const ListOfFiles& theFiles, const bool IsDirDeleted) { - int i, aLength = theFiles.size() - 1; + int i, aLength = (int)theFiles.size() - 1; //!< TODO: conversion size_t to int if(aLength <= 0) { return; } diff --git a/src/LightApp/LightApp_Study.cxx b/src/LightApp/LightApp_Study.cxx index c51f5bbdd..35d1a5be6 100644 --- a/src/LightApp/LightApp_Study.cxx +++ b/src/LightApp/LightApp_Study.cxx @@ -167,7 +167,7 @@ bool LightApp_Study::saveDocumentAs( const QString& theFileName ) std::set aNewNames; std::set toRemove; - int i, n; + size_t i, n; for( i = 0, n = aNewList.size(); i < n; i++ ) aNewNames.insert( aNewList[ i ] ); for( i = 0, n = anOldList.size(); i < n; i++ ) @@ -349,7 +349,7 @@ void LightApp_Study::saveModuleData(QString theModuleName, int type, QStringList void LightApp_Study::openModuleData(QString theModuleName, int /*type*/, QStringList& theListOfFiles) { std::vector aListOfFiles = myDriver->GetListOfFiles(theModuleName.toLatin1().constData()); - int i, aLength = aListOfFiles.size() - 1; + int i, aLength = (int)aListOfFiles.size() - 1; //!< TODO: conversion size_t to int if (aLength < 0) return; diff --git a/src/OCCViewer/OCCViewer_ClippingDlg.cxx b/src/OCCViewer/OCCViewer_ClippingDlg.cxx index 4afd25da3..1bf2cf18d 100644 --- a/src/OCCViewer/OCCViewer_ClippingDlg.cxx +++ b/src/OCCViewer/OCCViewer_ClippingDlg.cxx @@ -791,7 +791,7 @@ void OCCViewer_ClippingDlg::setPlaneParam( OCCViewer_ClipPlane& thePlane ) void OCCViewer_ClippingDlg::synchronize() { ComboBoxPlanes->clear(); - int aNbPlanesAbsolute = myLocalPlanes.size(); + int aNbPlanesAbsolute = (int)myLocalPlanes.size(); QString aName; for(int i = 1; i<=aNbPlanesAbsolute; i++ ) { diff --git a/src/OCCViewer/OCCViewer_EnvTextureDlg.cxx b/src/OCCViewer/OCCViewer_EnvTextureDlg.cxx index 73342e85a..d6987ab11 100644 --- a/src/OCCViewer/OCCViewer_EnvTextureDlg.cxx +++ b/src/OCCViewer/OCCViewer_EnvTextureDlg.cxx @@ -189,7 +189,7 @@ void OCCViewer_EnvTextureDlg::onTextureChanged() } else { myEnvTextureName->setText(""); - Graphic3d_NameOfTextureEnv aStandardTexture; + Graphic3d_NameOfTextureEnv aStandardTexture; //! aTextures; aTextures << Graphic3d_NOT_ENV_CLOUDS << Graphic3d_NOT_ENV_CV << Graphic3d_NOT_ENV_MEDIT << Graphic3d_NOT_ENV_PEARL << Graphic3d_NOT_ENV_SKY1 << Graphic3d_NOT_ENV_SKY2 diff --git a/src/OCCViewer/OCCViewer_ViewFrame.h b/src/OCCViewer/OCCViewer_ViewFrame.h index d216935bf..9c5ec78e9 100644 --- a/src/OCCViewer/OCCViewer_ViewFrame.h +++ b/src/OCCViewer/OCCViewer_ViewFrame.h @@ -145,15 +145,15 @@ public slots: virtual void activateRotation() {} virtual void activatePanning() {} virtual void activateGlobalPanning() {} - virtual void onSetRotationPoint( bool on ) {} + virtual void onSetRotationPoint( bool on ) {/*GUI_UNUSED(on);*/} virtual void onAxialScale() {} virtual void onAmbientToogle() {} virtual void onMemorizeView() {} virtual void onRestoreView() {} - virtual void onSwitchInteractionStyle( bool on ) {} + virtual void onSwitchInteractionStyle( bool on ) {/*GUI_UNUSED(on);*/ } virtual void activateSetRotationGravity() {} - virtual void activateSetRotationSelected( double theX, double theY, double theZ ) {} + virtual void activateSetRotationSelected( double theX, double theY, double theZ ) {/*GUI_UNUSED(theX);GUI_UNUSED(theY);GUI_UNUSED(theZ);*/} virtual void activateStartPointSelection( TopAbs_ShapeEnum ) {} virtual void updateGravityCoords() {} diff --git a/src/OCCViewer/OCCViewer_ViewModel.cxx b/src/OCCViewer/OCCViewer_ViewModel.cxx index 49adfd65b..1f5817a03 100644 --- a/src/OCCViewer/OCCViewer_ViewModel.cxx +++ b/src/OCCViewer/OCCViewer_ViewModel.cxx @@ -1451,7 +1451,7 @@ bool OCCViewer_Viewer::computeTrihedronSize( double& theNewSize, double& theSize float aSizeInPercents = SUIT_Session::session()->resourceMgr()->doubleValue("3DViewer","trihedron_size", 100.); - static float EPS = 5.0E-3; + static float EPS = 5.0E-3f; theSize = getTrihedron()->Size(); theNewSize = aMaxSide*aSizeInPercents / 100.0; diff --git a/src/OCCViewer/OCCViewer_ViewSketcher.cxx b/src/OCCViewer/OCCViewer_ViewSketcher.cxx index 6e2cbc007..ab1548c6b 100644 --- a/src/OCCViewer/OCCViewer_ViewSketcher.cxx +++ b/src/OCCViewer/OCCViewer_ViewSketcher.cxx @@ -554,7 +554,7 @@ bool OCCViewer_PolygonSketcher::isValid( const QPolygon* aPoints, const QPoint& return true; bool res = true; - for ( uint i = 0; i < aPoints->count() - 1 && res; i++ ) + for ( uint i = 0; i < (uint)aPoints->count() - 1 && res; i++ ) { const QPoint& aStart = aPoints->point( i ); const QPoint& anEnd = aPoints->point( i + 1 ); diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index 104a964be..0cd2c8525 100644 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -3763,7 +3763,7 @@ void OCCViewer_ViewWindow::projAndPanToGravity(V3d_TypeOfOrientation CamOri) if( USE_XY ) { const double EPS = 1E-6; - int xp = myViewPort->width()/2, yp = myViewPort->height()/2, xp1, yp1; + int xp = myViewPort->width()/2, yp = myViewPort->height()/2, xp1, yp1; //!< TODO: unused xp1, yp1 aView3d->Convert( xp, yp, X, Y, Z ); gp_Dir d = aView3d->Camera()->Direction(); diff --git a/src/PVViewer/PVViewer_Behaviors.cxx b/src/PVViewer/PVViewer_Behaviors.cxx index 80f4dfabf..a7d7e4636 100644 --- a/src/PVViewer/PVViewer_Behaviors.cxx +++ b/src/PVViewer/PVViewer_Behaviors.cxx @@ -62,6 +62,7 @@ PVViewer_Behaviors::PVViewer_Behaviors(QMainWindow * parent) */ void PVViewer_Behaviors::instanciateMinimalBehaviors(QMainWindow * desk) { + //GUI_UNUSED(desk); if (BehaviorLoadingLevel < 1) { // Register ParaView interfaces. diff --git a/src/PVViewer/PVViewer_Core.cxx b/src/PVViewer/PVViewer_Core.cxx index 2f34196e6..5fdd60a67 100644 --- a/src/PVViewer/PVViewer_Core.cxx +++ b/src/PVViewer/PVViewer_Core.cxx @@ -62,6 +62,7 @@ pqPVApplicationCore * PVViewer_Core::GetPVApplication() */ bool PVViewer_Core::ParaviewInitApp(QMainWindow * aDesktop) { + //GUI_UNUSED(aDesktop); if ( ! MyCoreApp) { // Obtain command-line arguments int argc = 0; diff --git a/src/Plot2d/Plot2d_PlotItems.cxx b/src/Plot2d/Plot2d_PlotItems.cxx index 614b39858..e0a78895c 100644 --- a/src/Plot2d/Plot2d_PlotItems.cxx +++ b/src/Plot2d/Plot2d_PlotItems.cxx @@ -297,9 +297,9 @@ public: return qwtMin(myMin.size(), myMax.size()); } bool values(size_t i, double &min, double &max) { - if(myMin.contains(i) && myMax.contains(i)) { - min = myMin[i]; - max = myMax[i]; + if(myMin.contains((int)i) && myMax.contains((int)i)) { //!< TODO: conversion from size_t to int + min = myMin[(int)i]; + max = myMax[(int)i]; return true; } return false; @@ -399,7 +399,7 @@ void Plot2d_QwtPlotCurve::drawSeries( QPainter *painter, int from, int to) const { if (to < 0) - to = dataSize() - 1; + to = (int)dataSize() - 1; //!< TODO: conversion from size_t to int QwtPlotCurve::drawSeries(painter, xMap, yMap, canvasRect, from, to); //draw deviation data diff --git a/src/Plot2d/Plot2d_ViewFrame.cxx b/src/Plot2d/Plot2d_ViewFrame.cxx index ff52f41d5..90d0eda45 100644 --- a/src/Plot2d/Plot2d_ViewFrame.cxx +++ b/src/Plot2d/Plot2d_ViewFrame.cxx @@ -1944,7 +1944,7 @@ AnalyticalCurveList Plot2d_ViewFrame::getAnalyticalCurves() const Plot2d_AnalyticalCurve* Plot2d_ViewFrame::getAnalyticalCurve(QwtPlotItem * theItem) { AnalyticalCurveList::iterator it = myAnalyticalCurves.begin(); for( ; it != myAnalyticalCurves.end(); it++) { - if((*it)->plotItem() == theItem); + if((*it)->plotItem() == theItem); //!< TODO: empty controlled statement found; is this the intent? return (*it); } return 0; diff --git a/src/QxScene/QxScene_ViewModel.cxx b/src/QxScene/QxScene_ViewModel.cxx index f4ce54336..3944d4d4f 100644 --- a/src/QxScene/QxScene_ViewModel.cxx +++ b/src/QxScene/QxScene_ViewModel.cxx @@ -86,6 +86,7 @@ SUIT_ViewWindow* QxScene_Viewer::createView(SUIT_Desktop* theDesktop) */ void QxScene_Viewer::contextMenuPopup(QMenu* thePopup) { + //GUI_UNUSED(thePopup); DEBTRACE("QxScene_Viewer::contextMenuPopup"); } diff --git a/src/QxScene/QxScene_ViewWindow.cxx b/src/QxScene/QxScene_ViewWindow.cxx index 0cba0ab81..5eb9bbf5d 100644 --- a/src/QxScene/QxScene_ViewWindow.cxx +++ b/src/QxScene/QxScene_ViewWindow.cxx @@ -237,6 +237,7 @@ void QxScene_ViewWindow::onViewFitAll() */ void QxScene_ViewWindow::setBackgroundColor( const QColor& color ) { + //GUI_UNUSED(color); DEBTRACE("QxScene_ViewWindow::setBackgroundColor"); } @@ -255,6 +256,7 @@ QColor QxScene_ViewWindow::backgroundColor() const */ void QxScene_ViewWindow::resizeEvent( QResizeEvent* theEvent ) { + //GUI_UNUSED(theEvent); DEBTRACE("QxScene_ViewWindow::resizeEvent"); } diff --git a/src/SALOME_PY/SalomePy.cxx b/src/SALOME_PY/SalomePy.cxx index a06880e47..7a2bdfe5c 100644 --- a/src/SALOME_PY/SalomePy.cxx +++ b/src/SALOME_PY/SalomePy.cxx @@ -373,7 +373,7 @@ extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_showTrihedron( PyObject* self, virtual void Execute() { if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( __Find ) ) { - if ( aVTKViewWindow->isTrihedronDisplayed() != myShow ) + if ( aVTKViewWindow->isTrihedronDisplayed() != (bool)myShow ) aVTKViewWindow->onViewTrihedron(myShow); } } diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_BorrowedDataObjectLight.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_BorrowedDataObjectLight.cxx index 9ccf98f0d..d7871c6d3 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_BorrowedDataObjectLight.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_BorrowedDataObjectLight.cxx @@ -114,6 +114,7 @@ QPixmap SALOME_PYQT_BorrowedDataObjectLight::icon(const int index) const //================================================================================= QString SALOME_PYQT_BorrowedDataObjectLight::toolTip(const int index) const { + //GUI_UNUSED(index); return myToolTip; } diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.cxx index aeaf7dbf4..39b4d70df 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.cxx @@ -110,6 +110,7 @@ bool SALOME_PYQT_DataModelLight::save( QStringList& theListOfFiles) //================================================================================= bool SALOME_PYQT_DataModelLight::saveAs ( const QString& theURL, CAM_Study* theStudy, QStringList& theListOfFiles) { + //GUI_UNUSED(theStudy); myStudyURL = theURL; return save(theListOfFiles); } @@ -118,6 +119,7 @@ bool SALOME_PYQT_DataModelLight::saveAs ( const QString& theURL, CAM_Study* theS bool SALOME_PYQT_DataModelLight::create( CAM_Study* study ) { + //GUI_UNUSED(study); return true; } @@ -185,6 +187,7 @@ bool SALOME_PYQT_DataModelLight::close() void SALOME_PYQT_DataModelLight::update ( LightApp_DataObject* theObj, LightApp_Study* theStudy ) { + //GUI_UNUSED(theObj);GUI_UNUSED(theStudy); // Nothing to do here: we always keep the data tree in the up-to-date state // The only goal of this method is to hide default behavior from LightApp_DataModel return; diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataObjectLight.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataObjectLight.cxx index 0902b20a5..70f3b2a92 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataObjectLight.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataObjectLight.cxx @@ -115,6 +115,7 @@ QPixmap SALOME_PYQT_DataObjectLight::icon(const int index) const //================================================================================= QString SALOME_PYQT_DataObjectLight::toolTip(const int index) const { + //GUI_UNUSED(index); return myToolTip; } diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx index 0789456ee..07ab2ebc9 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx @@ -639,6 +639,7 @@ void SALOME_PYQT_ModuleLight::getSelected( DataObjectList& ) const */ void SALOME_PYQT_ModuleLight::setSelected( const QStringList& entries, const bool isUnused) { + //GUI_UNUSED(isUnused); MESSAGE("setSelected"); return myHelper->selectionUpdated(entries); } diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx index e305afbe0..86f607395 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx @@ -2088,6 +2088,7 @@ void PyModuleHelper::internalCustomize( SUIT_Study* study ) */ void PyModuleHelper::internalDeactivate( SUIT_Study* study ) { + //GUI_UNUSED(study); FuncMsg fmsg( "--- PyModuleHelper::internalDeactivate()" ); // check that Python subinterpreter is initialized and Python module is imported diff --git a/src/SOCC/SOCC_ViewModel.cxx b/src/SOCC/SOCC_ViewModel.cxx index 943a1583c..220c1fdf8 100644 --- a/src/SOCC/SOCC_ViewModel.cxx +++ b/src/SOCC/SOCC_ViewModel.cxx @@ -105,6 +105,7 @@ bool SOCC_Viewer::highlight( const Handle(SALOME_InteractiveObject)& obj, bool SOCC_Viewer::isInViewer( const Handle(SALOME_InteractiveObject)& obj, bool onlyInViewer ) { + //GUI_UNUSED(on); AIS_ListOfInteractive List; getAISContext()->DisplayedObjects(List); AIS_ListIteratorOfListOfInteractive ite(List); @@ -365,6 +366,7 @@ void SOCC_Viewer::Display( const SALOME_OCCPrs* prs ) */ void SOCC_Viewer::Erase( const SALOME_OCCPrs* prs, const bool forced ) { + //GUI_UNUSED(forced); // try do downcast object const SOCC_Prs* anOCCPrs = dynamic_cast( prs ); if ( !anOCCPrs || anOCCPrs->IsNull() ) diff --git a/src/SOCC/SOCC_ViewWindow.cxx b/src/SOCC/SOCC_ViewWindow.cxx index ae5648a6e..b0e92ce1e 100644 --- a/src/SOCC/SOCC_ViewWindow.cxx +++ b/src/SOCC/SOCC_ViewWindow.cxx @@ -53,7 +53,7 @@ SOCC_ViewWindow ::action( const int theAction ) { const int inc = 10; - int cx, cy; + int cx, cy; // if ( theAction == SUIT_Accel::ZoomIn || theAction == SUIT_Accel::ZoomOut || theAction == SUIT_Accel::RotateLeft || theAction == SUIT_Accel::RotateRight || theAction == SUIT_Accel::RotateUp || theAction == SUIT_Accel::RotateDown ) { diff --git a/src/SPlot2d/SPlot2d_ViewModel.cxx b/src/SPlot2d/SPlot2d_ViewModel.cxx index 7154f4cd3..2b58930e1 100644 --- a/src/SPlot2d/SPlot2d_ViewModel.cxx +++ b/src/SPlot2d/SPlot2d_ViewModel.cxx @@ -102,7 +102,7 @@ void SPlot2d_Viewer::renameAll( const Handle(SALOME_InteractiveObject)& IObj, co { const QVector& wnds = vm->getViews(); - for ( uint i = 0; i < wnds.size(); i++ ) + for ( uint i = 0; i < (uint)wnds.size(); i++ ) { Plot2d_ViewWindow* pwnd = dynamic_cast( wnds.at( i ) ); rename( IObj, name, pwnd->getViewFrame() ); diff --git a/src/SPlot2d/SPlot2d_ViewModel.h b/src/SPlot2d/SPlot2d_ViewModel.h index 569451e9c..f63c246d5 100644 --- a/src/SPlot2d/SPlot2d_ViewModel.h +++ b/src/SPlot2d/SPlot2d_ViewModel.h @@ -52,7 +52,7 @@ public: virtual QString getType() const { return Type(); } /* interactive object management */ - void highlight( const Handle(SALOME_InteractiveObject)& IObject, bool highlight, bool update = true ) {} + void highlight( const Handle(SALOME_InteractiveObject)& IObject, bool highlight, bool update = true ) {/*GUI_UNUSED(highlight);GUI_UNUSED(IObject);*/} void unHighlightAll() {} void rename( const Handle(SALOME_InteractiveObject)&, const QString&, Plot2d_ViewFrame* = 0 ); void renameAll( const Handle(SALOME_InteractiveObject)&, const QString& ); diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 7204f3f74..0f3a5eef9 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -1192,6 +1192,7 @@ void SalomeApp_Application::updateDesktopTitle() { int SalomeApp_Application::closeChoice( const QString& docName ) { + //GUI_UNUSED(docName); QStringList buttons; QMap choices; int idx = 0; @@ -1900,6 +1901,7 @@ bool SalomeApp_Application::renameAllowed( const QString& entry) const */ bool SalomeApp_Application::renameObject( const QString& entry, const QString& name ) { + //GUI_UNUSED(entry); SalomeApp_Study* aStudy = dynamic_cast( activeStudy() ); int savePoint = ::getSelectedSavePoint( selectionMgr() ); diff --git a/src/SalomeApp/SalomeApp_DataModel.cxx b/src/SalomeApp/SalomeApp_DataModel.cxx index 593a7e558..4e32f1405 100644 --- a/src/SalomeApp/SalomeApp_DataModel.cxx +++ b/src/SalomeApp/SalomeApp_DataModel.cxx @@ -238,6 +238,7 @@ suitPtr SalomeApp_DataModelSync::parent( const suitPtr& p ) const */ void SalomeApp_DataModelSync::updateItem( const kerPtr& obj, const suitPtr& ) const { + //GUI_UNUSED(obj); } /*! diff --git a/src/SalomeApp/SalomeApp_Engine_i.cxx b/src/SalomeApp/SalomeApp_Engine_i.cxx index 68fd9dc59..25247a12c 100644 --- a/src/SalomeApp/SalomeApp_Engine_i.cxx +++ b/src/SalomeApp/SalomeApp_Engine_i.cxx @@ -136,7 +136,7 @@ SALOMEDS::TMPFile* SalomeApp_Engine_i::Save (SALOMEDS::SComponent_ptr theCompone // listOfFiles must contain temporary directory name in its first item // and names of files (relatively the temporary directory) in the others ListOfFiles listOfFiles = GetListOfFiles( 0 ); // 0 means persistence file - const int n = listOfFiles.size() - 1; + const int n = (int)listOfFiles.size() - 1; //!< TODO: conversion from size_t to int if (n > 0) { // there are some files, containing persistent data of the component std::string aTmpDir = listOfFiles[0]; @@ -187,7 +187,7 @@ CORBA::Boolean SalomeApp_Engine_i::Load (SALOMEDS::SComponent_ptr theComponent, SALOMEDS_Tool::PutStreamToFiles(theFile, aTmpDir.c_str(), isMultiFile); // Store list of file names to be used by the component loading procedure - const int n = aSeq.size() + 1; + const int n = (int)aSeq.size() + 1; //!< TODO: conversion from size_t to int ListOfFiles listOfFiles (n); listOfFiles[0] = aTmpDir; for (int i = 1; i < n; i++) @@ -216,6 +216,7 @@ Engines::TMPFile* SalomeApp_Engine_i::DumpPython(CORBA::Boolean isPublished, CORBA::Boolean isMultiFile, CORBA::Boolean& isValidScript) { + //GUI_UNUSED(isPublished);GUI_UNUSED(isMultiFile); MESSAGE("SalomeApp_Engine_i::DumpPython(): myComponentName = "<< qPrintable( myComponentName ) << ", this = " << this); diff --git a/src/SalomeApp/SalomeApp_ListView.cxx b/src/SalomeApp/SalomeApp_ListView.cxx index e55787d0c..271f25233 100644 --- a/src/SalomeApp/SalomeApp_ListView.cxx +++ b/src/SalomeApp/SalomeApp_ListView.cxx @@ -980,7 +980,7 @@ void SalomeApp_ComboBox::insertItem(const QString& theValue, */ void SalomeApp_ComboBox::insertList(const QStringList& theList) { - for (unsigned i = 0; i < theList.count(); i++) + for (unsigned i = 0; i < (unsigned int)theList.count(); i++) //!< TODO: mismatch signed/unsigned insertItem(theList[i]); } @@ -1243,7 +1243,7 @@ void SalomeApp_EntityEdit::insertList(const TColStd_ListOfInteger& theList, TColStd_ListIteratorOfListOfInteger aIter(theList); for (unsigned i = 0; aIter.More(); aIter.Next(), i++) { - if (theCurrent == i) { + if (theCurrent == (int)i) { //!< TODO: mismatch signed/unsigned setText(QString::number(aIter.Value())); break; } @@ -1274,7 +1274,7 @@ void SalomeApp_EntityEdit::insertList(const TColStd_ListOfReal& theList, TColStd_ListIteratorOfListOfReal aIter(theList); for (unsigned i = 0; aIter.More(); aIter.Next(), i++) { - if (theCurrent == i) { + if (theCurrent == (int)i) { //!< TODO: mismatch signed/unsigned setText(QString::number(aIter.Value())); break; } diff --git a/src/SalomeApp/SalomeApp_Module.cxx b/src/SalomeApp/SalomeApp_Module.cxx index 5d662a004..47ca15604 100644 --- a/src/SalomeApp/SalomeApp_Module.cxx +++ b/src/SalomeApp/SalomeApp_Module.cxx @@ -137,6 +137,7 @@ void SalomeApp_Module::extractContainers( const SALOME_ListIO& source, SALOME_Li */ void SalomeApp_Module::storeVisualParameters(int savePoint) { + //GUI_UNUSED(savePoint); } /*! @@ -147,4 +148,5 @@ void SalomeApp_Module::storeVisualParameters(int savePoint) */ void SalomeApp_Module::restoreVisualParameters(int savePoint) { + //GUI_UNUSED(savePoint); } diff --git a/src/SalomeApp/SalomeApp_Study.cxx b/src/SalomeApp/SalomeApp_Study.cxx index 39bf6bf03..197391df4 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -211,7 +211,7 @@ public: return; } - int last2Pnt_pos = theID.rfind( ":" ); + int last2Pnt_pos = (int)theID.rfind( ":" ); //!< TODO: conversion from size_t to int std::string parent_id = theID.substr( 0, last2Pnt_pos ); int tag = atoi( theID.substr( last2Pnt_pos+1 ).c_str() ); @@ -842,7 +842,7 @@ void SalomeApp_Study::openModuleData( QString theModuleName, int type, QStringLi { std::vector aListOfFiles = GetListOfFiles( theModuleName.toStdString().c_str(), type ); - int i, aLength = aListOfFiles.size() - 1; + int i, aLength = (int)aListOfFiles.size() - 1; //!< TODO: conversion from size_t to int if ( aLength < 0 ) return; @@ -859,6 +859,7 @@ void SalomeApp_Study::openModuleData( QString theModuleName, int type, QStringLi */ bool SalomeApp_Study::saveStudyData( const QString& theFileName, int type ) { + //GUI_UNUSED(theFileName); ModelList list; dataModels( list ); QListIterator it( list ); while ( it.hasNext() ){ @@ -1108,7 +1109,7 @@ void SalomeApp_Study::RemoveTemporaryFiles ( const char* theModuleName, bool isM if (aListOfFiles.size() > 0) { std::string aTmpDir = aListOfFiles[0]; - const int n = aListOfFiles.size() - 1; + const int n = (int)aListOfFiles.size() - 1; //!< TODO: conversion from size_t to int std::vector aSeq; aSeq.reserve(n); for (int i = 0; i < n; i++) @@ -1157,7 +1158,7 @@ void SalomeApp_Study::deleteReferencesTo( _PTR( SObject ) obj ) { _PTR(StudyBuilder) sb = studyDS()->NewBuilder(); std::vector<_PTR(SObject)> aRefs = studyDS()->FindDependances( obj ); - for( int i=0, n=aRefs.size(); iGetFatherComponent()->ComponentDataType()==obj->GetFatherComponent()->ComponentDataType() ) diff --git a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx index a83658d8a..3c8404c17 100644 --- a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx +++ b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx @@ -225,7 +225,7 @@ void SalomeApp_StudyPropertiesDlg::initData() std::vector aUsers; std::vector aMins, aHours, aDays, aMonths, aYears; propAttr->GetModificationsList(aUsers, aMins, aHours, aDays, aMonths, aYears, false); - int aCnt = aUsers.size(); + size_t aCnt = aUsers.size(); for ( int i = 0; i < aCnt; i++ ) { QString date; date.sprintf("%2.2d/%2.2d/%2d %2.2d:%2.2d", diff --git a/src/TOOLSGUI/ToolsGUI.cxx b/src/TOOLSGUI/ToolsGUI.cxx index 1be827f46..82ac3bc45 100644 --- a/src/TOOLSGUI/ToolsGUI.cxx +++ b/src/TOOLSGUI/ToolsGUI.cxx @@ -46,7 +46,7 @@ bool ToolsGUI::GetVisibility( _PTR(SObject) theObj, if ( theObj && theObj->FindAttribute( anAttr, "AttributeGraphic" ) ) { _PTR(AttributeGraphic) aGraphic (anAttr); - return aGraphic->GetVisibility( (unsigned long)theId ); + return aGraphic->GetVisibility( (int)((ULONG_PTR)theId) ); //!< TODO: pointer truncation } return false; @@ -71,13 +71,13 @@ bool ToolsGUI::SetVisibility( const char* theEntry, if ( anObj->FindAttribute( aGAttr, "AttributeGraphic" ) ) { _PTR(AttributeGraphic) anAttr ( aGAttr ); - anAttr->SetVisibility( (unsigned long)theId, theValue ); + anAttr->SetVisibility( (int)((ULONG_PTR)theId), theValue ); //!< TODO: pointer truncation } else if ( theValue ) { _PTR(StudyBuilder) aBuilder (aStudy->NewBuilder()); _PTR(AttributeGraphic) anAttr (aBuilder->FindOrCreateAttribute(anObj, "AttributeGraphic")); - anAttr->SetVisibility( (unsigned long)theId, theValue ); + anAttr->SetVisibility( (int)((ULONG_PTR)theId), theValue ); //!< TODO: pointer truncation } return true; } diff --git a/src/TOOLSGUI/ToolsGUI_RegWidget.cxx b/src/TOOLSGUI/ToolsGUI_RegWidget.cxx index bb7c0a448..70a1d3a9f 100644 --- a/src/TOOLSGUI/ToolsGUI_RegWidget.cxx +++ b/src/TOOLSGUI/ToolsGUI_RegWidget.cxx @@ -140,7 +140,7 @@ static Registry::Components_ptr GetRegistry( CORBA::ORB_ptr orb ) if ( CORBA::is_nil( object ) ) throw CommException( "Unable to find the Registry service" ); aRegistry = Registry::Components::_narrow( object ); } - catch( const CORBA::Exception& ex ) + catch( const CORBA::Exception& /*ex*/ ) //!< TODO: unused variable { MESSAGE( "Error: can't access Registry server" ); } @@ -351,7 +351,7 @@ void ToolsGUI_RegWidget::refresh() // update current services list myViews[Clients]->clear(); - for ( int i = 0; i < myData[Clients]->length(); i++ ) { + for ( int i = 0; i < (int)myData[Clients]->length(); i++ ) { //!< TODO: mismatch signed/unsigned const Registry::Infos& c_info = (*myData[Clients])[i]; time_t aStarted = time_t( c_info.tc_start ); time_t aLastPing = time_t( c_info.tc_hello ); @@ -367,7 +367,7 @@ void ToolsGUI_RegWidget::refresh() // update history myViews[History]->clear(); - for ( int i = 0; i < myData[History]->length(); i++ ) { + for ( int i = 0; i < (int)myData[History]->length(); i++ ) { //!< TODO: mismatch signed/unsigned const Registry::Infos& c_info = (*myData[History])[i]; time_t aStarted = time_t( c_info.tc_start ); time_t aFinished = time_t( c_info.tc_end ); diff --git a/src/TreeData/DockWidgets.cxx b/src/TreeData/DockWidgets.cxx index a34ec6c04..75801281c 100644 --- a/src/TreeData/DockWidgets.cxx +++ b/src/TreeData/DockWidgets.cxx @@ -116,7 +116,8 @@ void DockWidgets::setDataView(QTreeView * dataView) { _dwDataPanel->setWidget(_tvDataView); } -void DockWidgets::setPropertiesView(QTreeView * propertiesView) { +void DockWidgets::setPropertiesView(QTreeView * propertiesView) { + //GUI_UNUSED(propertiesView); // Not implemented yet } diff --git a/tools/PyInterp/src/PyInterp_Interp.cxx b/tools/PyInterp/src/PyInterp_Interp.cxx index 38369cc38..38f522310 100644 --- a/tools/PyInterp/src/PyInterp_Interp.cxx +++ b/tools/PyInterp/src/PyInterp_Interp.cxx @@ -401,7 +401,7 @@ std::string __join(const std::vector& v, int begin=0, int end=-1) { if (end == -1) - end = v.size(); + end = (int)v.size(); //!< TODO: conversion from size_t to int std::stringstream ss; for (int i = begin; i < end; ++i) { if (i != begin) -- 2.39.2