From: rnv Date: Tue, 11 Aug 2020 11:38:51 +0000 (+0300) Subject: Suppress compilation warnings. X-Git-Tag: V9_6_0a1~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=29b3ea91e60d94497184a304797a58413f1ec9a8;p=modules%2Fkernel.git Suppress compilation warnings. --- diff --git a/src/Basics/BasicsGenericDestructor.cxx b/src/Basics/BasicsGenericDestructor.cxx index e2aa0dcb3..dc811ee66 100644 --- a/src/Basics/BasicsGenericDestructor.cxx +++ b/src/Basics/BasicsGenericDestructor.cxx @@ -196,5 +196,5 @@ const int GENERIC_DESTRUCTOR::Add(GENERIC_DESTRUCTOR &anObject) } assert(Destructors); Destructors->push_back(&anObject); - return Destructors->size(); + return (int)Destructors->size(); } diff --git a/src/Basics/Basics_DirUtils.cxx b/src/Basics/Basics_DirUtils.cxx index 90079b283..dee7639da 100644 --- a/src/Basics/Basics_DirUtils.cxx +++ b/src/Basics/Basics_DirUtils.cxx @@ -54,7 +54,7 @@ namespace Kernel_Utils std::string GetBaseName( const std::string& file_path, const bool with_extension ) { std::string tmp_str = file_path; - int pos = file_path.rfind( _separator_ ); + auto pos = file_path.rfind( _separator_ ); if ( pos >= 0 ) tmp_str = pos < (int)file_path.size()-1 ? file_path.substr( pos+1 ) : ""; @@ -67,7 +67,7 @@ namespace Kernel_Utils std::string GetDirName( const std::string& file_path ) { - int pos = file_path.rfind( _separator_ ); + auto pos = file_path.rfind( _separator_ ); if ( pos >= 0 ) return pos < (int)file_path.size()-1 ? file_path.substr(0, pos ) : ""; return std::string("."); @@ -190,7 +190,7 @@ namespace Kernel_Utils std::string AddExtension( const std::string& name ) { std::string tmp_str = name; - int pos = tmp_str.rfind( _extension_ ); + auto pos = tmp_str.rfind( _extension_ ); if( pos < 0 ) return tmp_str.append( _extension_ ); return tmp_str; diff --git a/src/Basics/Basics_Utils.cxx b/src/Basics/Basics_Utils.cxx index 2ef4de8e0..15f598427 100644 --- a/src/Basics/Basics_Utils.cxx +++ b/src/Basics/Basics_Utils.cxx @@ -184,9 +184,9 @@ namespace Kernel_Utils char* utf8_encode(const wchar_t* encoded) { if (encoded == NULL) return NULL; - int size_needed = WideCharToMultiByte(CP_UTF8, 0, encoded, std::wcslen(encoded), NULL, 0, NULL, NULL); + auto size_needed = WideCharToMultiByte(CP_UTF8, 0, encoded, (int)std::wcslen(encoded), NULL, 0, NULL, NULL); char* strTo = new char[ size_needed + 1 ]; - WideCharToMultiByte(CP_UTF8, 0, encoded, std::wcslen(encoded), strTo, size_needed, NULL, NULL); + WideCharToMultiByte(CP_UTF8, 0, encoded, (int)std::wcslen(encoded), strTo, size_needed, NULL, NULL); strTo[size_needed] = '\0'; return strTo; } @@ -194,9 +194,9 @@ namespace Kernel_Utils wchar_t* utf8_decode(const char* decoded) { if (decoded == NULL) return NULL; - int size_needed = MultiByteToWideChar(CP_UTF8, 0, decoded, strlen(decoded), NULL, 0); + auto size_needed = MultiByteToWideChar(CP_UTF8, 0, decoded, (int)strlen(decoded), NULL, 0); wchar_t* wstrTo = new wchar_t[ size_needed + 1 ]; - MultiByteToWideChar(CP_UTF8, 0, decoded, strlen(decoded), wstrTo, size_needed); + MultiByteToWideChar(CP_UTF8, 0, decoded, (int)strlen(decoded), wstrTo, size_needed); wstrTo[size_needed] = '\0'; return wstrTo; } diff --git a/src/Basics/Basics_Utils.hxx b/src/Basics/Basics_Utils.hxx index 2b2d676f4..387514396 100644 --- a/src/Basics/Basics_Utils.hxx +++ b/src/Basics/Basics_Utils.hxx @@ -34,6 +34,7 @@ #else #include #pragma comment(lib,"winmm.lib") +#pragma warning (disable : 4251) #endif diff --git a/src/HDFPersist/HDFattrCreate.c b/src/HDFPersist/HDFattrCreate.c index 6d6f75b2f..d9b788716 100644 --- a/src/HDFPersist/HDFattrCreate.c +++ b/src/HDFPersist/HDFattrCreate.c @@ -43,7 +43,7 @@ hdf_idt HDFattrCreate(hdf_idt pid,char *name,hdf_type type, size_t size) { hdf_idt aid,attr; hdf_err ret; - int type_hdf; + hid_t type_hdf; switch(type) { case HDF_FLOAT64 :