From e814895d8a5c227cb4478526fcd15a48bb7c0eb1 Mon Sep 17 00:00:00 2001 From: Yichao Yu Date: Thu, 19 Jun 2014 06:32:57 +0800 Subject: [PATCH] use arg_out for status_code --- src/c_wrapper/error.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/c_wrapper/error.h b/src/c_wrapper/error.h index f7dc72b2..1bf4ab9f 100644 --- a/src/c_wrapper/error.h +++ b/src/c_wrapper/error.h @@ -219,10 +219,8 @@ PYOPENCL_USE_RESULT static PYOPENCL_INLINE T call_guarded(T (*func)(ArgTypes...), const char *name, ArgTypes2&&... args) { cl_int status_code = CL_SUCCESS; - // This magically turns off a weird gcc warning of uninitialized variable. - auto p = &status_code; - auto &_p = p; - auto argpack = make_clargpack(std::forward(args)..., _p); + auto status_arg = arg_buf(status_code); + auto argpack = make_clargpack(std::forward(args)..., status_arg); T res = argpack.clcall(func, name); if (status_code != CL_SUCCESS) { throw clerror(name, status_code); -- GitLab