[libcxx-commits] [PATCH] D112837: [SystemZ][z/OS] Fix warnings from unsigned int to long in 32-bit mode

Zibi Sarbino via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 16 05:51:41 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG422cf2b506c1: [SystemZ][z/OS] Fix warnings from unsigned int to long in 32-bit mode (authored by zibi).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112837/new/

https://reviews.llvm.org/D112837

Files:
  libcxx/include/__support/ibm/nanosleep.h


Index: libcxx/include/__support/ibm/nanosleep.h
===================================================================
--- libcxx/include/__support/ibm/nanosleep.h
+++ libcxx/include/__support/ibm/nanosleep.h
@@ -21,14 +21,13 @@
     errno = EINVAL;
     return -1;
   }
-  useconds_t __micro_sec =
-      static_cast<useconds_t>((__req->tv_nsec + 999) / 1000);
+  long __micro_sec = (__req->tv_nsec + 999) / 1000;
   time_t __sec = __req->tv_sec;
   if (__micro_sec > 999999) {
     ++__sec;
     __micro_sec -= 1000000;
   }
-  __sec = sleep(static_cast<unsigned int>(__sec));
+  __sec = static_cast<time_t>(sleep(static_cast<unsigned int>(__sec)));
   if (__sec) {
     if (__rem) {
       // Updating the remaining time to sleep in case of unsuccessful call to sleep().
@@ -39,7 +38,7 @@
     return -1;
   }
   if (__micro_sec) {
-    int __rt = usleep(__micro_sec);
+    int __rt = usleep(static_cast<unsigned int>(__micro_sec));
     if (__rt != 0 && __rem) {
       // The usleep() does not provide the amount of remaining time upon its failure,
       // so the time slept will be ignored.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112837.387594.patch
Type: text/x-patch
Size: 1096 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211116/21550f73/attachment.bin>


More information about the libcxx-commits mailing list