[Cmake-commits] [cmake-commits] david.cole committed TestDriver.cxx.in 1.7 1.8

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Dec 9 10:56:43 EST 2008


Update of /cvsroot/CMake/CMake/Templates
In directory public:/mounts/ram/cvs-serv30009/Templates

Modified Files:
	TestDriver.cxx.in 
Log Message:
COMP: Don't emit old style cast warning when configured as C++ but still allow being configured as C. Thanks to Monsieur Francois Bertel for the patch.


Index: TestDriver.cxx.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Templates/TestDriver.cxx.in,v
retrieving revision 1.7
retrieving revision 1.8
diff -C 2 -d -r1.7 -r1.8
*** TestDriver.cxx.in	25 Nov 2008 14:52:21 -0000	1.7
--- TestDriver.cxx.in	9 Dec 2008 15:56:41 -0000	1.8
***************
*** 30,34 ****
  {
    char *new_string, *p;
!   new_string = (char *)malloc(sizeof(char) * (size_t)(strlen(string) + 1));
    if (!new_string)
      {
--- 30,41 ----
  {
    char *new_string, *p;
! 
! #ifdef __cplusplus
!   new_string = static_cast<char *>(malloc(sizeof(char) *
!     static_cast<size_t>(strlen(string) + 1)));
! #else
!   new_string = (char *)(malloc(sizeof(char) * (size_t)(strlen(string) + 1)));
! #endif
! 
    if (!new_string)
      {
***************
*** 39,43 ****
    while (*p != 0)
      {
!     *p = (char)tolower(*p);
      ++p;
      }
--- 46,55 ----
    while (*p != 0)
      {
! #ifdef __cplusplus
!     *p = static_cast<char>(tolower(*p));
! #else
!     *p = (char)(tolower(*p));
! #endif
! 
      ++p;
      }



More information about the Cmake-commits mailing list