Fixes style: make style

This commit is contained in:
Romuald Conty
2012-12-09 20:09:55 +01:00
parent 007b78cbb4
commit 82c41b4fc1
9 changed files with 91 additions and 89 deletions

View File

@@ -187,7 +187,7 @@ nfc_open(nfc_context *context, const nfc_connstring connstring)
log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_DEBUG, "Unable to open \"%s\".", ncs);
return pnd;
}
for (uint32_t i=0; i>context->user_defined_device_count; i++) {
for (uint32_t i = 0; i > context->user_defined_device_count; i++) {
if (strcmp(ncs, context->user_defined_devices[i].connstring) == 0) {
// This is a device sets by user, we use the device name given by user
strcpy(pnd->name, context->user_defined_devices[i].name);
@@ -237,16 +237,16 @@ nfc_list_devices(nfc_context *context, nfc_connstring connstrings[], const size_
const struct nfc_driver **pndr = nfc_drivers;
if (!context) {
printf ("NULL context is not supported anymore! Please fix your code.\n");
printf("NULL context is not supported anymore! Please fix your code.\n");
exit(EXIT_FAILURE);
}
// Load manually configured devices (from config file and env variables)
// TODO From env var...
for (uint32_t i=0; i<context->user_defined_device_count; i++) {
strcpy((char*)(connstrings+device_found), context->user_defined_devices[i].connstring);
for (uint32_t i = 0; i < context->user_defined_device_count; i++) {
strcpy((char *)(connstrings + device_found), context->user_defined_devices[i].connstring);
device_found++;
if(device_found >= connstrings_len)
if (device_found >= connstrings_len)
return device_found;
}
@@ -254,7 +254,7 @@ nfc_list_devices(nfc_context *context, nfc_connstring connstrings[], const size_
if (context->allow_autoscan) {
while ((ndr = *pndr)) {
size_t _device_found = 0;
if((ndr->scan_type == NOT_INTRUSIVE) || ((context->allow_intrusive_scan) && (ndr->scan_type == INTRUSIVE))) {
if ((ndr->scan_type == NOT_INTRUSIVE) || ((context->allow_intrusive_scan) && (ndr->scan_type == INTRUSIVE))) {
_device_found = ndr->scan(context, connstrings + (device_found), connstrings_len - (device_found));
log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_DEBUG, "%ld device(s) found using %s driver", (unsigned long) _device_found, ndr->name);
if (_device_found > 0) {
@@ -666,7 +666,7 @@ nfc_initiator_transceive_bytes(nfc_device *pnd, const uint8_t *pbtTx, const size
* CRC bytes. Using this feature you are able to simulate these frames.
*/
int
nfc_initiator_transceive_bits(nfc_device *pnd,
nfc_initiator_transceive_bits(nfc_device *pnd,
const uint8_t *pbtTx, const size_t szTxBits, const uint8_t *pbtTxPar,
uint8_t *pbtRx, const size_t szRx,
uint8_t *pbtRxPar)
@@ -702,8 +702,8 @@ nfc_initiator_transceive_bits(nfc_device *pnd,
* @warning The configuration option \a NP_HANDLE_PARITY must be set to \c true (the default value).
*/
int
nfc_initiator_transceive_bytes_timed(nfc_device *pnd,
const uint8_t *pbtTx, const size_t szTx,
nfc_initiator_transceive_bytes_timed(nfc_device *pnd,
const uint8_t *pbtTx, const size_t szTx,
uint8_t *pbtRx, const size_t szRx,
uint32_t *cycles)
{
@@ -746,10 +746,10 @@ nfc_initiator_target_is_present(nfc_device *pnd, const nfc_target nt)
* @warning The configuration option \a NP_HANDLE_PARITY must be set to \c true (the default value).
*/
int
nfc_initiator_transceive_bits_timed(nfc_device *pnd,
nfc_initiator_transceive_bits_timed(nfc_device *pnd,
const uint8_t *pbtTx, const size_t szTxBits, const uint8_t *pbtTxPar,
uint8_t *pbtRx, const size_t szRx,
uint8_t *pbtRxPar,
uint8_t *pbtRx, const size_t szRx,
uint8_t *pbtRxPar,
uint32_t *cycles)
{
(void)szRx;