mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-04 20:13:38 +08:00
arraylen
This commit is contained in:
parent
73db5cb912
commit
3cb023f560
2 changed files with 5 additions and 3 deletions
|
@ -22,6 +22,7 @@
|
|||
#include "cmdsmartcard.h"
|
||||
#include "ui.h"
|
||||
#include "util.h"
|
||||
#include "commonutil.h"
|
||||
|
||||
#define CARD_INS_DECRYPT 0x01
|
||||
#define CARD_INS_ENCRYPT 0x02
|
||||
|
@ -78,7 +79,7 @@ bool IsHIDSamPresent(bool verbose) {
|
|||
{11, {0x3b, 0x90, 0x96, 0x91, 0x81, 0xb1, 0xfe, 0x55, 0x1f, 0xc7, 0xd4}},
|
||||
};
|
||||
bool found = false;
|
||||
for (int i = 0; i < sizeof(supported) / sizeof(supported[0]); i++) {
|
||||
for (int i = 0; i < ARRAYLEN(supported); i++) {
|
||||
if ((card.atr_len == supported[i].atr_len) &&
|
||||
(memcmp(card.atr, supported[i].atr, supported[i].atr_len) == 0)) {
|
||||
found = true;
|
||||
|
|
|
@ -23,6 +23,7 @@ License: GNU General Public License v3 or any later version (see LICENSE.txt)
|
|||
****************************************************************************/
|
||||
|
||||
#include "opencl.h"
|
||||
#define ARRAYLEN(x) (sizeof(x)/sizeof((x)[0]))
|
||||
|
||||
bool plat_dev_enabled(unsigned int id, const unsigned int *sel,
|
||||
unsigned int cnt, unsigned int cur_type, unsigned int allow_type) {
|
||||
|
@ -106,10 +107,10 @@ int discoverDevices(unsigned int profile_selected, uint32_t device_types_selecte
|
|||
}
|
||||
|
||||
cl_platform_info ocl_platforms_info[3] = { CL_PLATFORM_NAME, CL_PLATFORM_VENDOR, CL_PLATFORM_VERSION };
|
||||
unsigned int ocl_platforms_info_cnt = sizeof(ocl_platforms_info) / sizeof(cl_platform_info);
|
||||
unsigned int ocl_platforms_info_cnt = ARRAYLEN(ocl_platforms_info);
|
||||
|
||||
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 ocl_devices_info_cnt = ARRAYLEN(ocl_devices_info);
|
||||
|
||||
unsigned int info_idx;
|
||||
size_t tmp_len = 0;
|
||||
|
|
Loading…
Reference in a new issue