diff options
author | Brad King <brad.king@kitware.com> | 2009-07-08 19:09:16 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-07-08 19:09:16 (GMT) |
commit | 6028f3a4c70ee2ad00e8c1c54a31855be7ab3d0f (patch) | |
tree | daaca4bebee166e23afa786ac3fc3acaab0648cf /Source/kwsys/SharedForward.h.in | |
parent | 4c0bbe3828de12ac0c6f65b51cf4f4167e83652a (diff) | |
download | CMake-6028f3a4c70ee2ad00e8c1c54a31855be7ab3d0f.zip CMake-6028f3a4c70ee2ad00e8c1c54a31855be7ab3d0f.tar.gz CMake-6028f3a4c70ee2ad00e8c1c54a31855be7ab3d0f.tar.bz2 |
COMP: Fix KWSys SharedForward sign conversion
This uses size_t where necessary to avoid size_t/int conversion
warnings.
Diffstat (limited to 'Source/kwsys/SharedForward.h.in')
-rw-r--r-- | Source/kwsys/SharedForward.h.in | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/kwsys/SharedForward.h.in b/Source/kwsys/SharedForward.h.in index 59c14f7..dd4db55 100644 --- a/Source/kwsys/SharedForward.h.in +++ b/Source/kwsys/SharedForward.h.in @@ -147,6 +147,7 @@ /*--------------------------------------------------------------------------*/ /* Include needed system headers. */ +#include <stddef.h> /* size_t */ #include <limits.h> #include <stdlib.h> #include <string.h> @@ -550,7 +551,7 @@ static void kwsys_shared_forward_dirname(const char* begin, char* result) else if(last_slash_index == 2 && begin[1] == ':') { /* Only one leading drive letter and slash. */ - strncpy(result, begin, last_slash_index); + strncpy(result, begin, (size_t)last_slash_index); result[last_slash_index] = KWSYS_SHARED_FORWARD_PATH_SLASH; result[last_slash_index+1] = 0; } @@ -558,7 +559,7 @@ static void kwsys_shared_forward_dirname(const char* begin, char* result) else { /* A non-leading slash. */ - strncpy(result, begin, last_slash_index); + strncpy(result, begin, (size_t)last_slash_index); result[last_slash_index] = 0; } } @@ -630,7 +631,7 @@ static int kwsys_shared_forward_self_path(const char* argv0, char* result) if(first < last) { /* Determine the length without trailing slash. */ - int length = (int)(last-first); + size_t length = (size_t)(last-first); if(*(last-1) == '/' || *(last-1) == '\\') { --length; |