[clinfo] 22/55: Make UNUSED macro function-style

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 969cf92dca87e30f6d35e769f9b48b13a249994d
Author: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
Date:   Fri Feb 10 11:09:08 2017 +0100

    Make UNUSED macro function-style
    
    This should hopefully allow us to extend it better to other compilers.
---
 src/clinfo.c | 64 ++++++++++++++++++++++++++++++------------------------------
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git a/src/clinfo.c b/src/clinfo.c
index bbdb312..cea976b 100644
--- a/src/clinfo.c
+++ b/src/clinfo.c
@@ -33,7 +33,7 @@
 #include "strbuf.h"
 
 #define ARRAY_SIZE(ar) (sizeof(ar)/sizeof(*ar))
-#define UNUSED __attribute__((unused))
+#define UNUSED(x) x __attribute__((unused))
 
 struct platform_data {
 	char *pname; /* CL_PLATFORM_NAME */
@@ -317,7 +317,7 @@ void show_strbuf(const char *pname, int skip)
 }
 
 int
-platform_info_str(cl_platform_id pid, cl_platform_info param, const char* pname, const struct platform_info_checks * chk UNUSED)
+platform_info_str(cl_platform_id pid, cl_platform_info param, const char* pname, const struct platform_info_checks* UNUSED(chk))
 {
 	GET_STRING2(clGetPlatformInfo, pid, param);
 	/* when only listing, do not print anything we're just gathering
@@ -329,7 +329,7 @@ platform_info_str(cl_platform_id pid, cl_platform_info param, const char* pname,
 }
 
 int
-platform_info_ulong(cl_platform_id pid, cl_platform_info param, const char* pname, const struct platform_info_checks * chk UNUSED)
+platform_info_ulong(cl_platform_id pid, cl_platform_info param, const char* pname, const struct platform_info_checks* UNUSED(chk))
 {
 	cl_ulong val = 0;
 
@@ -762,7 +762,7 @@ void identify_device_extensions(const char *extensions, struct device_info_check
 
 #define DEFINE_DEVINFO_SHOW(how, type, fmt) \
 int device_info_##how(cl_device_id dev, cl_device_info param, const char *pname, \
-	const struct device_info_checks *chk UNUSED) \
+	const struct device_info_checks* UNUSED(chk)) \
 { \
 	type val = 0; \
 	SHOW_VAL(fmt); \
@@ -771,7 +771,7 @@ int device_info_##how(cl_device_id dev, cl_device_info param, const char *pname,
 
 /* Get string-type info without showing it */
 int device_info_str_get(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	current_param = pname;
 	GET_STRING2(clGetDeviceInfo, dev, param);
@@ -792,7 +792,7 @@ DEFINE_DEVINFO_SHOW(long, cl_ulong, "%" PRIu64)
 DEFINE_DEVINFO_SHOW(sz, size_t, "%" PRIuS)
 
 int device_info_bool(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	cl_bool val = 0;
 	const char * const * str = (output_mode == CLINFO_HUMAN ?
@@ -811,7 +811,7 @@ int device_info_bool(cl_device_id dev, cl_device_info param, const char *pname,
 }
 
 int device_info_bits(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	cl_uint val;
 	GET_VAL;
@@ -835,7 +835,7 @@ size_t strbuf_mem(cl_ulong val, size_t szval)
 }
 
 int device_info_mem(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	cl_ulong val = 0;
 	size_t szval = 0;
@@ -850,7 +850,7 @@ int device_info_mem(cl_device_id dev, cl_device_info param, const char *pname,
 }
 
 int device_info_mem_int(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	cl_uint val = 0;
 	size_t szval = 0;
@@ -865,7 +865,7 @@ int device_info_mem_int(cl_device_id dev, cl_device_info param, const char *pnam
 }
 
 int device_info_mem_sz(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	size_t val = 0;
 	size_t szval = 0;
@@ -880,7 +880,7 @@ int device_info_mem_sz(cl_device_id dev, cl_device_info param, const char *pname
 }
 
 int device_info_free_mem_amd(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	size_t *val = NULL;
 	size_t szval = 0, numval = 0;
@@ -904,7 +904,7 @@ int device_info_free_mem_amd(cl_device_id dev, cl_device_info param, const char
 }
 
 int device_info_time_offset(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	cl_ulong val = 0;
 	GET_VAL;
@@ -922,7 +922,7 @@ int device_info_time_offset(cl_device_id dev, cl_device_info param, const char *
 }
 
 int device_info_szptr(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	size_t *val = NULL;
 	size_t szval = 0, numval = 0;
@@ -945,8 +945,8 @@ int device_info_szptr(cl_device_id dev, cl_device_info param, const char *pname,
 	return had_error;
 }
 
-int device_info_wg(cl_device_id dev, cl_device_info param UNUSED, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+int device_info_wg(cl_device_id dev, cl_device_info UNUSED(param), const char *pname,
+	const struct device_info_checks* UNUSED(chk))
 {
 	cl_platform_id val = NULL;
 	{
@@ -966,7 +966,7 @@ int device_info_wg(cl_device_id dev, cl_device_info param UNUSED, const char *pn
 }
 
 int device_info_img_sz_2d(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	size_t width = 0, height = 0, val = 0;
 	GET_VAL; /* HEIGHT */
@@ -985,7 +985,7 @@ int device_info_img_sz_2d(cl_device_id dev, cl_device_info param, const char *pn
 }
 
 int device_info_img_sz_intel_planar_yuv(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	size_t width = 0, height = 0, val = 0;
 	GET_VAL; /* HEIGHT */
@@ -1005,7 +1005,7 @@ int device_info_img_sz_intel_planar_yuv(cl_device_id dev, cl_device_info param,
 
 
 int device_info_img_sz_3d(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	size_t width = 0, height = 0, depth = 0, val = 0;
 	GET_VAL; /* HEIGHT */
@@ -1032,7 +1032,7 @@ int device_info_img_sz_3d(cl_device_id dev, cl_device_info param, const char *pn
 
 
 int device_info_devtype(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	cl_device_type val = 0;
 	GET_VAL;
@@ -1065,7 +1065,7 @@ int device_info_devtype(cl_device_id dev, cl_device_info param, const char *pnam
 }
 
 int device_info_cachetype(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	cl_device_mem_cache_type val = 0;
 	GET_VAL;
@@ -1082,7 +1082,7 @@ int device_info_cachetype(cl_device_id dev, cl_device_info param, const char *pn
 }
 
 int device_info_lmemtype(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	cl_device_local_mem_type val = 0;
 	GET_VAL;
@@ -1123,7 +1123,7 @@ void devtopo_str(const cl_device_topology_amd *devtopo)
 }
 
 int device_info_devtopo_amd(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	cl_device_topology_amd val;
 	GET_VAL;
@@ -1137,7 +1137,7 @@ int device_info_devtopo_amd(cl_device_id dev, cl_device_info param, const char *
 
 /* we assemble a cl_device_topology_amd struct from the NVIDIA info */
 int device_info_devtopo_nv(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	cl_device_topology_amd devtopo;
 	cl_uint val = 0;
@@ -1167,7 +1167,7 @@ int device_info_devtopo_nv(cl_device_id dev, cl_device_info param, const char *p
 
 /* NVIDIA Compute Capability */
 int device_info_cc_nv(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	cl_uint major = 0, val = 0;
 	GET_VAL; /* MAJOR */
@@ -1186,7 +1186,7 @@ int device_info_cc_nv(cl_device_id dev, cl_device_info param, const char *pname,
 
 /* AMD GFXIP */
 int device_info_gfxip_amd(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	cl_uint major = 0, val = 0;
 	GET_VAL; /* MAJOR */
@@ -1205,7 +1205,7 @@ int device_info_gfxip_amd(cl_device_id dev, cl_device_info param, const char *pn
 
 
 /* Device Partition, CLINFO_HUMAN header */
-int device_info_partition_header(cl_device_id dev UNUSED, cl_device_info param UNUSED,
+int device_info_partition_header(cl_device_id UNUSED(dev), cl_device_info UNUSED(param),
 	const char *pname, const struct device_info_checks *chk)
 {
 	int is_12 = dev_is_12(chk);
@@ -1224,7 +1224,7 @@ int device_info_partition_header(cl_device_id dev UNUSED, cl_device_info param U
 
 /* Device partition properties */
 int device_info_partition_types(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	size_t numval = 0, szval = 0, cursor = 0, slen = 0;
 	cl_device_partition_property *val = NULL;
@@ -1278,7 +1278,7 @@ int device_info_partition_types(cl_device_id dev, cl_device_info param, const ch
 }
 
 int device_info_partition_types_ext(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	size_t numval = 0, szval = 0, cursor = 0, slen = 0;
 	cl_device_partition_property_ext *val = NULL;
@@ -1336,7 +1336,7 @@ int device_info_partition_types_ext(cl_device_id dev, cl_device_info param, cons
 
 /* Device partition affinity domains */
 int device_info_partition_affinities(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	cl_device_affinity_domain val;
 	GET_VAL;
@@ -1367,7 +1367,7 @@ int device_info_partition_affinities(cl_device_id dev, cl_device_info param, con
 }
 
 int device_info_partition_affinities_ext(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	size_t numval = 0, szval = 0, cursor = 0, slen = 0;
 	cl_device_partition_property_ext *val = NULL;
@@ -1542,7 +1542,7 @@ int device_info_qprop(cl_device_id dev, cl_device_info param, const char *pname,
 
 /* Execution capbilities */
 int device_info_execap(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	cl_device_exec_capabilities val = 0;
 	GET_VAL;
@@ -1569,7 +1569,7 @@ int device_info_execap(cl_device_id dev, cl_device_info param, const char *pname
 
 /* Arch bits and endianness (HUMAN) */
 int device_info_arch(cl_device_id dev, cl_device_info param, const char *pname,
-	const struct device_info_checks *chk UNUSED)
+	const struct device_info_checks* UNUSED(chk))
 {
 	cl_uint bits = 0;
 	{

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