diff --git a/ProcessUNIX.c b/ProcessUNIX.c index b7526f12bed8a63c4faa6e7347d282ddf72a87b5..765d1e0c90e9cb75c8b5a3c11792e6efbb87f6b4 100644 --- a/ProcessUNIX.c +++ b/ProcessUNIX.c @@ -723,7 +723,8 @@ void kwsysProcess_Execute(kwsysProcess* cp) if(cp->WorkingDirectory) { int r; - if(!getcwd(cp->RealWorkingDirectory, cp->RealWorkingDirectoryLength)) + if(!getcwd(cp->RealWorkingDirectory, + (size_t)(cp->RealWorkingDirectoryLength))) { kwsysProcessCleanup(cp, 1); return; @@ -1426,7 +1427,8 @@ static int kwsysProcessInitialize(kwsysProcess* cp) #else cp->RealWorkingDirectoryLength = 4096; #endif - cp->RealWorkingDirectory = malloc(cp->RealWorkingDirectoryLength); + cp->RealWorkingDirectory = + malloc((size_t)(cp->RealWorkingDirectoryLength)); if(!cp->RealWorkingDirectory) { return 0; @@ -1736,7 +1738,7 @@ static int kwsysProcessCreate(kwsysProcess* cp, int prIndex, { /* Keep trying to read until the operation is not interrupted. */ while(((n = read(si->ErrorPipe[0], cp->ErrorMessage+total, - KWSYSPE_PIPE_BUFFER_SIZE-total)) < 0) && + (size_t)(KWSYSPE_PIPE_BUFFER_SIZE-total))) < 0) && (errno == EINTR)); if(n > 0) { @@ -2665,7 +2667,7 @@ static int kwsysProcessAppendByte(char* local, if((*end - *begin) >= *size) { kwsysProcess_ptrdiff_t length = *end - *begin; - char* newBuffer = (char*)malloc(*size*2); + char* newBuffer = (char*)malloc((size_t)(*size*2)); if(!newBuffer) { return 0; @@ -2719,14 +2721,14 @@ static int kwsysProcessAppendArgument(char** local, } /* Allocate space for the argument string. */ - **end = (char*)malloc(*arg_end - *arg_begin); + **end = (char*)malloc((size_t)(*arg_end - *arg_begin)); if(!**end) { return 0; } /* Store the argument in the command array. */ - memcpy(**end, *arg_begin, *arg_end - *arg_begin); + memcpy(**end, *arg_begin,(size_t)(*arg_end - *arg_begin)); ++(*end); /* Reset the argument to be empty. */ diff --git a/SystemInformation.cxx b/SystemInformation.cxx index ac7b1f26ce60449992b7c49b773e9cfadc3d8a78..6c33e6af96f0c217c143d178983f0b28584103e6 100644 --- a/SystemInformation.cxx +++ b/SystemInformation.cxx @@ -2158,7 +2158,7 @@ int SystemInformationImplementation::RetreiveInformationFromCpuInfoFile() size_t fileSize = 0; while(!feof(fd)) { - buffer += fgetc(fd); + buffer += static_cast<unsigned char>(fgetc(fd)); fileSize++; } fclose( fd ); @@ -2500,7 +2500,7 @@ unsigned char SystemInformationImplementation::LogicalCPUPerPhysicalCPU(void) #if USE_ASM_INSTRUCTIONS if (!this->IsHyperThreadingSupported()) { - return (unsigned char) 1; // HT not supported + return static_cast<unsigned char>(1); // HT not supported } __asm { @@ -2509,7 +2509,7 @@ unsigned char SystemInformationImplementation::LogicalCPUPerPhysicalCPU(void) mov Regebx, ebx } #endif - return (unsigned char) ((Regebx & NUM_LOGICAL_BITS) >> 16); + return static_cast<unsigned char> ((Regebx & NUM_LOGICAL_BITS) >> 16); } /** Works only for windows */ @@ -2565,7 +2565,7 @@ unsigned char SystemInformationImplementation::GetAPICId() #if USE_ASM_INSTRUCTIONS if (!this->IsHyperThreadingSupported()) { - return (unsigned char) -1; // HT not supported + return static_cast<unsigned char>(-1); // HT not supported } // Logical processor = 1 __asm { @@ -2574,7 +2574,7 @@ unsigned char SystemInformationImplementation::GetAPICId() mov Regebx, ebx } #endif - return (unsigned char) ((Regebx & INITIAL_APIC_ID_BITS) >> 24); + return static_cast<unsigned char>((Regebx & INITIAL_APIC_ID_BITS) >> 24); } /** Count the number of CPUs. Works only on windows. */ @@ -2727,7 +2727,7 @@ bool SystemInformationImplementation::ParseSysCtl() this->NumberOfLogicalCPU /= this->NumberOfPhysicalCPU; } - this->CPUSpeedInMHz = atoi(this->ExtractValueFromSysCtl("hw.cpufrequency:").c_str()); + this->CPUSpeedInMHz = static_cast<float>(atoi(this->ExtractValueFromSysCtl("hw.cpufrequency:").c_str())); this->CPUSpeedInMHz /= 1000000; // Chip family @@ -2905,7 +2905,7 @@ bool SystemInformationImplementation::QuerySolarisInfo() this->NumberOfLogicalCPU /= this->NumberOfPhysicalCPU; } - this->CPUSpeedInMHz = atoi(this->ParseValueFromKStat("-s clock_MHz").c_str()); + this->CPUSpeedInMHz = static_cast<float>(atoi(this->ParseValueFromKStat("-s clock_MHz").c_str())); // Chip family this->ChipID.Family = 0; diff --git a/kwsysDateStamp.cmake b/kwsysDateStamp.cmake index a34677f2492e77c307c6bb0477db8da5f6e208ed..694daa5b24780f3103b64612b96e0d4b12ac75e8 100644 --- a/kwsysDateStamp.cmake +++ b/kwsysDateStamp.cmake @@ -7,4 +7,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2008) SET(KWSYS_DATE_STAMP_MONTH 12) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 04) +SET(KWSYS_DATE_STAMP_DAY 14)