From aa7b94efbc9fab2e32b49bf1edfa456f25e719b8 Mon Sep 17 00:00:00 2001 From: adam Date: Thu, 30 Jul 2009 16:09:49 +0000 Subject: [PATCH] Remove warnings --- src/CASCatch/CASCatch_Failure.cxx | 2 +- src/LightApp/LightApp_PyInterp.cxx | 2 +- src/PyInterp/PyInterp_Interp.cxx | 16 +++--- src/Qtx/Qtx.cxx | 2 +- src/SALOME_PY/SalomePy.cxx | 2 +- .../SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx | 2 +- .../SALOME_PYQT_ModuleLight.cxx | 52 +++++++++---------- src/SUITApp/SUITApp.cxx | 2 +- src/SalomeApp/SalomeApp_PyInterp.cxx | 2 +- src/Session/SALOME_Session_Server.cxx | 2 +- src/Session/Session_ServerLauncher.cxx | 2 +- src/Session/Session_ServerThread.cxx | 2 +- 12 files changed, 44 insertions(+), 44 deletions(-) diff --git a/src/CASCatch/CASCatch_Failure.cxx b/src/CASCatch/CASCatch_Failure.cxx index a0e290989..57274afbb 100644 --- a/src/CASCatch/CASCatch_Failure.cxx +++ b/src/CASCatch/CASCatch_Failure.cxx @@ -41,7 +41,7 @@ static Handle(CASCatch_Failure) RaisedError; * \brief creates a CASCatch_Failure */ //================================================================================ -CASCatch_Failure::CASCatch_Failure () { myMessage = "Signal detected";} +CASCatch_Failure::CASCatch_Failure () { myMessage = (Standard_Character*)"Signal detected";} //================================================================================ diff --git a/src/LightApp/LightApp_PyInterp.cxx b/src/LightApp/LightApp_PyInterp.cxx index 8e4a751ce..de65eba2b 100644 --- a/src/LightApp/LightApp_PyInterp.cxx +++ b/src/LightApp/LightApp_PyInterp.cxx @@ -84,7 +84,7 @@ bool LightApp_PyInterp::initContext() // Call init_shared_modules to initialize the shared import mechanism for modules //that must not be imported twice - PyObjWrapper m2( PyObject_CallMethod( m1, "init_shared_modules", "O", SUIT_PYTHON::salome_shared_modules_module ) ); + PyObjWrapper m2( PyObject_CallMethod( m1, (char*)"init_shared_modules", (char*)"O", SUIT_PYTHON::salome_shared_modules_module ) ); if ( !m2 ) { PyErr_Print(); diff --git a/src/PyInterp/PyInterp_Interp.cxx b/src/PyInterp/PyInterp_Interp.cxx index 0823e8657..0dfe60dc3 100644 --- a/src/PyInterp/PyInterp_Interp.cxx +++ b/src/PyInterp/PyInterp_Interp.cxx @@ -149,8 +149,8 @@ static PyMethodDef PyStdOut_methods[] = { }; static PyMemberDef PyStdOut_memberlist[] = { - {"softspace", T_INT, offsetof(PyStdOut, softspace), 0, - "flag indicating that a space needs to be printed; used by print"}, + {(char*)"softspace", T_INT, offsetof(PyStdOut, softspace), 0, + (char*)"flag indicating that a space needs to be printed; used by print"}, {NULL} /* Sentinel */ }; @@ -222,7 +222,7 @@ static PyStdOut* newPyStdOut( bool iscerr ) */ int PyInterp_Interp::_argc = 1; -char* PyInterp_Interp::_argv[] = {""}; +char* PyInterp_Interp::_argv[] = {(char*)""}; PyObject* PyInterp_Interp::builtinmodule = NULL; PyThreadState* PyInterp_Interp::_gtstate = NULL; PyInterpreterState* PyInterp_Interp::_interp = NULL; @@ -372,7 +372,7 @@ static int compile_command(const char *command,PyObject *context) PyErr_Print(); return -1; } - PyObjWrapper v(PyObject_CallMethod(m,"compile_command","s",command)); + PyObjWrapper v(PyObject_CallMethod(m,(char*)"compile_command",(char*)"s",command)); if(!v) { // Error encountered. It should be SyntaxError, //so we don't write out traceback @@ -432,14 +432,14 @@ int PyInterp_Interp::simpleRun(const char *command, const bool addToHistory) //PyLockWrapper aLock(_tstate); // san - lock is centralized now // Reset redirected outputs before treatment - PySys_SetObject("stderr",_verr); - PySys_SetObject("stdout",_vout); + PySys_SetObject((char*)"stderr",_verr); + PySys_SetObject((char*)"stdout",_vout); int ier = compile_command(command,_g); // Outputs are redirected on standards outputs (console) - PySys_SetObject("stdout",PySys_GetObject("__stdout__")); - PySys_SetObject("stderr",PySys_GetObject("__stderr__")); + PySys_SetObject((char*)"stdout",PySys_GetObject((char*)"__stdout__")); + PySys_SetObject((char*)"stderr",PySys_GetObject((char*)"__stderr__")); return ier; } diff --git a/src/Qtx/Qtx.cxx b/src/Qtx/Qtx.cxx index b6ce38713..774538fe0 100755 --- a/src/Qtx/Qtx.cxx +++ b/src/Qtx/Qtx.cxx @@ -434,7 +434,7 @@ QString Qtx::library( const QString& str ) */ QString Qtx::tmpDir() { - char* tmpdir = ::getenv( "TEMP" ); + const char* tmpdir = ::getenv( "TEMP" ); if ( !tmpdir ) tmpdir = ::getenv ( "TMP" ); if ( !tmpdir ) diff --git a/src/SALOME_PY/SalomePy.cxx b/src/SALOME_PY/SalomePy.cxx index 9a7ed243e..5acd5a1e1 100755 --- a/src/SALOME_PY/SalomePy.cxx +++ b/src/SALOME_PY/SalomePy.cxx @@ -479,7 +479,7 @@ static PyMethodDef Module_Methods[] = */ extern "C" void initlibSalomePy() { - static char* modulename = "libSalomePy"; + static char* modulename = (char*)"libSalomePy"; // init module PyObject* aModule = Py_InitModule( modulename, Module_Methods ); diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx index 32d434592..80da8eb31 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx @@ -158,7 +158,7 @@ void SALOME_PYQT_Module::getEngineIOR() return; if ( PyObject_HasAttrString( myModule , "engineIOR" ) ) { - PyObjWrapper res( PyObject_CallMethod( myModule, "engineIOR", "" ) ); + PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"engineIOR", (char*)"" ) ); if ( !res ) { PyErr_Print(); } 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 e52a67806..986b9e4e3 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx @@ -863,7 +863,7 @@ void SALOME_PYQT_ModuleLight::init( CAM_Application* app ) // ... (the Python module is already imported) // ... finally call Python module's initialize() method if ( PyObject_HasAttrString( myModule , "initialize" ) ) { - PyObjWrapper res( PyObject_CallMethod( myModule, "initialize", "" ) ); + PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"initialize", (char*)"" ) ); if ( !res ) { PyErr_Print(); } @@ -877,7 +877,7 @@ void SALOME_PYQT_ModuleLight::init( CAM_Application* app ) myWindowsMap.insert( LightApp_Application::WT_LogWindow, Qt::BottomDockWidgetArea ); if ( PyObject_HasAttrString( myModule , "windows" ) ) { - PyObjWrapper res1( PyObject_CallMethod( myModule, "windows", "" ) ); + PyObjWrapper res1( PyObject_CallMethod( myModule, (char*)"windows", (char*)"" ) ); if ( !res1 ) { PyErr_Print(); } @@ -904,7 +904,7 @@ void SALOME_PYQT_ModuleLight::init( CAM_Application* app ) // get compatible view windows types from the Python module // by calling views() method if ( PyObject_HasAttrString( myModule , "views" ) ) { - PyObjWrapper res2( PyObject_CallMethod( myModule, "views", "" ) ); + PyObjWrapper res2( PyObject_CallMethod( myModule, (char*)"views", (char*)"" ) ); if ( !res2 ) { PyErr_Print(); } @@ -963,7 +963,7 @@ void SALOME_PYQT_ModuleLight::activate( SUIT_Study* theStudy ) // call Python module's activate() method (for the new modules) if ( PyObject_HasAttrString( myModule , "activate" ) ) { - PyObject* res1 = PyObject_CallMethod( myModule, "activate", "" ); + PyObject* res1 = PyObject_CallMethod( myModule, (char*)"activate", (char*)"" ); if ( !res1 || !PyBool_Check( res1 ) ) { PyErr_Print(); // always true for old modules (no return value) @@ -1036,7 +1036,7 @@ void SALOME_PYQT_ModuleLight::customize( SUIT_Study* theStudy ) if ( IsCallOldMethods ) { // call Python module's setSettings() method (obsolete) if ( PyObject_HasAttrString( myModule , "setSettings" ) ) { - PyObjWrapper res( PyObject_CallMethod( myModule, "setSettings", "" ) ); + PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"setSettings", (char*)"" ) ); if( !res ) { PyErr_Print(); } @@ -1063,7 +1063,7 @@ void SALOME_PYQT_ModuleLight::deactivate( SUIT_Study* theStudy ) } // then call Python module's deactivate() method if ( PyObject_HasAttrString( myModule , "deactivate" ) ) { - PyObjWrapper res( PyObject_CallMethod( myModule, "deactivate", "" ) ); + PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"deactivate", (char*)"" ) ); if( !res ) { PyErr_Print(); } @@ -1117,7 +1117,7 @@ void SALOME_PYQT_ModuleLight::studyChanged( SUIT_Study* theStudy ) // call Python module's activeStudyChanged() method if ( PyObject_HasAttrString( myModule , "activeStudyChanged" ) ) { - PyObjWrapper res( PyObject_CallMethod( myModule, "activeStudyChanged", "i", aStudyId ) ); + PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"activeStudyChanged", (char*)"i", aStudyId ) ); if( !res ) { PyErr_Print(); } @@ -1154,8 +1154,8 @@ void SALOME_PYQT_ModuleLight::contextMenu( const QString& theContext, QMenu* the // call definePopup() Python module's function // this is obsolete function, used only for compatibility reasons PyObjWrapper res( PyObject_CallMethod( myModule, - "definePopup", - "sss", + (char*)"definePopup", + (char*)"sss", theContext.toLatin1().constData(), aObject.toLatin1().constData(), aParent.toLatin1().constData() ) ); @@ -1183,8 +1183,8 @@ void SALOME_PYQT_ModuleLight::contextMenu( const QString& theContext, QMenu* the // then call Python module's createPopupMenu() method (for new modules) if ( PyObject_HasAttrString( myModule , "createPopupMenu" ) ) { PyObjWrapper res1( PyObject_CallMethod( myModule, - "createPopupMenu", - "Os", + (char*)"createPopupMenu", + (char*)"Os", sipPopup.get(), theContext.toLatin1().constData() ) ); if( !res1 ) { @@ -1196,8 +1196,8 @@ void SALOME_PYQT_ModuleLight::contextMenu( const QString& theContext, QMenu* the // call customPopup() Python module's function // this is obsolete function, used only for compatibility reasons PyObjWrapper res2( PyObject_CallMethod( myModule, - "customPopup", - "Osss", + (char*)"customPopup", + (char*)"Osss", sipPopup.get(), aContext.toLatin1().constData(), aObject.toLatin1().constData(), @@ -1226,7 +1226,7 @@ void SALOME_PYQT_ModuleLight::guiEvent( const int theId ) return; if ( PyObject_HasAttrString( myModule , "OnGUIEvent" ) ) { - PyObjWrapper res( PyObject_CallMethod( myModule, "OnGUIEvent", "i", theId ) ); + PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"OnGUIEvent", (char*)"i", theId ) ); if( !res ) { PyErr_Print(); } @@ -1253,7 +1253,7 @@ void SALOME_PYQT_ModuleLight::initPreferences() myInitModule = this; if ( PyObject_HasAttrString( myModule , "createPreferences" ) ) { - PyObjWrapper res( PyObject_CallMethod( myModule, "createPreferences", "" ) ); + PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"createPreferences", (char*)"" ) ); if( !res ) { PyErr_Print(); } @@ -1305,7 +1305,7 @@ void SALOME_PYQT_ModuleLight::initInterp( int theStudyId ) } // ... then call a method int embedded = 1; - PyObjWrapper aRes( PyObject_CallMethod( aMod, "salome_init", "ii", theStudyId, embedded ) ); + PyObjWrapper aRes( PyObject_CallMethod( aMod, (char*)"salome_init", (char*)"ii", theStudyId, embedded ) ); if( !aRes ) { // Error! PyErr_Print(); @@ -1389,7 +1389,7 @@ void SALOME_PYQT_ModuleLight::setWorkSpace() PyObjWrapper pyws( sipBuildResult( 0, "M", aWorkspace, sipClass_QWidget ) ); // ... and finally call Python module's setWorkspace() method (obsolete) if ( PyObject_HasAttrString( myModule , "setWorkSpace" ) ) { - PyObjWrapper res( PyObject_CallMethod( myModule, "setWorkSpace", "O", pyws.get() ) ); + PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"setWorkSpace", (char*)"O", pyws.get() ) ); if( !res ) { PyErr_Print(); } @@ -1417,8 +1417,8 @@ void SALOME_PYQT_ModuleLight::prefChanged( const QString& section, const QString if ( PyObject_HasAttrString( myModule , "preferenceChanged" ) ) { PyObjWrapper res( PyObject_CallMethod( myModule, - "preferenceChanged", - "ss", + (char*)"preferenceChanged", + (char*)"ss", section.toLatin1().constData(), setting.toLatin1().constData() ) ); if( !res ) { @@ -1818,7 +1818,7 @@ void SALOME_PYQT_ModuleLight::activeViewChanged( const SUIT_ViewWindow* pview ) if ( !pview ) return; - PyObjWrapper res( PyObject_CallMethod( myModule, "activeViewChanged", "i" , pview->getId() ) ); + PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"activeViewChanged", (char*)"i" , pview->getId() ) ); if( !res ) PyErr_Print(); } @@ -1862,7 +1862,7 @@ void SALOME_PYQT_ModuleLight::viewCloned( const SUIT_ViewWindow* pview ) if ( PyObject_HasAttrString( myModule, "viewCloned" ) ) { - PyObjWrapper res( PyObject_CallMethod( myModule, "viewCloned", "i", pview->getId() ) ); + PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"viewCloned", (char*)"i", pview->getId() ) ); if( !res ) PyErr_Print(); } @@ -1906,7 +1906,7 @@ void SALOME_PYQT_ModuleLight::viewClosed( const SUIT_ViewWindow* pview ) if ( PyObject_HasAttrString( myModule, "viewClosed" ) ) { - PyObjWrapper res( PyObject_CallMethod( myModule, "viewClosed", "i", pview->getId() ) ); + PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"viewClosed", (char*)"i", pview->getId() ) ); if ( !res ) { PyErr_Print(); @@ -2373,8 +2373,8 @@ void SALOME_PYQT_ModuleLight::saveEvent(QStringList& theListOfFiles) return; if ( PyObject_HasAttrString(myModule , "saveFiles") ) { - PyObjWrapper res( PyObject_CallMethod( myModule, "saveFiles", - "s", (*it).toLatin1().constData())); + PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"saveFiles", + (char*)"s", (*it).toLatin1().constData())); if( !res ) { PyErr_Print(); } @@ -2452,8 +2452,8 @@ void SALOME_PYQT_ModuleLight::openEvent(QStringList theListOfFiles, bool &opened PyObjWrapper sipList( sipBuildResult( 0, "M", theList, sipClass_QStringList ) ); if ( PyObject_HasAttrString(myModule , "openFiles") ) { - PyObjWrapper res( PyObject_CallMethod( myModule, "openFiles", - "O", sipList.get())); + PyObjWrapper res( PyObject_CallMethod( myModule, (char*)"openFiles", + (char*)"O", sipList.get())); if( !res || !PyBool_Check( res )) { PyErr_Print(); opened = false; diff --git a/src/SUITApp/SUITApp.cxx b/src/SUITApp/SUITApp.cxx index ad77b3bd7..b534f5683 100644 --- a/src/SUITApp/SUITApp.cxx +++ b/src/SUITApp/SUITApp.cxx @@ -281,7 +281,7 @@ int main( int argc, char* argv[] ) #ifdef SUIT_ENABLE_PYTHON //...Initialize python int _argc = 1; - char* _argv[] = {""}; + char* _argv[] = {(char*)""}; SUIT_PYTHON::init_python(_argc,_argv); PyEval_RestoreThread( SUIT_PYTHON::_gtstate ); diff --git a/src/SalomeApp/SalomeApp_PyInterp.cxx b/src/SalomeApp/SalomeApp_PyInterp.cxx index 27d520f6f..51868318c 100755 --- a/src/SalomeApp/SalomeApp_PyInterp.cxx +++ b/src/SalomeApp/SalomeApp_PyInterp.cxx @@ -92,7 +92,7 @@ bool SalomeApp_PyInterp::initContext() // Call init_shared_modules to initialize the shared import mechanism for modules //that must not be imported twice - PyObjWrapper m2( PyObject_CallMethod( m1, "init_shared_modules", "O", KERNEL_PYTHON::salome_shared_modules_module ) ); + PyObjWrapper m2( PyObject_CallMethod( m1, (char*)"init_shared_modules", (char*)"O", KERNEL_PYTHON::salome_shared_modules_module ) ); if ( !m2 ) { MESSAGE( "initContext: problem with init_shared_modules call" ); diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index f767206e8..46e753b13 100755 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -398,7 +398,7 @@ int main( int argc, char **argv ) try { // ...initialize Python (only once) int _argc = 1; - char* _argv[] = {""}; + char* _argv[] = {(char*)""}; KERNEL_PYTHON::init_python( _argc,_argv ); PyEval_RestoreThread( KERNEL_PYTHON::_gtstate ); if ( !KERNEL_PYTHON::salome_shared_modules_module ) // import only once diff --git a/src/Session/Session_ServerLauncher.cxx b/src/Session/Session_ServerLauncher.cxx index bf7fe0890..ab558f666 100755 --- a/src/Session/Session_ServerLauncher.cxx +++ b/src/Session/Session_ServerLauncher.cxx @@ -213,7 +213,7 @@ void Session_ServerLauncher::ActivateAll() int argc=1; char** argv = new char*[argc]; - argv[0] = "Session"; + argv[0] = (char*)"Session"; Session_SessionThread* aServerThread = new Session_SessionThread(argc, argv, _orb,_root_poa,_SessionMutex,_SessionStarted); _serverThreads.push_front(aServerThread); diff --git a/src/Session/Session_ServerThread.cxx b/src/Session/Session_ServerThread.cxx index 3a66b102e..e46db7d48 100755 --- a/src/Session/Session_ServerThread.cxx +++ b/src/Session/Session_ServerThread.cxx @@ -365,7 +365,7 @@ void Session_ServerThread::ActivateContainer(int argc, MESSAGE("pmanfac->activate()"); } - char *containerName = ""; + char *containerName = (char*)""; if (argc >1) { containerName = argv[1]; } -- 2.39.2