diff options
author | mcorino <mcorino@remedy.nl> | 2015-05-28 16:31:05 +0200 |
---|---|---|
committer | mcorino <mcorino@remedy.nl> | 2015-05-28 16:31:05 +0200 |
commit | 372d1db11a14a5402303cdfd9bdd36ffd42e3355 (patch) | |
tree | 16af8be681f6f312a297e954207d709bb7b722c0 | |
parent | ec6da64f25c36c22f97e522a5a3b7c872ec42019 (diff) | |
parent | 4cc58ce93b93e07f2d73228ad7c621c7fccbd2f6 (diff) | |
download | ATCD-372d1db11a14a5402303cdfd9bdd36ffd42e3355.tar.gz |
Merge pull request #84 from mcorino/master
Fix MSVC14 compile warnings
-rw-r--r-- | ACE/ace/ETCL/ETCL_y.cpp | 2 | ||||
-rw-r--r-- | ACE/ace/OS_NS_sys_utsname.cpp | 7 | ||||
-rw-r--r-- | ACE/ace/Object_Manager_Base.cpp | 5 | ||||
-rw-r--r-- | ACE/ace/XML_Utils/XercesString.cpp | 8 | ||||
-rw-r--r-- | ACE/ace/config-win32-common.h | 4 | ||||
-rw-r--r-- | ACE/apps/gperf/src/Gen_Perf.cpp | 3 | ||||
-rw-r--r-- | ACE/apps/gperf/src/List_Node.cpp | 2 | ||||
-rw-r--r-- | ACE/apps/gperf/src/Options.cpp | 3 |
8 files changed, 26 insertions, 8 deletions
diff --git a/ACE/ace/ETCL/ETCL_y.cpp b/ACE/ace/ETCL/ETCL_y.cpp index 9fe453f62fa..bee4ad17f11 100644 --- a/ACE/ace/ETCL/ETCL_y.cpp +++ b/ACE/ace/ETCL/ETCL_y.cpp @@ -623,7 +623,7 @@ yynewstate: #endif /* Get the current used size of the three stacks, in elements. */ - int size = yyssp - yyss + 1; + int size = (int)(yyssp - yyss + 1); #ifdef yyoverflow /* Each stack pointer address is followed by the size of diff --git a/ACE/ace/OS_NS_sys_utsname.cpp b/ACE/ace/OS_NS_sys_utsname.cpp index 2ce19b133f4..535925bc81c 100644 --- a/ACE/ace/OS_NS_sys_utsname.cpp +++ b/ACE/ace/OS_NS_sys_utsname.cpp @@ -22,9 +22,14 @@ ACE_OS::uname (ACE_utsname *name) size_t maxnamelen = sizeof name->nodename; ACE_OS::strcpy (name->sysname, "Win32"); +# if defined (ACE_HAS_WIN32_GETVERSION) + /* Since MS found it necessary to deprecate these. */ +# pragma warning disable 4996 ACE_TEXT_OSVERSIONINFO vinfo; vinfo.dwOSVersionInfoSize = sizeof(ACE_TEXT_OSVERSIONINFO); ACE_TEXT_GetVersionEx (&vinfo); +# pragma warning enable 4996 +# endif SYSTEM_INFO sinfo; # if defined (ACE_HAS_PHARLAP) @@ -45,6 +50,7 @@ ACE_OS::uname (ACE_utsname *name) const char* unknown = "???"; +# if defined (ACE_HAS_WIN32_GETVERSION) if ( vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT # if defined (VER_PLATFORM_WIN32_CE) @@ -196,6 +202,7 @@ ACE_OS::uname (ACE_utsname *name) ACE_OS::strcpy (name->machine, unknown); } else +# endif /* !ACE_HAS_WIN32_GETVERSION */ { // We don't know what this is! diff --git a/ACE/ace/Object_Manager_Base.cpp b/ACE/ace/Object_Manager_Base.cpp index 1ef953dfd45..6cd773ed13a 100644 --- a/ACE/ace/Object_Manager_Base.cpp +++ b/ACE/ace/Object_Manager_Base.cpp @@ -256,10 +256,13 @@ ACE_OS_Object_Manager::init (void) // been initialized. object_manager_state_ = OBJ_MAN_INITIALIZED; -# if defined (ACE_WIN32) +# if defined (ACE_WIN32) && defined (ACE_HAS_WIN32_GETVERSION) +/* Since MS found it necessary to deprecate these. */ +# pragma warning disable 4996 ACE_OS::win32_versioninfo_.dwOSVersionInfoSize = sizeof (ACE_TEXT_OSVERSIONINFO); ACE_TEXT_GetVersionEx (&ACE_OS::win32_versioninfo_); +# pragma warning enable 4996 # endif /* ACE_WIN32 */ return 0; } else { diff --git a/ACE/ace/XML_Utils/XercesString.cpp b/ACE/ace/XML_Utils/XercesString.cpp index d4fe450e229..5a85dfb43c4 100644 --- a/ACE/ace/XML_Utils/XercesString.cpp +++ b/ACE/ace/XML_Utils/XercesString.cpp @@ -4,6 +4,8 @@ #include "XercesString.h" #include "xercesc/util/PlatformUtils.hpp" +#include "ace/Truncate.h" + using xercesc::XMLString; using xercesc::XMLPlatformUtils; @@ -62,8 +64,8 @@ namespace XML bool XStr::append(const XMLCh *tail) { - int iTailLen = XMLString::stringLen(tail); - int iWorkLen = XMLString::stringLen(_wstr); + XMLSize_t iTailLen = XMLString::stringLen(tail); + XMLSize_t iWorkLen = XMLString::stringLen(_wstr); XMLSize_t bytes = (iWorkLen + iTailLen + 1) * sizeof (XMLCh); void *tmp = XMLPlatformUtils::fgMemoryManager->allocate (bytes); @@ -112,7 +114,7 @@ namespace XML int XStr::size () const { - return XMLString::stringLen(_wstr); + return ACE_Utils::truncate_cast<int> (XMLString::stringLen(_wstr)); } XMLCh XStr::operator [] (const int i) diff --git a/ACE/ace/config-win32-common.h b/ACE/ace/config-win32-common.h index 28c8f6337eb..13464c4332f 100644 --- a/ACE/ace/config-win32-common.h +++ b/ACE/ace/config-win32-common.h @@ -239,6 +239,10 @@ #define ACE_HAS_SOCKADDR_MSG_NAME #define ACE_HAS_THREAD_SAFE_ACCEPT +/* MS is phasing out the GetVersion API so let's prepare */ +/* For now all releases still provide it. */ +#define ACE_HAS_WIN32_GETVERSION + /* LACKS dir-related facilities */ #define ACE_LACKS_READDIR_R #define ACE_LACKS_REWINDDIR diff --git a/ACE/apps/gperf/src/Gen_Perf.cpp b/ACE/apps/gperf/src/Gen_Perf.cpp index e56ca40e44d..7c46c1ba6a7 100644 --- a/ACE/apps/gperf/src/Gen_Perf.cpp +++ b/ACE/apps/gperf/src/Gen_Perf.cpp @@ -27,6 +27,7 @@ #include "ace/OS_NS_time.h" #include "ace/OS_NS_stdio.h" #include "ace/OS_Memory.h" +#include "ace/Truncate.h" /// Current release version. extern const char *version_string; @@ -77,7 +78,7 @@ Gen_Perf::compute_disjoint_union (char *set1, char *set2, char *set3) set3++; } *set3 = '\0'; - return set3 - base; + return ACE_Utils::truncate_cast<int> (set3 - base); } /// Sort the UNION_SET in increasing frequency of occurrence. This diff --git a/ACE/apps/gperf/src/List_Node.cpp b/ACE/apps/gperf/src/List_Node.cpp index 037f2406435..018f66db6b7 100644 --- a/ACE/apps/gperf/src/List_Node.cpp +++ b/ACE/apps/gperf/src/List_Node.cpp @@ -117,7 +117,7 @@ List_Node::List_Node (char *k, int len) *ptr = '\0'; // Sort the KEYSIG items alphabetically. - sort (keysig, ptr - keysig); + sort (keysig, ACE_Utils::truncate_cast<int> (ptr - keysig)); } List_Node::~List_Node (void) diff --git a/ACE/apps/gperf/src/Options.cpp b/ACE/apps/gperf/src/Options.cpp index 6809f86e999..c93e8dc62e4 100644 --- a/ACE/apps/gperf/src/Options.cpp +++ b/ACE/apps/gperf/src/Options.cpp @@ -27,6 +27,7 @@ #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_string.h" #include "ace/OS_NS_stdlib.h" +#include "ace/Truncate.h" /// These need to appear before the global class instantiation, since /// they are static members with a default constructor that initializes @@ -518,7 +519,7 @@ Options::parse_args (int argc, ACE_TCHAR *argv[]) *l_key_pos = EOS; - total_keysig_size_ = (l_key_pos - key_positions_); + total_keysig_size_ = ACE_Utils::truncate_cast<u_int> (l_key_pos - key_positions_); if (total_keysig_size_ == 0) ACE_ERROR_RETURN ((LM_ERROR, "No keys selected.\n%r", |