Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba8cdf99 authored by Chih-Hung Hsieh's avatar Chih-Hung Hsieh
Browse files

Add required casts for clang/llvm -Wc++11-narrowing

system/core/include/utils/Mutex.h:134:25: error: non-constant-expression
cannot be narrowed from type 'long long' to '__kernel_time_t' (aka
'long') in initializer list [-Wc++11-narrowing]

system/core/include/utils/Mutex.h:135:26: error: non-constant-expression
cannot be narrowed from type 'long long' to 'long' in initializer list
[-Wc++11-narrowing]

Change-Id: Icb9df26aeb01617da5ab1c36987289f7c2b11954
parent ec556521
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -131,8 +131,8 @@ inline status_t Mutex::tryLock() {
#if HAVE_ANDROID_OS
inline status_t Mutex::timedLock(nsecs_t timeoutNs) {
    const struct timespec ts = {
        /* .tv_sec = */ timeoutNs / 1000000000,
        /* .tv_nsec = */ timeoutNs % 1000000000,
        /* .tv_sec = */ static_cast<time_t>(timeoutNs / 1000000000),
        /* .tv_nsec = */ static_cast<long>(timeoutNs % 1000000000),
    };
    return -pthread_mutex_timedlock(&mMutex, &ts);
}