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

Commit 0878f716 authored by Vishnu Nair's avatar Vishnu Nair
Browse files

Fix implicit cast from ssize_t to size_t in KeyedVector.h

Fixes a compiler warning for implicit conversion changes from signed
to unsigned which surfaced when refactoring native input libraries.
Add an explicit cast to avoid adding -Wno-sign-conversion compile
flags.

Test: b libsurfaceflinger_unittest
Change-Id: I8866aef7f09ca5173604abe18c586b68bbf12ed6
parent 48c35f0c
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -208,7 +208,7 @@ DefaultKeyedVector<KEY,VALUE>::DefaultKeyedVector(const VALUE& defValue)
template<typename KEY, typename VALUE> inline
const VALUE& DefaultKeyedVector<KEY,VALUE>::valueFor(const KEY& key) const {
    ssize_t i = this->indexOfKey(key);
    return i >= 0 ? KeyedVector<KEY,VALUE>::valueAt(i) : mDefault;
    return i >= 0 ? KeyedVector<KEY, VALUE>::valueAt(static_cast<size_t>(i)) : mDefault;
}

}  // namespace android