[libc-commits] [PATCH] D124468: [libc] Minor test signedness fixes

Dominic Chen via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Apr 26 17:11:01 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGde94cf528627: [libc] Minor test signedness fixes (authored by ddcc).

Changed prior to commit:
  https://reviews.llvm.org/D124468?vs=425260&id=425348#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124468

Files:
  libc/test/src/threads/cnd_test.cpp
  libc/utils/testutils/ExecuteFunction.h


Index: libc/utils/testutils/ExecuteFunction.h
===================================================================
--- libc/utils/testutils/ExecuteFunction.h
+++ libc/utils/testutils/ExecuteFunction.h
@@ -24,7 +24,7 @@
   int platform_defined;
   const char *failure = nullptr;
 
-  static constexpr uintptr_t TIMEOUT = -1L;
+  static constexpr unsigned TIMEOUT = ~0U;
 
   static ProcessStatus error(const char *error) { return {0, error}; }
   static ProcessStatus timed_out_ps() {
@@ -41,7 +41,7 @@
 };
 
 ProcessStatus invoke_in_subprocess(FunctionCaller *func,
-                                   unsigned timeout_ms = -1);
+                                   unsigned timeout_ms = TIMEOUT);
 
 const char *signal_as_string(int signum);
 
Index: libc/test/src/threads/cnd_test.cpp
===================================================================
--- libc/test/src/threads/cnd_test.cpp
+++ libc/test/src/threads/cnd_test.cpp
@@ -41,7 +41,7 @@
 
 int broadcast_thread_func(void *) {
   __llvm_libc::mtx_lock(&broadcast_mtx);
-  int oldval = broadcast_count.fetch_add(1);
+  unsigned oldval = broadcast_count.fetch_add(1);
   if (oldval == THRD_COUNT - 1) {
     __llvm_libc::mtx_lock(&threads_ready_mtx);
     __llvm_libc::cnd_signal(&threads_ready_cnd);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124468.425348.patch
Type: text/x-patch
Size: 1260 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220427/1d71546b/attachment-0001.bin>


More information about the libc-commits mailing list