mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-04-11 17:16:18 +00:00
Fix cppcheck style: scope of variable can be reduced
Fix the following cppcheck warnings: [libnfc/drivers/pn532_uart.c:492]: (style) The scope of the variable 'res' can be reduced [libnfc/chips/pn53x.c:320]: (style) The scope of the variable 'res' can be reduced [libnfc/chips/pn53x.c:616]: (style) The scope of the variable 'res' can be reduced [libnfc/nfc.c:356]: (style) The scope of the variable '_device_found' can be reduced [utils/nfc-mfclassic.c:178]: (style) The scope of the variable 'key_index' can be reduced
This commit is contained in:
@@ -353,9 +353,8 @@ nfc_list_devices(nfc_context *context, nfc_connstring connstrings[], const size_
|
||||
const struct nfc_driver_list *pndl = nfc_drivers;
|
||||
while (pndl) {
|
||||
const struct nfc_driver *ndr = pndl->driver;
|
||||
size_t _device_found = 0;
|
||||
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));
|
||||
size_t _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) {
|
||||
device_found += _device_found;
|
||||
|
||||
Reference in New Issue
Block a user