[clinfo] 09/30: Remove last hard-coded %zu

Andreas Beckmann anbe at moszumanska.debian.org
Tue Apr 28 12:53:52 UTC 2015


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

anbe pushed a commit to branch master
in repository clinfo.

commit 1c1469b155b9c6ab033602b4fbc9e6a015fa02db
Author: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
Date:   Sun Feb 8 10:30:10 2015 +0100

    Remove last hard-coded %zu
    
    Use the PRIuS macro instead, for portability.
---
 src/clinfo.c | 4 ++--
 src/strbuf.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/clinfo.c b/src/clinfo.c
index fc9c844..6f1b76f 100644
--- a/src/clinfo.c
+++ b/src/clinfo.c
@@ -820,7 +820,7 @@ int device_info_szptr(cl_device_id dev, cl_device_info param, const char *pname,
 				strcpy(strbuf + szval, sep);
 				szval += sepsz;
 			}
-			szval += snprintf(strbuf + szval, bufsz - szval - 1, "%zu", val[counter]);
+			szval += snprintf(strbuf + szval, bufsz - szval - 1, "%" PRIuS, val[counter]);
 			if (szval >= bufsz) {
 				trunc_strbuf();
 				break;
@@ -2125,7 +2125,7 @@ void checkNullCtxFromType()
 				sprintf(strbuf, "<error: platform 0x%p not found>", plat);
 				break;
 			} else {
-				szval += sprintf(strbuf, "%s (%zu)",
+				szval += sprintf(strbuf, "%s (%" PRIuS ")",
 					(output_mode == CLINFO_HUMAN ? "Success" : "CL_SUCCESS"),
 					ndevs);
 				szval += snprintf(strbuf + szval, bufsz - szval, "\n" I2_STR "%s",
diff --git a/src/strbuf.h b/src/strbuf.h
index 09dd4fe..110ec23 100644
--- a/src/strbuf.h
+++ b/src/strbuf.h
@@ -45,7 +45,7 @@ static inline size_t bufcpy(size_t offset, const char *str)
 	char *dst = strbuf + offset;
 	int trunc = 0;
 	if (bufsz < offset) {
-		fprintf(stderr, "bufcpy overflow copying %s at offset %zu/%zu (%s)\n",
+		fprintf(stderr, "bufcpy overflow copying %s at offset %" PRIuS "/%" PRIuS " (%s)\n",
 			str, offset, bufsz, strbuf);
 		maxlen = 0;
 		trunc = 1;

-- 
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