summaryrefslogtreecommitdiffstats
path: root/Utilities/cmtar
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-03-30 18:49:56 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-03-30 18:49:56 (GMT)
commit5a2668b326471874ca69357af831cdcf1575c621 (patch)
tree92f40c9de267766f0533df44212ec2df6415aa47 /Utilities/cmtar
parent08b14163ee2cc9cced08d80b2c81b29c83072229 (diff)
downloadCMake-5a2668b326471874ca69357af831cdcf1575c621.zip
CMake-5a2668b326471874ca69357af831cdcf1575c621.tar.gz
CMake-5a2668b326471874ca69357af831cdcf1575c621.tar.bz2
ENH: add support for win64 for visual studio 2005 ide and nmake, also fix warnings produced by building for win64
Diffstat (limited to 'Utilities/cmtar')
-rw-r--r--Utilities/cmtar/CMakeLists.txt10
-rw-r--r--Utilities/cmtar/append.c6
-rw-r--r--Utilities/cmtar/block.c8
-rw-r--r--Utilities/cmtar/compat/snprintf.c10
-rw-r--r--Utilities/cmtar/extract.c6
-rw-r--r--Utilities/cmtar/handle.c4
-rw-r--r--Utilities/cmtar/output.c2
7 files changed, 26 insertions, 20 deletions
diff --git a/Utilities/cmtar/CMakeLists.txt b/Utilities/cmtar/CMakeLists.txt
index 038c38c..3ef4100 100644
--- a/Utilities/cmtar/CMakeLists.txt
+++ b/Utilities/cmtar/CMakeLists.txt
@@ -169,7 +169,6 @@ ELSE(HAVE_SIZEOF_OFF_T)
SET (HAVE_OFF_T 0)
SET (off_t "long")
ENDIF(HAVE_SIZEOF_OFF_T)
-
CHECK_TYPE_SIZE("size_t" SIZEOF_SIZE_T)
IF(HAVE_SIZEOF_SIZE_T)
SET (HAVE_SIZE_T 1)
@@ -183,7 +182,14 @@ IF(HAVE_SIZEOF_SSIZE_T)
SET (HAVE_SSIZE_T 1)
ELSE(HAVE_SIZEOF_SSIZE_T)
SET (HAVE_SSIZE_T 0)
- SET (ssize_t "int")
+ CHECK_TYPE_SIZE("long" SIZEOF_LONG)
+ CHECK_TYPE_SIZE("__int64" SIZEOF___INT64)
+ IF(SIZEOF_LONG EQUAL SIZEOF_SIZE_T)
+ SET(ssize_t "long")
+ ENDIF(SIZEOF_LONG EQUAL SIZEOF_SIZE_T)
+ IF(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T)
+ SET(ssize_t "__int64")
+ ENDIF(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T)
ENDIF(HAVE_SIZEOF_SSIZE_T)
CHECK_TYPE_SIZE("uid_t" SIZEOF_UID_T)
diff --git a/Utilities/cmtar/append.c b/Utilities/cmtar/append.c
index cc845ab..7cee558 100644
--- a/Utilities/cmtar/append.c
+++ b/Utilities/cmtar/append.c
@@ -217,7 +217,7 @@ tar_append_file(TAR *t, char *realname, char *savename)
int
tar_append_eof(TAR *t)
{
- int i, j;
+ ssize_t i, j;
char block[T_BLOCKSIZE];
memset(&block, 0, T_BLOCKSIZE);
@@ -242,7 +242,7 @@ tar_append_regfile(TAR *t, char *realname)
{
char block[T_BLOCKSIZE];
int filefd;
- int i, j;
+ ssize_t i, j;
size_t size;
#if defined( _WIN32 ) || defined(__CYGWIN__)
@@ -278,7 +278,7 @@ tar_append_regfile(TAR *t, char *realname)
if (i > 0)
{
- j = read(filefd, &block, i);
+ j = (size_t)read(filefd, &block, (unsigned int)i);
if (j == -1)
return -1;
memset(&(block[i]), 0, T_BLOCKSIZE - i);
diff --git a/Utilities/cmtar/block.c b/Utilities/cmtar/block.c
index f47f7ba..e618d79 100644
--- a/Utilities/cmtar/block.c
+++ b/Utilities/cmtar/block.c
@@ -27,7 +27,7 @@
int
th_read_internal(TAR *t)
{
- int i;
+ ssize_t i;
int num_zero_blocks = 0;
#ifdef DEBUG
@@ -82,7 +82,7 @@ th_read_internal(TAR *t)
#ifdef DEBUG
printf("<== th_read_internal(): returning %d\n", i);
#endif
- return i;
+ return (int)i;
}
@@ -90,7 +90,7 @@ th_read_internal(TAR *t)
int
th_read(TAR *t)
{
- int i, j;
+ ssize_t i, j;
size_t sz;
char *ptr;
@@ -247,7 +247,7 @@ th_read(TAR *t)
int
th_write(TAR *t)
{
- int i, j;
+ ssize_t i, j;
char type2;
size_t sz, sz2;
char *ptr;
diff --git a/Utilities/cmtar/compat/snprintf.c b/Utilities/cmtar/compat/snprintf.c
index 26a203e..ef6e2f1 100644
--- a/Utilities/cmtar/compat/snprintf.c
+++ b/Utilities/cmtar/compat/snprintf.c
@@ -316,7 +316,7 @@ static void dopr (char *buffer, size_t maxlen, const char *format, va_list args)
case 's':
strvalue = va_arg (args, char *);
if (max < 0)
- max = maxlen; /* ie, no max */
+ max = (int)maxlen; /* ie, no max */
fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max);
break;
case 'p':
@@ -328,19 +328,19 @@ static void dopr (char *buffer, size_t maxlen, const char *format, va_list args)
{
short int *num;
num = va_arg (args, short int *);
- *num = currlen;
+ *num = (int)currlen;
}
else if (cflags == DP_C_LONG)
{
long int *num;
num = va_arg (args, long int *);
- *num = currlen;
+ *num = (int)currlen;
}
else
{
int *num;
num = va_arg (args, int *);
- *num = currlen;
+ *num = (int)currlen;
}
break;
case '%':
@@ -713,7 +713,7 @@ int mutt_snprintf (va_alist) va_dcl
(void) mutt_vsnprintf(str, count, fmt, ap);
#endif
VA_END;
- return(strlen(str));
+ return((int)strlen(str));
}
#ifdef TEST_SNPRINTF
diff --git a/Utilities/cmtar/extract.c b/Utilities/cmtar/extract.c
index 6d37659..3ebdeeb 100644
--- a/Utilities/cmtar/extract.c
+++ b/Utilities/cmtar/extract.c
@@ -224,7 +224,7 @@ tar_extract_regfile(TAR *t, char *realname)
uid_t uid;
gid_t gid;
int fdout;
- int i, k;
+ ssize_t i, k;
char buf[T_BLOCKSIZE];
char *filename;
char *pathname = 0;
@@ -334,7 +334,7 @@ tar_extract_regfile(TAR *t, char *realname)
/* write block to output file */
if (write(fdout, buf,
- ((i > T_BLOCKSIZE) ? T_BLOCKSIZE : i)) == -1)
+ ((i > T_BLOCKSIZE) ? T_BLOCKSIZE : (unsigned int)i)) == -1)
{
if (pathname)
{
@@ -375,7 +375,7 @@ tar_extract_regfile(TAR *t, char *realname)
int
tar_skip_regfile(TAR *t)
{
- int i, k;
+ ssize_t i, k;
size_t size;
char buf[T_BLOCKSIZE];
diff --git a/Utilities/cmtar/handle.c b/Utilities/cmtar/handle.c
index de324cb..4f6dd10 100644
--- a/Utilities/cmtar/handle.c
+++ b/Utilities/cmtar/handle.c
@@ -56,12 +56,12 @@ static int libtar_close(void* call_data)
static ssize_t libtar_read(void* call_data, void* buf, size_t count)
{
struct libtar_fd_file* lf = (struct libtar_fd_file*)call_data;
- return read(lf->fd, buf, count);
+ return (ssize_t)read(lf->fd, buf, (unsigned int)count);
}
static ssize_t libtar_write(void* call_data, const void* buf, size_t count)
{
struct libtar_fd_file* lf = (struct libtar_fd_file*)call_data;
- return write(lf->fd, buf, count);
+ return (ssize_t) write(lf->fd, buf, (unsigned int)count);
}
static tartype_t default_type = { libtar_open, libtar_close, libtar_read, libtar_write, &libtar_fd_file_pointer };
diff --git a/Utilities/cmtar/output.c b/Utilities/cmtar/output.c
index 56e5a74..283c594 100644
--- a/Utilities/cmtar/output.c
+++ b/Utilities/cmtar/output.c
@@ -118,7 +118,7 @@ th_print_long_ls(TAR *t)
mtime = th_get_mtime(t);
mtm = localtime(&mtime);
#ifdef HAVE_STRFTIME
- strftime(timebuf, sizeof(timebuf), "%h %e %H:%M %Y", mtm);
+ strftime(timebuf, sizeof(timebuf), "%b %d %H:%M %Y", mtm);
printf("%s", timebuf);
#else
printf("%.3s %2d %2d:%02d %4d",