From 3b546caeb0a576c4d7d7f1e8d2fdfed2bb8bdeed Mon Sep 17 00:00:00 2001 From: synergydev Date: Fri, 25 Oct 2013 12:36:28 -0700 Subject: 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 --- media/libnbaio/MonoPipe.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'media/libnbaio') 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(ns)}; nanosleep(&req, NULL); } // record the time that this write() completed -- cgit v1.1