COMP: Fix warnings on 64-bit Mac OS X build. Patch from issue #3697.
This commit is contained in:
parent
cfa723d457
commit
f410f8578e
@ -338,7 +338,7 @@ static int copy_ar(CF *cfp, off_t size)
|
|||||||
{
|
{
|
||||||
static char pad = '\n';
|
static char pad = '\n';
|
||||||
off_t sz = size;
|
off_t sz = size;
|
||||||
int nr, nw;
|
size_t nr, nw;
|
||||||
char buf[8*1024];
|
char buf[8*1024];
|
||||||
|
|
||||||
if (sz == 0)
|
if (sz == 0)
|
||||||
@ -347,11 +347,11 @@ static int copy_ar(CF *cfp, off_t size)
|
|||||||
FILE* from = cfp->rFile;
|
FILE* from = cfp->rFile;
|
||||||
FILE* to = cfp->wFile;
|
FILE* to = cfp->wFile;
|
||||||
while (sz &&
|
while (sz &&
|
||||||
(nr = fread(buf, 1, sz < off_t(sizeof(buf)) ? sz : sizeof(buf), from ))
|
(nr = fread(buf, 1, sz < static_cast<off_t>(sizeof(buf)) ? static_cast<size_t>(sz) : sizeof(buf), from ))
|
||||||
> 0) {
|
> 0) {
|
||||||
sz -= nr;
|
sz -= nr;
|
||||||
for (int off = 0; off < nr; nr -= off, off += nw)
|
for (size_t off = 0; off < nr; nr -= off, off += nw)
|
||||||
if ((nw = fwrite(buf + off, 1, nr, to)) < 0)
|
if ((nw = fwrite(buf + off, 1, nr, to)) < nr)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (sz)
|
if (sz)
|
||||||
@ -424,7 +424,7 @@ static int ar_append(const char* archive,const std::vector<std::string>& files)
|
|||||||
FILE* aFile = fopen(archive, "wb+");
|
FILE* aFile = fopen(archive, "wb+");
|
||||||
if (aFile!=NULL) {
|
if (aFile!=NULL) {
|
||||||
fwrite(ARMAG, SARMAG, 1, aFile);
|
fwrite(ARMAG, SARMAG, 1, aFile);
|
||||||
if (fseek(aFile, (off_t)0, SEEK_END) != (off_t)-1) {
|
if (fseek(aFile, 0, SEEK_END) != -1) {
|
||||||
CF cf;
|
CF cf;
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
/* Read from disk, write to an archive; pad on write. */
|
/* Read from disk, write to an archive; pad on write. */
|
||||||
|
@ -216,8 +216,8 @@ int cmCPackNSISGenerator::InitializeInternal()
|
|||||||
<< "Please check " << tmpFile.c_str() << " for errors" << std::endl);
|
<< "Please check " << tmpFile.c_str() << " for errors" << std::endl);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
float nsisVersion = atof(versionRex.match(1).c_str());
|
double nsisVersion = atof(versionRex.match(1).c_str());
|
||||||
float minNSISVersion = 2.09;
|
double minNSISVersion = 2.09;
|
||||||
cmCPackLogger(cmCPackLog::LOG_DEBUG, "NSIS Version: "
|
cmCPackLogger(cmCPackLog::LOG_DEBUG, "NSIS Version: "
|
||||||
<< nsisVersion << std::endl);
|
<< nsisVersion << std::endl);
|
||||||
if ( nsisVersion < minNSISVersion )
|
if ( nsisVersion < minNSISVersion )
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
cmCPackPackageMakerGenerator::cmCPackPackageMakerGenerator()
|
cmCPackPackageMakerGenerator::cmCPackPackageMakerGenerator()
|
||||||
{
|
{
|
||||||
this->PackageMakerVersion = 0;
|
this->PackageMakerVersion = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@ -196,7 +196,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
this->PackageMakerVersion = atof(rexVersion.match(1).c_str());
|
this->PackageMakerVersion = atof(rexVersion.match(1).c_str());
|
||||||
if ( this->PackageMakerVersion < 1 )
|
if ( this->PackageMakerVersion < 1.0 )
|
||||||
{
|
{
|
||||||
cmCPackLogger(cmCPackLog::LOG_ERROR, "Require PackageMaker 1.0 or higher"
|
cmCPackLogger(cmCPackLog::LOG_ERROR, "Require PackageMaker 1.0 or higher"
|
||||||
<< std::endl);
|
<< std::endl);
|
||||||
|
@ -48,7 +48,7 @@ protected:
|
|||||||
bool CopyCreateResourceFile(const char* name);
|
bool CopyCreateResourceFile(const char* name);
|
||||||
bool CopyResourcePlistFile(const char* name);
|
bool CopyResourcePlistFile(const char* name);
|
||||||
|
|
||||||
float PackageMakerVersion;
|
double PackageMakerVersion;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1501,15 +1501,15 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
|
|||||||
float cper = percentBranch + percentFunction;
|
float cper = percentBranch + percentFunction;
|
||||||
if(totalBranches > 0)
|
if(totalBranches > 0)
|
||||||
{
|
{
|
||||||
cper /= 2.0;
|
cper /= 2.0f;
|
||||||
}
|
}
|
||||||
percent_coverage += cper;
|
percent_coverage += cper;
|
||||||
float cmet = percentFunction + percentBranch;
|
float cmet = percentFunction + percentBranch;
|
||||||
if(totalBranches > 0)
|
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
|
// Hack for conversion of function to loc assume a function
|
||||||
// has 100 lines of code
|
// has 100 lines of code
|
||||||
functionsCalled *=100;
|
functionsCalled *=100;
|
||||||
|
@ -695,7 +695,15 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const cmStdString& localprefix,
|
|||||||
return false;
|
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");
|
FILE* fp = fopen(local_file.c_str(), "rb");
|
||||||
if ( !fp )
|
if ( !fp )
|
||||||
{
|
{
|
||||||
|
@ -2484,8 +2484,8 @@ void cmake::TruncateOutputLog(const char* fname)
|
|||||||
cmSystemTools::RemoveFile(fullPath.c_str());
|
cmSystemTools::RemoveFile(fullPath.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
size_t fsize = st.st_size;
|
off_t fsize = st.st_size;
|
||||||
const size_t maxFileSize = 50 * 1024;
|
const off_t maxFileSize = 50 * 1024;
|
||||||
if ( fsize < maxFileSize )
|
if ( fsize < maxFileSize )
|
||||||
{
|
{
|
||||||
//TODO: truncate file
|
//TODO: truncate file
|
||||||
|
@ -1588,17 +1588,16 @@ bool SystemTools::FilesDiffer(const char* source,
|
|||||||
// Compare the files a block at a time.
|
// Compare the files a block at a time.
|
||||||
char source_buf[KWSYS_ST_BUFFER];
|
char source_buf[KWSYS_ST_BUFFER];
|
||||||
char dest_buf[KWSYS_ST_BUFFER];
|
char dest_buf[KWSYS_ST_BUFFER];
|
||||||
long nleft = statSource.st_size;
|
off_t nleft = statSource.st_size;
|
||||||
while(nleft > 0)
|
while(nleft > 0)
|
||||||
{
|
{
|
||||||
// Read a block from each file.
|
// Read a block from each file.
|
||||||
long nnext = (nleft > KWSYS_ST_BUFFER)? KWSYS_ST_BUFFER : nleft;
|
kwsys_ios::streamsize nnext = (nleft > KWSYS_ST_BUFFER)? KWSYS_ST_BUFFER : static_cast<kwsys_ios::streamsize>(nleft);
|
||||||
finSource.read(source_buf, nnext);
|
finSource.read(source_buf, nnext);
|
||||||
finDestination.read(dest_buf, nnext);
|
finDestination.read(dest_buf, nnext);
|
||||||
|
|
||||||
// If either failed to read assume they are different.
|
// If either failed to read assume they are different.
|
||||||
if(static_cast<long>(finSource.gcount()) != nnext ||
|
if(finSource.gcount() != nnext || finDestination.gcount() != nnext)
|
||||||
static_cast<long>(finDestination.gcount()) != nnext)
|
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -3384,8 +3384,9 @@ CURLcode ftp_perform(struct connectdata *conn,
|
|||||||
}
|
}
|
||||||
*connected = conn->bits.tcpconnect;
|
*connected = conn->bits.tcpconnect;
|
||||||
|
|
||||||
if(*dophase_done)
|
if(*dophase_done) {
|
||||||
DEBUGF(infof(conn->data, "DO phase is complete\n"));
|
DEBUGF(infof(conn->data, "DO phase is complete\n"));
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user