structs: initializes explicitely all fields, so we can detect when we really forgot one [-Wmissing-field-initializers]

This commit is contained in:
Philippe Teuwen 2019-04-10 13:59:00 +02:00
commit 0ab6de64d4
43 changed files with 211 additions and 211 deletions

View file

@ -108,14 +108,14 @@ static int usage_hf_14b_dump(void) {
/*
static void switch_on_field_14b(void) {
UsbCommand c = {CMD_ISO_14443B_COMMAND, {ISO14B_CONNECT, 0, 0}};
UsbCommand c = {CMD_ISO_14443B_COMMAND, {ISO14B_CONNECT, 0, 0}, {{0}}};
clearCommandBuffer();
SendCommand(&c);
}
*/
static int switch_off_field_14b(void) {
UsbCommand c = {CMD_ISO_14443B_COMMAND, {ISO14B_DISCONNECT, 0, 0}};
UsbCommand c = {CMD_ISO_14443B_COMMAND, {ISO14B_DISCONNECT, 0, 0}, {{0}}};
clearCommandBuffer();
SendCommand(&c);
return 0;
@ -136,7 +136,7 @@ int CmdHF14BSim(const char *Cmd) {
pupi = param_get32ex(Cmd, 1, 0, 16);
}
UsbCommand c = {CMD_SIMULATE_TAG_ISO_14443B, {pupi, 0, 0}};
UsbCommand c = {CMD_SIMULATE_TAG_ISO_14443B, {pupi, 0, 0}, {{0}}};
clearCommandBuffer();
SendCommand(&c);
return 0;
@ -147,7 +147,7 @@ int CmdHF14BSniff(const char *Cmd) {
char cmdp = tolower(param_getchar(Cmd, 0));
if (cmdp == 'h') return usage_hf_14b_sniff();
UsbCommand c = {CMD_SNIFF_ISO_14443B, {0, 0, 0}};
UsbCommand c = {CMD_SNIFF_ISO_14443B, {0, 0, 0}, {{0}}};
clearCommandBuffer();
SendCommand(&c);
return 0;
@ -242,7 +242,7 @@ int CmdHF14BCmdRaw(const char *Cmd) {
// Max buffer is USB_CMD_DATA_SIZE
datalen = (datalen > USB_CMD_DATA_SIZE) ? USB_CMD_DATA_SIZE : datalen;
UsbCommand c = {CMD_ISO_14443B_COMMAND, {flags, datalen, time_wait}};
UsbCommand c = {CMD_ISO_14443B_COMMAND, {flags, datalen, time_wait}, {{0}}};
memcpy(c.d.asBytes, data, datalen);
clearCommandBuffer();
SendCommand(&c);
@ -267,7 +267,7 @@ static bool get_14b_UID(iso14b_card_select_t *card) {
int8_t retry = 3;
UsbCommand resp;
UsbCommand c = {CMD_ISO_14443B_COMMAND, {ISO14B_CONNECT | ISO14B_SELECT_SR | ISO14B_DISCONNECT, 0, 0}};
UsbCommand c = {CMD_ISO_14443B_COMMAND, {ISO14B_CONNECT | ISO14B_SELECT_SR | ISO14B_DISCONNECT, 0, 0}, {{0}}};
// test for 14b SR
while (retry--) {
@ -473,7 +473,7 @@ bool HF14B_Std_Info(bool verbose) {
bool isSuccess = false;
// 14b get and print UID only (general info)
UsbCommand c = {CMD_ISO_14443B_COMMAND, {ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_DISCONNECT, 0, 0}};
UsbCommand c = {CMD_ISO_14443B_COMMAND, {ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_DISCONNECT, 0, 0}, {{0}}};
clearCommandBuffer();
SendCommand(&c);
UsbCommand resp;
@ -514,7 +514,7 @@ bool HF14B_Std_Info(bool verbose) {
// SRx get and print full info (needs more info...)
bool HF14B_ST_Info(bool verbose) {
UsbCommand c = {CMD_ISO_14443B_COMMAND, {ISO14B_CONNECT | ISO14B_SELECT_SR | ISO14B_DISCONNECT, 0, 0}};
UsbCommand c = {CMD_ISO_14443B_COMMAND, {ISO14B_CONNECT | ISO14B_SELECT_SR | ISO14B_DISCONNECT, 0, 0}, {{0}}};
clearCommandBuffer();
SendCommand(&c);
UsbCommand resp;
@ -586,7 +586,7 @@ bool HF14B_ST_Reader(bool verbose) {
bool isSuccess = false;
// SRx get and print general info about SRx chip from UID
UsbCommand c = {CMD_ISO_14443B_COMMAND, {ISO14B_CONNECT | ISO14B_SELECT_SR | ISO14B_DISCONNECT, 0, 0}};
UsbCommand c = {CMD_ISO_14443B_COMMAND, {ISO14B_CONNECT | ISO14B_SELECT_SR | ISO14B_DISCONNECT, 0, 0}, {{0}}};
clearCommandBuffer();
SendCommand(&c);
UsbCommand resp;
@ -626,7 +626,7 @@ bool HF14B_Std_Reader(bool verbose) {
bool isSuccess = false;
// 14b get and print UID only (general info)
UsbCommand c = {CMD_ISO_14443B_COMMAND, {ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_DISCONNECT, 0, 0}};
UsbCommand c = {CMD_ISO_14443B_COMMAND, {ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_DISCONNECT, 0, 0}, {{0}}};
clearCommandBuffer();
SendCommand(&c);
UsbCommand resp;
@ -671,7 +671,7 @@ bool HF14B_Other_Reader() {
// // 14b get and print UID only (general info)
// uint32_t flags = ISO14B_CONNECT | ISO14B_SELECT_STD | ISO14B_RAW | ISO14B_APPEND_CRC;
// UsbCommand c = {CMD_ISO_14443B_COMMAND, {flags, datalen, 0}};
// UsbCommand c = {CMD_ISO_14443B_COMMAND, {flags, datalen, 0}, {{0}}};
// memcpy(c.d.asBytes, data, datalen);
// clearCommandBuffer();
@ -758,7 +758,7 @@ int CmdHF14BReadSri(const char *Cmd) {
uint8_t tagtype = param_get8(Cmd, 0);
uint8_t blocks = (tagtype == 1) ? 0x7F : 0x0F;
UsbCommand c = {CMD_READ_SRI_TAG, {blocks, 0, 0}};
UsbCommand c = {CMD_READ_SRI_TAG, {blocks, 0, 0}, {{0}}};
clearCommandBuffer();
SendCommand(&c);
return 0;
@ -898,7 +898,7 @@ int CmdHF14BDump(const char *Cmd) {
uint8_t *recv = NULL;
UsbCommand resp;
UsbCommand c = {CMD_ISO_14443B_COMMAND, { ISO14B_CONNECT | ISO14B_SELECT_SR, 0, 0}};
UsbCommand c = {CMD_ISO_14443B_COMMAND, { ISO14B_CONNECT | ISO14B_SELECT_SR, 0, 0}, {{0}}};
clearCommandBuffer();
SendCommand(&c);