diff options
author | synergydev <synergye@codefi.re> | 2013-10-25 12:36:28 -0700 |
---|---|---|
committer | synergydev <synergye@codefi.re> | 2013-10-25 12:38:30 -0700 |
commit | 3b546caeb0a576c4d7d7f1e8d2fdfed2bb8bdeed (patch) | |
tree | 06f5ff682b7809091f39ca7c2beae8f435d741a0 /media/libnbaio | |
parent | d5255d1de125d15afae6cfc35701a5255b5e2933 (diff) | |
download | frameworks_av-3b546caeb0a576c4d7d7f1e8d2fdfed2bb8bdeed.zip frameworks_av-3b546caeb0a576c4d7d7f1e8d2fdfed2bb8bdeed.tar.gz frameworks_av-3b546caeb0a576c4d7d7f1e8d2fdfed2bb8bdeed.tar.bz2 |
Fix c++11 narrowing
The best fix for these narrowing
violations is to use static casting
As an example, this change would the following for libnaio:
error: non-constant-expression cannot be narrowed from
type 'uint32_t' (aka 'unsigned int') to 'long' in initializer list
const struct timespec req = {0, ns};
^~
Change-Id: I04ed1de4497dc19772194afef3ebf8fe0c8b82bc
Diffstat (limited to 'media/libnbaio')
-rw-r--r-- | media/libnbaio/MonoPipe.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/media/libnbaio/MonoPipe.cpp b/media/libnbaio/MonoPipe.cpp index e8d3d9b..095a4ff 100644 --- a/media/libnbaio/MonoPipe.cpp +++ b/media/libnbaio/MonoPipe.cpp @@ -180,7 +180,7 @@ ssize_t MonoPipe::write(const void *buffer, size_t count) } } if (ns > 0) { - const struct timespec req = {0, ns}; + const struct timespec req = {0, static_cast<long>(ns)}; nanosleep(&req, NULL); } // record the time that this write() completed |