]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
fix warning "unused variable", "pointer truncation", "unreferenced formal parametr...
authorViktor Uzlov <viktor.uzlov@opencascade.com>
Fri, 14 Aug 2020 08:27:40 +0000 (11:27 +0300)
committerViktor Uzlov <viktor.uzlov@opencascade.com>
Fri, 14 Aug 2020 08:27:40 +0000 (11:27 +0300)
28 files changed:
src/Container/Component_i.cxx
src/Container/Container_i.cxx
src/Container/Container_init_python.cxx
src/Container/SALOME_Component_i.hxx
src/Container/SALOME_ContainerManager.cxx
src/Container/Salome_file_i.cxx
src/DF/DF_Application.cxx
src/DF/DF_Document.cxx
src/HDFPersist/HDFascii.cc
src/HDFPersist/HDFcontainerObject.cc
src/HDFPersist/HDFdataset.cc
src/HDFPersist/HDFfile.cc
src/HDFPersist/HDFgroup.cc
src/HDFPersist/HDFnObjects.c
src/HDFPersist/HDFobjectIdentify.c
src/Logger/SALOME_Logger_Server.hxx
src/Logger/SALOME_Trace.cxx
src/Notification/NOTIFICATION_Consumer.cxx
src/Notification/NOTIFICATION_Supplier.cxx
src/Registry/RegistryConnexion.cxx
src/Registry/RegistryService.cxx
src/ResourcesManager/SALOME_LoadRateManager.cxx
src/ResourcesManager/SALOME_LoadRateManager.hxx
src/SALOMELocalTrace/FileTraceCollector.cxx
src/SALOMELocalTrace/LocalTraceCollector.cxx
src/SALOMESDS/CMakeLists.txt
src/SALOMESDS/SALOMESDS_RefCountServ.cxx
src/SALOMETraceCollector/SALOMETraceCollector.cxx

index 18e6494c219c1bb1823dcb217f4bedc6fb4be06e..d31c8c3c30320c0fc620650bd28456e96ba1ab25 100644 (file)
@@ -877,6 +877,7 @@ Engines::TMPFile* Engines_Component_i::DumpPython(CORBA::Boolean isPublished,
                                                   CORBA::Boolean isMultiFile,
                                                   CORBA::Boolean& isValidScript)
 {
+  SALOME_UNUSED(isPublished);
   const char* aScript = isMultiFile ? "def RebuildData(): pass" : "";
   char* aBuffer = new char[strlen(aScript)+1];
   strcpy(aBuffer, aScript);
@@ -1043,6 +1044,7 @@ Engines_Component_i::configureSalome_file(std::string service_name,
                                           std::string file_port_name,
                                           Salome_file_i * file)
 {
+       SALOME_UNUSED(file);
   // By default this method does nothing
 }
 
index 1f25c1bfcc9df6890a90a4510a5a468b7ce005bd..12369b96eb5249908d8b26c19b49f9353a02b556 100644 (file)
@@ -1219,6 +1219,7 @@ Engines::EngineComponent_ptr
 Engines_Container_i::load_impl( const char* genericRegisterName,
                                 const char* componentName )
 {
+  SALOME_UNUSED(componentName);
   char* reason;
   std::string impl_name = std::string(LIB) + genericRegisterName + ENGINESO;
   Engines::EngineComponent_var iobject = Engines::EngineComponent::_nil() ;
index 2f767109658faf86f83a9295196ce5bb8d12bee3..6e8a913e191c4e1f6b66a3a662ec5f143f39fc63 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "utilities.h"
 #include "Container_init_python.hxx"
+#include "Basics_Utils.hxx"
 
 #if PY_VERSION_HEX < 0x03050000
 static char*
@@ -75,6 +76,7 @@ ContainerPyStdOut_write(ContainerPyStdOut *self, PyObject *args)
 static PyObject*
 ContainerPyStdOut_flush(ContainerPyStdOut *self)
 {
+  SALOME_UNUSED(self);
   Py_INCREF(Py_None);
   return Py_None;
 }
index 665ec14c81d3a30c763669a4792ae018088ab6cf..c2e1fdf201d816cdc33d28296bbafb27b9b0414e 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <SALOMEconfig.h>
 
+#include "Basics_Utils.hxx"
 #include "SALOME_Container.hxx"
 
 #include <iostream>
@@ -116,7 +117,7 @@ public:
 
   // Object information
   virtual bool hasObjectInfo() { return false; }
-  virtual char* getObjectInfo(const char* entry) { return CORBA::string_dup(""); }
+  virtual char* getObjectInfo(const char* entry) { SALOME_UNUSED(entry); return CORBA::string_dup(""); }
 
   // Version information
   virtual char* getVersion();
index 1b7467784b1e48714ab6019fd725b6db13fdcca0..68de29edc2d88610e0f7b03c2f739dfce77c6f41 100644 (file)
@@ -2013,6 +2013,7 @@ Engines::Container_ptr
 SALOME_ContainerManager::StartPaCOPPContainer(const Engines::ContainerParameters& params,
                                               std::string resource_selected)
 {
+  SALOME_UNUSED(params);
   Engines::Container_ptr ret = Engines::Container::_nil();
   INFOS("[StarPaCOPPContainer] is disabled !");
   INFOS("[StarPaCOPPContainer] recompile SALOME Kernel to enable PaCO++ parallel extension");
@@ -2024,6 +2025,8 @@ SALOME_ContainerManager::BuildCommandToLaunchPaCOProxyContainer(const Engines::C
                                                                 std::string machine_file_name,
                                                                 std::string & proxy_hostname)
 {
+  SALOME_UNUSED(params);
+  SALOME_UNUSED(proxy_hostname);
   return "";
 }
 
@@ -2033,6 +2036,10 @@ SALOME_ContainerManager::BuildCommandToLaunchPaCONodeContainer(const Engines::Co
                                                                SALOME_ContainerManager::actual_launch_machine_t & vect_machine,
                                                                const std::string & proxy_hostname)
 {
+  SALOME_UNUSED(params);
+  SALOME_UNUSED(machine_file_name);
+  SALOME_UNUSED(vect_machine);
+  SALOME_UNUSED(proxy_hostname);
   return "";
 }
 void
@@ -2043,6 +2050,12 @@ SALOME_ContainerManager::LogConfiguration(const std::string & log_type,
                                           std::string & begin,
                                           std::string & end)
 {
+       SALOME_UNUSED(log_type);
+       SALOME_UNUSED(exe_type);
+       SALOME_UNUSED(container_name);
+       SALOME_UNUSED(hostname);
+       SALOME_UNUSED(begin);
+       SALOME_UNUSED(end);
 }
 
 CORBA::Object_ptr
@@ -2050,6 +2063,9 @@ SALOME_ContainerManager::LaunchPaCOProxyContainer(const std::string& command,
                                                   const Engines::ContainerParameters& params,
                                                   const std::string& hostname)
 {
+  SALOME_UNUSED(command);
+  SALOME_UNUSED(params);
+  SALOME_UNUSED(hostname);
   CORBA::Object_ptr ret = CORBA::Object::_nil();
   return ret;
 }
@@ -2060,6 +2076,10 @@ SALOME_ContainerManager::LaunchPaCONodeContainer(const std::string& command,
                         const std::string& name,
                         SALOME_ContainerManager::actual_launch_machine_t & vect_machine)
 {
+  SALOME_UNUSED(command);
+  SALOME_UNUSED(params);
+  SALOME_UNUSED(name);
+  SALOME_UNUSED(vect_machine);
   return false;
 }
 #endif
index dc4026224e0369d39e2715c9f73570db85b259c5..9e70202aa9420b4763affe094286081dddad30af 100644 (file)
@@ -23,6 +23,7 @@
 //  $Header: 
 //
 #include "Salome_file_i.hxx"
+#include "Basics_Utils.hxx"
 #include "utilities.h"
 #include <stdlib.h>
 #include "HDFOI.hxx"
@@ -885,6 +886,7 @@ Salome_file_i::getDistributedFile(std::string file_name)
 void 
 Salome_file_i::removeFile(const char* file_name) 
 {
+  SALOME_UNUSED(file_name);
   MESSAGE("Salome_file_i::removeFile : NOT YET IMPLEMENTED");
 }
     
index 3fb265b5a5478e1ce23233d213fb5d995ef8cb94..60f3066a5e24cb1044d0f01cd3502c2564170322 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "DF_definitions.hxx"
 #include "DF_Application.hxx"
+#include "Basics_Utils.hxx"
 
 //Constructor
 DF_Application::DF_Application()
@@ -85,6 +86,7 @@ int DF_Application::NbDocuments()
 //pointer to opened document.
 DF_Document* DF_Application::Open(const std::string& theFileName)
 {
+  SALOME_UNUSED(theFileName);
   //Not implemented
   return NULL;
 }
@@ -93,5 +95,7 @@ DF_Document* DF_Application::Open(const std::string& theFileName)
 //Saves a Document in a given file with name theFileName
 void DF_Application::SaveAs(const DF_Document* theDocument, const std::string& theFileName)
 {
+  SALOME_UNUSED(theDocument);
+  SALOME_UNUSED(theFileName);
   //Not implemented
 }
index 5447b35cf0f3eb75a2144bd252e101cfa2b1d3f3..3715506eb4ea214be3d4c6693dec193634803ce9 100644 (file)
@@ -21,6 +21,7 @@
 #include "DF_Document.hxx"
 #include "DF_Label.hxx"
 #include "DF_ChildIterator.hxx"
+#include "Basics_Utils.hxx"
 
 //Class DF_Document is container for user's data stored as a tree of Labels
 //with assigned Attributes
@@ -132,6 +133,7 @@ void DF_Document::SetModified(bool isModified)
 //Restores a content of the Document from the std::string theData
 void DF_Document::Load(const std::string& theData)
 {
+       SALOME_UNUSED(theData);
    //Not implemented
 }
 
index 55ee4e11a5e52d37f0d90e4296dc918c6a2b8009..3887d0f4f02c65c0a84fabc4cb27d58c94c7d884 100644 (file)
@@ -310,6 +310,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident)
 //============================================================================
 void SaveAttributeInASCIIfile(HDFattribute *hdf_attribute, FILE* fp, int ident)
 {
+  SALOME_UNUSED(ident);
   hdf_attribute->OpenOnDisk();
 
   hdf_type type = hdf_attribute->GetType();
index bb09a5eff486c8c236edb41d5f0d8e476fa7902f..d3543350a93c6efb936b7aa76c2993f9250f86d0 100644 (file)
@@ -27,6 +27,7 @@
 #include "hdfi.h"
 #include "HDFcontainerObject.hxx"
 #include "HDFexception.hxx"
+#include "Basics_Utils.hxx"
 
 HDFcontainerObject::HDFcontainerObject(const char *name)
   : HDFinternalObject(name)
@@ -54,6 +55,7 @@ int HDFcontainerObject::nInternalObjects()
 
 void HDFcontainerObject::InternalObjectIndentify(int rank, char *object_name)
 {
+  SALOME_UNUSED(rank);
   object_name = NULL;
 }
 
index 576abfb9cbd77a38ea717ae130907e4723a078b7..7f9ffd5406984f779f39d5c1ff12e49ad6fe06f4 100644 (file)
 #include "HDFdataset.hxx"
 #include "HDFcontainerObject.hxx"
 #include "HDFexception.hxx"
+#include "Basics_Utils.hxx"
 
 #include <iostream>
 
 herr_t dataset_attr(hid_t loc_id, const char *attr_name, void *operator_data)
 {
+  SALOME_UNUSED(loc_id);
   *(char**)operator_data = new char[strlen(attr_name)+1];
   strcpy(*(char**)operator_data, attr_name);
   return 1;
index 9e8391142a94ff75ce692d1841b4cfc2f352b764..398aeb9ebc815b0d4dc7808e2eab6d48afe670e3 100644 (file)
 #include <iostream>
 #include "HDFfile.hxx"
 #include "HDFexception.hxx"
+#include "Basics_Utils.hxx"
 
 herr_t file_attr(hid_t loc_id, const char *attr_name, void *operator_data)
 {
+   SALOME_UNUSED(loc_id);
    *(char**)operator_data = new char[strlen(attr_name)+1];
    strcpy(*(char**)operator_data, attr_name);
    return 1;
index 1a586f20edc502a42cbd7b7ef4302181e7f1e28c..2db76d5caa5734f65331b592f8689c5bf243d488 100644 (file)
 #include <string.h>
 #include "HDFgroup.hxx"
 #include "HDFexception.hxx"
+#include "Basics_Utils.hxx"
 
 herr_t group_attr(hid_t loc_id, const char *attr_name, void *operator_data)
 {
+  SALOME_UNUSED(loc_id);
   *(char**)operator_data = new char[strlen(attr_name)+1];
   strcpy(*(char**)operator_data, attr_name);
   return 1;
index 7edecd69b8e17c6d2b9836d99a3da45c3d7fdab8..1b5d20e9bf6388ec2538995be78cfe9fc813a313 100644 (file)
@@ -28,7 +28,6 @@ SALOME HDFPersist : implementation of HDF persitent ( save/ restore )
 
 #include "hdfi.h"
 #include <stdlib.h>
-
 /*
  * - Name : HDFnObjects
  * - Description : returns the number of HDF objects in an HDF group
@@ -59,7 +58,8 @@ HDFnObjects(hdf_idt fid,const char *path,int *n)
 hdf_err Num(hdf_idt id,const char *name, void *data)
 {
   int *count;
-
+  (void)name;
+  (void)id;
   count = (int *) data;
   (*count)++;
 
index ab24a6ca86808424262cbcf0695062b5711ac792..7d846a1effec57b7a41ce69c2546ad9c726f531e 100644 (file)
@@ -59,6 +59,7 @@ hdf_err HDFobjectIdentify(hdf_idt fid,const char *path,int i,char *name)
 
 hdf_err RankInfo(hdf_idt id, const char *name, void *data)
 {
+  (void)id;
   if ( data )
     strcpy( (char*)data, name );
   else 
index c4a5182a228fee051ad6909359a0c0ffd0fd4b1b..b74ac45be9d27082bf0793af75766ead75128b3e 100644 (file)
@@ -48,7 +48,7 @@
 #endif
 
 #ifdef WIN32
-#pragma warning(disable:4275) // Disable warning interface non dll
+//#pragma warning(disable:4275) // Disable warning interface non dll
 #endif
 
 class LOGGER_EXPORT Logger :
index 0ec93bb175d810275fff2d7155d1db9817f913c5..6f47313759a94875bae1b64cd4a188c3112bf693 100644 (file)
@@ -26,6 +26,7 @@
 //  Module : SALOME
 //
 #include "SALOME_Trace.hxx"
+#include "Basics_Utils.hxx"
 #include <memory.h>
 #include <string>
 //#include <stdio.h>
@@ -136,6 +137,7 @@ int SALOME_Trace::Initialize(CORBA::ORB_ptr theOrb) {
 
 void SALOME_Trace::putMessage(std::ostream& msg)
 {
+  SALOME_UNUSED(msg);
   //if (!isInitialized) std::cout<<"!!! SALOME_Trace is used without initialising !!!"<<std::endl;
   //write resulting string into Logger CORBA server
   //concatenate string from passing parameters for transferring into Logger CORBA server
index edaf22ec055dec4eec28d4a909dbc9ed3d874426..937f7d4ad038969e774293c329cab8ff58240992 100644 (file)
@@ -26,6 +26,7 @@
 //  Module : SALOME
 //
 #include "NOTIFICATION.hxx"
+#include "Basics_Utils.hxx"
 
 NOTIFICATION_Consumer::NOTIFICATION_Consumer():
     proxy_supplier(0),
@@ -127,4 +128,5 @@ void NOTIFICATION_Consumer::disconnect_structured_pull_consumer() {
 }
 
 void NOTIFICATION_Consumer::offer_change(const CosN_EventTypeSeq& added, const CosN_EventTypeSeq& deled) {
+       SALOME_UNUSED(added); SALOME_UNUSED(deled);
 }
index 7fff8c621d2c96806129198bc5d000b621453771..0025569ad5903fb2209435413aaec346f28368a6 100644 (file)
@@ -26,6 +26,7 @@
 //  Module : SALOME
 //
 #include "NOTIFICATION.hxx"
+#include "Basics_Utils.hxx"
 
 long NOTIFICATION_Supplier::_stamp = 0;
 
@@ -124,4 +125,5 @@ void NOTIFICATION_Supplier::disconnect_structured_push_supplier() {
 }
 
 void NOTIFICATION_Supplier::subscription_change(const CosN_EventTypeSeq& added, const CosN_EventTypeSeq& deled) {
+       SALOME_UNUSED(added); SALOME_UNUSED(deled);
 }
index f726b7a2f5db8699981d57465f9959dd96df2272..a5cf3dc077fda1141edd0a46545493c389da7b06 100644 (file)
@@ -119,9 +119,9 @@ void RegistryConnexion::add( const char *aName )
                 infos.pid        = lesInfos.pid() ;
                 infos.machine        = CORBA::string_dup( lesInfos.host_char() ) ;
                 infos.adip        = CORBA::string_dup( lesInfos.adip() ) ;
-                infos.uid        = (long)lesInfos.uid() ;
+                infos.uid        = /*(long)*/(CORBA::Long)((LONG_PTR)lesInfos.uid()) ; //!< TODO: pointer truncation from const PSID to long
                 infos.pwname        = CORBA::string_dup( lesInfos.pwname() ) ;
-                infos.tc_start        = lesInfos.start() ;
+                infos.tc_start        = (CORBA::Long)lesInfos.start() ; //!< TODO: conversation from const time_t to CORBA::Long
                 infos.tc_hello        = 0 ;
                 infos.tc_end        = 0 ;
                 infos.difftime        = 0 ;
index 1125996c6f8830d1238becb0534b3a6baf2fef0c..e673cc0a9c3d70030906cf13b7bbdd0f029c8241 100644 (file)
@@ -111,7 +111,7 @@ void RegistryService::remove( CORBA::ULong id)
         
         ASSERT(_reg.find(id)!=_reg.end()) 
         _reg[id]->_status=TERMINATED;
-        _reg[id]->_ts_end = time(NULL) ;
+        _reg[id]->_ts_end = (long)time(NULL) ; //!< TODO: conversation from time_t to long
 
         _fin[id]=_reg[id];
         _reg.erase(id);
@@ -132,7 +132,7 @@ void RegistryService::hello( CORBA::ULong id )
         ASSERT(strlen(_SessionName)>0) ;
 
         ASSERT(_reg.find(id)!=_reg.end()) 
-        _reg[id]->_ts_hello = time(NULL) ;
+        _reg[id]->_ts_hello = (long)time(NULL) ; //!< TODO: conversation from time_t to long
                 
         END_OF("RegistryService::hello") ;
         return ;
@@ -207,7 +207,7 @@ RegistryService::client_infos::client_infos( const Registry::Infos &infos ):\
                                                                         _adip(duplicate(infos.adip)),\
                                                                         _uid(infos.uid),\
                                                                         _pwname(duplicate(infos.pwname)),\
-                                                                        _ts_start(time(NULL)),\
+                                                                        _ts_start((long)time(NULL)),\
                                                                         _difftime(infos.tc_start - _ts_start),\
                                                                         _cdir(duplicate(infos.cdir)),\
                                                                         _ts_hello(_ts_start),\
index a777802739c443d7483485686a272ad3bd0aada2..4d45ba5faa49c124453299d6cb9f1892266975d0 100644 (file)
@@ -27,6 +27,7 @@
 std::string LoadRateManagerFirst::Find(const std::vector<std::string>& hosts,
                                        const MapOfParserResourcesType& resList)
 {
+  SALOME_UNUSED(resList);
   if (hosts.size() == 0)
     return std::string("");
 
@@ -66,6 +67,7 @@ std::string LoadRateManagerCycl::Find(const std::vector<std::string>& hosts,
 std::string LoadRateManagerAltCycl::Find(const std::vector<std::string>& hosts,
                                          const MapOfParserResourcesType& resList)
 {
+  SALOME_UNUSED(resList);
   if (hosts.size() == 0)
     return std::string("");
 
index e56999ad7a032a7d5a61b22684fd9d88f483e1fd..8a7d244e212f327d3f4235914e8801efa17191c2 100644 (file)
@@ -27,6 +27,7 @@
 #include <string>
 #include <map>
 #include "SALOME_ResourcesCatalog_Parser.hxx"
+#include "Basics_Utils.hxx"
 
 class RESOURCESMANAGER_EXPORT LoadRateManager
 {
index 932b20f7f5828915ff0c54849ce8a3b90fb65189..c282e6645c7576c16e147a46c59d805209c070e4 100644 (file)
@@ -32,6 +32,7 @@
 
 //#define _DEVDEBUG_
 #include "FileTraceCollector.hxx"
+#include "Basics_Utils.hxx"
 
 // Class attributes initialisation, for class method FileTraceCollector::run
 
@@ -88,6 +89,7 @@ BaseTraceCollector* FileTraceCollector::instance(const char *fileName)
 
 void* FileTraceCollector::run(void *bid)
 {
+  SALOME_UNUSED(bid);
   //DEVTRACE("init run");
   _threadId = new pthread_t;
   *_threadId = pthread_self();
index cd88641631aa590546c132d34c83ca2ac92cb03b..8b2ffa43be37f512da47ec722d07d5a6d22283f9 100644 (file)
@@ -30,6 +30,7 @@
 #include <fstream>
 #include <cstdlib>
 
+#include "Basics_Utils.hxx"
 #include "LocalTraceCollector.hxx"
 
 // ============================================================================
@@ -78,6 +79,7 @@ BaseTraceCollector* LocalTraceCollector::instance()
 
 void* LocalTraceCollector::run(void *bid)
 {
+  SALOME_UNUSED(bid);
   _threadId = new pthread_t;
   *_threadId = pthread_self();
   sem_post(&_sem); // unlock instance
index 737f21eecf1db1ffffe830c4d4440dd49b4668a8..8ae23bba3100cf3b0ebe0da21dc02b87d40e265f 100644 (file)
@@ -24,6 +24,7 @@ INCLUDE_DIRECTORIES(
   ${PYTHON_INCLUDE_DIRS}
   ${PROJECT_BINARY_DIR}/idl
   ${PROJECT_BINARY_DIR}/salome_adm
+  ${CMAKE_CURRENT_SOURCE_DIR}/../Basics
   ${CMAKE_CURRENT_SOURCE_DIR}/../Utils
   ${CMAKE_CURRENT_SOURCE_DIR}/../NamingService
   ${CMAKE_CURRENT_SOURCE_DIR}/../Launcher
index d95e282d8c321ef06b1bcbc5898a0365518d2bc7..7a7c72186ba42da644fad0472e709a5d8b2cb654 100644 (file)
@@ -19,6 +19,7 @@
 // Author : Anthony GEAY (EDF R&D)
 
 #include "SALOMESDS_RefCountServ.hxx"
+#include "Basics_Utils.hxx"
 
 using namespace SALOMESDS;
 
index 4c556288a9797e61efdd489b0797260c81be49d6..6840848389d94a19387f020222332070dc5f6558 100644 (file)
@@ -26,6 +26,7 @@
 //  $Header$
 //
 #include <SALOMEconfig.h>
+#include "Basics_Utils.hxx"
 
 #include <iostream>
 #include <sstream>
@@ -92,6 +93,7 @@ BaseTraceCollector* SALOMETraceCollector::instance()
 
 void* SALOMETraceCollector::run(void *bid)
 {
+  SALOME_UNUSED(bid);
   _threadId = new pthread_t;
   *_threadId = pthread_self();
   sem_post(&_sem); // unlock instance