[libc-commits] [libc] change the return value type of mktime_internal to time_t (PR #132231)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Sun Mar 23 08:21:10 PDT 2025


================
@@ -102,11 +103,11 @@ int64_t mktime_internal(const tm *tm_out) {
 
   // TODO: https://github.com/llvm/llvm-project/issues/121962
   // Need to handle timezone and update of tm_isdst.
-  int64_t seconds = tm_out->tm_sec +
-                    tm_out->tm_min * time_constants::SECONDS_PER_MIN +
-                    tm_out->tm_hour * time_constants::SECONDS_PER_HOUR +
-                    total_days * time_constants::SECONDS_PER_DAY;
-  return seconds;
+  time_t seconds = tm_out->tm_sec +
+                   tm_out->tm_min * time_constants::SECONDS_PER_MIN +
+                   tm_out->tm_hour * time_constants::SECONDS_PER_HOUR +
+                   total_days * time_constants::SECONDS_PER_DAY;
+  return {seconds};
----------------
jhuber6 wrote:

Are the braces really necessary?

https://github.com/llvm/llvm-project/pull/132231


More information about the libc-commits mailing list