Merge pull request #64 from nfc-tools/style

Use astyle(1) to make style consistent
This commit is contained in:
Romain Tartière 2017-06-27 14:35:48 +02:00 committed by GitHub
commit b49692848e
68 changed files with 5956 additions and 5950 deletions

4
.gitignore vendored
View file

@ -36,6 +36,10 @@ examples/mifare-desfire-info
examples/mifare-desfire-read-ndef
examples/mifare-desfire-write-ndef
examples/mifare-ultralight-info
examples/ntag-detect
examples/ntag-removeauth
examples/ntag-setauth
examples/ntag-write
test/test-suite.log
test/run-test.sh.log
test/run-test.sh.trs

View file

@ -1,6 +1,8 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = contrib libfreefare test examples
libfreefare_subdirs = libfreefare test examples
SUBDIRS = contrib $(libfreefare_subdirs)
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libfreefare.pc
@ -39,3 +41,7 @@ svn-keywords:
svn-keywords-check:
@echo "Files missing a '$$"Id"$$' vcs keyword:"
@$(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 '{}' ';'

View file

@ -166,8 +166,7 @@ main(int argc, char *argv[])
memcpy(default_keys, default_keys_int, sizeof(default_keys_int));
if ((argc - optind) > 0)
{
if ((argc - optind) > 0) {
int i, rc;
char kbuffer[1024] = {0};
memset(kbuffer, 0, sizeof kbuffer);
@ -178,8 +177,7 @@ main(int argc, char *argv[])
fclose(fp);
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 pos_a = (startblock + 3) * 16;
int pos_b = (startblock + 3) * 16 + 10;

View file

@ -249,8 +249,7 @@ main(int argc, char *argv[])
} else {
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,
// 2 bytes File Identifiers supported, File-ID equal to E110h
aid = mifare_desfire_aid_new(0x000001);

View file

@ -147,8 +147,7 @@ freefare_get_tags (nfc_device *device)
* Returns the type of the provided tag.
*/
enum freefare_tag_type
freefare_get_tag_type (FreefareTag tag)
{
freefare_get_tag_type(FreefareTag tag) {
return tag->type;
}

View file

@ -306,8 +306,7 @@ ntag21x_get_info(FreefareTag tag)
* Get subtype of tag
*/
enum ntag_tag_subtype
ntag21x_get_subtype(FreefareTag tag)
{
ntag21x_get_subtype(FreefareTag tag) {
return NTAG_21x(tag)->subtype;
}

View file

@ -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_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,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const uint8_t key_data_aes_version = 0x42;