#define DEVTRACE(msg)
#endif
+#ifdef WNT
+#pragma warning(disable:4251) // Warning DLL Interface ...
+#endif
+
// ============================================================================
/*!
* The PROTECTED_DELETE base class provides a protected destructor.
{
int pos = file_path.rfind( _separator_ );
if ( pos >= 0 )
- return pos < file_path.size()-1 ? file_path.substr( pos+1 ) : "";
+ return pos < (int)file_path.size()-1 ? file_path.substr( pos+1 ) : "";
return file_path;
}
string::size_type length = path.length();
//detect all separators in Unix format
- for ( int i = 0; i < length; i++ )
+ for ( unsigned int i = 0; i < length; i++ )
{
if( path[i] == '/' )
path[i] = '|';
}
//detect all separators in Windows format
- for ( int i = 0; i < length; i++ )
+ for ( unsigned int i = 0; i < length; i++ )
{
if( path[i] == '\\' )
path[i] = '|';
}
length = path.length();
- for ( int i = 0; i < length; i++ )
+ for ( unsigned int i = 0; i < length; i++ )
{
if( path[i] == '|' )
path[i] = _separator_;
//Returns true if there is a current Label
bool DF_ChildIterator::More()
{
- return bool(_current);
+ return _current!=0;
}
//Moves to the next Label
bool DF_Label::IsAttached()
{
if(!_node) return false;
- return (bool)(_node->_document);
+ return _node->_document != 0;
}
//Searches an Attribute with given ID located on this Label.
{
if(!_node) return false;
- return (bool)(_node->_firstChild);
+ return _node->_firstChild != 0;
}
//Returns a number of child Labels.
#include <pwd.h>
#else
#include <time.h>
-#include <lmcons.h>
#include <windows.h>
+#include <lmcons.h>
#endif
using namespace std;
# define GENERICOBJ_EXPORT
#endif
+#ifdef WNT
+#pragma warning(disable:4275) // Disable warning interface non dll
+#pragma warning(disable:4251) // Warning DLL Interface ...
+#endif
+
namespace SALOME{
class GENERICOBJ_EXPORT GenericObj_i :
public virtual POA_SALOME::GenericObj,
#include <io.h>
#include <time.h>
#include <windows.h>
+#define open _open
+#define read _read
+#define close _close
#define dir_separator '\\'
#else
#define dir_separator '/'
fprintf(fp, "%s\n", ASCIIHDF_ID);
fprintf(fp, "%i\n", nbsons+nbAttr);
- for(unsigned j=0; j<nbAttr; j++) {
+ for(int j=0; j<nbAttr; j++) {
char* attr_name = hdf_file->GetAttributeName(j);
HDFattribute *hdf_attribute = new HDFattribute(attr_name, hdf_file);
delete attr_name;
fprintf(fp, "%s %i\n", name, nbsons+nbAttr);
delete [] name;
- for(unsigned j=0; j<nbAttr; j++) {
+ for(int j=0; j<nbAttr; j++) {
name = hdf_group->GetAttributeName(j);
HDFattribute *hdf_attribute = new HDFattribute(name, hdf_group);
delete [] name;
{
hdf_dataset->OpenOnDisk();
- long size = hdf_dataset->GetSize();
+ long size = (long) hdf_dataset->GetSize();
long ndim = hdf_dataset->nDim(); //Get number of dimesions
hdf_size *dim = new hdf_size[ndim];
hdf_type type = hdf_dataset->GetType();
fprintf(fp, "\n");
- for ( unsigned j=0; j<nbAttr; j++ )
+ for ( int j=0; j<nbAttr; j++ )
{
name = hdf_dataset->GetAttributeName(j);
HDFattribute *hdf_attribute = new HDFattribute(name, hdf_dataset);
#ifdef WIN32
#include <io.h>
#include <windows.h>
+#define open _open
+#define close _close
#endif
int HDFConvert::FromAscii(const string& file, const HDFcontainerObject & hdf_container, const string& nomdataset)
dim[i] = _dim[i];
}
-int HDFdataset::GetSize()
+hdf_size HDFdataset::GetSize()
{
int size_type;
hdf_type _type;
hdf_size *_dim;
hdf_byte_order _byte_order;
- int _size;
+ hdf_size _size;
int _ndim;
char* _attribute;
hdf_type GetType();
int nDim();
void GetDim(hdf_size dim[]);
- int GetSize();
+ hdf_size GetSize();
hdf_object_type GetObjectType();
hdf_byte_order GetOrder();
#else
#include <io.h>
#define F_OK 0
+#define access _access
#endif
#include <string.h>
}
#include <stdlib.h>
using namespace std;
+#ifdef WNT
+#define strdup _strdup
+#endif
+
HDFobject::HDFobject(const char *name)
{
HDFerrorModeLock();
# define LOGGER_EXPORT
#endif
+#ifdef WNT
+#pragma warning(disable:4275) // Disable warning interface non dll
+#endif
class LOGGER_EXPORT Logger :
public POA_SALOME_Logger::Logger
orb->run() ;
orb->destroy() ;
}
- catch(CORBA::COMM_FAILURE& ex)
+ catch(CORBA::COMM_FAILURE&)
{
std::cerr << "Caught system exception COMM_FAILURE -- unable to contact the "
<< "object." << std::endl;
#include CORBA_SERVER_HEADER(SALOME_ModuleCatalog)
+#ifdef WNT
+#pragma warning(disable:4275) // Disable warning interface non dll
+#pragma warning(disable:4290) // Warning Exception ...
+#endif
+
class MODULECATALOG_EXPORT SALOME_ModuleCatalog_AcomponentImpl: public POA_SALOME_ModuleCatalog::Acomponent
{
public:
INFOS("CosNaming::NamingContext::NotEmpty")
}
- catch(CORBA::Exception &sysEx) {
+ catch(CORBA::Exception &) {
INFOS("Caught CORBA::Exception.")
}
// Tag test_component_multistudy
if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_multistudy) )
- _aModule.multistudy = atoi( aContent.c_str() );
+ _aModule.multistudy = atoi( aContent.c_str() ) != 0;
// Tag test_component_impltype
if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_impltype) )
// Tag test_defaultservice
if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_defaultservice) )
- _aService.byDefault = (bool)(atoi((const char*)aCompServiceData));
+ _aService.byDefault = atoi((const char*)aCompServiceData) !=0 ;
// Tag test_typeofnode
if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_typeofnode) )
- _aService.typeOfNode = (bool)(atoi((const char*)aCompServiceData));;
+ _aService.typeOfNode = atoi((const char*)aCompServiceData) !=0 ;
xmlFree(aCompServiceData);
}
#include <libxml/parser.h>
+#ifdef WNT
+#pragma warning(disable:4251) // Warning DLL Interface ...
+#endif
+
class MODULECATALOG_EXPORT SALOME_ModuleCatalog_Handler
{
public:
//
long TIMESleep = 500000000;
int NumberOfTries = 40;
+#ifndef WIN32
int a;
+#endif
timespec ts_req;
ts_req.tv_nsec=TIMESleep;
ts_req.tv_sec=0;
SALOME_ModuleCatalog::ListOfTypeDefinition_var type_list = new SALOME_ModuleCatalog::ListOfTypeDefinition();
type_list->length(_typeList.size());
- for (int ind = 0 ; ind < _typeList.size() ; ind++)
+ for (unsigned int ind = 0 ; ind < _typeList.size() ; ind++)
{
//no real need to call string_dup, omniorb calls it on operator= (const char *) but it is safer
type_list[ind].name=CORBA::string_dup(_typeList[ind].name.c_str());
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOME_ModuleCatalog)
+#ifdef WNT
+#pragma warning(disable:4275) // Disable warning interface non dll
+#pragma warning(disable:4290) // Warning Exception ...
+#endif
+
class MODULECATALOG_EXPORT SALOME_ModuleCatalogImpl: public POA_SALOME_ModuleCatalog::ModuleCatalog
{
public:
#include <string>
#include <cstdio>
+#ifdef WNT
+#define strdup _strdup
+#endif
+
using namespace std;
/*! \class SALOME_NamingService
#include "SALOME_NamingService_defs.hxx"
+#ifdef WNT
+#pragma warning(disable:4290) // Warning Exception ...
+#endif
+
class NAMINGSERVICE_EXPORT SALOME_NamingService
{
public:
MESSAGE("NOTIFICATION Error : failed to obtain context for NameService");
return(channel);
};
- } catch(CORBA::ORB::InvalidName& ex) {
+ } catch(CORBA::ORB::InvalidName& ) {
MESSAGE("NOTIFICATION Error : service required is invalid [does not exist]");
return(channel);
- } catch (CORBA::SystemException& ex) {
+ } catch (CORBA::SystemException& ) {
MESSAGE("NOTIFICATION Error : caught system exception COMM_FAILURE");
return(channel);
} catch (...) {
if (CORBA::is_nil(channel)) {
MESSAGE("NOTIFICATION Error : failed to narrow object found in naming service");
};
- } catch(CORBA::ORB::InvalidName& ex) {
+ } catch(CORBA::ORB::InvalidName& ) {
MESSAGE("NOTIFICATION Error : invalid name");
- } catch (CORBA::SystemException& ex) {
+ } catch (CORBA::SystemException& ) {
MESSAGE("NOTIFICATION Error : caught system exception COMM_FAILURE while resolving event channel name");
} catch (...) {
MESSAGE("NOTIFICATION Error : caught exception while resolving event channel name");
proxy_supplier->connect_structured_pull_consumer(_this());
_ok = true;
MESSAGE("NOTIFICATION Info : successfully connection for pull consumer notification");
- } catch (CORBA::BAD_PARAM& ex) {
+ } catch (CORBA::BAD_PARAM&) {
MESSAGE("NOTIFICATION Error : pull consumer BAD_PARAM exception while connecting");
- } catch (CosEventChannelAdmin::AlreadyConnected& ex) {
+ } catch (CosEventChannelAdmin::AlreadyConnected&) {
MESSAGE("NOTIFICATION Error : pull consumer already connected");
} catch (...) {
MESSAGE("NOTIFICATION Error : pull consumer failed to connect");
proxy_consumer->connect_structured_push_supplier(_this());
_ok = true;
MESSAGE("NOTIFICATION Info : successfully connection for push supplier notification");
- } catch (CORBA::BAD_PARAM& ex) {
+ } catch (CORBA::BAD_PARAM&) {
MESSAGE("NOTIFICATION Error : push supplier BAD_PARAM Exception while connecting");
- } catch (CosEventChannelAdmin::AlreadyConnected& ex) {
+ } catch (CosEventChannelAdmin::AlreadyConnected&) {
MESSAGE("NOTIFICATION Error : push supplier already connected");
} catch (...) {
MESSAGE("NOTIFICATION Error : push supplier failed to connect");
#include "SALOME_NOTIFICATION.hxx"
+#ifdef WNT
+#pragma warning(disable:4275) // Disable warning interface non dll
+#endif
+
class NOTIFICATION_EXPORT NOTIFICATION_Supplier: public POA_CosNotifyComm::StructuredPushSupplier {
public:
NOTIFICATION_Supplier(const char* instanceName, bool notif);
#include <unistd.h>
#else
#include <process.h>
+#define getpid _getpid
#endif
using namespace std;
# include <map>
+#ifdef WNT
+#pragma warning(disable:4275) // Disable warning interface non dll
+#pragma warning(disable:4251) // Warning DLL Interface ...
+#endif
+
class REGISTRY_EXPORT RegistryService : public POA_Registry::Components //, public PortableServer::RefCountServantBase
{
const char *registryName = "Registry" ;
long TIMESleep = 250000000;
int NumberOfTries = 40;
+#ifndef WIN32
int a;
+#endif
timespec ts_req;
ts_req.tv_nsec=TIMESleep;
ts_req.tv_sec=0;
MESSAGE("RegistryService servant already existing" ) ;
exit( EXIT_FAILURE ) ;
}
- catch( const ServiceUnreachable &ex )
+ catch( const ServiceUnreachable & )
{
}
- catch( const CORBA::Exception &exx )
+ catch( const CORBA::Exception & )
{
}
string absoluteName = string("/") + registryName;
#endif
orb->run() ;
}
- catch( const CORBA::Exception &ex )
+ catch( const CORBA::Exception & )
{
MESSAGE("System error") ;
return EXIT_FAILURE ;
#include <unistd.h>
#endif
+#ifdef WNT
+#pragma warning(disable:4251) // Warning DLL Interface ...
+#pragma warning(disable:4290) // Warning Exception ...
+#endif
+
// --- WARNING ---
// The call of BuildTempFileToLaunchRemoteContainer and RmTmpFile must be done
// in a critical section to be sure to be clean.
else{
iproc = 1;
imachine++;
- if(imachine >= hosts.size())
+ if(imachine >= (int)hosts.size())
imachine = 0;
return string(hosts[imachine]);
}
"Modules : " << endl <<
"Components : " << endl;
- for(int i=0;i<ComponentsList.size();i++)
+ for(unsigned int i=0;i<ComponentsList.size();i++)
oss << "Component " << i+1 << " called : " << ComponentsList[i] << endl;
#include <map>
#include <iostream>
+#ifdef WNT
+#pragma warning(disable:4251) // Warning DLL Interface ...
+#endif
+
enum AccessProtocolType {rsh, ssh};
enum AccessModeType {interactive, batch};
# define SALOMERESOURCESMANAGER_EXPORT
#endif
+#ifdef WNT
+#pragma warning(disable:4275) // Disable warning interface non dll
+#endif
+
// --- WARNING ---
// The call of BuildTempFileToLaunchRemoteContainer and RmTmpFile must be done
// in a critical section to be sure to be clean.
_orb = CORBA::ORB_init( argc, argv, "omniORB3" ) ;
#endif
}
- catch( const CORBA::Exception &ex )
+ catch( const CORBA::Exception & )
{
throw CommException( "Unable to create an ORB connexion" ) ;
}
#include "Utils_CommException.hxx"
+#ifdef WNT
+#pragma warning(disable:4251) // Warning DLL Interface ...
+#pragma warning(disable:4290) // Warning Exception ...
+#endif
+
/*!
* Ce composant prend en charge la connexion et la deconnexion a l'orb
* Il est souhaitable de l'utiliser dans un SINGLETON.
# define UTILS_EXPORT __declspec( dllexport )
# else
# define UTILS_EXPORT __declspec( dllimport )
+# undef LOCALIZED
# define LOCALIZED(message) #message
# endif
#else
SALOME_Exception( const char *text, const char *fileName=0, const unsigned int lineNumber=0 );
SALOME_Exception( const SALOME_Exception &ex );
virtual ~SALOME_Exception() throw ();
- friend std::ostream & operator<<( std::ostream &os , const SALOME_Exception &ex );
+ UTILS_EXPORT friend std::ostream & operator<<( std::ostream &os , const SALOME_Exception &ex );
virtual const char *what( void ) const throw () ;
} ;
#ifndef WIN32
unsigned long Absolute_user = (unsigned long) ((timeval*)RefToCurrentTimeB)->tv_sec ;
#else
- unsigned long Absolute_user = *RefToCurrentTimeB;
+ unsigned long Absolute_user = (unsigned long) *RefToCurrentTimeB;
#endif
MESSAGE("Absolute time: " << Absolute_user << " seconds ");
#endif