summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-11-05 19:34:36 (GMT)
committerBrad King <brad.king@kitware.com>2007-11-05 19:34:36 (GMT)
commitf410f8578eea403d0ca657e46ec7659cd0f805e7 (patch)
tree09715a217fb40d51d17508c95244dbdfa6d1d399 /Source/CTest
parentcfa723d45792ef6969304fb7d9274778f662a116 (diff)
downloadCMake-f410f8578eea403d0ca657e46ec7659cd0f805e7.zip
CMake-f410f8578eea403d0ca657e46ec7659cd0f805e7.tar.gz
CMake-f410f8578eea403d0ca657e46ec7659cd0f805e7.tar.bz2
COMP: Fix warnings on 64-bit Mac OS X build. Patch from issue #3697.
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx6
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx10
2 files changed, 12 insertions, 4 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 1f27394..0606cd9 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -1501,15 +1501,15 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
float cper = percentBranch + percentFunction;
if(totalBranches > 0)
{
- cper /= 2.0;
+ cper /= 2.0f;
}
percent_coverage += cper;
float cmet = percentFunction + percentBranch;
if(totalBranches > 0)
{
- cmet /= 2.0;
+ cmet /= 2.0f;
}
- cmet /= 100.0;
+ cmet /= 100.0f;
// Hack for conversion of function to loc assume a function
// has 100 lines of code
functionsCalled *=100;
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 05a8e5a..8e7919d 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -695,7 +695,15 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const cmStdString& localprefix,
return false;
}
- size_t fileSize = st.st_size;
+ // off_t can be bigger than size_t. fread takes size_t.
+ // make sure the file is not too big.
+ if (st.st_size > (size_t)-1)
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE, " File too big: "
+ << local_file.c_str() << std::endl);
+ return false;
+ }
+ size_t fileSize = static_cast<size_t>(st.st_size);
FILE* fp = fopen(local_file.c_str(), "rb");
if ( !fp )
{