[Cmake-commits] [cmake-commits] king committed SharedForward.h.in 1.12 1.13

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Jul 8 15:09:18 EDT 2009


Update of /cvsroot/CMake/CMake/Source/kwsys
In directory public:/mounts/ram/cvs-serv2247/Source/kwsys

Modified Files:
	SharedForward.h.in 
Log Message:
COMP: Fix KWSys SharedForward sign conversion

This uses size_t where necessary to avoid size_t/int conversion
warnings.


Index: SharedForward.h.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/kwsys/SharedForward.h.in,v
retrieving revision 1.12
retrieving revision 1.13
diff -C 2 -d -r1.12 -r1.13
*** SharedForward.h.in	8 Jul 2009 19:09:10 -0000	1.12
--- SharedForward.h.in	8 Jul 2009 19:09:16 -0000	1.13
***************
*** 148,151 ****
--- 148,152 ----
  /* Include needed system headers.  */
  
+ #include <stddef.h> /* size_t */
  #include <limits.h>
  #include <stdlib.h>
***************
*** 551,555 ****
      {
      /* Only one leading drive letter and slash.  */
!     strncpy(result, begin, last_slash_index);
      result[last_slash_index] = KWSYS_SHARED_FORWARD_PATH_SLASH;
      result[last_slash_index+1] = 0;
--- 552,556 ----
      {
      /* Only one leading drive letter and slash.  */
!     strncpy(result, begin, (size_t)last_slash_index);
      result[last_slash_index] = KWSYS_SHARED_FORWARD_PATH_SLASH;
      result[last_slash_index+1] = 0;
***************
*** 559,563 ****
      {
      /* A non-leading slash.  */
!     strncpy(result, begin, last_slash_index);
      result[last_slash_index] = 0;
      }
--- 560,564 ----
      {
      /* A non-leading slash.  */
!     strncpy(result, begin, (size_t)last_slash_index);
      result[last_slash_index] = 0;
      }
***************
*** 631,635 ****
          {
          /* Determine the length without trailing slash.  */
!         int length = (int)(last-first);
          if(*(last-1) == '/' || *(last-1) == '\\')
            {
--- 632,636 ----
          {
          /* Determine the length without trailing slash.  */
!         size_t length = (size_t)(last-first);
          if(*(last-1) == '/' || *(last-1) == '\\')
            {



More information about the Cmake-commits mailing list