Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame^] | 1 | From 176230435cb4b64ff7f2d97f77a04579ad9ca239 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sat, 18 Feb 2023 13:14:14 -0800 |
| 4 | Subject: [PATCH] Change SleepForMilliseconds parameter from unsigned int -> long |
| 5 | |
| 6 | Fixes following error on 32bit platforms |
| 7 | |
| 8 | src/googletest.h:631:35: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'long' in initializer list [-Wc++11-narrowing] |
| 9 | const struct timespec req = {0, t * 1000 * 1000}; |
| 10 | ^~~~~~~~~~~~~~~ |
| 11 | |
| 12 | Upstream-Status: Submitted [https://github.com/google/glog/pull/894] |
| 13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 14 | --- |
| 15 | src/googletest.h | 2 +- |
| 16 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 17 | |
| 18 | diff --git a/src/googletest.h b/src/googletest.h |
| 19 | index 5761361..836b06c 100644 |
| 20 | --- a/src/googletest.h |
| 21 | +++ b/src/googletest.h |
| 22 | @@ -625,7 +625,7 @@ class Thread { |
| 23 | #endif |
| 24 | }; |
| 25 | |
| 26 | -static inline void SleepForMilliseconds(unsigned t) { |
| 27 | +static inline void SleepForMilliseconds(long t) { |
| 28 | #ifndef GLOG_OS_WINDOWS |
| 29 | # if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309L |
| 30 | const struct timespec req = {0, t * 1000 * 1000}; |
| 31 | -- |
| 32 | 2.39.2 |
| 33 | |