Merge branch 'upstream-kwsys' into update-kwsys

This commit is contained in:
Brad King 2013-05-29 08:56:20 -04:00
commit 2c0c59a2e1
4 changed files with 18 additions and 9 deletions

View File

@ -1471,7 +1471,7 @@ int SystemInformationImplementation::GetFullyQualifiedDomainName(
{
char host[NI_MAXHOST]={'\0'};
int addrlen
socklen_t addrlen
= (fam==AF_INET?sizeof(struct sockaddr_in):sizeof(struct sockaddr_in6));
ierr=getnameinfo(
@ -3487,7 +3487,7 @@ bool SystemInformationImplementation::QueryLinuxMemory()
bool have[6] = { false, false, false, false, false, false };
unsigned long value[6];
int count = 0;
while(fgets(buffer, sizeof(buffer), fd))
while(fgets(buffer, static_cast<int>(sizeof(buffer)), fd))
{
for(int i=0; i < 6; ++i)
{

View File

@ -2742,14 +2742,23 @@ bool SystemTools::FileIsDirectory(const char* name)
}
// Remove any trailing slash from the name except in a root component.
char buffer[KWSYS_SYSTEMTOOLS_MAXPATH];
char local_buffer[KWSYS_SYSTEMTOOLS_MAXPATH];
std::string string_buffer;
size_t last = length-1;
if(last > 0 && (name[last] == '/' || name[last] == '\\')
&& strcmp(name, "/") !=0 && name[last-1] != ':')
{
memcpy(buffer, name, last);
buffer[last] = 0;
name = buffer;
if(last < sizeof(local_buffer))
{
memcpy(local_buffer, name, last);
local_buffer[last] = 0;
name = local_buffer;
}
else
{
string_buffer.append(name, last);
name = string_buffer.c_str();
}
}
// Now check the file node type.

View File

@ -48,7 +48,7 @@ int testIOS(int, char*[])
return 1;
}
static const unsigned char array[] = { 0xff,0x4f,0xff,0x51,0x00,0x29,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x07,0x01,0x01,0xff,0x52,0x00,0x0c,0x00,0x00,0x00,0x01,0x00,0x05,0x04,0x04,0x00,0x01,0xff,0x5c,0x00,0x13,0x40,0x40,0x48,0x48,0x50,0x48,0x48,0x50,0x48,0x48,0x50,0x48,0x48,0x50,0x48,0x48,0x50,0xff,0x64,0x00,0x2c,0x00,0x00,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x62,0x79,0x20,0x49,0x54,0x4b,0x2f,0x47,0x44,0x43,0x4d,0x2f,0x4f,0x70,0x65,0x6e,0x4a,0x50,0x45,0x47,0x20,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x31,0x2e,0x30,0xff,0x90,0x00,0x0a,0x00,0x00,0x00,0x00,0x06,0x2c,0x00,0x01,0xff,0x93,0xcf,0xb0,0x18,0x08,0x7f,0xc6,0x99,0xbf,0xff,0xc0,0xf8,0xc1,0xc1,0xf3,0x05,0x81,0xf2,0x83,0x0a,0xa5,0xff,0x10,0x90,0xbf,0x2f,0xff,0x04,0xa8,0x7f,0xc0,0xf8,0xc4,0xc1,0xf3,0x09,0x81,0xf3,0x0c,0x19,0x34 };
const unsigned int narray = sizeof(array); // 180
const size_t narray = sizeof(array); // 180
kwsys_ios::stringstream strstr;
strstr.write( (char*)array, narray );
//strstr.seekp( narray / 2 ); // set position of put pointer in mid string

View File

@ -88,9 +88,9 @@ int testSystemInformation(int, char*[])
printMethod3(info, GetHostMemoryUsed(), "KiB");
printMethod3(info, GetProcMemoryUsed(), "KiB");
for (int i = 0; i <= 31; i++)
for (long int i = 0; i <= 31; i++)
{
if (info.DoesCPUSupportFeature(1 << i))
if (info.DoesCPUSupportFeature(static_cast<long int>(1) << i))
{
kwsys_ios::cout << "CPU feature " << i << "\n";
}