summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-07-13 13:27:10 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-07-13 13:27:10 (GMT)
commit4f728e93e19ffcf8aacbdad0b8cbedbeea03cbde (patch)
treed9c498dcace58ec370290bb82eff6002d90dd67a
parentd2710d514268813d0b0291c6d5571ee6638b8b7b (diff)
downloadCMake-4f728e93e19ffcf8aacbdad0b8cbedbeea03cbde.zip
CMake-4f728e93e19ffcf8aacbdad0b8cbedbeea03cbde.tar.gz
CMake-4f728e93e19ffcf8aacbdad0b8cbedbeea03cbde.tar.bz2
COMP: Remove warnings
-rw-r--r--Source/cmStandardIncludes.h2
-rw-r--r--Source/kwsys/SystemTools.cxx20
-rw-r--r--Utilities/cmtar/compat/strlcpy.c2
-rw-r--r--Utilities/cmtar/libtar.c5
-rw-r--r--Utilities/cmtar/listhash/list.c.in2
5 files changed, 18 insertions, 13 deletions
diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h
index f40945c..39a6059 100644
--- a/Source/cmStandardIncludes.h
+++ b/Source/cmStandardIncludes.h
@@ -341,7 +341,7 @@ static thisClass* SafeDownCast(cmObject *c) \
{ \
if ( c && c->IsA(#thisClass) ) \
{ \
- return (thisClass *)c; \
+ return static_cast<thisClass *>(c); \
} \
return 0;\
}
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 1107fe5..b98d6ff 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -1507,7 +1507,8 @@ bool SystemTools::FilesDiffer(const char* source,
}
// If this block differs the file differs.
- if(memcmp((const void*)source_buf, (const void*)dest_buf, nnext) != 0)
+ if(memcmp(static_cast<const void*>(source_buf),
+ static_cast<const void*>(dest_buf), nnext) != 0)
{
return true;
}
@@ -1737,7 +1738,7 @@ long int SystemTools::ModifiedTime(const char* filename)
}
else
{
- return (long int)fs.st_mtime;
+ return static_cast<long int>(fs.st_mtime);
}
}
@@ -1751,7 +1752,7 @@ long int SystemTools::CreationTime(const char* filename)
}
else
{
- return fs.st_ctime >= 0 ? (long int)fs.st_ctime : 0;
+ return fs.st_ctime >= 0 ? static_cast<long int>(fs.st_ctime) : 0;
}
}
@@ -2238,7 +2239,7 @@ bool SystemTools::FileIsDirectory(const char* name)
struct stat fs;
if(stat(name, &fs) == 0)
{
-#if _WIN32
+#if defined( _WIN32 )
return ((fs.st_mode & _S_IFDIR) != 0);
#else
return S_ISDIR(fs.st_mode);
@@ -2252,7 +2253,7 @@ bool SystemTools::FileIsDirectory(const char* name)
bool SystemTools::FileIsSymlink(const char* name)
{
-#if _WIN32
+#if defined( _WIN32 )
(void)name;
return false;
#else
@@ -3077,7 +3078,8 @@ SystemTools::DetectFileType(const char *filename,
delete [] buffer;
double current_percent_bin =
- ((double)(read_length - text_count) / (double)read_length);
+ (static_cast<double>(read_length - text_count) /
+ static_cast<double>(read_length));
if (current_percent_bin >= percent_bin)
{
@@ -3107,14 +3109,14 @@ bool SystemTools::LocateFileInDir(const char *filename,
kwsys_stl::string real_dir;
if (!SystemTools::FileIsDirectory(dir))
{
-#if _WIN32
+#if defined( _WIN32 )
size_t dir_len = strlen(dir);
if (dir_len < 2 || dir[dir_len - 1] != ':')
{
#endif
real_dir = SystemTools::GetFilenamePath(dir);
dir = real_dir.c_str();
-#if _WIN32
+#if defined( _WIN32 )
}
#endif
}
@@ -3417,7 +3419,7 @@ int SystemTools::GetTerminalWidth()
t = strtol(columns, &endptr, 0);
if(endptr && !*endptr && (t>0) && (t<1000))
{
- width = (int)t;
+ width = static_cast<int>(t);
}
}
if ( width < 9 )
diff --git a/Utilities/cmtar/compat/strlcpy.c b/Utilities/cmtar/compat/strlcpy.c
index c10c283..ee46557 100644
--- a/Utilities/cmtar/compat/strlcpy.c
+++ b/Utilities/cmtar/compat/strlcpy.c
@@ -34,6 +34,8 @@ static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp
#include <sys/types.h>
#include <string.h>
+size_t strlcpy(char *dst, const char *src, size_t siz);
+
/*
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
diff --git a/Utilities/cmtar/libtar.c b/Utilities/cmtar/libtar.c
index a4bd966..c918e24 100644
--- a/Utilities/cmtar/libtar.c
+++ b/Utilities/cmtar/libtar.c
@@ -83,7 +83,8 @@ struct gzStruct GZStruct;
#endif
#endif
-int libtar_gzopen(void* call_data, const char *pathname, int oflags, mode_t mode)
+static int libtar_gzopen(void* call_data, const char *pathname,
+ int oflags, mode_t mode)
{
char *gzoflags;
int fd;
@@ -155,7 +156,7 @@ tartype_t gztype = {
#endif /* HAVE_LIBZ */
-int
+static int
create(char *tarfile, char *rootdir, libtar_list_t *l)
{
TAR *t;
diff --git a/Utilities/cmtar/listhash/list.c.in b/Utilities/cmtar/listhash/list.c.in
index e807f93..e9d8365 100644
--- a/Utilities/cmtar/listhash/list.c.in
+++ b/Utilities/cmtar/listhash/list.c.in
@@ -414,7 +414,7 @@ int
/*
** @LISTHASH_PREFIX@_list_dup() - copy an existing list
*/
-@LISTHASH_PREFIX@_list_t *
+static @LISTHASH_PREFIX@_list_t *
@LISTHASH_PREFIX@_list_dup(@LISTHASH_PREFIX@_list_t *l)
{
@LISTHASH_PREFIX@_list_t *newlist;