Merge pull request #64 from nfc-tools/style
Use astyle(1) to make style consistent
This commit is contained in:
commit
b49692848e
68 changed files with 5956 additions and 5950 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -36,6 +36,10 @@ examples/mifare-desfire-info
|
||||||
examples/mifare-desfire-read-ndef
|
examples/mifare-desfire-read-ndef
|
||||||
examples/mifare-desfire-write-ndef
|
examples/mifare-desfire-write-ndef
|
||||||
examples/mifare-ultralight-info
|
examples/mifare-ultralight-info
|
||||||
|
examples/ntag-detect
|
||||||
|
examples/ntag-removeauth
|
||||||
|
examples/ntag-setauth
|
||||||
|
examples/ntag-write
|
||||||
test/test-suite.log
|
test/test-suite.log
|
||||||
test/run-test.sh.log
|
test/run-test.sh.log
|
||||||
test/run-test.sh.trs
|
test/run-test.sh.trs
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
ACLOCAL_AMFLAGS = -I m4
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
SUBDIRS = contrib libfreefare test examples
|
libfreefare_subdirs = libfreefare test examples
|
||||||
|
|
||||||
|
SUBDIRS = contrib $(libfreefare_subdirs)
|
||||||
|
|
||||||
pkgconfigdir = $(libdir)/pkgconfig
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
pkgconfig_DATA = libfreefare.pc
|
pkgconfig_DATA = libfreefare.pc
|
||||||
|
@ -39,3 +41,7 @@ svn-keywords:
|
||||||
svn-keywords-check:
|
svn-keywords-check:
|
||||||
@echo "Files missing a '$$"Id"$$' vcs keyword:"
|
@echo "Files missing a '$$"Id"$$' vcs keyword:"
|
||||||
@$(SVN_KEYWORDS_FILES_LIST_CMD) | xargs grep -L '\$$Id[^$$]*\$$'
|
@$(SVN_KEYWORDS_FILES_LIST_CMD) | xargs grep -L '\$$Id[^$$]*\$$'
|
||||||
|
|
||||||
|
style:
|
||||||
|
find ${libfreefare_subdirs} -name '*.[ch]' -exec perl -pi -e 's/[ \t]+$$//' {} \;
|
||||||
|
find ${libfreefare_subdirs} -name '*.[ch]' -exec astyle --style=linux --indent=force-tab-x --lineend=linux '{}' ';'
|
||||||
|
|
|
@ -166,8 +166,7 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
memcpy(default_keys, default_keys_int, sizeof(default_keys_int));
|
memcpy(default_keys, default_keys_int, sizeof(default_keys_int));
|
||||||
|
|
||||||
if ((argc - optind) > 0)
|
if ((argc - optind) > 0) {
|
||||||
{
|
|
||||||
int i, rc;
|
int i, rc;
|
||||||
char kbuffer[1024] = {0};
|
char kbuffer[1024] = {0};
|
||||||
memset(kbuffer, 0, sizeof kbuffer);
|
memset(kbuffer, 0, sizeof kbuffer);
|
||||||
|
@ -178,8 +177,7 @@ main(int argc, char *argv[])
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
i = sizeof(default_keys_int) / 6;
|
i = sizeof(default_keys_int) / 6;
|
||||||
for(int s = 0; s<16; s++)
|
for (int s = 0; s < 16; s++) {
|
||||||
{
|
|
||||||
int startblock = s * 4;
|
int startblock = s * 4;
|
||||||
int pos_a = (startblock + 3) * 16;
|
int pos_a = (startblock + 3) * 16;
|
||||||
int pos_b = (startblock + 3) * 16 + 10;
|
int pos_b = (startblock + 3) * 16 + 10;
|
||||||
|
|
|
@ -249,8 +249,7 @@ main(int argc, char *argv[])
|
||||||
} else {
|
} else {
|
||||||
errx(EXIT_FAILURE, "Write CC file content failed");
|
errx(EXIT_FAILURE, "Write CC file content failed");
|
||||||
}
|
}
|
||||||
}
|
} else if (ndef_mapping == 2) {
|
||||||
else if (ndef_mapping == 2) {
|
|
||||||
// Mifare DESFire Create Application with AID equal to 000001h, key settings equal to 0x0F, NumOfKeys equal to 01h,
|
// Mifare DESFire Create Application with AID equal to 000001h, key settings equal to 0x0F, NumOfKeys equal to 01h,
|
||||||
// 2 bytes File Identifiers supported, File-ID equal to E110h
|
// 2 bytes File Identifiers supported, File-ID equal to E110h
|
||||||
aid = mifare_desfire_aid_new(0x000001);
|
aid = mifare_desfire_aid_new(0x000001);
|
||||||
|
|
|
@ -147,8 +147,7 @@ freefare_get_tags (nfc_device *device)
|
||||||
* Returns the type of the provided tag.
|
* Returns the type of the provided tag.
|
||||||
*/
|
*/
|
||||||
enum freefare_tag_type
|
enum freefare_tag_type
|
||||||
freefare_get_tag_type (FreefareTag tag)
|
freefare_get_tag_type(FreefareTag tag) {
|
||||||
{
|
|
||||||
return tag->type;
|
return tag->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -306,8 +306,7 @@ ntag21x_get_info(FreefareTag tag)
|
||||||
* Get subtype of tag
|
* Get subtype of tag
|
||||||
*/
|
*/
|
||||||
enum ntag_tag_subtype
|
enum ntag_tag_subtype
|
||||||
ntag21x_get_subtype(FreefareTag tag)
|
ntag21x_get_subtype(FreefareTag tag) {
|
||||||
{
|
|
||||||
return NTAG_21x(tag)->subtype;
|
return NTAG_21x(tag)->subtype;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,8 @@ uint8_t key_data_des[8] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' };
|
||||||
uint8_t key_data_3des[16] = { 'C', 'a', 'r', 'd', ' ', 'M', 'a', 's', 't', 'e', 'r', ' ', 'K', 'e', 'y', '!' };
|
uint8_t key_data_3des[16] = { 'C', 'a', 'r', 'd', ' ', 'M', 'a', 's', 't', 'e', 'r', ' ', 'K', 'e', 'y', '!' };
|
||||||
uint8_t key_data_aes[16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
uint8_t key_data_aes[16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||||
uint8_t key_data_3k3des[24] = { 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
uint8_t key_data_3k3des[24] = { 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||||
|
};
|
||||||
|
|
||||||
const uint8_t key_data_aes_version = 0x42;
|
const uint8_t key_data_aes_version = 0x42;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue