From 0cad19b462c3b45523b8107d2d1e506e6225b0cf Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Tue, 23 Feb 2021 23:17:22 +0100 Subject: [PATCH] cppchecker --- tools/hitag2crack/crack5opencl/opencl.c | 4 ++-- tools/hitag2crack/crack5opencl/opencl.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/hitag2crack/crack5opencl/opencl.c b/tools/hitag2crack/crack5opencl/opencl.c index 31cad1334..ebd14fd7b 100644 --- a/tools/hitag2crack/crack5opencl/opencl.c +++ b/tools/hitag2crack/crack5opencl/opencl.c @@ -106,7 +106,7 @@ int discoverDevices(unsigned int profile_selected, uint32_t device_types_selecte cl_device_info ocl_devices_info[8] = { CL_DEVICE_TYPE, CL_DEVICE_NAME, CL_DEVICE_VERSION, CL_DRIVER_VERSION, CL_DEVICE_VENDOR, CL_DEVICE_LOCAL_MEM_TYPE, CL_DEVICE_MAX_WORK_ITEM_SIZES, CL_DEVICE_MAX_COMPUTE_UNITS }; unsigned int ocl_devices_info_cnt = sizeof(ocl_devices_info) / sizeof(cl_device_info); - unsigned int info_idx = 0; + unsigned int info_idx; size_t tmp_len = 0; char *tmp_buf = NULL; @@ -120,7 +120,7 @@ int discoverDevices(unsigned int profile_selected, uint32_t device_types_selecte if ((*cd_ctx)[platform_idx].selected)(*selected_platforms_cnt)++; - if (verbose) printf("\n-- Platform ID: %d\n", platform_idx + 1); + if (verbose) printf("\n-- Platform ID: %u\n", platform_idx + 1); for (info_idx = 0; info_idx < ocl_platforms_info_cnt; info_idx++) { cl_platform_info ocl_info = ocl_platforms_info[info_idx]; diff --git a/tools/hitag2crack/crack5opencl/opencl.h b/tools/hitag2crack/crack5opencl/opencl.h index 76e9857bc..03ae9a990 100644 --- a/tools/hitag2crack/crack5opencl/opencl.h +++ b/tools/hitag2crack/crack5opencl/opencl.h @@ -123,7 +123,7 @@ typedef struct opencl_ctx { bool plat_dev_enabled(unsigned int id, unsigned int *sel, unsigned int cnt, unsigned int cur_type, unsigned int allow_type); unsigned int get_smallest_profile(compute_platform_ctx_t *cd_ctx, size_t ocl_platform_cnt); -int discoverDevices(unsigned int profile_selected, uint32_t device_types_selected, cl_uint *ocl_platform_cnt, size_t *selected_platforms_cnt, size_t *selected_devices_cnt, compute_platform_ctx_t **cd_ctx, unsigned int *plat_sel, unsigned int plat_cnt, unsigned int *dev_sel, unsigned int dev_cnt, bool verbose, bool show); +int discoverDevices(unsigned int profile_selected, uint32_t device_types_selected, cl_uint *platform_detected_cnt, size_t *selected_platforms_cnt, size_t *selected_devices_cnt, compute_platform_ctx_t **cd_ctx, unsigned int *plat_sel, unsigned int plat_cnt, unsigned int *dev_sel, unsigned int dev_cnt, bool verbose, bool show); int runKernel(opencl_ctx_t *ctx, uint32_t cand_base, uint64_t *matches, uint32_t *matches_found, size_t id); #endif // OPENCL_H