This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  27dc919a85b74389fe8335b4ac6bba990c82c3a1 (commit)
       via  eb5f4ece7281a83775ae9dd409f23e77c67e4743 (commit)
      from  46678f7d22fd0249e478f4896703fddc3035137c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=27dc919a85b74389fe8335b4ac6bba990c82c3a1
commit 27dc919a85b74389fe8335b4ac6bba990c82c3a1
Merge: 46678f7 eb5f4ec
Author:     Nils Gladitz <nilsglad...@gmail.com>
AuthorDate: Wed Feb 17 10:50:47 2016 -0500
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Wed Feb 17 10:50:47 2016 -0500

    Merge topic 'unix-timestamps' into next
    
    eb5f4ece !fixup CMake: Work around compiler warnings; add release note


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=eb5f4ece7281a83775ae9dd409f23e77c67e4743
commit eb5f4ece7281a83775ae9dd409f23e77c67e4743
Author:     Nils Gladitz <nilsglad...@gmail.com>
AuthorDate: Wed Feb 17 16:45:15 2016 +0100
Commit:     Nils Gladitz <nilsglad...@gmail.com>
CommitDate: Wed Feb 17 16:45:15 2016 +0100

    !fixup CMake: Work around compiler warnings; add release note

diff --git a/Help/release/dev/unix-timestamps.rst 
b/Help/release/dev/unix-timestamps.rst
new file mode 100644
index 0000000..cdb0e5b
--- /dev/null
+++ b/Help/release/dev/unix-timestamps.rst
@@ -0,0 +1,6 @@
+unix-timestamps
+---------------
+
+* The :command:`string(TIMESTAMP)` and :command:`file(TIMESTAMP)`
+  commands gained support for the ``%s`` placeholder.  This is
+  the number of seconds since the UNIX Epoch.
diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx
index 6e059db..2724e2d 100644
--- a/Source/cmTimestamp.cxx
+++ b/Source/cmTimestamp.cxx
@@ -57,7 +57,8 @@ std::string cmTimestamp::CreateTimestampFromTimeT(time_t 
timeT,
       }
     }
 
-  struct tm timeStruct = {0};
+  struct tm timeStruct;
+  memset(&timeStruct, 0, sizeof(timeStruct));
 
   struct tm* ptr = (struct tm*) 0;
   if(utcFlag)
@@ -155,12 +156,13 @@ std::string cmTimestamp::AddTimestampComponent(
     case 's': // Seconds since UNIX epoch (midnight 1-jan-1970)
       {
       // Build a time_t for UNIX epoch and substract from the input "timeT":
-      struct tm tm_unix_epoch = {0};
-      tm_unix_epoch.tm_mday = 1;
-      tm_unix_epoch.tm_year = 1970-1900;
+      struct tm tmUnixEpoch;
+      memset(&timeStruct, 0, sizeof(tmUnixEpoch));
+      tmUnixEpoch.tm_mday = 1;
+      tmUnixEpoch.tm_year = 1970-1900;
 
-      const time_t unix_epoch = this->CreateUtcTimeTFromTm(tm_unix_epoch);
-      if (unix_epoch == -1)
+      const time_t unixEpoch = this->CreateUtcTimeTFromTm(tmUnixEpoch);
+      if (unixEpoch == -1)
         {
         cmSystemTools::Error("Error generating UNIX epoch in "
           "STRING(TIMESTAMP ...). Please, file a bug report aginst CMake");
@@ -168,7 +170,7 @@ std::string cmTimestamp::AddTimestampComponent(
         }
 
       std::stringstream ss;
-      ss << static_cast<long int>(difftime(timeT, unix_epoch));
+      ss << static_cast<long int>(difftime(timeT, unixEpoch));
       return ss.str();
       }
     default:

-----------------------------------------------------------------------

Summary of changes:
 Help/release/dev/unix-timestamps.rst |    6 ++++++
 Source/cmTimestamp.cxx               |   16 +++++++++-------
 2 files changed, 15 insertions(+), 7 deletions(-)
 create mode 100644 Help/release/dev/unix-timestamps.rst


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to