summaryrefslogtreecommitdiffstats
path: root/SystemInformation.cxx
diff options
context:
space:
mode:
authorKWSys Robot <kwrobot@kitware.com>2013-10-08 12:29:16 (GMT)
committerBrad King <brad.king@kitware.com>2013-10-08 13:53:08 (GMT)
commit1a39f857f705604818b81ed38a3d7de2d1b66fa6 (patch)
treec2b9566e4e1b0261f3bca4a458c4aa340617205a /SystemInformation.cxx
parentce6eac8b58b0230cd1d8ee100a27973e5354a5c4 (diff)
downloadCMake-1a39f857f705604818b81ed38a3d7de2d1b66fa6.zip
CMake-1a39f857f705604818b81ed38a3d7de2d1b66fa6.tar.gz
CMake-1a39f857f705604818b81ed38a3d7de2d1b66fa6.tar.bz2
KWSys 2013-10-08 (96b2f6f4)
Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ 96b2f6f4 | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' deec6b8a..96b2f6f4 Adrien Destugues (2): 2b303bd7 SystemTools: Remove outdated preprocessor checks for Haiku 96b2f6f4 DynamicLoader: Cleanup test include files for Haiku Rolf Eike Beer (1): dbc8fa1b SystemInformation: fix truncation warnings Change-Id: I25364f58d62dd73fde0f7625d9d77ed0d4726e33
Diffstat (limited to 'SystemInformation.cxx')
-rw-r--r--SystemInformation.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/SystemInformation.cxx b/SystemInformation.cxx
index beefd7d..7c31f3a 100644
--- a/SystemInformation.cxx
+++ b/SystemInformation.cxx
@@ -1734,12 +1734,12 @@ int SystemInformationImplementation::GetFullyQualifiedDomainName(
{
char host[NI_MAXHOST]={'\0'};
- socklen_t addrlen
+ const size_t addrlen
= (fam==AF_INET?sizeof(struct sockaddr_in):sizeof(struct sockaddr_in6));
ierr=getnameinfo(
ifa->ifa_addr,
- addrlen,
+ static_cast<socklen_t>(addrlen),
host,
NI_MAXHOST,
NULL,
@@ -3836,7 +3836,8 @@ bool SystemInformationImplementation::QueryLinuxMemory()
unsigned long temp;
unsigned long cachedMem;
unsigned long buffersMem;
- char *r=fgets(buffer, sizeof(buffer), fd); // Skip "total: used:..."
+ // Skip "total: used:..."
+ char *r=fgets(buffer, static_cast<int>(sizeof(buffer)), fd);
int status=0;
if(r==buffer)
{