diff options
author | Brad King <brad.king@kitware.com> | 2007-11-05 19:34:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2007-11-05 19:34:36 (GMT) |
commit | f410f8578eea403d0ca657e46ec7659cd0f805e7 (patch) | |
tree | 09715a217fb40d51d17508c95244dbdfa6d1d399 /Source/CPack/cmCPackDebGenerator.cxx | |
parent | cfa723d45792ef6969304fb7d9274778f662a116 (diff) | |
download | CMake-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/CPack/cmCPackDebGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackDebGenerator.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index 75bf36f..0c9eab6 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -338,7 +338,7 @@ static int copy_ar(CF *cfp, off_t size) { static char pad = '\n'; off_t sz = size; - int nr, nw; + size_t nr, nw; char buf[8*1024]; if (sz == 0) @@ -347,11 +347,11 @@ static int copy_ar(CF *cfp, off_t size) FILE* from = cfp->rFile; FILE* to = cfp->wFile; 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) { sz -= nr; - for (int off = 0; off < nr; nr -= off, off += nw) - if ((nw = fwrite(buf + off, 1, nr, to)) < 0) + for (size_t off = 0; off < nr; nr -= off, off += nw) + if ((nw = fwrite(buf + off, 1, nr, to)) < nr) return -1; } if (sz) @@ -424,7 +424,7 @@ static int ar_append(const char* archive,const std::vector<std::string>& files) FILE* aFile = fopen(archive, "wb+"); if (aFile!=NULL) { 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; struct stat sb; /* Read from disk, write to an archive; pad on write. */ |