[libfreefare] push by romain.t...@gmail.com - Fix mifare_desfire_get_[iso_]file_ids() prototype.... on 2014-04-16 00:39 GMT

3 views
Skip to first unread message

libfr...@googlecode.com

unread,
Apr 15, 2014, 8:39:53 PM4/15/14
to nfc-tool...@googlegroups.com
Revision: ffde4d4d92a5
Author: Romain Tartière <rom...@blogreen.org>
Date: Wed Apr 16 00:25:54 2014 UTC
Log: Fix mifare_desfire_get_[iso_]file_ids() prototype.

The "files" parameter is not an array of pointer to uint8_t (uint8_t
*files[]), but rather an pointer to an array of uint8_t (uint8_t
(*files)[]). Since this syntax confuses the compiler (the program
attempt to assign a value to what "files" is pointing to, which is
supposed to be an array, which is not assignable), declare "files" as a
pointer to a pointer to uint8_t (uint8_t **files) which makes everybody
happy.

Fixes issue 26.

http://code.google.com/p/libfreefare/source/detail?r=ffde4d4d92a5

Modified:
/libfreefare/freefare.h
/libfreefare/mifare_desfire.c

=======================================
--- /libfreefare/freefare.h Sun Apr 13 18:29:57 2014 UTC
+++ /libfreefare/freefare.h Wed Apr 16 00:25:54 2014 UTC
@@ -354,8 +354,8 @@
int mifare_desfire_set_default_key (MifareTag tag, MifareDESFireKey key);
int mifare_desfire_set_ats (MifareTag tag, uint8_t *ats);
int mifare_desfire_get_card_uid (MifareTag tag, char **uid);
-int mifare_desfire_get_file_ids (MifareTag tag, uint8_t *files[], size_t
*count);
-int mifare_desfire_get_iso_file_ids (MifareTag tag, uint16_t *files[],
size_t *count);
+int mifare_desfire_get_file_ids (MifareTag tag, uint8_t **files, size_t
*count);
+int mifare_desfire_get_iso_file_ids (MifareTag tag, uint16_t **files,
size_t *count);
int mifare_desfire_get_file_settings (MifareTag tag, uint8_t file_no,
struct mifare_desfire_file_settings *settings);
int mifare_desfire_change_file_settings (MifareTag tag, uint8_t file_no,
uint8_t communication_settings, uint16_t access_rights);
int mifare_desfire_create_std_data_file (MifareTag tag, uint8_t file_no,
uint8_t communication_settings, uint16_t access_rights, uint32_t file_size);
=======================================
--- /libfreefare/mifare_desfire.c Wed Apr 16 00:02:50 2014 UTC
+++ /libfreefare/mifare_desfire.c Wed Apr 16 00:25:54 2014 UTC
@@ -1167,7 +1167,7 @@
/* Application level commands */

int
-mifare_desfire_get_file_ids (MifareTag tag, uint8_t *files[], size_t
*count)
+mifare_desfire_get_file_ids (MifareTag tag, uint8_t **files, size_t *count)
{
ASSERT_ACTIVE (tag);
ASSERT_MIFARE_DESFIRE (tag);
@@ -1200,7 +1200,7 @@
}

int
-mifare_desfire_get_iso_file_ids (MifareTag tag, uint16_t *files[], size_t
*count)
+mifare_desfire_get_iso_file_ids (MifareTag tag, uint16_t **files, size_t
*count)
{
ASSERT_ACTIVE (tag);
ASSERT_MIFARE_DESFIRE (tag);
Reply all
Reply to author
Forward
0 new messages