less hardcoded sizes and more ARRAYLEN
This commit is contained in:
@@ -40,10 +40,9 @@ static const PlusErrorsElm PlusErrors[] = {
|
||||
{0x0f, "General Manipulation Error. Failure in the operation of the PICC (cannot write to the data block), etc."},
|
||||
{0x90, "OK"},
|
||||
};
|
||||
int PlusErrorsLen = sizeof(PlusErrors) / sizeof(PlusErrorsElm);
|
||||
|
||||
const char *mfpGetErrorDescription(uint8_t errorCode) {
|
||||
for (int i = 0; i < PlusErrorsLen; i++)
|
||||
for (int i = 0; i < ARRAYLEN(PlusErrors); i++)
|
||||
if (errorCode == PlusErrors[i].Code)
|
||||
return PlusErrors[i].Description;
|
||||
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#define MIFARE_DEFAULTKEYS_SIZE sizeof(g_mifare_default_keys) / sizeof(uint64_t)
|
||||
|
||||
static const uint64_t g_mifare_default_keys[] = {
|
||||
0xffffffffffff, // Default key (first key used by program if no user defined key)
|
||||
0x000000000000, // Blank key
|
||||
|
||||
Reference in New Issue
Block a user