[clinfo] 24/55: Avoid possible narrowing warnings

Andreas Beckmann anbe at moszumanska.debian.org
Sat Jan 13 14:40:00 UTC 2018


This is an automated email from the git hooks/post-receive script.

anbe pushed a commit to branch master
in repository clinfo.

commit 73d85a9c7fd36ecbcab5c75d29924a7a953dcf5a
Author: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
Date:   Fri Feb 10 11:15:24 2017 +0100

    Avoid possible narrowing warnings
---
 src/clinfo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/clinfo.c b/src/clinfo.c
index ffe1904..e277791 100644
--- a/src/clinfo.c
+++ b/src/clinfo.c
@@ -824,7 +824,7 @@ int device_info_bits(cl_device_id dev, cl_device_info param, const char *pname,
 
 size_t strbuf_mem(cl_ulong val, size_t szval)
 {
-	double dbl = val;
+	double dbl = (double)val;
 	size_t sfx = 0;
 	while (dbl > 1024 && sfx < memsfx_end) {
 		dbl /= 1024;
@@ -1155,7 +1155,7 @@ int device_info_devtopo_nv(cl_device_id dev, cl_device_info param, const char *p
 		GET_VAL;
 
 		if (!had_error) {
-			devtopo.pcie.device = val >> 3;
+			devtopo.pcie.device = (val >> 3) & 0xff;
 			devtopo.pcie.function = val & 7;
 			devtopo_str(&devtopo);
 		}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/clinfo.git



More information about the Pkg-opencl-commits mailing list